本文整理汇总了PHP中wpcf_admin_add_submenu_page函数的典型用法代码示例。如果您正苦于以下问题:PHP wpcf_admin_add_submenu_page函数的具体用法?PHP wpcf_admin_add_submenu_page怎么用?PHP wpcf_admin_add_submenu_page使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wpcf_admin_add_submenu_page函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: initialize
/**
* Call this only if you are actually showing the page.
*/
public function initialize()
{
$page_hook = wpcf_admin_add_submenu_page(array('menu_title' => $this->get_title(), 'function' => array($this, 'page_handler'), 'capability_filter' => 'wpcf_tfc_view'), wpcf_getget('page'));
// I hate having to do this. Refactor!
require_once WPCF_INC_ABSPATH . '/fields.php';
wpcf_fields_contol_common_resources();
add_action("load-{$page_hook}", array($this, 'add_screen_options'));
}
开发者ID:lytranuit,项目名称:wordpress,代码行数:11,代码来源:termmeta.php
示例2: setup_installer
function setup_installer()
{
if (isset($_GET['page']) && 'installer' == $_GET['page']) {
wpcf_admin_add_submenu_page(array('menu_title' => __('Installer', 'wpcf'), 'menu_slug' => 'installer', 'function' => 'installer_content'));
}
}
开发者ID:VanessaGarcia-Freelance,项目名称:CrowdsLine,代码行数:6,代码来源:wpcf.php
示例3: add_getting_started_to_admin_menu
/**
* add Getting Started to menu
*/
public function add_getting_started_to_admin_menu()
{
$menu = array('page_title' => __('What kind of site are you building?', 'wpcf'), 'menu_title' => __('Getting Started', 'wpcf'), 'menu_slug' => basename(dirname(dirname(__FILE__))) . '/marketing/getting-started/index.php', 'hook' => 'wpcf_marketing', 'load_hook' => 'wpcf_marketing_hook');
wpcf_admin_add_submenu_page($menu);
}
开发者ID:SpencerNeitzke,项目名称:types,代码行数:8,代码来源:class.wpcf-marketing.php
示例4: wpcf_admin_add_submenu_page
function wpcf_admin_add_submenu_page($menu, $menu_slug = null, $menu_parent = 'wpcf')
{
if (!is_admin()) {
return;
}
$menu_slug = array_key_exists('menu_slug', $menu) ? $menu['menu_slug'] : $menu_slug;
$capability = array_key_exists('capability', $menu) ? $menu['capability'] : 'manage_options';
$wpcf_capability = apply_filters('wpcf_capability', $capability, $menu, $menu_slug);
$wpcf_capability = apply_filters('wpcf_capability' . $menu_slug, $capability, $menu, $menu_slug);
/**
* allow change capability by filter
* full list https://goo.gl/OJYTvl
*/
if (isset($menu['capability_filter'])) {
$wpcf_capability = apply_filters($menu['capability_filter'], $wpcf_capability, $menu, $menu_slug);
}
/**
* add submenu
*/
$hook = add_submenu_page($menu_parent, isset($menu['page_title']) ? $menu['page_title'] : $menu['menu_title'], $menu['menu_title'], $wpcf_capability, $menu_slug, array_key_exists('function', $menu) ? $menu['function'] : null);
// For given menu slug, publish the final hook name in case we need it somewhere.
do_action("wpcf_admin_add_submenu_page_{$menu_slug}", $hook);
if (!empty($menu_slug)) {
wpcf_admin_plugin_help($hook, $menu_slug);
}
/**
* add action
*/
if (!array_key_exists('load_hook', $menu) && array_key_exists('function', $menu) && is_string($menu['function'])) {
$menu['load_hook'] = sprintf('%s_hook', $menu['function']);
}
if (!empty($menu['load_hook']) && function_exists($menu['load_hook'])) {
$action = sprintf('load-%s', array_key_exists('hook', $menu) ? $menu['hook'] : $hook);
add_action($action, $menu['load_hook']);
}
/**
* add submenu to submenu
*/
if (array_key_exists('submenu', $menu)) {
foreach ($menu['submenu'] as $submenu_slug => $submenu) {
wpcf_admin_add_submenu_page($submenu, $submenu_slug, $hook);
}
}
return $hook;
}
开发者ID:torch2424,项目名称:Team-No-Comply-Games-Wordpress,代码行数:45,代码来源:admin.php
示例5: wpcf_access_teaser_admin_menu
/**
* Teaser menu hook.
*/
function wpcf_access_teaser_admin_menu()
{
$hook = wpcf_admin_add_submenu_page(array('page_title' => __('Access Control and User Roles', 'wpcf'), 'menu_title' => __('Access Control and User Roles', 'wpcf'), 'menu_slug' => 'wpcf-access', 'function' => 'wpcf_access_teaser_admin_menu_page', 'load_hook' => 'wpcf_access_teaser_admin_menu_load'));
}
开发者ID:santikrass,项目名称:apache,代码行数:7,代码来源:types-access.php
示例6: setup_installer
function setup_installer()
{
wpcf_admin_add_submenu_page(array('page_title' => __('Installer', 'wpcf'), 'menu_title' => __('Installer', 'wpcf'), 'menu_slug' => 'installer', 'function' => 'installer_content'));
}
开发者ID:Kilbourne,项目名称:restart,代码行数:4,代码来源:wpcf.php
示例7: wpcf_admin_add_submenu_page
function wpcf_admin_add_submenu_page($menu, $menu_slug = null, $menu_parent = 'wpcf')
{
if (!is_admin()) {
return;
}
$wpcf_capability = apply_filters('wpcf_capability', 'manage_options');
$menu_slug = array_key_exists('menu_slug', $menu) ? $menu['menu_slug'] : $menu_slug;
/**
* add submenu
*/
$hook = add_submenu_page($menu_parent, isset($menu['page_title']) ? $menu['page_title'] : $menu['menu_title'], $menu['menu_title'], $wpcf_capability, $menu_slug, array_key_exists('function', $menu) ? $menu['function'] : null);
if (!empty($menu_slug)) {
wpcf_admin_plugin_help($hook, $menu_slug);
}
/**
* add action
*/
if (!array_key_exists('load_hook', $menu) && array_key_exists('function', $menu)) {
$menu['load_hook'] = sprintf('%s_hook', $menu['function']);
}
if (!empty($menu['load_hook']) && function_exists($menu['load_hook'])) {
$action = sprintf('load-%s', array_key_exists('hook', $menu) ? $menu['hook'] : $hook);
add_action($action, $menu['load_hook']);
}
/**
* add submenu to submenu
*/
if (array_key_exists('submenu', $menu)) {
foreach ($menu['submenu'] as $submenu_slug => $submenu) {
wpcf_admin_add_submenu_page($submenu, $submenu_slug, $hook);
}
}
return $hook;
}
开发者ID:chrismathers,项目名称:premierplacement,代码行数:34,代码来源:admin.php
示例8: add_getting_started_to_admin_menu
/**
* add Getting Started to menu
*/
public function add_getting_started_to_admin_menu()
{
if (!isset($_REQUEST['page'])) {
return;
}
$slug = basename(dirname(dirname(dirname(__FILE__)))) . '/marketing/getting-started/index.php';
if ($_REQUEST['page'] != $slug) {
return;
}
$menu = array('page_title' => __('What kind of site are you building?', 'wpcf'), 'menu_title' => __('Getting Started', 'wpcf'), 'menu_slug' => $slug, 'hook' => 'wpcf_marketing', 'load_hook' => 'wpcf_marketing_hook');
wpcf_admin_add_submenu_page($menu);
}
开发者ID:torch2424,项目名称:Team-No-Comply-Games-Wordpress,代码行数:15,代码来源:class.wpcf.marketing.php
示例9: wpcf_access_teaser_admin_menu
/**
* Teaser menu hook.
*/
function wpcf_access_teaser_admin_menu()
{
if (isset($_GET['page']) && 'wpcf-access' == $_GET['page']) {
$hook = wpcf_admin_add_submenu_page(array('menu_title' => __('Access', 'wpcf'), 'menu_slug' => 'wpcf-access', 'function' => 'wpcf_access_teaser_admin_menu_page', 'load_hook' => 'wpcf_access_teaser_admin_menu_load'));
}
}
开发者ID:sonvq,项目名称:passioninvestment,代码行数:9,代码来源:types-access.php
注:本文中的wpcf_admin_add_submenu_page函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论