I’ve been busy thinking about a problem, and so far I didn’t find a solution to it.
The abstract scenario
On admin page A, I would like to print the value of a (global) variable—in the context of admin page B, though.
The concrete scenario
On a custom user-options page, I would like to list all metaboxes registered for each post type.
Both plugins and the theme can add/remove metaboxes with respect to the current page context ($pagenow
). Thus, the $wp_meta_boxes
global is set up in that context.
So far, I’ve read into virtually any hook, read a lot on AJAX (the right and the wrong ways), and tried out numerous different approaches I came up with.
Unfortunatly, without luck.
The question
Is it possible to retrieve the value of $wp_meta_boxes
on admin page post-new.php?post_type=my_super_duper_post_type
, for instance, from another admin page?
If so, how would I go about that?
Can this be done via AJAX?
Or can I trick the plugins/theme into thinking that the current page is post-new.php?post_type=my_super_duper_post_type
, for instance, while we’re actually on my options page?