[wordpress插件] DCO Insert Analytics CodeDCO插入分析代码

wordpress 插件 文章 2020-04-13 14:50 471 0 全屏看文

AI助手支持GPT4.0

评分
100
描述

DCO Insert Analytics Code is a WordPress plugin is intended for insert analytics code(or any custom code) before or after or before

DCO插入分析代码是WordPress插件,旨在在之前,之后或 之前插入分析代码(或任何自定义代码)。

Usage

用法

After installation and activation, you can insert the necessary code to the respective fields on the plugin settings page.

安装和激活后,您可以在插件设置页面的相应字段中插入必要的代码。

GitHub

GitHub

Settings

设置

    • Before code
    • 代码之前

    • After code
    • 在代码之后

    • Before code
    • 代码之前

    Filters list

    过滤器列表

    dco_iac_get_options

    dco_iac_get_options

    Filter for hardcoding override plugin settings.

    用于硬编码的过滤器覆盖插件设置。

    You won’t be able to edit them on the settings page anymore when using this filter.

    使用此过滤器时,您将无法在设置页面上对其进行编辑。

    dco_iac_insert_before_head

    dco_iac_insert_before_head

    Filter to change the code is inserted before

    之前插入用于更改代码的过滤器

    dco_iac_insert_before_head_show

    dco_iac_insert_before_head_show

    Filter to change show the code is inserted before

    更改过滤器以显示代码已插入

    dco_iac_insert_after_body

    dco_iac_insert_after_body

    Filter to change the code is inserted after

    之后插入用于更改代码的过滤器

    dco_iac_insert_after_body_show

    dco_iac_insert_after_body_show

    Filter to change show the code is inserted after

    要更改的过滤器,以显示在 之后插入的代码

    dco_iac_insert_before_body

    dco_iac_insert_before_body

    Filter to change the code is inserted before

    用于更改代码的过滤器插入 之前

    dco_iac_insert_before_body_show

    dco_iac_insert_before_body_show

    Filter to change show the code is inserted before

    更改过滤器以显示代码插入在 之前

    dco_iac_disable_do_shortcode

    dco_iac_disable_do_shortcode

    Filter to disable shortcode processing in inserted codes

    过滤器以禁用插入代码中的短代码处理

    Examples of using filters

    使用过滤器的示例

    Hardcoding override plugin settings

    硬编码覆盖插件设置

    /*

      / *

    * $current - current plugin settings

    * $ current-当前插件设置

    *

    *

    * $options - plugin settings from database

    * $ options-数据库中的插件设置

    *

    *

    * $default - default plugin settings

    * $ default-默认插件设置

    */

    * /

    function custom_get_options($current, $options, $default) {    

    函数custom_get_options($ current,$ options,$ default){    

    $array = array(        

    $ array =数组(        

    'before_head' => '',        

    'before_head'=>'<!-在->'之前,        

    'before_head_show' => '0',        

    'before_head_show'=>'0',        

    'after_body' => '',        

    'after_body'=>'<!-->之后',        

    'after_body_show' => '1',        

    'after_body_show'=>'1',        

    'before_body' => '',        

    'before_body'=>'<!-在->'之前,        

    'before_body_show' => '2'    

    'before_body_show'=>'2'    

    );    

    );    

    return $array;

    返回$ array;

    }

    }

    add_filter('dco_iac_get_options', 'custom_get_options', 10, 3);

    add_filter('dco_iac_get_options','custom_get_options',10,3);

    Change before code

    代码之前更改

    /*

      / *

    * $code - value from "before " setting

    * $ code-“ before ”设置中的值

    */

    * /

    function custom_before_head_code( $code ) {    

    函数custom_before_head_code($ code){    

    return $code .

    返回$ code。

    '' .

    '<!-在->'之前。

    "\n";

    “ \ n”;

    }

    }

    add_filter( 'dco_iac_insert_before_head', 'custom_before_head_code' );

    add_filter('dco_iac_insert_before_head','custom_before_head_code');

    Change before code show

    代码显示之前更改

    /*

      / *

    * $value - value from "before show" setting

    * $ value-“显示前显示”设置中的值

    */

    * /

    function custom_before_head_code( $value ) {    

    函数custom_before_head_code($ value){    

    return '2';

    返回'2';

    }

    }

    add_filter( 'dco_iac_insert_before_body_show', 'custom_before_body_show' );

    add_filter('dco_iac_insert_before_body_show','custom_before_body_show');

    Disable shortcode processing in insert codes

    在插入代码中禁用短码处理

    add_filter('dco_iac_disable_do_shortcode', '__return_true');

      add_filter('dco_iac_disable_do_shortcode','__return_true');

安装步骤

    1. Upload dco-insert-analytics-code folder to the /wp-content/plugins/ directory
    2. dco-insert-analytics-code 文件夹上载到 / wp-content / plugins / 目录

    3. Activate the plugin through the ‘Plugins’ menu in WordPress
    4. 通过WordPress中的“插件”菜单激活插件

下载地址
https://downloads.wordpress.org/plugin/dco-insert-analytics-code.1.1.3.zip
-EOF-

AI助手支持GPT4.0