post_title is empty on global $post object

This hook is called like this: do_action(“{$new_status}_{$post->post_type}”, $post->ID, $post); My guess is that you should be using data passed as second $post argument, rather than global. So: add_action(‘publish_post’, ‘publish_post’, 10, 2 ); function publish_post($post_id, $post) { // stuff

Proper way to include stylesheet for panels

The best practice method of enqueueing admin stylesheets is to hook into your appearance page’s specific hook, using the admin_print_styles-{hook}, where {hook} = {admin_page}-{menu_slug}. I’ll assume: This is a Theme You are properly using an appearance page, via add_appearance_page() Your $menu_slug is wpse48416-settings The hook, then, is: admin_print_styles-appearance_page_wpse48416-settings: <?php function wpse48416_admin_style(){ wp_register_style( ‘wpse48416_admin_css’, get_template_directory_uri() . … Read more

Can plugin2 uninstall plugin1 at the very beginning of plugin2’s installation?

On the register_activation_hook() function of the new plugin use the function deactivate_plugins() (or deactivate_plugin_before_upgrade()) and deactivate the older plugin and also delete the data with delete_option. If you will also delete the files, then use the function uninstall_plugin($plugin); maybe delete_plugins( $plugins, $redirect=”” )

Default taxonomy template in plugin, override in theme

This is what I ended up using (for all those interested): function override_tax_template($template){ // is a specific custom taxonomy being shown? $taxonomy_array = array(‘tax1′,’tax2’); foreach ($taxonomy_array as $taxonomy_single) { if ( is_tax($taxonomy_single) ) { if(file_exists(trailingslashit(get_stylesheet_directory()) . ‘tax-template-directory/taxonomy-‘.$taxonomy_single.’.php’)) { $template = trailingslashit(get_stylesheet_directory()) . ‘tax-template-directory/taxonomy-‘.$taxonomy_single.’.php’; } else { $template = BASE_PLUGIN_DIR . ‘includes/tax-template-directory/taxonomy-‘.$taxonomy_single.’.php’; } break; } } … Read more