Ticket #12702: Enable sticky post checkbox for custom post type.patch
File Enable sticky post checkbox for custom post type.patch, 3.7 KB (added by , 14 years ago) |
---|
-
wp-admin/includes/meta-boxes.php
15 15 $post_type = $post->post_type; 16 16 $post_type_object = get_post_type_object($post_type); 17 17 $can_publish = current_user_can($post_type_object->cap->publish_posts); 18 $post_type_supports_stickies = ( $post_type == 'post' || post_type_supports( $post_type, 'sticky') ); 18 19 ?> 19 20 <div class="submitbox" id="submitpost"> 20 21 … … 116 117 } elseif ( !empty( $post->post_password ) ) { 117 118 $visibility = 'password'; 118 119 $visibility_trans = __('Password protected'); 119 } elseif ( $post_type == 'post'&& is_sticky( $post->ID ) ) {120 } elseif ( $post_type_supports_stickies && is_sticky( $post->ID ) ) { 120 121 $visibility = 'public'; 121 122 $visibility_trans = __('Public, Sticky'); 122 123 } else { … … 130 131 131 132 <div id="post-visibility-select" class="hide-if-js"> 132 133 <input type="hidden" name="hidden_post_password" id="hidden-post-password" value="<?php echo esc_attr($post->post_password); ?>" /> 133 <?php if ( $post_type == 'post'): ?>134 <?php if ( $post_type_supports_stickies ): ?> 134 135 <input type="checkbox" style="display:none" name="hidden_post_sticky" id="hidden-post-sticky" value="sticky" <?php checked(is_sticky($post->ID)); ?> /> 135 136 <?php endif; ?> 136 137 <input type="hidden" name="hidden_post_visibility" id="hidden-post-visibility" value="<?php echo esc_attr( $visibility ); ?>" /> 137 138 138 139 139 140 <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 /> 140 <?php if ( $post_type == 'post'): ?>141 <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 postto the front page') ?></label><br /></span>141 <?php if ( $post_type_supports_stickies ): ?> 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->post_type .' to the front page') ?></label><br /></span> 142 143 <?php endif; ?> 143 144 <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 /> 144 145 <span id="password-span"><label for="post_password"><?php _e('Password:'); ?></label> <input type="text" name="post_password" id="post_password" value="<?php echo esc_attr($post->post_password); ?>" /><br /></span> -
wp-admin/includes/template.php
1111 1111 </select> 1112 1112 </label> 1113 1113 1114 <?php if ( 'post' == $screen->post_type&& $can_publish && current_user_can( $post_type_object->cap->edit_others_posts ) ) : ?>1114 <?php if ( ('post' == $screen->post_type || post_type_supports( $screen->post_type, 'sticky') )&& $can_publish && current_user_can( $post_type_object->cap->edit_others_posts ) ) : ?> 1115 1115 1116 1116 <?php if ( $bulk ) : ?> 1117 1117 … … 1128 1128 1129 1129 <label class="alignleft"> 1130 1130 <input type="checkbox" name="sticky" value="sticky" /> 1131 <span class="checkbox-title"><?php _e( 'Make this poststicky' ); ?></span>1131 <span class="checkbox-title"><?php _e( 'Make this '.$screen->post_type.' sticky' ); ?></span> 1132 1132 </label> 1133 1133 1134 1134 <?php endif; // $bulk ?>