Support » Developing with WordPress » Restrict Category When Post

  • Resolved niel

    (@nielfernandez)


    Hello WordPress Good day, I need help again with the same concern…

    how to hide or restrict the users to select a specific category using the WordPress PHP function or any plugins because in CSS display none, not all browser work especially on mobile the user should able to select the category aside from the “Incomplete” and “Completed”.

    Here’s my configuration using plugins restrict the category in my back end
    ..
    link: https://ibb.co/RHMBvdB

    Expectedly is the “Incomplete” and “Completed” only show when the user creates post but still the category display all, exactly the user can’t add a category that’s perfect.

    Here is the image for my post user dashboard that all categories should not display aside to my “Incomplete” and “Completed” category.
    ..
    link: https://ibb.co/rf6Qz0m

    Currently, I am using the latest version of WordPress 5.5
    Plugins version: Version 2.6.4 | By Matthew Muro (Restrict Categories)

    Similar Issue:
    https://wordpress.org/support/topic/create-post-and-display-category-by-user-role/

    The page I need help with: [log in to see the link]

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

    (@bcworkz)

    Use the ‘wp_terms_checklist_args’ filter to add the “exclude” arg, passing an array of category term IDs which should not be listed. This filter is used for any taxonomy term checklist, so you should only alter the args under certain conditions. For example, only exclude terms for users who lack a certain capability, checked with current_user_can().

    Thread Starter niel

    (@nielfernandez)

    Hello @bcworkz Thank you very much but I tried plugins again now it’s working, someday I will use that function you give me, Thanks cool! you saved me. :))

    Thread Starter niel

    (@nielfernandez)

    Yes, I will now it will show correctly when edit but when add display all category so sad anyway, you have a function and let me try that.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Restrict Category When Post’ is closed to new replies.