diff --git a/src/wp-includes/capabilities.php b/src/wp-includes/capabilities.php index 028e61ec414a8..645ab5588ee5e 100644 --- a/src/wp-includes/capabilities.php +++ b/src/wp-includes/capabilities.php @@ -1163,11 +1163,7 @@ function remove_role( $role ) { function get_super_admins() { global $super_admins; - if ( isset( $super_admins ) ) { - return $super_admins; - } else { - return get_site_option( 'site_admins', array( 'admin' ) ); - } + return $super_admins ?? get_site_option( 'site_admins', array( 'admin' ) ); } /** diff --git a/src/wp-includes/customize/class-wp-customize-selective-refresh.php b/src/wp-includes/customize/class-wp-customize-selective-refresh.php index f51b1e6dc7627..3077d09dcf75e 100644 --- a/src/wp-includes/customize/class-wp-customize-selective-refresh.php +++ b/src/wp-includes/customize/class-wp-customize-selective-refresh.php @@ -120,11 +120,7 @@ public function add_partial( $id, $args = array() ) { * @return WP_Customize_Partial|null The partial, if set. Otherwise null. */ public function get_partial( $id ) { - if ( isset( $this->partials[ $id ] ) ) { - return $this->partials[ $id ]; - } else { - return null; - } + return $this->partials[ $id ] ?? null; } /** diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index 6afe9fad0c7ff..30b5a4aae337e 100644 --- a/src/wp-includes/functions.php +++ b/src/wp-includes/functions.php @@ -1445,11 +1445,7 @@ function get_status_header_desc( $code ) { ); } - if ( isset( $wp_header_to_desc[ $code ] ) ) { - return $wp_header_to_desc[ $code ]; - } else { - return ''; - } + return $wp_header_to_desc[ $code ] ?? ''; } /** diff --git a/src/wp-includes/http.php b/src/wp-includes/http.php index 8280f424934dd..19aec80581a44 100644 --- a/src/wp-includes/http.php +++ b/src/wp-includes/http.php @@ -855,9 +855,5 @@ function _wp_translate_php_url_constant_to_key( $constant ) { PHP_URL_FRAGMENT => 'fragment', ); - if ( isset( $translation[ $constant ] ) ) { - return $translation[ $constant ]; - } else { - return false; - } + return $translation[ $constant ] ?? false; }