本文整理汇总了PHP中get_plugin_page_hookname函数的典型用法代码示例。如果您正苦于以下问题:PHP get_plugin_page_hookname函数的具体用法?PHP get_plugin_page_hookname怎么用?PHP get_plugin_page_hookname使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_plugin_page_hookname函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: actionHookIsValid
private function actionHookIsValid($menuSlug, $parentSlug)
{
$menuSlug = plugin_basename($menuSlug);
$parentSlug = plugin_basename($parentSlug);
$hookname = get_plugin_page_hookname($menuSlug, $parentSlug);
return !has_action($hookname);
}
开发者ID:page-carbajal,项目名称:wpexpress,代码行数:7,代码来源:BaseSettingsPage.class.php
示例2: detach
/**
* Revert the result of attach()
*
* @return void
**/
function detach()
{
parent::detach();
$this->drop_unique_page();
$page_hook = get_plugin_page_hookname($this->settings['file'], '');
remove_action('load-' . $page_hook, array($this, '_save'));
}
开发者ID:mkessel007,项目名称:resume-builder,代码行数:12,代码来源:Carbon_Container_ThemeOptions.php
示例3: bp_core_add_admin_menu_page
/**
* In BuddyPress 1.1 - 1.2.x, this function provided a better version of add_menu_page()
* that allowed positioning of menus. Deprecated in 1.5 in favour of a nxt core function.
*
* @deprecated 1.5
* @deprecated Use add_menu_page().
* @since 1.1
*/
function bp_core_add_admin_menu_page($args = '')
{
global $_registered_pages, $admin_page_hooks, $menu;
_deprecated_function(__FUNCTION__, '1.5', 'Use add_menu_page()');
$defaults = array('access_level' => 2, 'file' => false, 'function' => false, 'icon_url' => false, 'menu_title' => '', 'page_title' => '', 'position' => 100);
$r = nxt_parse_args($args, $defaults);
extract($r, EXTR_SKIP);
$file = plugin_basename($file);
$hookname = get_plugin_page_hookname($file, '');
$admin_page_hooks[$file] = sanitize_title($menu_title);
if (!empty($function) && !empty($hookname)) {
add_action($hookname, $function);
}
if (empty($icon_url)) {
$icon_url = 'images/generic.png';
} elseif (is_ssl() && 0 === strpos($icon_url, 'http://')) {
$icon_url = 'https://' . substr($icon_url, 7);
}
do {
$position++;
} while (!empty($menu[$position]));
$menu[$position] = array($menu_title, $access_level, $file, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url);
$_registered_pages[$hookname] = true;
return $hookname;
}
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:33,代码来源:1.5.php
示例4: add_menu_page
function add_menu_page($page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '', $position = null)
{
global $menu, $admin_page_hooks, $_registered_pages, $_parent_pages;
$menu_slug = plugin_basename($menu_slug);
$admin_page_hooks[$menu_slug] = sanitize_title($menu_title);
$hookname = get_plugin_page_hookname($menu_slug, '');
if (!empty($function) && !empty($hookname) && current_user_can($capability)) {
add_action($hookname, $function);
}
if (empty($icon_url)) {
$icon_url = 'dashicons-admin-generic';
$icon_class = 'menu-icon-generic ';
} else {
$icon_url = set_url_scheme($icon_url);
$icon_class = '';
}
$new_menu = array($menu_title, $capability, $menu_slug, $page_title, 'menu-top ' . $icon_class . $hookname, $hookname, $icon_url);
if (null === $position) {
$menu[] = $new_menu;
} else {
$menu = insertInArray($menu, $position, $new_menu);
}
$_registered_pages[$hookname] = true;
// No parent as top level
$_parent_pages[$menu_slug] = false;
return $hookname;
}
开发者ID:oscaru,项目名称:WP-PluginFactory,代码行数:27,代码来源:functions.php
示例5: add_pages
/**
* Adds additional management pages
*/
public static function add_pages()
{
if (!current_user_can('manage_options')) {
return;
}
global $_registered_pages;
/** Template management page */
$hookname = get_plugin_page_hookname('wp_cta_manage_templates', 'edit.php?post_type=wp-call-to-action');
if (!empty($hookname)) {
add_action($hookname, array(__CLASS__, 'display_management_page'));
}
$_registered_pages[$hookname] = true;
/** Template upload page */
$hookname = get_plugin_page_hookname('wp_cta_templates_upload', 'edit.php?post_type=wp-call-to-action');
if (!empty($hookname)) {
add_action($hookname, array(__CLASS__, 'display_upload_page'));
}
$_registered_pages[$hookname] = true;
/** Template search page */
$hookname = get_plugin_page_hookname('wp_cta_store', 'edit.php?post_type=wp-call-to-action');
if (!empty($hookname)) {
add_action($hookname, array(__CLASS__, 'display_store_search'));
}
$_registered_pages[$hookname] = true;
}
开发者ID:jyotiprava,项目名称:45serverbackup,代码行数:28,代码来源:class.templates.manage.php
示例6: admin_menu
/**
* Register plugin menus
*
* @return void
*/
public function admin_menu() {
// sublevel Export menu
$export_page_hook_suffix = get_plugin_page_hookname( 'site-migration-export', 'site-migration-export' );
add_action(
'admin_print_scripts-' . $export_page_hook_suffix,
array( $this, 'register_export_scripts_and_styles' )
);
// sublevel Import menu
$import_page_hook_suffix = get_plugin_page_hookname( 'site-migration-import', 'site-migration-export' );
add_action(
'admin_print_scripts-' . $import_page_hook_suffix,
array( $this, 'register_import_scripts_and_styles' )
);
// sublevel Settings menu
$settings_page_hook_suffix = add_submenu_page(
'site-migration-export',
__( 'Google Drive Settings', AI1WMGE_PLUGIN_NAME ),
__( 'Google Drive Settings', AI1WMGE_PLUGIN_NAME ),
'export',
'site-migration-gdrive-settings',
'Ai1wmge_Settings_Controller::index'
);
add_action(
'admin_print_scripts-' . $settings_page_hook_suffix,
array( $this, 'register_settings_scripts_and_styles' )
);
}
开发者ID:jknowles94,项目名称:Work-examples,代码行数:34,代码来源:class-ai1wmge-main-controller.php
示例7: register_menu
public function register_menu()
{
add_action('admin_init', array(&$this, 'register_options'));
if (isset($this->help)) {
add_contextual_help(get_plugin_page_hookname($this->slug, ''), $this->help);
}
}
开发者ID:billyprice1,项目名称:website,代码行数:7,代码来源:CustomPageBase.php
示例8: add_hidden_pages
function add_hidden_pages()
{
global $_registered_pages;
$menu_slug = 'tf_shortcodes_preview';
$hookname = get_plugin_page_hookname($menu_slug, '');
if (!empty($hookname)) {
add_action($hookname, array($this, 'preview_shortcode'));
}
$_registered_pages[$hookname] = true;
}
开发者ID:shimion,项目名称:stlucks,代码行数:10,代码来源:TF_SHORTCODES.php
示例9: add_non_menu_page
public function add_non_menu_page($slug, $callback)
{
global $_registered_pages;
$hookname = get_plugin_page_hookname($slug, '');
if (!empty($hookname)) {
add_action($hookname, $callback);
}
$_registered_pages[$hookname] = true;
return $hookname;
}
开发者ID:GaryJones,项目名称:TPWP,代码行数:10,代码来源:PeThemeAdmin.php
示例10: addAdminMenu
/**
* action hook for building admin menu
*/
public function addAdminMenu()
{
// register the instructions page, only linked from plugin page
global $_registered_pages;
$hookname = get_plugin_page_hookname(self::MENU_PAGE . '-instructions', '');
if (!empty($hookname)) {
add_action($hookname, array($this, 'instructions'));
$_registered_pages[$hookname] = true;
}
}
开发者ID:kevinreilly,项目名称:ivsn-wp,代码行数:13,代码来源:class.FlxMapAdmin.php
示例11: marketplace_register_admin_page
function marketplace_register_admin_page()
{
global $_registered_pages;
$menu_slug = plugin_basename('setcommision.php');
$hookname = get_plugin_page_hookname($menu_slug, '');
if (!empty($hookname)) {
add_action($hookname, 'commision_setting_layout');
}
$_registered_pages[$hookname] = true;
}
开发者ID:pcuervo,项目名称:mobbily-wordpress,代码行数:10,代码来源:index.php
示例12: add_menu_items
/**
* Add Groups Import settings page
*
* @since 1.0.0
*/
public function add_menu_items()
{
global $_registered_pages;
// Register Import Groups page
if (current_user_can('manage_woocommerce')) {
// Modifies the `$_registered_pages` global directly
$hookname = get_plugin_page_hookname('wc-memberships-import-groups', null);
add_action($hookname, array($this, 'render_import_page'));
$_registered_pages[$hookname] = true;
}
}
开发者ID:eugene-gromky-co,项目名称:mindfulnesssummit,代码行数:16,代码来源:class-wc-memberships-integration-groups.php
示例13: add_menu
public function add_menu()
{
global $Ktai_Style;
add_menu_page(__('Ktai Style Configuration', 'ktai_style'), __('Mobile Output', 'ktai_style'), 'manage_options', self::OPTIONS, array($this, 'misc_page'), $Ktai_Style->get('plugin_url') . KtaiStyle::CONFIG_DIR . '/icon16.png');
add_submenu_page(self::OPTIONS, __('Ktai Style Configuration', 'ktai_style'), __('Behavior', 'ktai_style'), 'manage_options', self::OPTIONS, array($this, 'misc_page'));
add_submenu_page(self::OPTIONS, __('Theme for mobile', 'ktai_style'), __('Theme', 'ktai_style'), 'switch_themes', self::THEME_OPTIONS, array($this, 'theme_page'));
add_action('load-' . get_plugin_page_hookname(self::THEME_OPTIONS, ''), array($this, 'theme_page_header'));
add_action('load-' . get_plugin_page_hookname(self::THEME_OPTIONS, ''), array($this, 'update_common_theme'));
add_submenu_page(self::OPTIONS, __('Mobile Theme Configuration', 'ktai_style'), __('Color & Format', 'ktai_style'), 'manage_options', self::COLOR_OPTIONS, array($this, 'color_page'));
add_submenu_page(self::OPTIONS, __('Delete Configuration', 'ktai_style'), __('Delete Options', 'ktai_style'), 'manage_options', self::DELETE_OPTIONS, array($this, 'delete_page'));
add_action('admin_print_styles', array($this, 'icon_style'));
}
开发者ID:masayukiando,项目名称:wordpress-event-search,代码行数:12,代码来源:panel.php
示例14: mp_core_install_plugin_page
/**
* Create mp core install plugin page
*
* @access public
* @since 1.0.0
* @see get_plugin_page_hookname()
* @see add_action()
* @return void
*/
public function mp_core_install_plugin_page()
{
// This WordPress variable is essential: it stores which admin pages are registered to WordPress
global $_registered_pages;
// Get the name of the hook for this plugin
// We use "options-general.php" as the parent as we want our page to appear under "options-general.php?page=mp_core_install_plugin_page" . $this->plugin_name_slug
$hookname = get_plugin_page_hookname('mp_core_install_plugin_page_' . $this->plugin_name_slug, 'options-general.php');
// Add the callback via the action on $hookname, so the callback function is called when the page "options-general.php?page=mp_core_install_plugin_page" . $this->plugin_name_slug is loaded
if (!empty($hookname)) {
add_action($hookname, array($this, 'mp_core_install_check_callback'));
}
// Add this page to the registered pages
$_registered_pages[$hookname] = true;
}
开发者ID:mintplugins,项目名称:tweetrly-auto-tweets,代码行数:23,代码来源:class-plugin-installer.php
示例15: surveys_add_menu_links
function surveys_add_menu_links()
{
global $wp_version, $_registered_pages;
$view_level = 2;
$page = 'edit.php';
if ($wp_version >= '2.7') {
$page = 'tools.php';
}
add_submenu_page($page, __('Manage Surveys', 'surveys'), __('Manage Surveys', 'surveys'), $view_level, 'surveys/survey.php');
$code_pages = array('export.php', 'export_choose.php', 'individual_responses.php', 'question.php', 'question_form.php', 'responses.php', 'show_individual_response.php', 'survey_action.php', 'survey_form.php');
foreach ($code_pages as $code_page) {
$hookname = get_plugin_page_hookname("surveys/{$code_page}", '');
$_registered_pages[$hookname] = true;
}
}
开发者ID:umairriaz90,项目名称:Daschug1,代码行数:15,代码来源:surveys.php
示例16: add_menu_pages
public function add_menu_pages()
{
global $_registered_pages;
$menu_position = 12;
$menu_position = apply_filters('mvc_menu_position', $menu_position);
$admin_pages = MvcConfiguration::get('AdminPages');
foreach ($this->admin_controller_names as $controller_name) {
if (isset($admin_pages[$controller_name])) {
if (empty($admin_pages[$controller_name]) || !$admin_pages[$controller_name]) {
continue;
}
$pages = $admin_pages[$controller_name];
} else {
$pages = null;
}
$processed_pages = $this->process_admin_pages($controller_name, $pages);
$hide_menu = isset($pages['hide_menu']) ? $pages['hide_menu'] : false;
if (!$hide_menu) {
$controller_titleized = MvcInflector::titleize($controller_name);
$admin_controller_name = 'admin_' . $controller_name;
$top_level_handle = 'mvc_' . $controller_name;
$method = $admin_controller_name . '_index';
$this->dispatcher->{$method} = create_function('', 'MvcDispatcher::dispatch(array("controller" => "' . $admin_controller_name . '", "action" => "index"));');
add_menu_page($controller_titleized, $controller_titleized, 'administrator', $top_level_handle, array($this->dispatcher, $method), null, $menu_position);
foreach ($processed_pages as $key => $admin_page) {
$method = $admin_controller_name . '_' . $admin_page['action'];
if (!method_exists($this->dispatcher, $method)) {
$this->dispatcher->{$method} = create_function('', 'MvcDispatcher::dispatch(array("controller" => "' . $admin_controller_name . '", "action" => "' . $admin_page['action'] . '"));');
}
$page_handle = $top_level_handle . '-' . $key;
$parent_slug = empty($admin_page['parent_slug']) ? $top_level_handle : $admin_page['parent_slug'];
if ($admin_page['in_menu']) {
add_submenu_page($parent_slug, $admin_page['label'] . ' ‹ ' . $controller_titleized, $admin_page['label'], $admin_page['capability'], $page_handle, array($this->dispatcher, $method));
} else {
// It looks like there isn't a more native way of creating an admin page without
// having it show up in the menu, but if there is, it should be implemented here.
// To do: set up capability handling and page title handling for these pages that aren't in the menu
$hookname = get_plugin_page_hookname($page_handle, '');
if (!empty($hookname)) {
add_action($hookname, array($this->dispatcher, $method));
}
$_registered_pages[$hookname] = true;
}
}
$menu_position++;
}
}
}
开发者ID:akilham,项目名称:wp-mvc,代码行数:48,代码来源:mvc_admin_loader.php
示例17: sunshine_admin_menu
function sunshine_admin_menu()
{
global $menu, $sunshine;
$plugin_dir_path = dirname(__FILE__);
add_menu_page('Sunshine', 'Sunshine', 'sunshine_manage_options', 'sunshine_admin', 'sunshine_dashboard_display', plugins_url('assets/images/sunshine-icon.png', $plugin_dir_path));
//add_submenu_page('sunshine', 'Settings', 'Settings', 10, 'sunshine');
add_submenu_page('sunshine_admin', __('Dashboard', 'sunshine'), __('Dashboard', 'sunshine'), 'sunshine_manage_options', 'sunshine_admin', 'sunshine_dashboard_display');
add_submenu_page('sunshine_admin', __('Settings', 'sunshine'), __('Settings', 'sunshine'), 'sunshine_manage_options', 'admin.php?page=sunshine');
$sunshine_admin_submenu = array();
$sunshine_admin_submenu[9] = array(__('Orders', 'sunshine'), __('Orders', 'sunshine'), 'edit_sunshine_order', 'edit.php?post_type=sunshine-order');
$sunshine_admin_submenu[10] = array(__('Galleries', 'sunshine'), __('Galleries', 'sunshine'), 'edit_sunshine_gallery', 'edit.php?post_type=sunshine-gallery');
$sunshine_admin_submenu[20] = array(__('Product Categories', 'sunshine'), __('Product Categories', 'sunshine'), 'edit_sunshine_product', 'edit-tags.php?taxonomy=sunshine-product-category&post_type=sunshine-product');
$sunshine_admin_submenu[30] = array(__('Products', 'sunshine'), __('Products', 'sunshine'), 'edit_sunshine_product', 'edit.php?post_type=sunshine-product');
if (!$sunshine->is_pro()) {
$sunshine_admin_submenu[110] = array(__('Add-Ons or Go Pro!', 'sunshine'), '<span id="sunshine-addons-link">' . __('Add-Ons or Go Pro!', 'sunshine') . '</span>', 'sunshine_manage_options', 'sunshine_addons', 'sunshine_addons');
}
$sunshine_admin_submenu[140] = array(__('Get Help', 'sunshine'), __('Get Help', 'sunshine'), 'sunshine_manage_options', 'sunshine_help', 'sunshine_help');
$sunshine_admin_submenu[150] = array(__('System Info', 'sunshine'), __('System Info', 'sunshine'), 'sunshine_manage_options', 'sunshine_system_info', 'sunshine_system_info');
$sunshine_admin_submenu = apply_filters('sunshine_admin_menu', $sunshine_admin_submenu);
ksort($sunshine_admin_submenu);
foreach ($sunshine_admin_submenu as $item) {
add_submenu_page('sunshine_admin', $item[0], $item[1], $item[2], $item[3], !empty($item[4]) ? $item[4] : '');
}
if (isset($_GET['page']) && $_GET['page'] == 'sunshine_about') {
add_dashboard_page(__('About Sunshine Photo Cart', 'sunshine'), __('About Sunshine Photo Cart', 'sunshine'), 'manage_options', 'sunshine_about', 'sunshine_about');
}
// "Hidden" page for image processor - allows us to make the page but not appear in menu
// This WordPress variable is essential: it stores which admin pages are registered to WordPress
global $_registered_pages;
// Get the name of the hook for this plugin
$hookname_image_processor = get_plugin_page_hookname('sunshine_image_processor', 'admin.php');
$hookname_bulk_add_products = get_plugin_page_hookname('sunshine_bulk_add_products', 'admin.php');
$hookname_invoice_display = get_plugin_page_hookname('sunshine_invoice_display', 'admin.php');
// Add the callback via the action on $hookname, so the callback function is called when the page "options-general.php?page=my-plugin-hidden-page" is loaded
if (!empty($hookname_image_processor)) {
add_action($hookname_image_processor, 'sunshine_image_processor');
}
if (!empty($hookname_bulk_add_products)) {
add_action($hookname_bulk_add_products, 'sunshine_bulk_add_products');
}
if (!empty($hookname_invoice_display)) {
add_action($hookname_invoice_display, 'sunshine_invoice_display');
}
// Add this page to the registered pages
$_registered_pages[$hookname_image_processor] = true;
$_registered_pages[$hookname_bulk_add_products] = true;
$_registered_pages[$hookname_invoice_display] = true;
}
开发者ID:sunshinephotocart,项目名称:sunshine-photo-cart,代码行数:48,代码来源:sunshine-menu.php
示例18: wp_user_profiles_get_section_hooknames
/**
* Get profile section slugs
*
* @since 0.1.7
*/
function wp_user_profiles_get_section_hooknames($section = '')
{
// What slugs are we looking for
$sections = !empty($section) ? array($section) : wp_list_pluck(wp_user_profiles_sections(), 'slug');
// Get file
$hooks = array();
$file = wp_user_profiles_get_file();
// Generate hooknames
foreach ($sections as $slug) {
$hookname = get_plugin_page_hookname($slug, $file);
$hooks[] = $hookname;
}
// Network & user admin corrections
array_walk($hooks, '_wp_user_profiles_walk_section_hooknames');
return $hooks;
}
开发者ID:bradyvercher,项目名称:wp-user-profiles,代码行数:21,代码来源:functions.php
示例19: eventr_add_menu_links
function eventr_add_menu_links()
{
global $wp_version;
$view_level = 2;
$page = 'edit.php';
if ($wp_version >= '2.7') {
$page = 'tools.php';
}
add_submenu_page($page, __('Manage Events', 'eventr'), __('Manage Events', 'eventr'), $view_level, 'eventr/events.php');
global $_registered_pages;
$code_pages = array('attendee_form.php', 'attendees.php', 'event_form.php', 'export.php', 'export_choose.php', 'event_action.php');
foreach ($code_pages as $code_page) {
$hookname = get_plugin_page_hookname("eventr/{$code_page}", '');
$_registered_pages[$hookname] = true;
}
}
开发者ID:htmELS,项目名称:eventr,代码行数:16,代码来源:eventr.php
示例20: create_pages
/**
* Add support for additional pages
*/
public static function create_pages()
{
if (!current_user_can('manage_options')) {
return;
}
global $_registered_pages;
$hookname = get_plugin_page_hookname('lp_templates_upload', 'edit.php?post_type=landing-page');
if (!empty($hookname)) {
add_action($hookname, 'lp_templates_upload');
}
$_registered_pages[$hookname] = true;
$hookname = get_plugin_page_hookname('lp_templates_search', 'edit.php?post_type=landing-page');
/*echo $hookname;exit; */
if (!empty($hookname)) {
add_action($hookname, 'lp_templates_search');
}
$_registered_pages[$hookname] = true;
}
开发者ID:alekseivillegas,项目名称:landing-pages,代码行数:21,代码来源:class.template-management.php
注:本文中的get_plugin_page_hookname函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论