Home Download Buy Blog Forum Support

Wordpress

Wordpress

Postby purplefish32 on Fri Dec 16, 2011 9:35 am

I would just like to anounce Wordpress snippets/completions : https://github.com/purplefish32/sublime ... -wordpress or via the Package Manager,
I Just did a straight textmate/sublime conversion from https://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 - https://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: Select all
<snippet>
   <content><![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>


Strangely seems to work fine in an HTML file and not in a PHP file, any one know why ? (Please excuse my ignorance)
purplefish32
 
Posts: 11
Joined: Tue Dec 13, 2011 7:58 pm

Re: Wordpress

Postby iamntz on Fri Dec 16, 2011 9:47 am

You need to escape all $ signs from your code.

This should work (notice \$atts )
Code: Select all
    <snippet>
       <content><![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>
iamntz
 
Posts: 915
Joined: Fri Apr 29, 2011 8:52 am
Location: Romania

Re: Wordpress

Postby purplefish32 on Fri Dec 16, 2011 1:22 pm

Nice catch, I fixed a couple escapeing problemes in the new version,
Any idea about the scope ?
purplefish32
 
Posts: 11
Joined: Tue Dec 13, 2011 7:58 pm

Re: Wordpress

Postby purplefish32 on Sat Dec 17, 2011 12:03 pm

Fixed scope in the new version
purplefish32
 
Posts: 11
Joined: Tue Dec 13, 2011 7:58 pm

Re: Wordpress

Postby egill on Fri Jan 06, 2012 11:58 am

Please rename it from Wordpress to WordPress :)
egill
 
Posts: 1
Joined: Fri Jan 06, 2012 11:56 am


Return to Plugin Announcements

Who is online

Users browsing this forum: Exabot [Bot], Yahoo [Bot] and 27 guests