Bloginfo hook – can it be more precise?

You can access that, using the additional variable in the Filter Functions. The Filter bloginfo_url uses the $show parameter (the parameter you use when calling bloginfo) and passes it to apply_filters. So hooking into bloginfo_url should be no problem, you just have to make a switch inside the function, and it only applies to e.g. … Read more

Removing Submenu from Menu

You can change nav menu args via the wp_nav_menu_args filter. So let’s say you have a theme that does something like this… <?php wp_nav_menu(array( ‘theme_location’ => ‘second_level’, ‘depth’ => 2, // how many levels to show // prolly some other stuff here )); You can hook into wp_nav_menu_args, check for the theme location, and set … Read more

an action hook when a post reaches a certain number of views

Use the action from update_post_meta(): do_action( “updated_{$meta_type}_meta”, // example: updated_post_meta $meta_id, $object_id, // post ID $meta_key, // ‘view’ $_meta_value // view count ); Something like this should work (not tested): add_action( ‘update_post_meta’, ‘badge_check’, 10, 4 ); function badge_check( $meta_id, $post_id, $key, $value ) { if ( ‘views’ !== $key or 1000 > $value ) return; … Read more

Is there a author_update action?

There’s the edit_user_profile_update and personal_options_update actions that runs after a user is updated, with access to the user object. There’s also a variable update_{$meta_type}_meta action that runs when meta of type user is updated.