How to parse wordpress options json

The comments and answers are correct, it is no JSON but indeed a serialized array. The reason you’re having trouble unserializing it is because of the quotes inside the serialized data. David Walsh wrote a neat article about this. The problem is that you can’t simply go into the database and remove these single quotes … Read more

How to apply a patch?

You can download the diff file from the bottom of the diff page. The program to apply a diff is called “patch”. It’s widely available for various platforms. Example usages: http://en.wikipedia.org/wiki/Patch_(Unix)#Usage_examples

wp_localize_script with mce_external_plugins in wordpress

If I understand correctly; you just need to make a Javascript variable available to testing.js. I think it would be just as useful to send the variable with jQuery, as that would be loaded prior to TinyMCE anyway: add_action(‘wp_enqueue_scripts’, ‘YOUR_NAME_scripts’); //back end function YOUR_NAME_scripts( $hook_suffix ) { global $blog_id; $params = array( ‘site_url’ => site_url(), … Read more

Call to undefined function `get_plugin_data()`

get_plugin_data() is only defined in the administration section. What info did you need to get from the plugin’s header that you would need to display in the theme? If the answer is none, I would suggest that you place a conditional call in your constructor. Something like: if ( is_admin() ) { $var = get_plugin_data(); … Read more

Efficient Taxonomy Intersection

To generalize this is issue of retrieving all terms of taxonomy A that posts with specific term of taxonomy B have. While this is not impossible in several steps and plenty of looping through posts (which will indeed be inefficient), I think it’s reasonable to go through SQL for efficiency. My rough take on it … Read more

Should 3rd Parties Use $wp_scripts/$wp_styles->add_data?

This function adds data to scripts/styles that have been enqueued during the WordPress load. Not really. It adds data to scripts/styles that’ve been registered. The data key that is set by wp_localize_script is ultimately overwritten by the call to $wp_scripts->add_data, whereas if you call wp_localize_script twice for the same script, the string will be properly … Read more