diff --git a/src/wp-admin/includes/class-wp-comments-list-table.php b/src/wp-admin/includes/class-wp-comments-list-table.php index d51c9655e9950..5f1716199bbe6 100644 --- a/src/wp-admin/includes/class-wp-comments-list-table.php +++ b/src/wp-admin/includes/class-wp-comments-list-table.php @@ -105,14 +105,14 @@ public function prepare_items() { $comment_type = $_REQUEST['comment_type']; } - $search = ( isset( $_REQUEST['s'] ) ) ? $_REQUEST['s'] : ''; + $search = $_REQUEST['s'] ?? ''; $post_type = ( isset( $_REQUEST['post_type'] ) ) ? sanitize_key( $_REQUEST['post_type'] ) : ''; - $user_id = ( isset( $_REQUEST['user_id'] ) ) ? $_REQUEST['user_id'] : ''; + $user_id = $_REQUEST['user_id'] ?? ''; - $orderby = ( isset( $_REQUEST['orderby'] ) ) ? $_REQUEST['orderby'] : ''; - $order = ( isset( $_REQUEST['order'] ) ) ? $_REQUEST['order'] : ''; + $orderby = $_REQUEST['orderby'] ?? ''; + $order = $_REQUEST['order'] ?? ''; $comments_per_page = $this->get_per_page( $comment_status ); diff --git a/src/wp-admin/network/edit.php b/src/wp-admin/network/edit.php index f46896bd2b5be..f12251babeeb3 100644 --- a/src/wp-admin/network/edit.php +++ b/src/wp-admin/network/edit.php @@ -10,7 +10,7 @@ /** Load WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; -$action = ( isset( $_GET['action'] ) ) ? $_GET['action'] : ''; +$action = $_GET['action'] ?? ''; if ( empty( $action ) ) { wp_redirect( network_admin_url() ); diff --git a/src/wp-includes/class-wp-xmlrpc-server.php b/src/wp-includes/class-wp-xmlrpc-server.php index ce278a861c285..995ade9508a9a 100644 --- a/src/wp-includes/class-wp-xmlrpc-server.php +++ b/src/wp-includes/class-wp-xmlrpc-server.php @@ -4449,7 +4449,7 @@ public function wp_getMediaLibrary( $args ) { do_action( 'xmlrpc_call', 'wp.getMediaLibrary', $args, $this ); $parent_id = ( isset( $struct['parent_id'] ) ) ? absint( $struct['parent_id'] ) : ''; - $mime_type = ( isset( $struct['mime_type'] ) ) ? $struct['mime_type'] : ''; + $mime_type = $struct['mime_type'] ?? ''; $offset = ( isset( $struct['offset'] ) ) ? absint( $struct['offset'] ) : 0; $number = ( isset( $struct['number'] ) ) ? absint( $struct['number'] ) : -1; diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index 82a95c265edd8..9cdeef75788f2 100644 --- a/src/wp-includes/functions.php +++ b/src/wp-includes/functions.php @@ -3351,7 +3351,7 @@ function wp_get_image_mime( $file ) { $imagesize = @getimagesize( $file ); } - $mime = ( isset( $imagesize['mime'] ) ) ? $imagesize['mime'] : false; + $mime = $imagesize['mime'] ?? false; } else { $mime = false; } diff --git a/src/wp-includes/post-formats.php b/src/wp-includes/post-formats.php index 2c199e6dc052d..9205ecb6e71e2 100644 --- a/src/wp-includes/post-formats.php +++ b/src/wp-includes/post-formats.php @@ -134,7 +134,7 @@ function get_post_format_string( $slug ) { if ( ! $slug ) { return $strings['standard']; } else { - return ( isset( $strings[ $slug ] ) ) ? $strings[ $slug ] : ''; + return $strings[ $slug ] ?? ''; } }