Switch language

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




post_format_meta_box [ WordPress Function ]

post_format_meta_box ( $post, $box )
Parameters:
  • (object) $post
Defined at:



Display post format form elements.

Source


<?php
function post_format_meta_box$post$box ) {
    if ( 
current_theme_supports'post-formats' ) && post_type_supports$post->post_type'post-formats' ) ) :
    
$post_formats get_theme_support'post-formats' );

    if ( 
is_array$post_formats[0] ) ) :
        
$post_format get_post_format$post->ID );
        if ( !
$post_format )
            
$post_format '0';
        
// Add in the current one if it isn't there yet, in case the current theme doesn't support it
        
if ( $post_format && !in_array$post_format$post_formats[0] ) )
            
$post_formats[0][] = $post_format;
    
?>
    <div id="post-formats-select">
        <input type="radio" name="post_format" class="post-format" id="post-format-0" value="0" <?php checked$post_format'0' ); ?> /> <label for="post-format-0"><?php _e('Standard'); ?></label>
        <?php foreach ( $post_formats[0] as $format ) : ?>
        <br /><input type="radio" name="post_format" class="post-format" id="post-format-<?php echo esc_attr$format ); ?>" value="<?php echo esc_attr$format ); ?><?php checked$post_format$format ); ?> /> <label for="post-format-<?php echo esc_attr$format ); ?>"><?php echo esc_htmlget_post_format_string$format ) ); ?></label>
        <?php endforeach; ?><br />
    </div>
    <?php endif; endif;
}
?>

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