Sublime Forum

Wordpress

#1

I would just like to anounce Wordpress snippets/completions : github.com/purplefish32/sublime … -wordpress or via the Package Manager,
I Just did a straight textmate/sublime conversion from github.com/Gipetto/wordpress.tmbundle , all credit goes to the original author

Description :
Sublime Text 2 Wordpress Package is a collection of Wordpress snippets and autocompletions for Sublime Text 2
Original TextMate bundle author : Gipetto - github.com/Gipetto/wordpress.tmbundle

Please bear in mind that this is my first attempt at a sublime text plugin and that it is not yet fully tested (only on ubuntu and not all snippets/completions), please dont hesitate to give me feedback/fixes via github.

I allready have one question for someone who has more skills than me :
I think I have an error in my snippet php scope, eg :

[code]
<![CDATA[
function ${2:func_name}($atts) {
$atts = extract(shortcode_atts(array(‘default’=>‘values’),$atts));

// do shortcode actions here
}
add_shortcode(’${1:shortcode-id}’,’${2:func_name}’);
]]>
Shortcode
shortcode
source.php
[/code]

Strangely seems to work fine in an HTML file and not in a PHP file, any one know why ? (Please excuse my ignorance)

0 Likes

#2

You need to escape all $ signs from your code.

This should work (notice $atts )

[code]
<![CDATA[
function ${2:func_name}($atts) {
$atts = extract(shortcode_atts(array(‘default’=>‘values’),$atts));

// do shortcode actions here
}
add_shortcode('${1:shortcode-id}','${2:func_name}');
]]></content>
   <description>Shortcode</description>
   <tabTrigger>shortcode</tabTrigger>
   <scope>source.php</scope>
</snippet>[/code]
0 Likes

#3

Nice catch, I fixed a couple escapeing problemes in the new version,
Any idea about the scope ?

0 Likes

#4

Fixed scope in the new version

0 Likes

#5

Please rename it from Wordpress to WordPress :smile:

0 Likes

#6

Hi,
I created a package for WordPress completions and I think yours is abandoned and I thought of could merge and there is only one package called WordPress, you think?

0 Likes