Skip to content

Commit

Permalink
Revert "Merge pull request #725 from Automattic/amedina/add-amp-actio…
Browse files Browse the repository at this point in the history
…ns-class-hierarchy"

This reverts commit c5237e6, reversing
changes made to 41af096.

Fixes merge conflicts introduced by #810 and #828.
  • Loading branch information
westonruter committed Jan 13, 2018
1 parent ed5594b commit 0300898
Show file tree
Hide file tree
Showing 7 changed files with 202 additions and 236 deletions.
7 changes: 4 additions & 3 deletions amp.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,13 @@ function amp_load_classes() {
}

function amp_add_frontend_actions() {
AMP_Frontend_Actions::register_hooks();
require_once AMP__DIR__ . '/includes/amp-frontend-actions.php';
}

function amp_add_post_template_actions() {
AMP_Paired_Post_Actions::register_hooks();
require_once( AMP__DIR__ . '/includes/amp-post-template-functions.php' );
require_once AMP__DIR__ . '/includes/amp-post-template-actions.php';
require_once AMP__DIR__ . '/includes/amp-post-template-functions.php';
amp_post_template_init_hooks();
}

function amp_prepare_render() {
Expand Down
20 changes: 0 additions & 20 deletions includes/actions/class-amp-actions.php

This file was deleted.

32 changes: 0 additions & 32 deletions includes/actions/class-amp-frontend-actions.php

This file was deleted.

178 changes: 0 additions & 178 deletions includes/actions/class-amp-paired-post-actions.php

This file was deleted.

28 changes: 28 additions & 0 deletions includes/amp-frontend-actions.php
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 ) );
}
Loading

0 comments on commit 0300898

Please sign in to comment.