WordPress Custom Category Picker in Page Editor
Posted
by Scott B
on Stack Overflow
See other posts from Stack Overflow
or by Scott B
Published on 2010-03-29T02:58:09Z
Indexed on
2010/03/29
3:03 UTC
Read the original article
Hit count: 357
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.
© Stack Overflow or respective owner