WordPress Custom Category Picker in Page Editor
- by Scott B
The 3 lines of code below will add a Category selector widget to the WordPress page editor.
add_action('admin_menu', 'my_post_categories_meta_box');
function my_post_categories_meta_box() {
add_meta_box('categorydiv', __('Categories'), 'post_categories_meta_box', 'page', 'side', 'core');
}
I would like to slightly modify this in order to limit the number of categories that are listed to two: get_cat_ID('nofollow'), get_cat_ID('noindex')
In other words, I only want the two categories, nofollow and noindex listed in this box.