Edit File by line
/home/barbar84/www/wp-conte.../plugins/wordpres.../src/integrat.../third-pa...
File: amp.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace Yoast\WP\SEO\Integrations\Third_Party;
[2] Fix | Delete
[3] Fix | Delete
use Yoast\WP\SEO\Conditionals\Front_End_Conditional;
[4] Fix | Delete
use Yoast\WP\SEO\Integrations\Front_End_Integration;
[5] Fix | Delete
use Yoast\WP\SEO\Integrations\Integration_Interface;
[6] Fix | Delete
[7] Fix | Delete
/**
[8] Fix | Delete
* AMP integration.
[9] Fix | Delete
*/
[10] Fix | Delete
class AMP implements Integration_Interface {
[11] Fix | Delete
[12] Fix | Delete
/**
[13] Fix | Delete
* The front end integration.
[14] Fix | Delete
*
[15] Fix | Delete
* @var Front_End_Integration
[16] Fix | Delete
*/
[17] Fix | Delete
protected $front_end;
[18] Fix | Delete
[19] Fix | Delete
/**
[20] Fix | Delete
* Returns the conditionals based in which this loadable should be active.
[21] Fix | Delete
*
[22] Fix | Delete
* @return array
[23] Fix | Delete
*/
[24] Fix | Delete
public static function get_conditionals() {
[25] Fix | Delete
return [ Front_End_Conditional::class ];
[26] Fix | Delete
}
[27] Fix | Delete
[28] Fix | Delete
/**
[29] Fix | Delete
* Constructs the AMP integration
[30] Fix | Delete
*
[31] Fix | Delete
* @param Front_End_Integration $front_end The front end integration.
[32] Fix | Delete
*/
[33] Fix | Delete
public function __construct( Front_End_Integration $front_end ) {
[34] Fix | Delete
$this->front_end = $front_end;
[35] Fix | Delete
}
[36] Fix | Delete
[37] Fix | Delete
/**
[38] Fix | Delete
* Initializes the integration.
[39] Fix | Delete
*
[40] Fix | Delete
* This is the place to register hooks and filters.
[41] Fix | Delete
*
[42] Fix | Delete
* @return void
[43] Fix | Delete
*/
[44] Fix | Delete
public function register_hooks() {
[45] Fix | Delete
\add_action( 'amp_post_template_head', [ $this, 'remove_amp_meta_output' ], 0 );
[46] Fix | Delete
\add_action( 'amp_post_template_head', [ $this->front_end, 'call_wpseo_head' ], 9 );
[47] Fix | Delete
}
[48] Fix | Delete
[49] Fix | Delete
/**
[50] Fix | Delete
* Removes amp meta output.
[51] Fix | Delete
*
[52] Fix | Delete
* @return void
[53] Fix | Delete
*/
[54] Fix | Delete
public function remove_amp_meta_output() {
[55] Fix | Delete
\remove_action( 'amp_post_template_head', 'amp_post_template_add_title' );
[56] Fix | Delete
\remove_action( 'amp_post_template_head', 'amp_post_template_add_canonical' );
[57] Fix | Delete
\remove_action( 'amp_post_template_head', 'amp_print_schemaorg_metadata' );
[58] Fix | Delete
}
[59] Fix | Delete
}
[60] Fix | Delete
[61] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function