Declaring script dependencies between scripts enqueued with different action hooks

The simple answer is, “No”. Although admin_enqueue_scripts and wp_enqueue_scripts hooks does exactly the same thing, the do their work in separate places which do not have any reference to the other. wp_enqueue_scripts runs on the public side or front end admin_enqueue_scripts As the name suggests, it runs on the admin side or back end Your … Read more

how to not show plugin in admin area

To complement @s_ha_dum’s answer: If you just want to offer a function to be used in a theme, make it a custom action. Sample: add_action( ‘call_hello_world’, ‘hello_world’ ); Now, in a theme, the author can call your function with … do_action( ‘call_hello_world’ ); … and the function will print its content only where the author … Read more

Hook for post permalink update

You need to exactly use wp_insert_post_data. This contains array of post data what will be store into database after WordPress has done all of the validation/sanitization. add_filter(‘wp_insert_post_data’, ‘wpse_wp_insert_post_data’, 10, 2); function wpse_wp_insert_post_data($data, $post_attr) { // you get the post_name using $data[‘post_name’]; // post id will not be present for the first insert // but you … Read more

How to duplicate custom menu settings to export to another site

Menus aren’t stored in options. They are linked quite complicatedly so through various other tables. $wpdb->get_results(sprintf(” select tr.object_id from wp_terms t left join wp_term_taxonomy tt on t.term_id = tt.term_id left join wp_term_relationships tr on tt.term_taxonomy_id = tr.term_taxonomy_id left join wp_posts p on p.ID=tr.object_id left join wp_postmeta m on m.post_id=tr.object_id where t.slug =’%s’ and tt.taxonomy=’nav_menu’ group … Read more

Multisite, sharing content by URL

Hope I understand you correctly. Not sure if your /Widgets content would be actual widgets, or just posts/pages, but I’ve been using this plugin for duplicating content between sites on a multisite network: http://wordpress.org/extend/plugins/diamond-multisite-widgets/ Use the “Broadcast on the network” feature. You can select on which sites you’d like to duplicate the content. 2 caveats: … Read more

Make the plugin directory recognize new version numbers

You need to make sure you update version numbers in all relevant locations: \trunk readme.txt pluginfile.php \tags\{tag} pluginfile.php (note: you should update readme.txt, but outside of trunk, it’s only for aesthetics) In this case, you updated readme.txt in \trunk, but you didn’t update the Plugin file in \trunk or in \tags\0.3.1.