Make WordPress Core

Changeset 16680


Ignore:
Timestamp:
12/02/2010 03:39:26 AM (14 years ago)
Author:
nacin
Message:

Revert [15742]. Custom post types and sticky posts don't mix. fixes #12702.

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

Legend:

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

    r16660 r16680  
    6969        }
    7070
    71         if ( $sticky_posts = get_option( 'sticky_posts' ) ) {
     71        if ( 'post' == $post_type && $sticky_posts = get_option( 'sticky_posts' ) ) {
    7272            $sticky_posts = implode( ', ', array_map( 'absint', (array) $sticky_posts ) );
    7373            $this->sticky_posts_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT( 1 ) FROM $wpdb->posts WHERE post_type = %s AND ID IN ($sticky_posts)", $post_type ) );
     
    951951                </label>
    952952
    953     <?php if ( post_type_supports( $screen->post_type, 'sticky' ) && $can_publish && current_user_can( $post_type_object->cap->edit_others_posts ) ) : ?>
     953    <?php if ( 'post' == $screen->post_type && $can_publish && current_user_can( $post_type_object->cap->edit_others_posts ) ) : ?>
    954954
    955955    <?php   if ( $bulk ) : ?>
     
    968968                <label class="alignleft">
    969969                    <input type="checkbox" name="sticky" value="sticky" />
    970                     <span class="checkbox-title"><?php _e( 'Make this sticky' ); ?></span>
     970                    <span class="checkbox-title"><?php _e( 'Make this post sticky' ); ?></span>
    971971                </label>
    972972
    973973    <?php   endif; // $bulk ?>
    974974
    975     <?php endif; // post_type_supports(sticky) && $can_publish && current_user_can( 'edit_others_cap' ) ?>
     975    <?php endif; // 'post' && $can_publish && current_user_can( 'edit_others_cap' ) ?>
    976976
    977977            </div>
  • trunk/wp-admin/includes/meta-boxes.php

    r16679 r16680  
    115115    $visibility = 'password';
    116116    $visibility_trans = __('Password protected');
    117 } elseif ( post_type_supports( $post->post_type, 'sticky' ) && is_sticky( $post->ID ) ) {
     117} elseif ( $post_type == 'post' && is_sticky( $post->ID ) ) {
    118118    $visibility = 'public';
    119119    $visibility_trans = __('Public, Sticky');
     
    129129<div id="post-visibility-select" class="hide-if-js">
    130130<input type="hidden" name="hidden_post_password" id="hidden-post-password" value="<?php echo esc_attr($post->post_password); ?>" />
    131 <?php if ( post_type_supports( $post->post_type, 'sticky' ) ): ?>
     131<?php if ($post_type == 'post'): ?>
    132132<input type="checkbox" style="display:none" name="hidden_post_sticky" id="hidden-post-sticky" value="sticky" <?php checked(is_sticky($post->ID)); ?> />
    133133<?php endif; ?>
     
    136136
    137137<input type="radio" name="visibility" id="visibility-radio-public" value="public" <?php checked( $visibility, 'public' ); ?> /> <label for="visibility-radio-public" class="selectit"><?php _e('Public'); ?></label><br />
    138 <?php if ( post_type_supports( $post->post_type, 'sticky' ) ): ?>
    139 <span id="sticky-span"><input id="sticky" name="sticky" type="checkbox" value="sticky" <?php checked(is_sticky($post->ID)); ?> tabindex="4" /> <label for="sticky" class="selectit"><?php _e('Stick this to the front page') ?></label><br /></span>
     138<?php if ($post_type == 'post'): ?>
     139<span id="sticky-span"><input id="sticky" name="sticky" type="checkbox" value="sticky" <?php checked(is_sticky($post->ID)); ?> tabindex="4" /> <label for="sticky" class="selectit"><?php _e('Stick this post to the front page') ?></label><br /></span>
    140140<?php endif; ?>
    141141<input type="radio" name="visibility" id="visibility-radio-password" value="password" <?php checked( $visibility, 'password' ); ?> /> <label for="visibility-radio-password" class="selectit"><?php _e('Password protected'); ?></label><br />
Note: See TracChangeset for help on using the changeset viewer.