Don't check the raw edit_others_posts cap. see #12702.

git-svn-id: http://svn.automattic.com/wordpress/trunk@16004 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2010-10-27 08:48:55 +00:00
parent 51b4b138af
commit a34d2bbe94
2 changed files with 7 additions and 6 deletions

View File

@ -90,6 +90,7 @@ class WP_Media_Table extends WP_List_Table {
function extra_tablenav( $which ) {
global $post_type, $detached;
$post_type_obj = get_post_type_object( $post_type );
?>
<div class="alignleft actions">
<?php
@ -104,7 +105,7 @@ class WP_Media_Table extends WP_List_Table {
if ( $detached ) { ?>
<input type="submit" id="find_detached" name="find_detached" value="<?php esc_attr_e( 'Scan for lost attachments' ); ?>" class="button-secondary" />
<?php } elseif ( $this->is_trash && current_user_can( 'edit_others_posts' ) ) { ?>
<?php } elseif ( $this->is_trash && current_user_can( $post_type_obj->cap->edit_others_posts ) ) { ?>
<input type="submit" id="delete_all" name="delete_all" value="<?php esc_attr_e( 'Empty Trash' ); ?>" class="button-secondary apply" />
<?php } ?>
</div>

View File

@ -205,11 +205,11 @@ function edit_post( $post_data = null ) {
wp_set_post_lock( $post_ID, $GLOBALS['current_user']->ID );
if ( current_user_can( 'edit_others_posts' ) ) {
if ( !empty($post_data['sticky']) )
stick_post($post_ID);
if ( current_user_can( $ptype->cap->edit_others_posts ) ) {
if ( ! empty( $post_data['sticky'] ) )
stick_post( $post_ID );
else
unstick_post($post_ID);
unstick_post( $post_ID );
}
return $post_ID;
@ -336,7 +336,7 @@ function bulk_edit_posts( $post_data = null ) {
$post_data['ID'] = $post_ID;
$updated[] = wp_update_post( $post_data );
if ( isset( $post_data['sticky'] ) && current_user_can( 'edit_others_posts' ) ) {
if ( isset( $post_data['sticky'] ) && current_user_can( $ptype->cap->edit_others_posts ) ) {
if ( 'sticky' == $post_data['sticky'] )
stick_post( $post_ID );
else