How do I access the menus produced by Dashboard > Appearance > Menus

First: Use, for options(), the Settings API (tutorial). Second: Take a look at the core function and the available filters. Then take a look at the available filters: $sorted_menu_items = apply_filters( ‘wp_nav_menu_objects’, $sorted_menu_items, $args ); $items = apply_filters( ‘wp_nav_menu_items’, $items, $args ); $items = apply_filters( “wp_nav_menu_{$menu->slug}_items”, $items, $args );

How to exit a plugin’s execution mid-stream?

A possible solution would be to hook in way late (template redirect, for example), do your conditional check. If it passes, include (or require) a file that contains the stuff needed. <?php add_action( ‘template_redirect’, ‘wpse30291_template_redirect’ ); function wpse30291_template_redirect() { if( ! is_singular() ) return; require_once( ‘your-file.php’ ); } This is not going to work if … Read more

What to hook into to check a value before a post is published?

Try function wpse46583_save($post_id,$post) { // verify this is not an auto save routine. if ( defined(‘DOING_AUTOSAVE’) && DOING_AUTOSAVE ) return; //You should check nonces and permissions here if ( !current_user_can( ‘edit_page’, $post_id ) return; //Get category slugs associated with post $cats =get_the_category($post_id); if(empty($cats)){ //No category assigned – do something here. } return; } add_action(‘save_post’,’wpse46583_save’,10,2);