wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes
remove_meta_box › WordPress Function
Depuis2.6.0
Dépréciéen/a
› remove_meta_box ( $id, $screen, $context )
Paramètres: (3) |
|
Défini(e) dans: |
|
Codex: | |
Changelog: |
|
Removes a meta box from one or more screens.
Fonctions en relation: do_meta_boxes, remove_theme_mod, remove_theme_mods, add_meta_box, remove_menu_page
Source
function remove_meta_box( $id, $screen, $context ) { global $wp_meta_boxes; if ( empty( $screen ) ) { $screen = get_current_screen(); } elseif ( is_string( $screen ) ) { $screen = convert_to_screen( $screen ); } elseif ( is_array( $screen ) ) { foreach ( $screen as $single_screen ) { remove_meta_box( $id, $single_screen, $context ); } } if ( ! isset( $screen->id ) ) { return; } $page = $screen->id; if ( ! isset( $wp_meta_boxes ) ) { $wp_meta_boxes = array(); } if ( ! isset( $wp_meta_boxes[ $page ] ) ) { $wp_meta_boxes[ $page ] = array(); } if ( ! isset( $wp_meta_boxes[ $page ][ $context ] ) ) { $wp_meta_boxes[ $page ][ $context ] = array(); } foreach ( array( 'high', 'core', 'default', 'low' ) as $priority ) { $wp_meta_boxes[ $page ][ $context ][ $priority ][ $id ] = false; } }