예제 #1
0
function jetpack_amp_add_og_tags($amp_template)
{
    if (function_exists('jetpack_og_tags')) {
        jetpack_og_tags();
    }
}
예제 #2
0
    $url .= '&' . stats_array_string(array('crypt' => base64_encode(wp_encrypt_plus(ltrim(add_query_arg($stats_extras, ''), '?'), 8, 'url'))));
    return $url;
}
add_action('pre_amp_render', function () {
    add_filter('post_flair_disable', '__return_true', 99);
    remove_filter('the_title', 'widont');
    remove_filter('pre_kses', array('Filter_Embedded_HTML_Objects', 'filter'), 11);
    remove_filter('pre_kses', array('Filter_Embedded_HTML_Objects', 'maybe_create_links'), 100);
});
add_action('post_amp_render', function () {
    add_filter('pre_kses', array('Filter_Embedded_HTML_Objects', 'filter'), 11);
    add_filter('pre_kses', array('Filter_Embedded_HTML_Objects', 'maybe_create_links'), 100);
});
add_action('amp_head', function ($amp_post) {
    if (function_exists('jetpack_og_tags')) {
        jetpack_og_tags();
    }
});
add_filter('amp_post_metadata', function ($metadata, $post) {
    $metadata = wpcom_amp_add_blavatar($metadata, $post);
    return $metadata;
}, 10, 2);
function wpcom_amp_add_blavatar($metadata, $post)
{
    if (!function_exists('blavatar_domain')) {
        return $metadata;
    }
    if (!isset($metadata['publisher'])) {
        return $metadata;
    }
    if (isset($metadata['publisher']['logo'])) {