I wrote this plugin for Sublime Text to help on a project where I am localizing a lot of text.
I found I was copy and pasting the same i18n methods over and over so I decided that there must be a relatively easy way to automate this using a plugin.
Now I select some text, press my key shortcut and the text gets replaced with the appropriate i18n method.
Continue reading “WordPress Localization Plugin for Sublime Text” →
If you are developing a plugin on WordPress, you will need to debug your code as you go.
To enable debugging, go to your wp-config.php file.
Find the line…
Replace the line above with the following…
// Turns WordPress debugging on
// Tells WordPress to log everything to the /wp-content/debug.log file
// Doesn't force the PHP 'display_errors' variable to be on
// Hides errors from being displayed on-screen
Now you all warnings and errors will show up in the /wp-content/debug.log file, including WordPress warnings of deprecated functions.
You can write directly to this log from your plugin using the
//output some debug string
error_log( 'this works yo' );
//output some array/object
error_log( print_r( $some_obj_or_array, 1 ) );
Kudos to this post. It has some good plugin development tips, including how to enable debugging on WordPress.
I have written a simple tool to tidy assignments. It basically takes a group of assignments and uses spaces to make the code more readable.
This tool will help code meet the indentation rules in the WordPress coding standards.
Continue reading “Tidy assignments in Coda and TextWrangler” →
If you are working in a collaborative environment, coding standards are important. When you are reading through code that you haven’t written, it helps if it follows a standard.
As I work with Automattic, the keepers of WordPress.com, I get the opportunity to work on the WordPress Platform. WordPress have their own standards that are sensible without being pedantic and are similar to the PEAR standard. The emphasis of the standard (in my opinion), is to present your code so collaboration is as easy as possible. It would prefer if you wrote code that is easier to read and understand, even if it is a little longer, than some compressed, ubersmart block of code that only you can follow.
Continue reading “Tidy and format your PHP and meet WordPress standards on Coda and TextWrangler” →
I am developing ( not from scratch, thanks mdawaffe for the leg up! ) a plugin for polls and ratings on WordPress.org, available here. It basically uses the core code used on WordPress.com with a few extra’s necessary for that platform.
The plugin allows you to create and manage polls and ratings from within your WordPress dashboard. All polls and ratings are fully customizable. I have added the style editor to allow you to create your own custom style for a poll. You can collect unlimited votes and create unlimited polls and ratings. The ratings menu allows you to embed ratings into your pages, comments and posts, including posts on the front page.
I’ve recently added the ‘Top Rated’ widget that will allow you to place the widget in your sidebar. This widget will show you the top rated posts, pages and comments today, this week and this month.
I have added a template tag so you can now add a rating where you like. Just place the following line into your theme where you want the rating to be displayed.
<?php echo polldaddy_get_rating_html(); ?>
You can also use the Polldaddy shortcodes in a text widget, similar to on WordPress.com, to embed a survey, poll and a rating into the sidebar.
Polls short code
Surveys short code
Ratings short code
More blog posts about these latest updates here and here.