Make WordPress Core

Ticket #12702: wp_admin_meta-boxes.diff

File wp_admin_meta-boxes.diff, 1.3 KB (added by sphoid, 11 years ago)

Patch to filter what post types can be made sticky

  • wp-admin/includes/meta-boxes.php

     
    134134<?php endif; ?>
    135135<input type="hidden" name="hidden_post_visibility" id="hidden-post-visibility" value="<?php echo esc_attr( $visibility ); ?>" />
    136136<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 />
    137 <?php if ( $post_type == 'post' && current_user_can( 'edit_others_posts' ) ) : ?>
     137<?php if ( in_array( $post_type, (array) apply_filters( 'sticky_post_types', array( 'post' )  ) ) && current_user_can( 'edit_others_posts' ) ) : ?>
    138138<span id="sticky-span"><input id="sticky" name="sticky" type="checkbox" value="sticky" <?php checked( is_sticky( $post->ID ) ); ?> /> <label for="sticky" class="selectit"><?php _e( 'Stick this post to the front page' ); ?></label><br /></span>
    139139<?php endif; ?>
    140140<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 />