post_format_meta_box [ WordPress Function ]
post_format_meta_box ( $post, $box )
| Parameters: |
|
| Defined at: |
|
Soorgelijke functies: post_comment_meta_box, post_author_meta_box, post_submit_meta_box, post_tags_meta_box, post_excerpt_meta_box
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_html( get_post_format_string( $format ) ); ?></label>
<?php endforeach; ?><br />
</div>
<?php endif; endif;
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- Different post format options per custom post type? - WordPress ...
May 1, 2011 ... You can change the list that appears in the post format meta box, but when you save the post the submitted value is checked against the ...
wordpress.stackexchange.com - PHPXRef 0.7 : WordPress : Detail view of meta-boxes.php
post_format_meta_box() post_tags_meta_box() ...
phpxref.ftwr.co.uk - User-friendly custom fields with Meta Boxes in WordPress | Tutorial ...
May 19, 2011 ... The above entry will add the Additional Post Format Meta box that I use on my blog to the post screen. If you're using Custom Post Types you ...
www.netmagazine.com - Post Format Meta Box | WPCandy
Dec 17, 2010 ... You are here: Home > Features > What's new and exciting in WordPress 3.1 > Post Format Meta Box. Previous Image · Next Image · Return to ...
wpcandy.com