本文整理汇总了PHP中add_users_page函数的典型用法代码示例。如果您正苦于以下问题:PHP add_users_page函数的具体用法?PHP add_users_page怎么用?PHP add_users_page使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了add_users_page函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add_admin_panel
/**
* Adds the admin panel and detects incoming admin actions
*
* When the admin submits an action like "activate" or "resend activation email", it will
* ultimately result in a redirect. In order to minimize the amount of work done in the
* interim page load (after the link is clicked but before the redirect happens), I check
* for these actions (out of $_REQUEST parameters) before the admin panel is even added to the
* Dashboard.
*
* @package Unconfirmed
* @since 1.0
*
* @uses BBG_Unconfirmed::delete_user() to delete registrations
* @uses BBG_Unconfirmed::activate_user() to process manual activations
* @uses BBG_Unconfirmed::resend_email() to process manual activations
* @uses add_users_page() to add the admin panel underneath user.php
*/
function add_admin_panel()
{
$page = add_users_page(__('Unconfirmed', 'unconfirmed'), __('Unconfirmed', 'unconfirmed'), 'create_users', 'unconfirmed', array($this, 'admin_panel_main'));
add_action("admin_print_styles-{$page}", array($this, 'add_admin_styles'));
if (isset($_REQUEST['performed_search']) && $_REQUEST['performed_search'] == '1') {
return;
}
// Look for actions first
if (isset($_REQUEST['unconfirmed_action'])) {
switch ($_REQUEST['unconfirmed_action']) {
case 'delete':
$this->delete_user();
break;
case 'activate':
$this->activate_user();
break;
case 'resend':
default:
$this->resend_email();
break;
}
$this->do_redirect();
}
if (isset($_REQUEST['unconfirmed_complete'])) {
$this->setup_get_users();
}
}
示例2: admin_menu
public function admin_menu()
{
$this->slug = add_users_page($this->title, $this->name, $this->capability, __CLASS__, array($this, 'show_page'));
//help tabs
add_action('load-' . $this->slug, array($this, '_help_tab'));
add_action(__FILE__ . 'add_meta_boxes', array($this, 'add_meta_boxes'));
}
示例3: xprofile_add_admin_menu
/**
* Creates the administration interface menus and checks to see if the DB
* tables are set up.
*
* @package BuddyPress XProfile
* @uses bp_current_user_can() returns true if the current user is a site admin, false if not
* @uses add_users_page() Adds a submenu tab to a top level tab in the admin area
* @return
*/
function xprofile_add_admin_menu()
{
if (!bp_current_user_can('bp_moderate')) {
return false;
}
add_users_page(_x('Profile Fields', 'xProfile admin page title', 'buddypress'), _x('Profile Fields', 'Admin Users menu', 'buddypress'), 'manage_options', 'bp-profile-setup', 'xprofile_admin');
}
示例4: sbscrbr_admin_menu
function sbscrbr_admin_menu()
{
bws_add_general_menu(plugin_basename(__FILE__));
add_submenu_page('bws_plugins', 'Subscriber', 'Subscriber', 'manage_options', 'sbscrbr_settings_page', 'sbscrbr_settings_page');
$hook = add_users_page(__('Subscribers', 'subscriber'), __('Subscribers', 'subscriber'), 'manage_options', 'sbscrbr_users', 'sbscrbr_users_list');
add_action("load-{$hook}", 'sbscrbr_screen_options');
}
示例5: menu
/**
* Register Ad Management Panel menu
*/
public function menu()
{
/* Profile Menu */
// We are using read as an alias for edit_classifieds_listings. If a user can `read`,
// he or she can `edit_classifieds_listings`.
$capability = 'read';
// Account Balance
if (awpcp_payments_api()->credit_system_enabled() && !awpcp_current_user_is_admin()) {
$parts = array($this->account->title, $this->account->menu, $this->account->page);
$hook = add_users_page($parts[0], $parts[1], $capability, $parts[2], array($this->account, 'dispatch'));
add_action("admin_print_styles-{$hook}", array($this->account, 'scripts'));
}
$current_user_is_non_admin_moderator = awpcp_current_user_is_moderator() && !awpcp_current_user_is_admin();
if (get_awpcp_option('enable-user-panel') != 1 || $current_user_is_non_admin_moderator) {
return;
}
/* Ad Management Menu */
$slug = 'awpcp-panel';
$title = sprintf(__('%s Ad Management Panel', 'AWPCP'), get_bloginfo());
$menu = __('Ad Management', 'AWPCP');
$hook = add_menu_page($title, $menu, $capability, $slug, array($this->listings, 'dispatch'), MENUICO);
// Listings
$title = __('Manage Ad Listings', 'AWPCP');
$menu = __('Listings', 'AWPCP');
$hook = add_submenu_page($slug, $title, $menu, $capability, $slug, array($this->listings, 'dispatch'));
add_action("admin_print_styles-{$hook}", array($this->listings, 'scripts'));
do_action('awpcp_panel_add_submenu_page', $slug, $capability);
}
示例6: admin_menu
public function admin_menu()
{
$this->slug = add_users_page($this->title, $this->name, $this->capability, get_class(), array($this, 'show_page'));
//help tabs
add_action('load-' . $this->slug, array($this, '_help_tab'));
add_action(get_class() . 'add_meta_boxes', array($this, 'add_meta_boxes'));
}
示例7: MBlinkdata_admin_actions
function MBlinkdata_admin_actions() {
global $user_ID;
if($user_ID && $user_ID>0){
if(current_user_can('level_10')==1){
add_users_page("Link Data From DB", "Link Data From DB", 1, "Link_Data_From_DB", "MBlinkdata_admin");
}
}
}
示例8: test3_menu
function test3_menu()
{
// get the hook for our admin page and use it to conditionally queue the
// css and js for the page.
// ref: http://wordpress.stackexchange.com/questions/41207/how-do-i-enqueue-styles-scripts-on-certain-wp-admin-pages
$page_hook = add_users_page('Test 3 Menu Page', 'Test 3 Menu', 'edit_posts', 'test3/page_slug_name.php', 'test3_admin_page', 'dashicons-tickets', 6);
add_action('load-' . $page_hook, 'test3_queue_scripts');
}
示例9: json_oauth_admin_register
/**
* Register the admin page
*/
function json_oauth_admin_register()
{
/**
* Include anything we need that relies on admin classes/functions
*/
include_once dirname(__FILE__) . '/lib/class-wp-json-authentication-oauth1-listtable.php';
add_users_page(__('Registered OAuth Applications', 'json_oauth'), _x('Applications', 'menu title', 'json_oauth'), 'list_users', 'json-oauth', 'json_oauth_admin_render');
}
示例10: wp_super_edit_admin_menu_setup
/**
* Set up administration menus
*
* Function used by WordPress action to set up adminstration menus and pages
* @global object $wp_super_edit
*/
function wp_super_edit_admin_menu_setup()
{
global $wp_super_edit;
$wp_super_edit_option_page = add_options_page(__('WP Super Edit', 'wp_super_edit'), __('WP Super Edit', 'wp_super_edit'), 'manage_options', basename(__FILE__), 'wp_super_edit_admin_page');
if ($wp_super_edit->management_mode == 'users') {
$wp_super_edit_user_page = add_users_page(__('Visual Editor Options', 'wp_super_edit'), __('Visual Editor Options', 'wp_super_edit'), 'edit_posts', 'wp-super-edit/wp-super-edit-user.php');
}
}
示例11: user_menu
static function user_menu()
{
// @ admin_menu
if (is_network_admin() && !current_user_can('manage_network_users') || !current_user_can('promote_users')) {
return;
}
add_users_page(__('Manage Access Areas', 'wp-access-areas'), __('Access Areas', 'wp-access-areas'), 'promote_users', 'user_labels', array(__CLASS__, 'manage_userlabels_page'));
add_action('load-users_page_user_labels', array(__CLASS__, 'do_userlabel_actions'));
}
示例12: admin_menu_link
/**
* Add the new menu item to the users portion of the admin menu
*
* @uses admin_menu
*/
function admin_menu_link()
{
$show_admin_page = apply_filters('new_user_approve_show_admin_page', true);
if ($show_admin_page) {
$cap = apply_filters('new_user_approve_minimum_cap', 'edit_users');
$hook = add_users_page(__('Approve New Users', 'new-user-approve'), __('Approve New Users', 'new-user-approve'), $cap, $this->_admin_page, array($this, 'approve_admin'));
add_action('load-' . $hook, array($this, 'admin_enqueue_scripts'));
}
}
示例13: register
/**
* Register the admin page
*/
public static function register()
{
/**
* Include anything we need that relies on admin classes/functions
*/
include_once dirname(__FILE__) . '/class-wp-rest-oauth1-listtable.php';
$hook = add_users_page(__('Registered OAuth Applications', 'rest_oauth1'), _x('Applications', 'menu title', 'rest_oauth1'), 'list_users', self::BASE_SLUG, array(get_class(), 'dispatch'));
add_action('load-' . $hook, array(get_class(), 'load'));
}
示例14: qrl_user_page
function qrl_user_page()
{
$page_title = __('QR - Login', 'qrl');
$menu_title = __('QR - Login', 'qrl');
$capability = 'edit_posts';
$menu_slug = 'qrl_user_login_options';
$function = 'qrl_user_login_render';
add_users_page($page_title, $menu_title, $capability, $menu_slug, $function);
}
示例15: jr_ps_admin_hook
/**
* Add Admin Menu item for plugin
*
* Plugin needs its own Page in the Settings section of the Admin menu.
*
*/
function jr_ps_admin_hook()
{
// Add Settings Page for this Plugin
global $jr_ps_plugin_data;
$settings = get_option('jr_ps_settings');
if ($settings['user_submenu']) {
add_users_page($jr_ps_plugin_data['Name'], 'Private Site', 'add_users', 'jr_ps_settings', 'jr_ps_users_settings_page');
}
add_options_page($jr_ps_plugin_data['Name'], 'Private Site', 'manage_options', 'jr_ps_settings', 'jr_ps_settings_page');
}