New WP_Customize API – how does it work under the hood?

There’s a few bits here that apply, but the short of it is this code in customize-preview.js: this.body.on( ‘click.preview’, ‘a’, function( event ) { event.preventDefault(); self.send( ‘scroll’, 0 ); self.send( ‘url’, $(this).prop(‘href’) ); }); The event.preventDefault prevents the links from actually working. The following code then sends a message back upwards telling it to a) … Read more

Multiple Inputs in a Customizer Control

This plugin demonstrates how to do it. Of note, the steps involved are: Register each setting to update/change When creating the control, pass an array as the setting argument When rendering the inputs, pass in the settings key to link and value The settings key is not the name of the setting, but the indices … Read more

How to *remove* a parent theme page template from a child theme?

Overriding that template would be much easier than getting rid of it. Just the way logic goes. I make no claim it’s efficient idea (late here), but this would get it nuked from edit screen: add_action(‘admin_head-post.php’,’remove_template’); function remove_template() { global $wp_themes; get_themes(); $templates = &$wp_themes[‘Twenty Ten’][‘Template Files’]; $template = trailingslashit( TEMPLATEPATH ).’onecolumn-page.php’; $key = array_search($template, … Read more

Creative uses of WordPress [closed]

Contact Manager http://rolopress.com/ Organize contacts and companies… your way. Easily enter and modify contacts and companies Keep track of phone numbers, email addresses, websites, social networks and many other types of information. Create your own Themes. Add functionality by installing Plugins. (or write your own) (replaced by piklist crm http://piklist.com )

What Is The Use Of map_meta_cap Filter?

This filter allows you to extend the map_meta_cap() function. This function is called by WP_User->has_cap() to convert a meta capability to one or more primitive capabilities. For example, you want to know whether the current user should be allowed to edit the current post, the edit_post meta capability. This depends on some factors: is the … Read more