From 357fa4131ae364d617e27b8f017234284623e99b Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Fri, 16 Jan 2015 22:50:20 +0000 Subject: [PATCH] Fix some internal types that are passed to functions to avoid changing the acceptable types passed as arguments to those functions: * In `WP_Importer->is_user_over_quota()`, the default value for the first argument for `upload_is_user_over_quota()` is `true`. Don't bother passing `1`. * When calling `submit_button()` with no `$name`, pass empty string instead of `false`. * The default value for the 2nd argument to `get_edit_post_link()` is `'display'`. Because PHP is PHP, passing `true` is the same as passing `'display'` or nothing. Don't bother passing `true`. * In `WP_User_Meta_Session_Tokens::drop_sessions()`, pass `0` instead of `false` to `delete_metadata()` as the value for `$object_id`, which expects an int. See #30799. git-svn-id: https://develop.svn.wordpress.org/trunk@31220 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-wp-importer.php | 2 +- src/wp-admin/includes/class-wp-list-table.php | 4 ++-- src/wp-admin/includes/class-wp-media-list-table.php | 8 ++++---- src/wp-admin/includes/class-wp-posts-list-table.php | 2 +- src/wp-includes/session.php | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/wp-admin/includes/class-wp-importer.php b/src/wp-admin/includes/class-wp-importer.php index 17ffaa3a59..ee10547deb 100644 --- a/src/wp-admin/includes/class-wp-importer.php +++ b/src/wp-admin/includes/class-wp-importer.php @@ -209,7 +209,7 @@ class WP_Importer { */ public function is_user_over_quota() { if ( function_exists( 'upload_is_user_over_quota' ) ) { - if ( upload_is_user_over_quota( 1 ) ) { + if ( upload_is_user_over_quota() ) { echo "Sorry, you have used your upload quota.\n"; return true; } diff --git a/src/wp-admin/includes/class-wp-list-table.php b/src/wp-admin/includes/class-wp-list-table.php index 39a8bce185..1152e64e12 100644 --- a/src/wp-admin/includes/class-wp-list-table.php +++ b/src/wp-admin/includes/class-wp-list-table.php @@ -337,7 +337,7 @@ class WP_List_Table { \n"; - submit_button( __( 'Apply' ), 'action', false, false, array( 'id' => "doaction$two" ) ); + submit_button( __( 'Apply' ), 'action', '', false, array( 'id' => "doaction$two" ) ); echo "\n"; } diff --git a/src/wp-admin/includes/class-wp-media-list-table.php b/src/wp-admin/includes/class-wp-media-list-table.php index 436ed40f35..483421b527 100644 --- a/src/wp-admin/includes/class-wp-media-list-table.php +++ b/src/wp-admin/includes/class-wp-media-list-table.php @@ -315,7 +315,7 @@ foreach ( $columns as $column_name => $column_display_name ) { echo $thumb; } else { ?> - + @@ -332,7 +332,7 @@ foreach ( $columns as $column_name => $column_display_name ) { is_trash || ! $user_can_edit ) { echo $att_title; } else { ?> - $column_display_name ) { if ( $this->detached ) { if ( current_user_can( 'edit_post', $post->ID ) ) - $actions['edit'] = '' . __( 'Edit' ) . ''; + $actions['edit'] = '' . __( 'Edit' ) . ''; if ( current_user_can( 'delete_post', $post->ID ) ) if ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) { $actions['trash'] = "ID ) . "'>" . __( 'Trash' ) . ""; @@ -515,7 +515,7 @@ foreach ( $columns as $column_name => $column_display_name ) { } else { if ( current_user_can( 'edit_post', $post->ID ) && !$this->is_trash ) - $actions['edit'] = '' . __( 'Edit' ) . ''; + $actions['edit'] = '' . __( 'Edit' ) . ''; if ( current_user_can( 'delete_post', $post->ID ) ) { if ( $this->is_trash ) $actions['untrash'] = "ID ) . "'>" . __( 'Restore' ) . ""; diff --git a/src/wp-admin/includes/class-wp-posts-list-table.php b/src/wp-admin/includes/class-wp-posts-list-table.php index 3c035a7fb0..194448660a 100644 --- a/src/wp-admin/includes/class-wp-posts-list-table.php +++ b/src/wp-admin/includes/class-wp-posts-list-table.php @@ -695,7 +695,7 @@ class WP_Posts_List_Table extends WP_List_Table { $actions = array(); if ( $can_edit_post && 'trash' != $post->post_status ) { - $actions['edit'] = '' . __( 'Edit' ) . ''; + $actions['edit'] = '' . __( 'Edit' ) . ''; $actions['inline hide-if-no-js'] = '' . __( 'Quick Edit' ) . ''; } if ( current_user_can( 'delete_post', $post->ID ) ) { diff --git a/src/wp-includes/session.php b/src/wp-includes/session.php index 9b93d41dc5..1d7c5d01a1 100644 --- a/src/wp-includes/session.php +++ b/src/wp-includes/session.php @@ -434,6 +434,6 @@ class WP_User_Meta_Session_Tokens extends WP_Session_Tokens { * @static */ public static function drop_sessions() { - delete_metadata( 'user', false, 'session_tokens', false, true ); + delete_metadata( 'user', 0, 'session_tokens', false, true ); } }