• Resolved lonewolf95

    (@lonewolf95)


    Hey there,

    I want some users to be able to select between whether the page is password protected or public but they mustn’t be allowed to publish the page, so the pages should always only be a draft. In AAM I have the already given option to uncheck “publish_pages”, so the users may not publish the page nor set the visibility to “passwort protected” but I’d like them to be able to set the visibility.

    I thought about managing it with the current_user_can function but I don’t know how the function that will allow setting the visibility is called.

    Can you help me please with those?

    Best regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author AAM Plugin

    (@vasyltech)

    Hi lonewolf95,

    Unfortunately you can not do that. The ability to change the Visibility is allowed only when user is allowed to publish pages. This is how WordPress core works and there is no way around unless you modify WordPress source code (which is very bad practice).

    Your only option is to create a custom metabox instead of Publish metabox. Check post_submit_meta_box function. It renders default WordPress Publish metabox.

    Regards,
    Vasyl

    • This reply was modified 7 years, 8 months ago by AAM Plugin.
    Thread Starter lonewolf95

    (@lonewolf95)

    Hi Vasyl,

    thank you for your reply!
    Can you provide me some information on how to create such a custom metabox with the ability to disable “publishing” but keep “password protected”?

    Regards.

    Plugin Author AAM Plugin

    (@vasyltech)

    Hi lonewolf95,

    There is no easy way to explain this to you. The best way to go is to register new metabox that has callback function similar to post_submit_meta_box.

    I can help you to develop it but you would have to consider to hire me for couple hours.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Page visibility with AAM’ is closed to new replies.