This topic has 8 replies, 2 voices, and was last updated 9 years by jerryd.

  • Author
  • #68685
     jerryd
    Participant

    How do I remove the theme settings like ‘KELO’ and ‘RevSlider’ on toolbar of post editor, post type “video” ,”audio” and “quote”, as well as the video and audio in media tab of theme general settings?

    Attachments:
    You must be logged in to view attached files.
    #68689
     jerryd
    Participant

    or is there any plugin can do that?

    #68692
     jerryd
    Participant

    only admin or certain level of role higher than contributor can see these settings

    #68694
     sharmstr
    Moderator

    Removing items from admin toolbar: https://codex.wordpress.org/Function_Reference/remove_menu

    Removing items from admin menu: https://codex.wordpress.org/Function_Reference/remove_menu_page

    Removing sections of Theme General Settings: The entire section is in /kleo/lib/metaboxes.php This topic should explain it a bit: https://archived.seventhqueen.com/forums/topic/add-kleo-meta-box-to-custom-post-type

    Google how to remove post formats

    Google how to remove MCE toolbar buttons.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #68695
     sharmstr
    Moderator

    You can use current_user_can(‘manage_options’) to determine whether or not to hide stuff. Example

    COPY CODE
    
    if( !current_user_can('manage_options') ) {
    remove_meta_box( 'mymetabox_revslider_0', 'post', 'normal' );
    }
    

    That says “If the user is not admin, remove the rev slider metabox from the post editor.”

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #68833
     jerryd
    Participant

    where should I place these codes? in kleo-child function.php or other file?

    #68838
     jerryd
    Participant

    I have tried to place the following code in kleo-child/functions.php, but there is nothing happened, am I doing correctly?

    COPY CODE
    
    add_filter( 'kleo_meta_boxes', 'kleo_my_metaboxes' );
    function kleo_my_metaboxes( array $meta_boxes ) {
     
    	// Start with an underscore to hide fields from custom fields list
    	$prefix = '_kleo_';
    	
    	$meta_boxes[] = array(
    		'id'         => 'general_settings',
    		'title'      => 'Theme General settings',
    		'pages'      => array( 'standard', 'link', 'image', 'gallery' ), // Post type
    		'context'    => 'normal',
    		'priority'   => 'default',
    		'show_names' => true, // Show field names on the left
    		'fields'     => array(
    			array(
    				'name' => 'Media',
    				'desc' => '',
    				'id'   => 'kleomedia',
    				'type' => 'tab'
    			),
    			array(
    				'name' => 'Slider',
    				'desc' => 'Used when you select the Gallery format. Upload an image or enter an URL.',
    				'id'   => $prefix . 'slider',
    				'type' => 'file_repeat',
    				'allow' => 'url'
    			),
    			array(
    				'name' => 'Display settings',
    				'desc' => '',
    				'id'   => 'kleodisplay',
    				'type' => 'tab'
    			),
    			array(
    				'name' => 'Centered text',
    				'desc' => 'Check to have centered text on this page',
    				'id'   => $prefix . 'centered_text',
    				'type' => 'checkbox',
    				'value' => '1'
    			)
    		)
    	);
    	return $meta_boxes;
    }
    #68851
     sharmstr
    Moderator

    No, that’s wrong. In your case you just need to edit /kleo/lib/metaboxes.php. I gave the link as a reference to explain the function. And as noted, you cant override it, so you’ll have to remember to apply your edits after every upgrade.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #68861
     jerryd
    Participant

    thanks mate, it works perfectly.

Viewing 9 posts - 1 through 9 (of 9 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?