From 11ea3d1378e50b507fe74316dfeaff1179071a4f Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Sun, 1 Jul 2018 21:48:34 -0700 Subject: [PATCH] Remove unused variable and fix phpcs issue --- amp.php | 9 --------- includes/class-amp-theme-support.php | 6 +----- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/amp.php b/amp.php index acac3f5b7ed..09fa1402bd7 100644 --- a/amp.php +++ b/amp.php @@ -295,15 +295,6 @@ function amp_correct_query_when_is_front_page( WP_Query $query ) { * ), * ) ); * - * Or if you want to prevent AMP from being used on the front page and on any Other template that is unrecognized: - * - * add_theme_support( 'amp', array( - * 'templates_supported' => array( - * 'is_front_page' => false, - * 'unrecognized' => false, - * ), - * ) ); - * * Or if you want to force AMP to be used on all templates: * * add_theme_support( 'amp', array( diff --git a/includes/class-amp-theme-support.php b/includes/class-amp-theme-support.php index 3f06cc24455..f9fdf7ee146 100644 --- a/includes/class-amp-theme-support.php +++ b/includes/class-amp-theme-support.php @@ -458,14 +458,10 @@ public static function get_template_availability( $query = null ) { } $all_templates_supported_by_theme_support = false; - $theme_templates_supported = array(); if ( isset( $theme_support_args['templates_supported'] ) ) { $all_templates_supported_by_theme_support = 'all' === $theme_support_args['templates_supported']; - if ( is_array( $theme_support_args['templates_supported'] ) ) { - $theme_templates_supported = $theme_support_args['templates_supported']; - } } - $all_templates_supported = ( + $all_templates_supported = ( $all_templates_supported_by_theme_support || AMP_Options_Manager::get_option( 'all_templates_supported' ) );