The MU forums have moved to WordPress.org

Automatically select a category depending on user (3 posts)

  1. hardworking
    Member
    Posted 16 years ago #

    Hi all

    Just a quick one, to see if there is a way of automatically selecting the category for a post, depending on who has logged in?

    If not, is it possible to restrict the number of items on the category list, so they can only tick the one they should?

    Any help would be much appreciated!

    Adam

  2. hardworking
    Member
    Posted 16 years ago #

    Has anybody got any ideas on how to do this? Are there any plugins out there that will help me achieve this?
    thanks in advance

  3. dsader
    Member
    Posted 16 years ago #

    Hmmm, ideas yes.

    Creating your own plugin to remove a meta_box and then add your own is easy enough.

    Working just with the post_categories_meta_box from edit_form_advanced.php you can easily enough remove the original post_categories_meta_box with a plugin ... and

    Create and Add your own custom_post_categories_meta_box with(or without) all the bells and whistles you like.

    Create your own plugin replacement function for wp_category_checklist to filter the get_categories based on user role/cap, ID, multiple cat ids etc etc.

    You can set up a plugin to work fine on a single blog with multiple users, but making sure categories and user roles are static across many blogs is another trick. For instance, in WPMU categories with same name have same ID from blog to blog, once the cats are added to the new blog. So '&hide_empty=0' will need to be added to the get_categories so cats list on a blog that has no posts in that category, yet. Anyway,

    Other ideas: http://wordpress.org/search/wp_category_checklist?forums=1

About this Topic

  • Started 16 years ago by hardworking
  • Latest reply from dsader