Skip to content

Instantly share code, notes, and snippets.

@cliffordp
Last active December 22, 2015 01:48
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cliffordp/6398556 to your computer and use it in GitHub Desktop.
Save cliffordp/6398556 to your computer and use it in GitHub Desktop.
<?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/?utm_source=pagelines&utm_medium=plugin&utm_content=pluginuri&utm_campaign=dmstoolbarcustomizer
Description: Removes the Theme, Store, and Account items from the DMS editor for non-Administrators (e.g. Editors). <strong>Edit the plugin's file to customize.</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.0.20130831
*/
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 Sections
//unset($toolbar['page-setup']); //Templates
//unset($toolbar['settings']); //Global Options
//unset($toolbar['pl-design']); //Custom Code
unset($toolbar['theme']); //Theme
unset($toolbar['pl-extend']); //Store (if unset, Add Sections panel and Theme panel get dead links if they're active)
unset($toolbar['account']); //Account
}
return $toolbar;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment