dashboard - global $wp_meta_boxes returns NULL

admin2025-06-06  4

When I call global $wp_meta_boxes; it returns null. I'm trying to calling like:

class my_class()
{
   public function __construct(){
     add_action( 'wp_dashboard_setup' , array( $this , 'my_meta_boxes' ));
   }
   public function my_meta_boxes(){
      global $wp_meta_boxes;
      return $wp_meta_boxes;
   }
}

The class is working fine, but I cannot make it work.

[EDIT]

To make understand better the issue, my objective is the one actually answered in this question:

  • Get List of Registered Meta Boxes and Removing Them.

I need to retrieve metaboxes for specific admin pages. The problem is that the globalis not working for me.

I appreciate any suggestion.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1749193472a317144.html

最新回复(0)