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:
parent
51b4b138af
commit
a34d2bbe94
|
@ -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>
|
||||
|
|
|
@ -205,7 +205,7 @@ function edit_post( $post_data = null ) {
|
|||
|
||||
wp_set_post_lock( $post_ID, $GLOBALS['current_user']->ID );
|
||||
|
||||
if ( current_user_can( 'edit_others_posts' ) ) {
|
||||
if ( current_user_can( $ptype->cap->edit_others_posts ) ) {
|
||||
if ( ! empty( $post_data['sticky'] ) )
|
||||
stick_post( $post_ID );
|
||||
else
|
||||
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue