• Resolved Kevin Pirnie

    (@kevp75)


    Hi all, wondering if someone can point me in the right direction.
    I have some custom user roles, tied to some custom post types. I notice the plugin shows on any post type related to ‘posts’ or ‘pages’, so what I’m wondering is, how can I remove it based on my user role?

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter Kevin Pirnie

    (@kevp75)

    remove_meta_box( 'b2s-post-meta-box-auto', 'tickets', 'normal' );

    does not work

    Plugin Support Blog2Social-Support

    (@blog2socialsupport)

    Hello @kevp75,

    do I understand you correctly, that you are aiming to hide a certain custome post type for a specific user role?

    In general, only admins can share any content of your blog or website. If you asign the user role author or cotributer, these users will only be able to share content they have created and published themselves. Therefore, if you have created an element with a custome post type, other wp user roles (that are not admins) won’t be able to share this content.

    I will gladly forward your suggestion to add a possibility to regulate the access of different user roles for admins. We will keep you posted on any possible implementations here.

    Best regards!

    Thread Starter Kevin Pirnie

    (@kevp75)

    Hi there.
    No, what I am trying to do is hide the plugin meta box for specific custom post types.

    I have created some custom user roles, with a base of administrator (because they need some abilities that admins have), so all my user roles see the meta box on all posts / pages / CPT’s (because the CPT is based on a page post type)

    I just need to know how I can remove the meta box, it seems that the normal method of doing so (remove_meta_box) does not work with your plugin.

    Thanks!

    Plugin Support Blog2Social-Support

    (@blog2socialsupport)

    Hello @kevp75,

    okay, thanks for clarifying. I have forwarded your question to one of our developers.

    Plugin Support Blog2Social-Support

    (@blog2socialsupport)

    Hello @kevp75,

    I got feedback from our developers and the correct command seems to be the following:

    remove_meta_box('b2s-post-meta-box-auto', 'tickets', 'side');

    You can check out how to apply this feature here: https://codex.www.ads-software.com/Function_Reference/remove_meta_box

    However, the feature kann only be carried out, if the meta box was preiously loaded.
    Please, let me know how this works for you.

    Best regards.

    Thread Starter Kevin Pirnie

    (@kevp75)

    Still shows
    Used:

    add_action( 'do_meta_boxes', function(){
    					remove_meta_box( 'b2s-post-meta-box-auto', 'tickets', 'side' );
    				} );
    Plugin Support Blog2Social-Support

    (@blog2socialsupport)

    Hello @kevp75,

    it works if you put it like this:

    add_action( 'do_meta_boxes', 'remove_plugin_metaboxes' );
    
        public function remove_plugin_metaboxes() {
            remove_meta_box('b2s-post-meta-box-auto', 'tickets', 'side');
        }

    Cheers

    Thread Starter Kevin Pirnie

    (@kevp75)

    the only difference between what you posted, and what I posted is the inline function. Which works for every other item I use like this.

    I have tried it like that as well, and it still does NOT remove the box

    Plugin Support Blog2Social-Support

    (@blog2socialsupport)

    Hello @kevp75,

    could you tell me in which file and where exactly you are placing this function?
    Thank you in advance.

    Thread Starter Kevin Pirnie

    (@kevp75)

    functions.php

    Plugin Support Blog2Social-Support

    (@blog2socialsupport)

    @kevp75,

    thank you for your feedback. Where exactly in the functions.php file do you insert the code? You are alsow more than welcome to contact us via email at customer-service(at)blog2social(dot)com to share more indepth information with us. Its easier this way for us to help you achieve the result you are aiming for.

    Best regards.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Remove Based on User Role’ is closed to new replies.