Make WordPress Core

Ticket #24096: 24096.3.diff

File 24096.3.diff, 2.6 KB (added by SergeyBiryukov, 11 years ago)
  • src/wp-admin/includes/class-wp-posts-list-table.php

     
    10341034        <?php endif; // 'post' && $can_publish && current_user_can( 'edit_others_cap' ) ?>
    10351035
    10361036                        </div>
     1037
     1038        <?php if ( $bulk ) : // post formats bulk edit
     1039                $all_post_formats = get_post_format_strings();
     1040                unset( $all_post_formats['standard'] );
     1041                ?>
     1042                <div class="inline-edit-group">
     1043                        <label class="alignleft" for="post_format">
     1044                        <span class="title"><?php _ex( 'Format', 'post format' ); ?></span>
     1045                        <select name="post_format">
     1046                                <option value="-1"><?php _e( '&mdash; No Change &mdash;' ); ?></option>
     1047                                <option value="0"><?php echo get_post_format_string( 'standard' ); ?></option>
     1048                        <?php foreach ( $all_post_formats as $slug => $format ) : ?>
     1049                                <option value="<?php echo esc_attr( $slug ); ?>"><?php echo esc_html( $format ); ?></option>
     1050                        <?php endforeach; ?>
     1051                        </select></label>
     1052                </div>
     1053        <?php endif; // $bulk ?>
     1054
    10371055                </div></fieldset>
    10381056
    10391057        <?php
  • src/wp-admin/includes/post.php

     
    325325
    326326        $post_IDs = array_map( 'intval', (array) $post_data['post'] );
    327327
    328         $reset = array( 'post_author', 'post_status', 'post_password', 'post_parent', 'page_template', 'comment_status', 'ping_status', 'keep_private', 'tax_input', 'post_category', 'sticky' );
     328        $reset = array(
     329                'post_author', 'post_status', 'post_password',
     330                'post_parent', 'page_template', 'comment_status',
     331                'ping_status', 'keep_private', 'tax_input',
     332                'post_category', 'sticky', 'post_format'
     333        );
     334
    329335        foreach ( $reset as $field ) {
    330336                if ( isset($post_data[$field]) && ( '' == $post_data[$field] || -1 == $post_data[$field] ) )
    331337                        unset($post_data[$field]);
     
    370376                }
    371377        }
    372378
     379        if ( isset( $post_data['post_format'] ) && '0' == $post_data['post_format'] )
     380                $post_data['post_format'] = false;
     381
    373382        $updated = $skipped = $locked = array();
    374383        foreach ( $post_IDs as $post_ID ) {
    375384                $post_type_object = get_post_type_object( get_post_type( $post_ID ) );
     
    419428                        else
    420429                                unstick_post( $post_ID );
    421430                }
     431
     432                if ( isset( $post_data['post_format'] ) )
     433                        set_post_format( $post_ID, $post_data['post_format'] );
    422434        }
    423435
    424436        return array( 'updated' => $updated, 'skipped' => $skipped, 'locked' => $locked );