Should I delete the default themes?

I keep the default themes in place, and keep them updated. The WordPress Foundation will keep those themes updated with any security issues, so as long as you keep them updated on your site, I’m not concerned with security problems. The advantage that you have by keeping them is for testing. When you are troubleshooting … Read more

Data sanitization: Best Practices with code examples

This codex page explains it pretty well I think. The most important and commonly used function is probably esc_attr. Take this example: <a href=”https://wordpress.stackexchange.com/questions/48660/<?php print $author_url; ?>” title=”<?php print $author_name; ?>”> <?php print $author_name; ?> </a> If $author_name contains a ” character you get your attribute closed, and if that character is followed by onclick=”do_something();” … Read more

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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)