Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




meta_box_prefs [ WordPress Function ]

meta_box_prefs ( $screen )
Parameters:
  • (string|WP_Screen) $screen
Defined at:



Prints the meta box preferences for screen meta.

Source


<?php
function meta_box_prefs$screen ) {
    global 
$wp_meta_boxes;

    if ( 
is_string$screen ) )
        
$screen convert_to_screen$screen );

    if ( empty(
$wp_meta_boxes[$screen->id]) )
        return;

    
$hidden get_hidden_meta_boxes($screen);

    foreach ( 
array_keys($wp_meta_boxes[$screen->id]) as $context ) {
        foreach ( 
array_keys($wp_meta_boxes[$screen->id][$context]) as $priority ) {
            foreach ( 
$wp_meta_boxes[$screen->id][$context][$priority] as $box ) {
                if ( 
false == $box || ! $box['title'] )
                    continue;
                
// Submit box cannot be hidden
                
if ( 'submitdiv' == $box['id'] || 'linksubmitdiv' == $box['id'] )
                    continue;
                
$box_id $box['id'];
                echo 
'<label for="' $box_id '-hide">';
                echo 
'<input class="hide-postbox-tog" name="' $box_id '-hide" type="checkbox" id="' $box_id '-hide" value="' $box_id '"' . (! in_array($box_id$hidden) ? ' checked="checked"' '') . ' />';
                echo 
"{$box['title']}</label>\n";
            }
        }
    }
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics