purplefish32 / sublime-text-2-wordpress Goto Github PK
View Code? Open in Web Editor NEWsublime text 2 wordpress package
License: MIT License
sublime text 2 wordpress package
License: MIT License
Hey @purplefish32, could you add a license file, MIT maybe, so it's clear how one is allowed to use your snippets?
I am in the process of running through the automated functions scraped from wordpress and changing all $args into their real values in the wordpress codex as per the_post()
I am running into depricated functions (ex : list_authors()).
My question is : do I remove them alltogeather or are some people still using depricated wprdpress functions and want me to leave them in ?
The usage of extract()
is now discouraged, even in WP core https://core.trac.wordpress.org/ticket/22400. As such, I recommend you remove this from the shortcode snippet.
I found several inaccuracies in this package so I created a custom parser for WP and a new package, you can view the output here: https://github.com/wycks/SublimeText-WordPress-Autocomplete
Some differences compared to this one ( I work with WP pretty much everyday):
The functions completions contains approximately 818 more functions/hooks.
The constants are more accurate
The plugin is updated when WP is updated (currently 3.6)
Deprecated functions have been removed
It does not contain any snippets
I still need to add class completions.
Do you have any suggestions on how we can work these packages together into sublime since they can't really have 2 autocomplete plugins.
Cheers
Dear purplefish,
I was delighted to see a wordpress bundle for sublime text. For some reason, although it autocompletes the function names (get_po... > get_post), but does not hint what arguments are accepted (http://codex.wordpress.org/Template_Tags/get_posts).
I was hoping I could spare me a couple of visits to the codex by having that information right within sublime text. Any idea what I might be doing wrong (installed the package through the package manager, so I figured that shouldn't a cause of error :o/)
Yours,
Torsten
Hi, I don't know why, but when I press the Tab, it doesn't select all parameters but directly the first parameter.
I use the last version with Sublime Text 3 (3143)
Thanks in advance and sorry for my english :)
I'm not sure what's involved but it would be great to have support for Sublime Text 3. It seems to be very stable and lots of people are using it (since it came out in 2013...)
Hi,
I installed the package via Package Control but only these snippets seem to be working: theme_head, readme and wp-config. I also checked if all snippet files were copied to the Packages directory and they are all just there. Not sure what is going here. I'm using Mac OS 10.7 with Sublime Text 2 Beta build #2181.
Is there instructions on how to install these in ST2?
It's Command + Shift + I on the textmate version, what is it in Sublime Text 2? I don't see it anywhere.
I'm not able to use the Theme Head snippet via either the tab trigger or the console, the other snippets are working fine. Is there a problem with the scope?
Thank you for this package, it is awesome.
Right now, you are the top result and used result for WordPress snippets for sublime, but the package is woefully out of date.
Are you open to maintainer assistance? I would love to take the time to get the hooks/constants/etc up-to-date with the current version of WordPress.
The scope for the plugin header snippet is PHP, so I have to add <?php to my file to denote it is PHP, yet the snippet add <?php. Can this be removed if using this method to denote PHP (as opposed to Set Format)?
I'm goind to ditch this file : sublime-text-2-wordpress / Actions.sublime-completions
Any objections ?
hi
when i use predefined function name an extra semicolon added at the end of function that really bad.
i think if it will delete will be better
Thanks
Please see this snippet and add the ")" to close issue
//Custom Field Parameters 'meta_key' => 'key', 'meta_value' => 'value', 'meta_value_num' => 10, 'meta_compare' => '=', 'meta_query' => array( array( 'key' => 'color', 'value' => 'blue', 'type' => 'CHAR', 'compare' => '=' ), array( 'key' => 'price', 'value' => array( 1,200 ), 'compare' => 'NOT LIKE' ),
You have three arrays but only two was closed
Thank you
It may seem trivial, but this package using the lowercase version of WordPress is kinda bugging me. Would it mess things up to rename to the proper version?
For example the shortcode
snippet outputs the following:
function func_name( $atts ) {
$atts = extract( shortcode_atts( array( 'default'=>'values' ),$atts ) );
// do shortcode actions here
}
add_shortcode( 'shortcode-id','func_name' );
Which should really have linebreaks and spaces inserted as follows:
function func_name( $atts ) {
$atts = extract( shortcode_atts( array(
'default' => 'values'
), $atts ) );
// do shortcode actions here
}
add_shortcode( 'shortcode-id', 'func_name' );
Also see ticket #31 on removing the extract()
function.
For some reason the snippets don't check rather it's in php or not. Messes up with emmet
Support for shortcodes like [one_half] [one_third]
etc?
[full_width][/full_width]
[one_half][/one_half]
[one_half_last][/one_half_last]
[one_third][/one_third]
[one_third_last][/one_third_last]
[two_third][/two_third]
[two_third_last][/two_third_last]
[one_fourth][/one_fourth]
[one_fourth_last][/one_fourth_last]
[three_fourth][/three_fourth]
[three_fourth_last][/three_fourth_last]
[one_fifth][/one_fifth]
[one_fifth_last][/one_fifth_last]
[two_fifth][/two_fifth]
[two_fifth_last][/two_fifth_last]
[three_fifth][/three_fifth]
[three_fifth_last][/three_fifth_last]
[four_fifth][/four_fifth]
[four_fifth_last][/four_fifth_last]
[one_sixth][/one_sixth]
[one_sixth_last][/one_sixth_last]
Hey, thanks for porting this to sublime! I'm new to the program however and can't figure out how to activate the auto-completions. any help would be much appreciated!
There's a very strange problem in the widget snippet. All of the angle brackets ("greater than") are encoded as HTML entities. So, when we use the snippet, array assignments key => value
and objects $this->something
appear as key => value
and $this->something
.
I was wondering, was this supposed to be like that?
Thanks
Hi Purplefish,
I noticed a bug while using the snippet for the WordPress loop. The snippet (theloop, tab) has a PHP scope, yet the snippet itself contains tags.
Perhaps you can edit the snippet so it doesn't contain the php tags or change the scope for the snippet?
Thanks :).
Hi all,
I was thinking about adding HAML scope to this package; what do you think about? It would activate completion for developers coding in HAML+PHP (we use this package at work https://github.com/xt99/sublimetext-php-haml) and it won't stress at all who code only in HTML+PHP.
In alternative I can for sure mantain a separate fork, but I think overall is better to contribute if is general interest.
What do you reccomend?
Thanks in advance
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.