for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* Plugin Name: Hide Menu
* Plugin URI: http://pothi.info
* Author: Pothi Kalimuthu
* Author URI: http://pothi.info
* Description: Hides unneccessary menu item/s
* Version: 1.0
* License: Apache 2.0
*/
function tiny_remove_menus() {
// Hide Ewww image optimizer settings that are found in four places
$page = remove_submenu_page( 'options-general.php', 'ewww-image-optimizer/ewww-image-optimizer.php' );
remove_submenu_page
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
ignore-call
$page = /** @scrutinizer ignore-call */ remove_submenu_page( 'options-general.php', 'ewww-image-optimizer/ewww-image-optimizer.php' );
$page
$page = remove_submenu_page( 'tools.php', 'ewww-image-optimizer-aux-images' );
$page = remove_submenu_page( 'themes.php', 'ewww-image-optimizer-theme-images' );
$page = remove_submenu_page( 'upload.php', 'ewww-image-optimizer-bulk' );
}
add_action( 'admin_menu', 'tiny_remove_menus', 999 );
add_action
/** @scrutinizer ignore-call */
function tiny_remove_admin_bar_nodes() {
// Hide WP Logo from the admin bar
global $wp_admin_bar;
$wp_admin_bar->remove_node( 'wp-logo' );
add_action( 'admin_bar_menu', 'tiny_remove_admin_bar_nodes', 999 );