Skip to content

Commit

Permalink
Fix phpcs issues
Browse files Browse the repository at this point in the history
  • Loading branch information
delawski committed Sep 22, 2021
1 parent 33450a0 commit d53efcd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
28 changes: 14 additions & 14 deletions src/Admin/OptionsMenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,31 +223,31 @@ public function enqueue_assets( $hook_suffix ) {
$is_reader_theme = $this->reader_themes->theme_data_exists( get_stylesheet() );

$js_data = [
'AMP_QUERY_VAR' => amp_get_slug(),
'CURRENT_THEME' => [
'AMP_QUERY_VAR' => amp_get_slug(),
'CURRENT_THEME' => [
'name' => $theme->get( 'Name' ),
'description' => $theme->get( 'Description' ),
'is_reader_theme' => $is_reader_theme,
'screenshot' => $theme->get_screenshot() ?: null,
'url' => $theme->get( 'ThemeURI' ),
],
'HAS_DEPENDENCY_SUPPORT' => $this->dependency_support->has_support(),
'HOME_URL' => home_url( '/' ),
'OPTIONS_REST_PATH' => '/amp/v1/options',
'READER_THEMES_REST_PATH' => '/amp/v1/reader-themes',
'IS_CORE_THEME' => in_array(
'HAS_DEPENDENCY_SUPPORT' => $this->dependency_support->has_support(),
'HOME_URL' => home_url( '/' ),
'OPTIONS_REST_PATH' => '/amp/v1/options',
'READER_THEMES_REST_PATH' => '/amp/v1/reader-themes',
'IS_CORE_THEME' => in_array(
get_stylesheet(),
AMP_Core_Theme_Sanitizer::get_supported_themes(),
true
),
'LEGACY_THEME_SLUG' => ReaderThemes::DEFAULT_READER_THEME,
'USING_FALLBACK_READER_THEME' => $this->reader_themes->using_fallback_theme(),
'THEME_SUPPORT_ARGS' => AMP_Theme_Support::get_theme_support_args(),
'THEME_SUPPORTS_READER_MODE' => AMP_Theme_Support::supports_reader_mode(),
'UPDATES_NONCE' => wp_create_nonce( 'updates' ),
'USER_FIELD_DEVELOPER_TOOLS_ENABLED' => UserAccess::USER_FIELD_DEVELOPER_TOOLS_ENABLED,
'LEGACY_THEME_SLUG' => ReaderThemes::DEFAULT_READER_THEME,
'USING_FALLBACK_READER_THEME' => $this->reader_themes->using_fallback_theme(),
'THEME_SUPPORT_ARGS' => AMP_Theme_Support::get_theme_support_args(),
'THEME_SUPPORTS_READER_MODE' => AMP_Theme_Support::supports_reader_mode(),
'UPDATES_NONCE' => wp_create_nonce( 'updates' ),
'USER_FIELD_DEVELOPER_TOOLS_ENABLED' => UserAccess::USER_FIELD_DEVELOPER_TOOLS_ENABLED,
'USER_FIELD_REVIEW_PANEL_DISMISSED_FOR_TEMPLATE_MODE' => UserRESTEndpointExtension::USER_FIELD_REVIEW_PANEL_DISMISSED_FOR_TEMPLATE_MODE,
'USERS_RESOURCE_REST_PATH' => '/wp/v2/users',
'USERS_RESOURCE_REST_PATH' => '/wp/v2/users',
];

wp_add_inline_script(
Expand Down
4 changes: 2 additions & 2 deletions src/Admin/UserRESTEndpointExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function register_rest_field() {
* @return string|WP_Error Template mode fir which the panel is dismissed, empty string if the option has not been set, or WP_Error if the current user lacks permission.
*/
public function get_review_panel_dismissed_for_template_mode( $user ) {
if ( $user['id'] !== wp_get_current_user()->ID ) {
if ( wp_get_current_user()->ID !== $user['id'] ) {
return new WP_Error(
'amp_rest_cannot_get_other_user',
__( 'Sorry, the current user is not allowed to get this data about other user.', 'amp' ),
Expand Down Expand Up @@ -90,7 +90,7 @@ public function update_review_panel_dismissed_for_template_mode( $template_mode,
);
}

if ( $user->ID !== wp_get_current_user()->ID ) {
if ( wp_get_current_user()->ID !== $user->ID ) {
return new WP_Error(
'amp_rest_cannot_edit_other_user',
__( 'Sorry, the user is not allowed to make this change for other user.', 'amp' ),
Expand Down

0 comments on commit d53efcd

Please sign in to comment.