我正在尝试删除由AMP插件添加的操作
add_action( \'wp_head\', \'remove_hooks\' );
function remove_hooks(){
remove_action(\'wp_head\', \'amp_frontend_add_canonical\');
}
插件添加如下操作:
add_action( \'wp_head\', \'amp_frontend_add_canonical\' );
function amp_frontend_add_canonical() {
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 ) );
}
但我没有成功——我不确定我是否必须设定优先顺序?