✏️ 编辑:plugins.php
路径:
/virtual/emerald/public_html/emerald.jpn.com/wp2020/wp-content/themes/cocoon-master/lib/plugins.php
大小:1.37 KB · 修改:2026-06-11 17:11:56 · 权限:0747 · 可写
← 返回目录
👁 查看
⬇ 下载
<?php //プラグイン関連する関数 /** * Cocoon WordPress Theme * @author: yhira * @link: https://wp-cocoon.com/ * @license: http://www.gnu.org/licenses/gpl-2.0.html GPL v2 or later */ if ( !defined( 'ABSPATH' ) ) exit; if ( !function_exists( 'is_jetpack_exist' ) ): function is_jetpack_exist(){ return class_exists('Jetpack'); } endif; //JetpackのAMP計測関数 if ( !function_exists( 'jetpack_amp_build_stats_pixel_url' ) ): function jetpack_amp_build_stats_pixel_url() { if (!is_jetpack_exist()) { return ; } global $wp_the_query; if ( function_exists( 'stats_build_view_data' ) ) { // added in https://github.com/Automattic/jetpack/pull/3445 $data = stats_build_view_data(); } else { $blog = Jetpack_Options::get_option( 'id' ); $tz = get_option( 'gmt_offset' ); $v = 'ext'; $blog_url = wp_parse_url( site_url() ); $srv = $blog_url['host']; $j = sprintf( '%s:%s', JETPACK__API_VERSION, JETPACK__VERSION ); $post = $wp_the_query->get_queried_object_id(); $data = compact( 'v', 'j', 'blog', 'post', 'tz', 'srv' ); } $data['host'] = isset( $_SERVER['HTTP_HOST'] ) ? rawurlencode( $_SERVER['HTTP_HOST'] ) : ''; $data['rand'] = 'RANDOM'; // amp placeholder $data['ref'] = 'DOCUMENT_REFERRER'; // amp placeholder $data = array_map( 'rawurlencode' , $data ); return add_query_arg( $data, 'https://pixel.wp.com/g.gif' ); } endif;
💾 保存
取消
保存为 UTF-8,换行统一为 LF