• Hi all,
    I have an problem….
    I’d like hide link inside wp users control panel Post —-> New Post.

    I’m looking plugin or code that hide only this possibility of add new post from Post —-> New post without change general permits….
    Only hide link…

    Is it possible??

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    You can remove the “Add New” submenu item under “Posts” with remove_submenu_page(). Examine the contents of global $submenu to determine the proper parameters.

    The same link appears at the top of the posts list table. This one is not possible to cleanly remove with PHP. You could hide it with CSS or remove it after the screen renders with JavaScript or jQuery.

    Any slightly knowledgeable user could always type in the URL in their browser to get the new post screen unless their capability to add posts has been removed.

    Thread Starter BakekaIncontritalia

    (@bakekaincontritalia)

    Complex…. But if I wont remove all users admin pannel? Is it more simple?

    Moderator bcworkz

    (@bcworkz)

    Are we talking about users or posts? The process of removing the menu is the same either way, and both have “Add new” on the list table screen that cannot be easily removed this way.

    For users, the best way to deal with this is remove the add_user and create_user capabilities from those user’s roles that you want to hide the link from. Then the links will not show up in the first place, there’s nothing to hide. And typing in the URL won’t work either.

    Posts are a little more complex, there is no add or create post capability to remove. If you remove the various edit post capabilities, the “Add new” still appears, but leads to an error page. But if you want to allow edits but not new, it is complex. However, without publish_posts capability, whatever they do will not reach the front end without someone else approving the post.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Only hide new post’ is closed to new replies.