Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add amp_story_supports_landscape filter for initial opt-in to landscape support for stories #2468

Merged
merged 1 commit into from
May 29, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions includes/templates/single-amp_story.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,17 @@
?>
<amp-story
standalone
<?php
/**
* Filters whether the story supports landscape.
*
* @param bool $supports_landscape Whether supports landscape. Currently false by default, but this will change in the future (e.g. via user toggle).
* @param wp_Post $post The current amp_story post object.
*/
if ( apply_filters( 'amp_story_supports_landscape', false, get_post() ) ) {
echo 'supports-landscape';
}
?>
publisher-logo-src="<?php echo esc_url( $publisher_logo_src ); ?>"
publisher="<?php echo esc_attr( $publisher ); ?>"
title="<?php the_title_attribute(); ?>"
Expand Down