• I’m trying to hide from our blog in WordPress using php in functions.php.

    I have code:

    function stackinnerflow_remove_dashboard_widgets() {
        global $wp_meta_boxes;
    
        // Remove At a glance
        unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);
        // Remove Activity
        unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_activity']);
        // Remove News and Events
        unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);
    }
    
    add_action('wp_dashboard_setup', 'stackinnerflow_remove_dashboard_widgets' );
    
    // removes the <code>profile.php</code> admin color scheme options
    remove_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );
    
    // Remove thanks WP
    add_action('admin_head', 'stackinnerflow_footer_remove');
    
    function stackinnerflow_footer_remove() {
      echo '<style>
                  #footer-thankyou,
                  #footer-upgrade {
                      display:none;
                  } 
            </style>';

    But if I try:

    // Remove From our blog
        unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);

    It doesn’t work.

    So presumably it’s because I’m calling the same function twice which isn’t permissible. So how do I remove from our blog

    Thanks
    Nico
    https://adsler.co.uk

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter adsler26

    (@adsler26)

    So full code is:

    function stackinnerflow_remove_dashboard_widgets() {
        global $wp_meta_boxes;
    
        // Remove At a glance
        unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);
        // Remove Activity
        unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_activity']);
        // Remove News and Events
        unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);
    }
    
    add_action('wp_dashboard_setup', 'stackinnerflow_remove_dashboard_widgets' );
    
    // removes the <code>profile.php</code> admin color scheme options
    remove_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );
    
    // Remove thanks WP
    add_action('admin_head', 'stackinnerflow_footer_remove');
    
    function stackinnerflow_footer_remove() {
      echo '<style>
                  #footer-thankyou,
                  #footer-upgrade {
                      display:none;
                  } 
            </style>';
    }
    
    // remove the Help Tab use
    
    add_action('admin_head', 'stackinnerflow_remove_help_tabs');
    function stackinnerflow_remove_help_tabs() {
        $screen = get_current_screen();
        $screen->remove_help_tabs();
    }
    
    //remove the Screen Options Tab
    add_filter('screen_options_show_screen', '__return_false');
    Thread Starter adsler26

    (@adsler26)

    WordPress events uses wp_dashboard_primary but what does from our blog use?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hiding From our Blog’ is closed to new replies.