From 7cda2404b5b86249d548b3215c1e5809d2b95541 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Tue, 18 Dec 2018 21:59:00 +0000 Subject: [PATCH] PHP 7.3 Compatibility: Fix compact related notices. In PHP 7.3, the `compact()` function has been changed to issue an `E_NOTICE` level error if a passed string refers to an unset variable. In previous versions of PHP, this notice was silently skipped. This fixes a few more instances of unset variables in the WordPress admin. The full RFC can be viewed here: https://wiki.php.net/rfc/compact. See #44416. Merges [44185] into trunk. Fixes #45483. git-svn-id: https://develop.svn.wordpress.org/trunk@44297 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/plugin-install.php | 1 + src/wp-admin/includes/post.php | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/wp-admin/includes/plugin-install.php b/src/wp-admin/includes/plugin-install.php index 6081bff05c..20aece0153 100644 --- a/src/wp-admin/includes/plugin-install.php +++ b/src/wp-admin/includes/plugin-install.php @@ -427,6 +427,7 @@ function install_plugin_install_status( $api, $loop = false ) { $status = 'install'; $url = false; $update_file = false; + $version = ''; /* * Check to see if this plugin is known to be installed, diff --git a/src/wp-admin/includes/post.php b/src/wp-admin/includes/post.php index a970116e68..0d599ef542 100644 --- a/src/wp-admin/includes/post.php +++ b/src/wp-admin/includes/post.php @@ -1099,18 +1099,24 @@ function wp_edit_posts_query( $q = false ) { } $avail_post_stati = get_available_post_statuses( $post_type ); + $post_status = ''; + $perm = ''; if ( isset( $q['post_status'] ) && in_array( $q['post_status'], $post_stati ) ) { $post_status = $q['post_status']; $perm = 'readable'; } + $orderby = ''; + if ( isset( $q['orderby'] ) ) { $orderby = $q['orderby']; } elseif ( isset( $q['post_status'] ) && in_array( $q['post_status'], array( 'pending', 'draft' ) ) ) { $orderby = 'modified'; } + $order = ''; + if ( isset( $q['order'] ) ) { $order = $q['order']; } elseif ( isset( $q['post_status'] ) && 'pending' == $q['post_status'] ) {