• Resolved chefvevo

    (@chefvevo)


    Hello, sir
    I want to hide the post meta box for the plugin for any content writer which is not an admin in my website using (Custom Admin Interface) plugin
    make an update for this please!

    screenshot: https://prnt.sc/11niq8c

    Best Regards,
    Thanks!

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

Viewing 1 replies (of 1 total)
  • Hello, You can add the below code to functions.php of your active/child theme to hide the box

    /* WP Telegram | Hide post edit switch for non-admins */
    add_filter(
    	'wptelegram_p2tg_show_post_edit_switch',
    	'wptelegram_filter_post_edit_switch'
    );
    function wptelegram_filter_post_edit_switch( $show_the_switch ) {
    	// If current user is not an admin
    	if ( ! current_user_can( 'manage_options' ) ) {
    		return false;
    	}
    	// Otherwise retain the behavior for admins
    	return $show_the_switch;
    }
    add_filter(
    	'wptelegram\core\includes\options__get_post_edit_switch',
    	'wptelegram_filter_post_edit_switch'
    );
Viewing 1 replies (of 1 total)
  • The topic ‘I want to hide the post meta box for the plugin’ is closed to new replies.