Created
December 14, 2011 19:43
-
-
Save GaryJones/1478136 to your computer and use it in GitHub Desktop.
has_meta_boxes()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Helper function to determine if a meta boxes exists for a given context on | |
* a given page. | |
* | |
* @global array $wp_meta_boxes | |
* | |
* @param string $page Name of the admin page | |
* @param string $context Name of the meta box context | |
* @return boolean True if given context on the given page has meta boxes. False otherwise | |
*/ | |
function has_meta_boxes( $page, $context ) { | |
global $wp_meta_boxes; | |
if ( isset( $wp_meta_boxes ) && isset( $wp_meta_boxes[$page] ) && isset( $wp_meta_boxes[$page][$context] ) ) | |
return true; | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment