如何在WordPress核心文件代码编辑中放入人类可读的笔记?

时间:2017-06-17 03:47:45

标签: php wordpress

可能引起关注的人:

我是编码的新手,但由于我正在管理一些WordPress网站并不得不不时编辑一些WordPress核心文件,所以我在这里寻求帮助我的问题如同标题。 例如,程序员可以在CSS编辑中执行/ Lorum Ipsum /用于人类可读的备忘录,那么,如何在WordPrsss核心文件编辑中执行此操作?比如function.php?谢谢你的关注。

此致

2 个答案:

答案 0 :(得分:1)

你在开玩笑吧?在每个更新中将覆盖的文件中的注释?我想我自己为什么新手需要在复杂的代码中发表评论。

但是对于你的答案,你可以在代码示例之前使用正斜杠执行php代码:

// $patt = array ( '0'  => 'x', '1'  => '*' );

CSS:

/*----------------------------------*/

HTML:

<!--<tags> </tags>--->

也可以使用ctrl + /进行评论。

答案 1 :(得分:0)

阅读包含function.php文件的顶部可以得到答案:

/**
 * Main WordPress API
 *
 * @package WordPress
 */

require( ABSPATH . WPINC . '/option.php' );

/**
 * Convert given date string into a different format.
 *
 * $format should be either a PHP date format string, e.g. 'U' for a Unix
 * timestamp, or 'G' for a Unix timestamp assuming that $date is GMT.
 *
 * If $translate is true then the given date and format string will
 * be passed to date_i18n() for translation.
 *
 * @since 0.71
 *
 * @param string $format    Format of the date to return.
 * @param string $date      Date string to convert.
 * @param bool   $translate Whether the return date should be translated. Default true.
 * @return string|int|bool Formatted date string or Unix timestamp. False if $date is empty.
 */