How to set Media Box form elements default value?

Not sure about the title part, but you should be able to set some defaults for images using update_option(). You can try adding the following to your functions.php to set the default size to large – you should be able to take it back out after it’s been called once so you’re not updating the … Read more

wp_insert_post hook for a wordpress plugin

The right hook to use before inserting the post is wp_insert_post_data function tr_insert_post($data){ $post [‘post_title’] = “the title: “.$post [‘post_title’]; return $post; } add_action(‘wp_insert_post_data’, ‘tr_insert_post’,1,2); But I think that a better way to achieve that would be to save the post as is and translate later using a filter like the_content this way you save … Read more

modify URL with mod_rewrite or hook

i fixed it using the apache proxy module: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{QUERY_STRING} !location RewriteRule ^(boston|newyork)/$ /index.php?location=$1 [NC,QSA,P] RewriteCond %{QUERY_STRING} !location RewriteRule ^(boston|newyork)/(.*)$ /$2?location=$1 [NC,QSA,P] RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> the [P] option does the trick.

Where exactly does the edit_{taxonomy} hook fire?

Please have a read on how to work with filters and actions (I’m not repeating it here). The filter in a theme or plugin // inside /wp-includes/taxonomy.php on line 1586 $value = apply_filters(“edit_{$taxonomy}_{$field}”, $value, $term_id); // inside some theme file that runs before – best on functions.php during your themes bootstrap: function wpse40709_edit_tax_field( $value, $term_id … Read more

Distinguish between different widgets of the same type

The correct practice is actually to use $args[‘before_widget] and $args[‘after_widget’] to handle the id, class, and anything else. In pseudo code: class My_Widget extends WP_Widget { function My_Widget() { //basic widget settings. $widget_ops = array( ‘classname’ => ‘my-name’, ‘description’ => ‘This is the description’ ); //widget control settings. $control_ops = array( ‘id_base’ => ‘my-name-widget’ ); … Read more