php wordpress函数,单引号字符串说明
在我的编辑器中查看文件,它是一个函数,函数中是一个单引号中的字符串 我有这样的wordpress功能:php wordpress函数,单引号字符串说明,php,mysql,wordpress,Php,Mysql,Wordpress,在我的编辑器中查看文件,它是一个函数,函数中是一个单引号中的字符串 我有这样的wordpress功能: <div class="site-info"> <?php do_action( 'focus_credits' ); ?> </div><!-- .site-info --> 当我检查铬合金中的元素时,它是这样的: <div class="site-info">
<div class="site-info">
<?php do_action( 'focus_credits' ); ?>
</div><!-- .site-info -->
当我检查铬合金中的元素时,它是这样的:
<div class="site-info">
Theme By yada yada yada and a link to their website here </div>
yada yada yada的主题和他们网站的链接
我的问题是文字字符串“focus credits”如何返回主题名称和指向其网站的href链接
我在plugin.php中发现了do_action函数
function do_action($tag, $arg = '') {
global $wp_filter, $wp_actions, $merged_filters, $wp_current_filter;
if ( ! isset($wp_actions[$tag]) )
$wp_actions[$tag] = 1;
else
++$wp_actions[$tag];
// Do 'all' actions first
if ( isset($wp_filter['all']) ) {
$wp_current_filter[] = $tag;
$all_args = func_get_args();
_wp_call_all_hook($all_args);
}
if ( !isset($wp_filter[$tag]) ) {
if ( isset($wp_filter['all']) )
array_pop($wp_current_filter);
return;
}
if ( !isset($wp_filter['all']) )
$wp_current_filter[] = $tag;
$args = array();
if ( is_array($arg) && 1 == count($arg) && isset($arg[0]) && is_object($arg[0]) ) // array(&$this)
$args[] =& $arg[0];
else
$args[] = $arg;
for ( $a = 2; $a < func_num_args(); $a++ )
$args[] = func_get_arg($a);
// Sort
if ( !isset( $merged_filters[ $tag ] ) ) {
ksort($wp_filter[$tag]);
$merged_filters[ $tag ] = true;
}
reset( $wp_filter[ $tag ] );
do {
foreach ( (array) current($wp_filter[$tag]) as $the_ )
if ( !is_null($the_['function']) )
call_user_func_array($the_['function'], array_slice($args, 0, (int) $the_['accepted_args']));
} while ( next($wp_filter[$tag]) !== false );
array_pop($wp_current_filter);
}
function do_action($tag,$arg=''){
全局$wp_filter、$wp_actions、$merged_filters、$wp_current_filter;
如果(!isset($wp_actions[$tag]))
$wp_actions[$tag]=1;
其他的
++$wp_actions[$tag];
//先做“所有”动作
如果(isset($wp_filter['all'])){
$wp_当前_过滤器[]=$tag;
$all_args=func_get_args();
_wp_call_all_hook($all_args);
}
如果(!isset($wp_filter[$tag])){
如果(isset($wp_filter['all']))
数组_pop($wp_current_filter);
返回;
}
如果(!isset($wp_filter['all']))
$wp_当前_过滤器[]=$tag;
$args=array();
if(is_数组($arg)&&1==count($arg)&&isset($arg[0])&&is_对象($arg[0])//数组(&$this)
$args[]=&$arg[0];
其他的
$args[]=$arg;
对于($a=2;$a
那么他的“焦点积分”从数据库中调用了一些文本
我翻了一些桌子,但找不到任何相关的东西
如果能帮上忙,去哪里找就好了。提前感谢。执行动作()
在模板中插入动作挂钩。如果您仔细查看主题的文件,可能是functions.php
,您应该会找到一个与此操作挂钩的函数:
add_action( 'focus_credits', 'focus_credits' );
function focus_credits(){
echo 'Theme By yada yada yada and a link to their website here';
}
有关do\u action()
的详细信息:do\u action()
在模板中插入动作挂钩。如果您仔细查看主题的文件,可能是functions.php
,您应该会找到一个与此操作挂钩的函数:
add_action( 'focus_credits', 'focus_credits' );
function focus_credits(){
echo 'Theme By yada yada yada and a link to their website here';
}
有关do\u action()
的详细信息:do\u action()
在模板中插入动作挂钩。如果您仔细查看主题的文件,可能是functions.php
,您应该会找到一个与此操作挂钩的函数:
add_action( 'focus_credits', 'focus_credits' );
function focus_credits(){
echo 'Theme By yada yada yada and a link to their website here';
}
有关do\u action()
的详细信息:do\u action()
在模板中插入动作挂钩。如果您仔细查看主题的文件,可能是functions.php
,您应该会找到一个与此操作挂钩的函数:
add_action( 'focus_credits', 'focus_credits' );
function focus_credits(){
echo 'Theme By yada yada yada and a link to their website here';
}
有关do\u action()
的更多信息: