WordPress.org

Make WordPress Core

Ticket #16073: meta-boxes.diff

File meta-boxes.diff, 1.0 KB (added by ericmann, 7 years ago)

Check to make sure the post format string exists ( != ) before adding its markup to the UI.

  • includes/meta-boxes.php

     
    255255        ?>
    256256        <div id="post-formats-select">
    257257                <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>
    258                 <?php foreach ( $post_formats[0] as $format ) : ?>
     258                <?php foreach ( $post_formats[0] as $format ) :
     259               
     260                if( get_post_format_string( $format ) == '' ) {
     261                        break;
     262                } ?>
    259263                <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>
    260264                <?php endforeach; ?><br />
    261265                <?php if ( 'post' == $post->post_type ) : ?>