Enforce conditions only for draft posts using WyPiekacz, ignore pending and published posts

The check is invoked after a call to get_option( ‘wypiekacz_allow_skip_rules’ ). When you filter pre_option_wypiekacz_allow_skip_rules and returns something different than FALSE, it should stop the check early. Not tested. add_filter( ‘pre_option_wypiekacz_allow_skip_rules’, ‘wpse_100503_wypiekacz_for_drafts_only’ ); function wpse_100503_wypiekacz_for_drafts_only( $bool ) { if ( ‘draft’ === get_post_status( $GLOBALS[‘post’] ) ) return $bool; return 0; } To prevent the post … Read more

How to add a prefix to existing custom fields over MYSQL query?

important: backup your database first! Assuming your table prefix is ‘wp_’, this query will change the custom field names: update wp_postmeta set meta_key = ‘booking_testfield’ where meta_key = ‘testfield’; NB: this also assumes that the custom field name is unique to your application, i.e. it isn’t used by another post type. If it is possible … Read more

WP.org API: Accessing plugin downloads “Today” value?

Late answer A mini plugin as local API This plugin gives you – after you filled in the slug of your repository – the downloads stats as array. The keys are the dates, the values the downloads. <?php /** Plugin Name: (#84254) Plugin stats API */ function wpse84254_get_download_stats() { $response = wp_remote_request( add_query_arg( ‘slug’ ,’YOUR-REPO-PLUGIN-SLUG’ … Read more

Snapshot Theme from WooThemes — empty ‘alt’ attribute

Since the original theme demo image doesn’t have any value in alt, I’m assuming there is a bug in the theme you might need to open a ticket for: http://demo.woothemes.com/snapshot/ I don’t recommend altering original theme template functions but if you are very far into the project and rather not switch out to another theme, … Read more

why is markup routinely placed in functions in wordpress?

I think WordPress is one of the cases where the original code just got bigger and bigger without having a chance to be rewritten from ground up with best practices. In this case, I think the WordPress conventional practice (writing markup in function) outweigh the best practices. You might find the theme development documentation interesting … Read more

How To: Simple domPDF Example

Seems as though I was attempting to perform this PDF creation too late in the lifecycle of the page. After adding this snippet to an action binding to init, it works perfectly.

Where To Find bb_profile_data(); In bbPress?

From this reference you get the following info: Function and Method Cross Reference bb_profile_data() Defined at: /bb-includes/functions.bb-template.php -> line 2405 Referenced 1 times: /bb-templates/kakumei/profile.php -> line 30 so you should check your profile template. If you have ssh access to your site, try # grep “bb_profile_data” -R /the/path/to/your/site/ in the shell command line, to search … Read more