管理栏在哪里实例化?

时间:2018-02-02 作者:Nora McDougall-Collins

有很多关于如何启用、禁用、更改和修复管理栏的资源,但根据一个学生的问题,我们只想了解它是如何创建的。

我们知道:1。轨迹以页脚开始。php->wp\\u footer();2、trail以wp\\u includes/adminbar结尾。php

中间有什么线索?

1 个回复
最合适的回答,由SO网友:mmm 整理而成

以下是WordPress 4.9.2后端主页中adminbar呈现的回溯

array (
  \'file\' => \'wp-admin/index.php\',
  \'line\' => 100,
  \'function\' => \'include\',
)
array (
  \'file\' => \'wp-admin/admin-header.php\',
  \'line\' => 219,
  \'function\' => \'do_action\',
)
array (
  \'file\' => \'wp-includes/plugin.php\',
  \'line\' => 457,
  \'function\' => \'do_action\',
  \'class\' => \'WP_Hook\',
  \'type\' => \'->\',
)
array (
  \'file\' => \'wp-includes/class-wp-hook.php\',
  \'line\' => 310,
  \'function\' => \'apply_filters\',
  \'class\' => \'WP_Hook\',
  \'type\' => \'->\',
)
array (
  \'file\' => \'wp-includes/class-wp-hook.php\',
  \'line\' => 286,
  \'function\' => \'wp_admin_bar_render\',
)
array (
  \'file\' => \'wp-includes/admin-bar.php\',
  \'line\' => 92,
  \'function\' => \'render\',
  \'class\' => \'WP_Admin_Bar\',
  \'type\' => \'->\',
)
array (
  \'file\' => \'wp-includes/class-wp-admin-bar.php\',
  \'line\' => 263,
  \'function\' => \'_render\',
  \'class\' => \'WP_Admin_Bar\',
  \'type\' => \'->\',
)
array (
  \'file\' => \'wp-includes/class-wp-admin-bar.php\',
  \'line\' => 413,
)
这里是主页上的路径

array (
  \'file\' => \'index.php\',
  \'line\' => 17,
  \'function\' => \'require\',
)
array (
  \'file\' => \'wp-blog-header.php\',
  \'line\' => 19,
  \'function\' => \'require_once\',
)
array (
  \'file\' => \'wp-includes/template-loader.php\',
  \'line\' => 74,
  \'function\' => \'include\',
)
array (
  \'file\' => \'wp-content/themes/storefront/page.php\',
  \'line\' => 38,
  \'function\' => \'get_footer\',
)
array (
  \'file\' => \'wp-includes/general-template.php\',
  \'line\' => 76,
  \'function\' => \'locate_template\',
)
array (
  \'file\' => \'wp-includes/template.php\',
  \'line\' => 647,
  \'function\' => \'load_template\',
)
array (
  \'file\' => \'wp-includes/template.php\',
  \'line\' => 688,
  \'function\' => \'require_once\',
)
array (
  \'file\' => \'wp-content/themes/storefront/footer.php\',
  \'line\' => 36,
  \'function\' => \'wp_footer\',
)
array (
  \'file\' => \'wp-includes/general-template.php\',
  \'line\' => 2630,
  \'function\' => \'do_action\',
)
array (
  \'file\' => \'wp-includes/plugin.php\',
  \'line\' => 457,
  \'function\' => \'do_action\',
  \'class\' => \'WP_Hook\',
  \'type\' => \'->\',
)
array (
  \'file\' => \'wp-includes/class-wp-hook.php\',
  \'line\' => 310,
  \'function\' => \'apply_filters\',
  \'class\' => \'WP_Hook\',
  \'type\' => \'->\',
)
array (
  \'file\' => \'wp-includes/class-wp-hook.php\',
  \'line\' => 286,
  \'function\' => \'wp_admin_bar_render\',
)

结束

相关推荐

在函数.php中检查footer.php中是否存在函数

我正在尝试保护来自的版权链接footer.php 文件,我想在footer php中创建一个函数,该函数将包含这些链接,然后我想从函数中进行检查。php如果该函数存在于页脚中,如果它不存在,我想显示一个exit(); 作用我还计划对页脚和函数php代码进行编码。我试过了function_exists() 但只有当我正在检查的函数与函数\\u exists位于同一个文件中时,它才起作用。有人能告诉我怎么解决这个问题吗?给你加油!