WordPress.org

Forums

Author Category
[resolved] Default setting for new users? (5 posts)

  1. craftcore
    Member
    Posted 2 years ago #

    Hi! First: I love the plugin! It works perfectly and is oh-so-easy to set up.

    In a future update, would it be possible to have it so that new users can be automatically restricted to a certain category? Right now, I'm just manually setting it with your plugin, but making it an automatic feature would be AWESOME! Or even if there was a way to do a bulk action to do many users at once.

    Thanks for making the plugin. It's great!

    http://wordpress.org/extend/plugins/author-category/

  2. Bainternet
    Member
    Plugin Author

    Posted 2 years ago #

    I'd like to keep it simple as possible so i wont add any kind of admin option panel to it, but you can use the built in hooks to set the category for each new user ex:

    add_action('user_register','set_default_cat_for_user');
    function set_default_cat_for_user($user_id){
            $default_category_id = 2; //change 2 with your default category id
            update_user_meta( $user_id, '_author_cat',$default_category_id);
    }
  3. InventiveWebDesign
    Member
    Posted 2 years ago #

    Can I use this plugin to set it for all existing users with the role of Author?

  4. InventiveWebDesign
    Member
    Posted 2 years ago #

    I have a few hundred users and don't want to switch it for each of them.

  5. ExNube
    Member
    Posted 2 years ago #

    Awesome plugin bro! and thx for the tip!
    >>>
    Set the default category for new users with the Author Category plugin:

    add_action('user_register','set_default_cat_for_user');
    function set_default_cat_for_user($user_id){
    $default_category_id = 2; //change 2 with your default category id
    update_user_meta( $user_id, '_author_cat',$default_category_id);
    }

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Author Category
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic