From ba994f6c095ae8310509ef84d0b3e24428d20c38 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Mon, 8 Jun 2020 21:25:46 +0000 Subject: [PATCH] Coding Standards: PHP short ternary operator syntax is not allowed. WPCS 2.2.0 added a sniff for detecting short ternary operator syntax, which is not allowed per the Core handbook. Follow up of [47927]. Fixes #50258. git-svn-id: https://develop.svn.wordpress.org/trunk@47929 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/translation-install.php | 4 ++-- .../rest-api/endpoints/class-wp-rest-themes-controller.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wp-admin/includes/translation-install.php b/src/wp-admin/includes/translation-install.php index 716567c21a..c03f69921d 100644 --- a/src/wp-admin/includes/translation-install.php +++ b/src/wp-admin/includes/translation-install.php @@ -175,7 +175,7 @@ function wp_install_language_form( $languages ) { '' . "\n", esc_attr( $language['language'] ), esc_attr( current( $language['iso'] ) ), - esc_attr( $language['strings']['continue'] ?: 'Continue' ), + esc_attr( $language['strings']['continue'] ? $language['strings']['continue'] : 'Continue' ), in_array( $language['language'], $installed_languages, true ) ? ' data-installed="1"' : '', esc_html( $language['native_name'] ) ); @@ -189,7 +189,7 @@ function wp_install_language_form( $languages ) { '' . "\n", esc_attr( $language['language'] ), esc_attr( current( $language['iso'] ) ), - esc_attr( $language['strings']['continue'] ?: 'Continue' ), + esc_attr( $language['strings']['continue'] ? $language['strings']['continue'] : 'Continue' ), in_array( $language['language'], $installed_languages, true ) ? ' data-installed="1"' : '', esc_html( $language['native_name'] ) ); diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php index dfc11edc08..f5aed07b64 100644 --- a/src/wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php +++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php @@ -144,7 +144,7 @@ class WP_REST_Themes_Controller extends WP_REST_Controller { if ( rest_is_field_included( 'screenshot', $fields ) ) { // Using $theme->get_screenshot() with no args to get absolute URL. - $data['screenshot'] = $theme->get_screenshot() ?: ''; + $data['screenshot'] = $theme->get_screenshot() ? $theme->get_screenshot() : ''; } $rich_field_mappings = array(