Skip to content

Commit

Permalink
WIP13 [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
westonruter committed Jun 29, 2018
1 parent 5288ccb commit 3f4ef4c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
18 changes: 2 additions & 16 deletions includes/class-amp-theme-support.php
Original file line number Diff line number Diff line change
Expand Up @@ -374,19 +374,6 @@ public static function get_template_availability( $query = null ) {

$matching_templates = array();
$supportable_templates = self::get_supportable_templates();

/*
* Singular template support is included here though it is not explicitly listed among the templates by default.
* It is the post type support that is used to indicate whether a given singular post template should be served
* via post_supports_amp() including the metabox toggle to enable/disable AMP, and the amp_skip_post filter.
*/
if ( ! isset( $supportable_templates['is_singular'] ) ) {
$supportable_templates['is_singular'] = array(
'callback' => 'is_singular',
'supported' => true,
);
}

foreach ( $supportable_templates as $id => $supportable_template ) {
if ( empty( $supportable_template['callback'] ) ) {
$callback = $id;
Expand Down Expand Up @@ -468,14 +455,13 @@ public static function get_template_availability( $query = null ) {
/**
* Get the templates which can be supported.
*
* @todo The callback could have support for running in an admin context.
* @return array Supportable templates.
*/
public static function get_supportable_templates() {
$templates = array(
'is_singular' => array(
'label' => __( 'Singular', 'amp' ),
// This needs to default to true.
'label' => __( 'Singular', 'amp' ),
'description' => __( 'Required for the above content types.', 'amp' ),
),
);
if ( 'page' === get_option( 'show_on_front' ) ) {
Expand Down
4 changes: 3 additions & 1 deletion includes/options/class-amp-options-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ class AMP_Options_Manager {
'accept_tree_shaking' => false,
'disable_admin_bar' => false,
'all_templates_supported' => true,
'supported_templates' => array(),
'supported_templates' => array(
'is_singular',
),
);

/**
Expand Down

0 comments on commit 3f4ef4c

Please sign in to comment.