-
Notifications
You must be signed in to change notification settings - Fork 383
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
Added meta tag for identifying AMP pages generated by plugin #810
Merged
Merged
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
25508a1
Added meta tag for identifying AMP pages generated by plugin. Issue #807
vaporwavre 5089b23
Add a function that outputs the generated by meta tag at the amp_post…
vaporwavre b2271ff
Fix WPCS error (Squiz.Commenting.FunctionComment.Missing)
vaporwavre f400b66
Fix WPCS error (WordPress.Arrays.MultipleStatementAlignment.DoubleArr…
vaporwavre f6cbcb3
Fix WPCS error FuctionComment.Missing
vaporwavre 045dc35
Fix WPCS error FuctionComment.ParamNameNoMatch
vaporwavre e169bc0
Code formatting
ThierryA File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
class AMP_Paired_Post_Actions extends AMP_Actions { | ||
|
||
public static function register_hooks() { | ||
add_action( 'amp_post_template_head', 'AMP_Paired_Post_Actions::add_generatedby_metadata' ); | ||
add_action( 'amp_post_template_head', 'AMP_Paired_Post_Actions::add_title' ); | ||
add_action( 'amp_post_template_head', 'AMP_Paired_Post_Actions::add_canonical_link' ); | ||
add_action( 'amp_post_template_head', 'AMP_Paired_Post_Actions::add_scripts' ); | ||
|
@@ -104,4 +105,10 @@ public static function add_analytics_data( $amp_template ) { | |
echo AMP_HTML_Utils::build_tag( 'amp-analytics', $amp_analytics_attr, $script_element ); | ||
} | ||
} | ||
|
||
public static function add_generatedby_metadata( $amp_template ) { | ||
?> | ||
<meta name="generator" content="<?php echo esc_attr( $amp_template->get( 'generatedby_metadata' ) );?>" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix WPCS error ( |
||
<?php | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,7 @@ public function __construct( $post_id ) { | |
'canonical_url' => get_permalink( $post_id ), | ||
'home_url' => home_url(), | ||
'blog_name' => get_bloginfo( 'name' ), | ||
'generatedby_metadata' => 'AMP Plugin v' . AMP__VERSION, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix WPCS error ( |
||
|
||
'html_tag_attributes' => array(), | ||
'body_class' => '', | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix WPCS error (
Squiz.Commenting.FunctionComment.Missing
). Here is a draft: