WordPress.org

Ready to get started?Download WordPress

Forums

Hide "New Post" from Non-admin (10 posts)

  1. Mary Jane
    Member
    Posted 3 years ago #

    How can i make it so the new page/new post option is not available to non-subscribers like a redirect?

  2. ClaytonJames
    Member
    Posted 3 years ago #

    New post and page options aren't normally available to those who aren't logged in. (casual visitors/non-subscribers).
    [edit] Capability vs. Role Table

  3. Mary Jane
    Member
    Posted 3 years ago #

    Yeah, but when it does it, it says you dont have privileges to do that or something like that, but i dont want people to see that message, is there a way to redirect just non admins to a different page? but i can still do new posts

  4. ClaytonJames
    Member
    Posted 3 years ago #

    I see. Well, this might do what you want. http://wordpress.org/extend/plugins/wp-hide-dashboard/ There is also a great redirect plugin, but it doesn't keep users from accessing their dashboard. http://wordpress.org/extend/plugins/peters-login-redirect/

  5. Mary Jane
    Member
    Posted 3 years ago #

    Didnt work for me :( is there any code that is somtihng like " if user is subscriber redirect to http://example.com" ?

  6. ClaytonJames
    Member
    Posted 3 years ago #

    Yes. the second plugin can redirect by user role. Take another look at the instructions.

    http://wordpress.org/extend/plugins/peters-login-redirect/

    "Define a set of redirect rules for specific users, users with specific roles, users with specific capabilities, and a blanket rule for all other users. This is all managed in Settings > Login redirects."

  7. Mary Jane
    Member
    Posted 3 years ago #

    Im really sorry but im a real noob with plugins like these but say i was to take post-new.php and redirect to example.com which form would I full out and what would I put?

    It looks like :

    Specific users
    Username URL

    Add:
    URL:
    __________________________
    Specific roles
    Role URL

    subscriber

    Add:
    URL:
    _________________________
    Specific levels
    Level Order URL

    publish_posts

    Add:
    Order:
    URL:
    ___________________________
    All other users

    URL

  8. ClaytonJames
    Member
    Posted 3 years ago #

    Ahh... Now I see a little more clearly. You want to redirect from post-new.php after login, to a url of your choice. That plugin probably will not work in that case. I guess I don't know the answer to that one.

    make it so the new page/new post option is not available to non-subscribers like a redirect?

    I guess what baffles me, is how anyone who is just a subscriber, or not logged in at all, would even normally access those pages. Those options aren't available in their dashboard if they don't have a user role with those permissions. Seems like they would have to manually append /wp-admin/post-new.php? to a url to even see the error message. Strange.

    I hope you find something that works for you.

    [edit] If customizing user role capabilities might be more what you are after, rather than just a redirect, this plugin lets you add or remove capabilities to individual user roles pretty easily. It might be of some help. User Role Editor

  9. Mary Jane
    Member
    Posted 3 years ago #

    Well what i am doing is i have a little menu setup using a plugin, and in the menu it has "New Post" in it, subscribers can see it so I need to make sure they don't see the sufficient privileges message when they click it

  10. ClaytonJames
    Member
    Posted 3 years ago #

    Now it makes sense to me! :-)

    I'm definitely not a plugin developer, but is there any chance you could attack the problem by placing a conditional statement in your plugin code or your themes functions.php file that only allows the "New Post" link to display for just the users roles you want?

    Something like:

    if ( current_user_can('some_capability') ) { show_NewPostLink();

    Something along those lines? I'm just guessing, of course.

Topic Closed

This topic has been closed to new replies.

About this Topic