-
Author
-
July 17, 2015 at 14:34 #68685jerrydParticipant
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.July 17, 2015 at 14:42 #68692jerrydParticipantonly admin or certain level of role higher than contributor can see these settings
July 17, 2015 at 15:02 #68694sharmstrModeratorRemoving 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
July 17, 2015 at 15:06 #68695sharmstrModeratorYou can use current_user_can(‘manage_options’) to determine whether or not to hide stuff. Example
COPY CODEif( !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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
July 18, 2015 at 08:14 #68833jerrydParticipantwhere should I place these codes? in kleo-child function.php or other file?
July 18, 2015 at 09:09 #68838jerrydParticipantI have tried to place the following code in kleo-child/functions.php, but there is nothing happened, am I doing correctly?
COPY CODEadd_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; }
July 18, 2015 at 16:58 #68851sharmstrModeratorNo, 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
-
AuthorPosts
The forum ‘General questions’ is closed to new topics and replies.