Skip to content

Commit

Permalink
refactor admin-menus to fix merge conflict #21
Browse files Browse the repository at this point in the history
  • Loading branch information
Herm71 committed May 31, 2024
1 parent 838b3eb commit 5094b2b
Showing 1 changed file with 14 additions and 26 deletions.
40 changes: 14 additions & 26 deletions lib/functions/admin-menus.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,19 @@
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
*/

/**
* Remove Link Manager from Dash Sidebar
*
* @return void
* Removes deprecated link manager from dashboard sidebar
* @package
* @since
* @author UC Santa Cruz
* @license GNU General Public License 2.0+
*/

if ( ! function_exists( 'ucsc_custom_functionality_customize_dash' ) ) {
/**
* Remove Link Manager from Dash Sidebar
*
* @return void
* Removes deprecated link manager from dashboard sidebar
* @package
* @since
* @author UC Santa Cruz
* @license GNU General Public License 2.0+
*/


function ucsc_custom_functionality_customize_dash() {

remove_menu_page( 'link-manager.php' );
Expand All @@ -31,21 +32,9 @@ function ucsc_custom_functionality_customize_dash() {
}
add_action( 'admin_menu', 'ucsc_custom_functionality_customize_dash' );

/**
* Remove items from Admin Bar
*
* @param mixed $wp_admin_bar
* @return void
* Removes unwanted items from the WP Admin bar
* @package
* @since
* @author UC Santa Cruz
* @license GNU General Public License 2.0+
*/
function ucsc_custom_functionality_remove_from_admin_bar( $wp_admin_bar ) {
if ( ! current_user_can( 'edit_themes' ) ) {
$wp_admin_bar->remove_node( 'customize' );

if ( ! function_exists( 'ucsc_custom_functionality_remove_from_admin_bar' ) ) {

/**
* Remove items from Admin Bar
*
Expand All @@ -60,7 +49,6 @@ function ucsc_custom_functionality_remove_from_admin_bar( $wp_admin_bar ) {
function ucsc_custom_functionality_remove_from_admin_bar( $wp_admin_bar ) {
if ( ! current_user_can( 'edit_themes' ) ) {
$wp_admin_bar->remove_node( 'customize' );
$wp_admin_bar->remove_node( 'site-editor' );
}
}
}
Expand Down

0 comments on commit 5094b2b

Please # to comment.