Make WordPress Core

Changeset 15742


Ignore:
Timestamp:
10/07/2010 09:10:35 AM (14 years ago)
Author:
nacin
Message:

Sticky post support for post types, first pass. see #12702, props azizur.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/default-list-tables.php

    r15719 r15742  
    921921                </label>
    922922
    923     <?php if ( 'post' == $screen->post_type && $can_publish && current_user_can( $post_type_object->cap->edit_others_posts ) ) : ?>
     923    <?php if ( post_type_supports( $screen->post_type, 'sticky' ) && $can_publish && current_user_can( $post_type_object->cap->edit_others_posts ) ) : ?>
    924924
    925925    <?php   if ( $bulk ) : ?>
     
    938938                <label class="alignleft">
    939939                    <input type="checkbox" name="sticky" value="sticky" />
    940                     <span class="checkbox-title"><?php _e( 'Make this post sticky' ); ?></span>
     940                    <span class="checkbox-title"><?php _e( 'Make this sticky' ); ?></span>
    941941                </label>
    942942
    943943    <?php   endif; // $bulk ?>
    944944
    945     <?php endif; // !$is_page && $can_publish && current_user_can( 'edit_others_cap' ) ?>
     945    <?php endif; // post_type_supports(sticky) && $can_publish && current_user_can( 'edit_others_cap' ) ?>
    946946
    947947            </div>
  • trunk/wp-admin/includes/meta-boxes.php

    r15722 r15742  
    118118    $visibility = 'password';
    119119    $visibility_trans = __('Password protected');
    120 } elseif ( $post_type == 'post' && is_sticky( $post->ID ) ) {
     120} elseif ( post_type_supports( $post->post_type, 'sticky' ) && is_sticky( $post->ID ) ) {
    121121    $visibility = 'public';
    122122    $visibility_trans = __('Public, Sticky');
     
    132132<div id="post-visibility-select" class="hide-if-js">
    133133<input type="hidden" name="hidden_post_password" id="hidden-post-password" value="<?php echo esc_attr($post->post_password); ?>" />
    134 <?php if ($post_type == 'post'): ?>
     134<?php if ( post_type_supports( $post->post_type, 'sticky' ) ): ?>
    135135<input type="checkbox" style="display:none" name="hidden_post_sticky" id="hidden-post-sticky" value="sticky" <?php checked(is_sticky($post->ID)); ?> />
    136136<?php endif; ?>
     
    139139
    140140<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 />
    141 <?php if ($post_type == 'post'): ?>
    142 <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>
     141<?php if ( post_type_supports( $post->post_type, 'sticky' ) ): ?>
     142<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>
    143143<?php endif; ?>
    144144<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 />
  • trunk/wp-includes/post.php

    r15700 r15742  
    2424        'rewrite' => false,
    2525        'query_var' => false,
    26         'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions' ),
     26        'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'sticky', 'trackbacks', 'custom-fields', 'comments', 'revisions' ),
    2727    ) );
    2828
Note: See TracChangeset for help on using the changeset viewer.