public function adminBarSetting($args)
    {
        if (empty($args)) {
            return;
        }

        add_action('wp_before_admin_bar_render', function () use ($args) {
            global $wp_admin_bar;

            // Iterate on all
            foreach ($args as $item) {
                $wp_admin_bar->remove_menu($item);
            }
        });
    }
public function adminBarSetting($args)
    {
        if (empty($args)) {
            return;
        }

        add_action('wp_before_admin_bar_render', function () use ($args) {
            global $wp_admin_bar;

            // Iterate on all
            foreach ($args as $item) {
                $wp_admin_bar->remove_menu($item);
            }
        });
    }
public function adminBarSetting ( $ args ) { if ( empty ( $ args ) ) { return ; } add_action ( 'wp_before_admin_bar_render' , function ( ) use ( $ args ) { global $ wp_admin_bar ; // Iterate on all foreach ( $ args as $ item ) { $ wp_admin_bar -> remove_menu ( $ item ) ; } } ) ; }
Remove some items from WP admin bar.

@param array $args
Remove some items from WP admin bar .