Support » Plugins » Hacks » Possible to show all metabox key from another plugin/theme ?

  • is it possible to show all custom metabox key/name that plugin/theme developer make ?
    i just wanna make a plugin that will support to detected custom metabox from all plugin/theme and show the metabox key to my dropdown menu, then i post the targeted metabox from my custom field plugin.


Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz


    All the info you need is available in the global $wp_meta_boxes. The problem is this global is only loaded up when the related template is being loaded, so you would need to call do_action('add_meta_boxes', $type, $object ); yourself to essentially have all plugins and the theme load up the global for your use.

    Further complicating things is some plugins use the “add_meta_boxes_{$entity_type}” action hook tag form, usually for custom post types. For completeness, you would need to determine the various entity types used and do those actions as well.

    not sure i understand that function.
    is that any example for using it ?
    so if i have


    whater your code will show an metaboxes title with metaboxes key or not ?

    sry,i’m new as wp developer.

    Moderator bcworkz


    There’s more to it than that I’m afraid. (first of all, any PHP code needs to be inside of <?php ?> blocks.)

    The $type and $object determine the metabox context, these need to be defined. All the do_action() call does is ask the theme and plugins to add their meta box callbacks (for the particular context) to the global $wp_meta_boxes. Your code would need to step through this global, extract the required information, and use it to build your dropdown and setup whatever else happens when the form is submitted.

    I’m not sure exactly how the global is structured, you’ll have to var_dump it and study it for yourself. Welcome to WordPress development 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Possible to show all metabox key from another plugin/theme ?’ is closed to new replies.