Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
/*
Plugin Name: PageLines DMS Toolbar Customizer
Author: TourKick (Clifford P)
Author URI: http://tourkick.com/?utm_source=pagelines&utm_medium=plugin&utm_content=pluginuri&utm_campaign=dmstoolbarcustomizer
Plugin URI: http://www.pagelinestheme.com/remove-dms-editor-toolbar-items-2/?utm_source=pagelines&utm_medium=plugin&utm_content=pluginuri&utm_campaign=dmstoolbarcustomizer
Description: Removes 'Get More Sections' link from Add To Page panel, removes Theme panel, and removes DMS panel from the DMS editor for non-Administrators (e.g. Editors). <strong>Edit the plugin's file to customize other options.</strong> May also choose to copy code directly into your DMS child theme's functions.php file instead of activating this plugin. <a href="http://www.pagelinestheme.com/dms-editor-lock-down/" target="_blank">http://www.pagelinestheme.com/dms-editor-lock-down/</a> may also be helpful.
License: GPLv2
Version: 1.1.20131105
*/
add_filter('pl_toolbar_config','pagelines_dms_toolbar_customizer',11, 2);
function pagelines_dms_toolbar_customizer( $toolbar ){
if(
!current_user_can('manage_options') // the uncommented items below only get removed for non-Administrators who also have access to the PageLines DMS Editor
//&& get_current_user_id() !== '1' // could also choose to limit to certain Administrators via user ID
){
//unset($toolbar['add-new']); //Add To Page (Sections)
unset( $toolbar['add-new']['panel']['more_sections']); // Add To Page -- Get More Sections
//unset($toolbar['page-setup']); //Templates
//unset($toolbar['settings']); //Settings (Global Options)
//unset( $toolbar['settings']['panel']['importexport']); // Settings -- Import + Export
//unset( $toolbar['settings']['panel']['advanced']); // Settings -- Advanced
unset($toolbar['theme']); //Theme
//unset( $toolbar['theme']['panel']['avail_themes']); // Theme -- Your Themes
//unset( $toolbar['theme']['panel']['more_themes']); // Theme -- Get More Themes
// do not use, makes DMS not load -- unset($toolbar['pl-design']); //Custom Code
//unset( $toolbar['pl-design']['panel']['user_less']); // Custom -- Custom LESS/CSS
//unset( $toolbar['pl-design']['panel']['user_scripts']); // Custom -- Custom Scripts
unset($toolbar['account']); //DMS
//unset( $toolbar['account']['panel']['pl_account']); // DMS -- Your Account (like defining DMS_DISABLE_ACCOUNT_PANEL constant in wp-config.php)
//unset( $toolbar['account']['panel']['getting_started']); // DMS -- Getting Started
//unset( $toolbar['account']['panel']['support']); // DMS -- Getting Started
//unset($toolbar['toggle-grid']); //Preview
}
return $toolbar;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.