Sticky Posts, firct cut. see #7457

git-svn-id: http://svn.automattic.com/wordpress/trunk@8546 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan
2008-08-05 05:48:21 +00:00
parent 80937742da
commit 7564143444
4 changed files with 121 additions and 1 deletions

View File

@@ -117,7 +117,8 @@ if ( current_user_can('publish_posts') OR ( $post->post_status == 'publish' AND
</p>
<?php if ( current_user_can( 'publish_posts' ) ) : ?>
<p><label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="checkbox" value="private" <?php checked($post->post_status, 'private'); ?> tabindex="4" /> <?php _e('Keep this post private') ?></label></p>
<p><label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="checkbox" value="private" <?php checked($post->post_status, 'private'); ?> tabindex="4" /> <?php _e('Keep this post private') ?></label><br />
<label for="sticky" class="selectit"><input id="sticky" name="sticky" type="checkbox" value="sticky" <?php checked(is_sticky($post->ID), true); ?> tabindex="4" /> <?php _e('Stick this post to the front page') ?></label></p>
<?php endif; ?>
<?php
if ($post_ID) {

View File

@@ -161,6 +161,11 @@ function edit_post() {
wp_set_post_lock( $post_ID, $GLOBALS['current_user']->ID );
if ( !empty($_POST['sticky']) )
stick_post($post_ID);
else
unstick_post($post_ID);
return $post_ID;
}