WordPress.org

Make WordPress Core

Changeset 23742


Ignore:
Timestamp:
03/18/2013 05:24:24 PM (7 years ago)
Author:
ryan
Message:

Don't allow changing the post format from quick edit and bulk edit. These do not have sufficient context to set the post format.

Props kovshenin
fixes #23426

Location:
trunk/wp-admin/includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/class-wp-posts-list-table.php

    r23681 r23742  
    10331033
    10341034            </div>
    1035 
    1036     <?php if ( post_type_supports( $screen->post_type, 'post-formats' ) && current_theme_supports( 'post-formats' ) ) :
    1037         $post_formats = get_theme_support( 'post-formats' );
    1038         if ( isset( $post_formats[0] ) && is_array( $post_formats[0] ) ) :
    1039             $all_post_formats = get_post_format_strings();
    1040             unset( $all_post_formats['standard'] ); ?>
    1041             <div class="inline-edit-group">
    1042                 <label class="alignleft" for="post_format">
    1043                 <span class="title"><?php _ex( 'Format', 'post format' ); ?></span>
    1044                 <select name="post_format">
    1045                 <?php if ( $bulk ) : ?>
    1046                     <option value="-1"><?php _e( '&mdash; No Change &mdash;' ); ?></option>
    1047                 <?php endif; ?>
    1048                     <option value="0"><?php _ex( 'Standard', 'Post format' ); ?></option>
    1049                 <?php foreach ( $all_post_formats as $slug => $format ) :
    1050                     $unsupported = ! in_array( $slug, $post_formats[0] );
    1051                     if ( $bulk && $unsupported )
    1052                         continue;
    1053                     ?>
    1054                     <option value="<?php echo esc_attr( $slug ); ?>"<?php if ( $unsupported ) echo ' class="unsupported"'; ?>><?php echo esc_html( $format ); ?></option>
    1055                 <?php endforeach; ?>
    1056                 </select></label>
    1057             </div>
    1058         <?php endif; ?>
    1059     <?php endif; // post-formats ?>
    1060 
    10611035        </div></fieldset>
    10621036
  • trunk/wp-admin/includes/post.php

    r23735 r23742  
    353353    }
    354354
    355     if ( isset( $post_data['post_format'] ) ) {
    356         if ( '0' == $post_data['post_format'] )
    357             $post_data['post_format'] = false;
    358         // don't change the post format if it's not supported or not '0' (standard)
    359         elseif ( ! current_theme_supports( 'post-formats', $post_data['post_format'] ) )
    360             unset( $post_data['post_format'] );
    361     }
    362 
    363355    $updated = $skipped = $locked = array();
    364356    foreach ( $post_IDs as $post_ID ) {
     
    410402                unstick_post( $post_ID );
    411403        }
    412 
    413         if ( isset( $post_data['post_format'] ) )
    414             set_post_format( $post_ID, $post_data['post_format'] );
    415404    }
    416405
Note: See TracChangeset for help on using the changeset viewer.