• Mary Jane

    (@jasonbrodbeckcom)


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

Viewing 9 replies - 1 through 9 (of 9 total)
  • Clayton James

    (@claytonjames)

    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

    Thread Starter Mary Jane

    (@jasonbrodbeckcom)

    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

    Clayton James

    (@claytonjames)

    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/

    Thread Starter Mary Jane

    (@jasonbrodbeckcom)

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

    Clayton James

    (@claytonjames)

    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.”

    Thread Starter Mary Jane

    (@jasonbrodbeckcom)

    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

    Clayton James

    (@claytonjames)

    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

    Thread Starter Mary Jane

    (@jasonbrodbeckcom)

    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

    Clayton James

    (@claytonjames)

    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.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Hide "New Post" from Non-admin’ is closed to new replies.