-
Notifications
You must be signed in to change notification settings - Fork 384
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Merge pull request #725 from Automattic/amedina/add-amp-actio…
…ns-class-hierarchy" This reverts commit c5237e6, reversing changes made to 41af096. Fixes merge conflicts introduced by #810 and #828.
- Loading branch information
1 parent
ed5594b
commit 0300898
Showing
7 changed files
with
202 additions
and
236 deletions.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
/** | ||
* Callbacks for adding AMP-related things to the main theme. | ||
* | ||
* @package AMP | ||
*/ | ||
|
||
add_action( 'wp_head', 'amp_frontend_add_canonical' ); | ||
|
||
/** | ||
* Add amphtml link to frontend. | ||
* | ||
* @since 0.2 | ||
*/ | ||
function amp_frontend_add_canonical() { | ||
|
||
/** | ||
* Filters whether to show the amphtml link on the frontend. | ||
* | ||
* @since 0.2 | ||
*/ | ||
if ( false === apply_filters( 'amp_frontend_show_canonical', true ) ) { | ||
return; | ||
} | ||
|
||
$amp_url = amp_get_permalink( get_queried_object_id() ); | ||
printf( '<link rel="amphtml" href="%s">', esc_url( $amp_url ) ); | ||
} |
Oops, something went wrong.