[wordpress插件] Debug Bar Custom Info调试栏自定义信息

wordpress 插件 文章 2020-04-14 01:30 562 0 全屏看文

AI助手支持GPT4.0

评分
100
描述

This plugin adds an extra panel to Debug Bar plugin that allows developers to output custom debug info.

此插件为调试栏插件添加了一个额外的面板,该插件允许开发人员输出自定义调试信息。

>

>

Developers can log any variable to see its value when running PHP in WordPress.

在WordPress中运行PHP时,开发人员可以记录任何变量以查看其值。

This helps developers see the real-time values of variables.

这有助于开发人员查看变量的实时值。

It works exactly like console.log() in browsers.

它与浏览器中的 console.log()完全一样。

How to add custom debug info

如何添加自定义调试信息

Add the following code wherever you want to debug a variable:

在要调试变量的任何地方添加以下代码:

do_action( 'add_debug_info', $var, $label );

  do_action('add_debug_info',$ var,$ label);

where $var can has any data type.

其中 $ var 可以具有任何数据类型。

    • If $var is a string or any simple value, the value is outputted directly.
    • 如果 $ var 是字符串或任何简单值,则该值将直接输出。

    • If $var is an array or object, the output is the same as print_r( $var ).
    • 如果 $ var 是数组或对象,则输出与 print_r($ var)相同。

    And $label is the description label (optional).

    $ label 是描述标签(可选)。

    How to view debug info

    如何查看调试信息

安装步骤

    1. Unzip the download package
    2. 解压缩下载包

    3. Upload debug-bar-custom-info to the /wp-content/plugins/ directory
    4. debug-bar-custom-info 上载到 / wp-content / plugins / 目录

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

下载地址
https://downloads.wordpress.org/plugin/debug-bar-custom-info.1.0.2.zip
-EOF-

AI助手支持GPT4.0