From 57578669548b6f56dab8e347815dcd34cbbaf3b5 Mon Sep 17 00:00:00 2001 From: nacin Date: Thu, 7 Oct 2010 09:10:35 +0000 Subject: [PATCH] Sticky post support for post types, first pass. see #12702, props azizur. git-svn-id: http://svn.automattic.com/wordpress/trunk@15742 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/default-list-tables.php | 6 +++--- wp-admin/includes/meta-boxes.php | 8 ++++---- wp-includes/post.php | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/wp-admin/includes/default-list-tables.php b/wp-admin/includes/default-list-tables.php index 6c1fc85f2a..844c108c15 100644 --- a/wp-admin/includes/default-list-tables.php +++ b/wp-admin/includes/default-list-tables.php @@ -920,7 +920,7 @@ class WP_Posts_Table extends WP_List_Table { - post_type && $can_publish && current_user_can( $post_type_object->cap->edit_others_posts ) ) : ?> + post_type, 'sticky' ) && $can_publish && current_user_can( $post_type_object->cap->edit_others_posts ) ) : ?> @@ -937,12 +937,12 @@ class WP_Posts_Table extends WP_List_Table { - + diff --git a/wp-admin/includes/meta-boxes.php b/wp-admin/includes/meta-boxes.php index fa8465d50e..c84ff754cf 100644 --- a/wp-admin/includes/meta-boxes.php +++ b/wp-admin/includes/meta-boxes.php @@ -117,7 +117,7 @@ if ( 'private' == $post->post_status ) { } elseif ( !empty( $post->post_password ) ) { $visibility = 'password'; $visibility_trans = __('Password protected'); -} elseif ( $post_type == 'post' && is_sticky( $post->ID ) ) { +} elseif ( post_type_supports( $post->post_type, 'sticky' ) && is_sticky( $post->ID ) ) { $visibility = 'public'; $visibility_trans = __('Public, Sticky'); } else { @@ -131,15 +131,15 @@ echo esc_html( $visibility_trans ); ?>
- +post_type, 'sticky' ) ): ?> ID)); ?> /> />
- -ID)); ?> tabindex="4" />
+post_type, 'sticky' ) ): ?> +ID)); ?> tabindex="4" />
/>

diff --git a/wp-includes/post.php b/wp-includes/post.php index 599a9ed45e..180962c18e 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -23,7 +23,7 @@ function create_initial_post_types() { 'hierarchical' => false, 'rewrite' => false, 'query_var' => false, - 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions' ), + 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'sticky', 'trackbacks', 'custom-fields', 'comments', 'revisions' ), ) ); register_post_type( 'page', array(