Example #1
0
 /**
  * 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();
     }
 }
 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'));
 }
Example #3
0
/**
 * 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');
}
Example #4
0
 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');
 }
Example #5
0
 /**
  * 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);
 }
 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'));
 }
Example #7
0
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");
        }
    }    
}
Example #8
0
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');
}
Example #9
0
/**
 * 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');
}
/**
* 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');
    }
}
 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'));
 }
 /**
  * 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'));
     }
 }
 /**
  * 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'));
 }
Example #14
0
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);
}
/**
 * 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');
}
Example #16
0
/**
 * Creates the admin submenu pages under the Users menu and assigns their
 * links to global variables
 *
 * @since 1.0.0
 * @global $wpum_settings_page
 * @return void
 */
function wpum_add_options_link()
{
    global $wpum_settings_page;
    $wpum_settings_page = add_users_page(__('WPUM Profile Fields Editor', 'wpum'), __('Profile Fields', 'wpum'), 'manage_options', 'wpum-profile-fields', 'WPUM_Fields_Editor::editor_page');
    $wpum_settings_page = add_users_page(__('WPUM Edit Field', 'wpum'), __('Edit Field', 'wpum'), 'manage_options', 'wpum-edit-field', 'WPUM_Fields_Editor::edit_field_page');
    $wpum_settings_page = add_users_page(__('WP User Manager Settings', 'wpum'), __('WPUM Settings', 'wpum'), 'manage_options', 'wpum-settings', 'wpum_options_page');
    $wpum_settings_page = add_users_page(__('WP User Manager Email Editor', 'wpum'), __('WPUM Email Editor', 'wpum'), 'manage_options', 'wpum-edit-email', 'WPUM_Emails_Editor::get_emails_editor_page');
    $wpum_settings_page = add_users_page(__('WP User Manager Addons', 'wpum'), __('WPUM Addons', 'wpum'), 'manage_options', 'plugin-install.php?tab=wpum_addons');
    add_action('admin_head', 'wpum_hide_admin_pages');
}
function oaf_create_submenu()
{
    add_dashboard_page('OAF Settings', 'OAF Settings', 'manage_options', 'oaf_create_submenu_plugin', 'oaf_create_submenu_function');
    add_posts_page('OAF Settings', 'OAF Settings', 'manage_options', 'oaf_create_submenu_plugin', 'oaf_create_submenu_function');
    add_media_page('OAF Settings', 'OAF Settings', 'manage_options', 'oaf_create_submenu_plugin', 'oaf_create_submenu_function');
    add_pages_page('OAF Settings', 'OAF Settings', 'manage_options', 'oaf_create_submenu_plugin', 'oaf_create_submenu_function');
    add_comments_page('OAF Settings', 'OAF Settings', 'manage_options', 'oaf_create_submenu_plugin', 'oaf_create_submenu_function');
    add_theme_page('OAF Settings', 'OAF Settings', 'manage_options', 'oaf_create_submenu_plugin', 'oaf_create_submenu_function');
    add_users_page('OAF Settings', 'OAF Settings', 'manage_options', 'oaf_create_submenu_plugin', 'oaf_create_submenu_function');
    add_management_page('OAF Settings', 'OAF Settings', 'manage_options', 'oaf_create_submenu_plugin', 'oaf_create_submenu_function');
    add_options_page('OAF Settings', 'OAF Settings', 'manage_options', 'oaf_create_submenu_plugin', 'oaf_create_submenu_function');
}
Example #18
0
 function my_admin_menu()
 {
     //create a main admin panel
     //create a sub admin panel link above
     add_menu_page('Bandi Summary', 'Bandi Summary', 'administrator', 9, array(&$this, 'overview'));
     //These functions adds sub menu for different kinds of admin panel on back end
     add_options_page('Mahesh Options', 'Mahesh  Plugin', 'administrator', basename(__FILE__), array(&$this, 'my_plugin_options'));
     add_posts_page('Mahesh posts', 'Mahesh  Plugin', 'administrator', basename(__FILE__), array(&$this, 'my_plugin_posts'));
     add_media_page('Mahesh media', 'Mahesh  Plugin', 'administrator', basename(__FILE__), array(&$this, 'my_plugin_media'));
     add_pages_page('Mahesh pages', 'Mahesh  Plugin', 'administrator', basename(__FILE__), array(&$this, 'my_plugin_pages'));
     add_users_page('Mahesh users', 'Mahesh  Plugin', 'administrator', basename(__FILE__), array(&$this, 'my_plugin_users'));
     add_management_page('Bandi', 'Mahesh  Plugin', 'administrator', basename(__FILE__), array(&$this, 'my_plugin_tools'));
     add_theme_page('Bandi', 'Mahesh  Plugin', 'administrator', basename(__FILE__), array(&$this, 'my_plugin_themes'));
 }
 public function init()
 {
     add_action('admin_menu', function () {
         add_users_page('Restrict User Registration', 'Restrict Registration', 'manage_options', 'rur', array($this, 'rur_settings'));
     });
     add_action('admin_enqueue_scripts', function () {
         wp_enqueue_script('rur-js', plugin_dir_url(__FILE__) . 'assets/admin.js', array('jquery'), '1.0', true);
         wp_enqueue_style('rur-css', plugin_dir_url(__FILE__) . 'assets/admin.css');
     });
     add_filter("plugin_action_links_" . plugin_basename(__FILE__), function ($links) {
         array_push($links, '<a href="users.php?page=rur">' . __('Settings') . '</a>');
         return $links;
     });
     $this->bail();
 }
Example #20
0
/**
 * Creates the admin submenu pages under the Users menu and assigns their
 * links to global variables
 *
 * @since 1.0.0
 * @global $wpaam_settings_page
 * @return void
 */
function wpaam_add_options_link()
{
    global $wpaam_settings_page;
    $wpaam_settings_page = add_users_page(__('VAT Manager', 'wpaam'), __('VAT Values ', 'wpaam'), 'manage_options', 'wpaam_show_vats', 'wpaam_render_vats');
    $wpaam_settings_page = add_users_page(__('Product Manager', 'wpaam'), __('Products', 'wpaam'), 'manage_options', 'wpaam_show_products', 'wpaam_render_products');
    $wpaam_settings_page = add_users_page(__('Quotation Manager', 'wpaam'), __('Quotations', 'wpaam'), 'manage_options', 'wpaam_show_quotations', 'wpaam_render_quotations');
    $wpaam_settings_page = add_users_page(__('Invoices Manager', 'wpaam'), __('Invoices', 'wpaam'), 'manage_options', 'wpaam_show_invoices', 'wpaam_render_invoices');
    $wpaam_settings_page = add_users_page(__('WPAAM Settings', 'wpaam'), __('WAAM Settings', 'wpaam'), 'manage_options', 'wpaam-settings', 'wpaam_options_page');
    // $wpaam_settings_page = add_menu_page( __('WPAAM USERS', 'wpaam'), __('WPAAM USERS', 'wpaam'), 'manage_options', 'wpaam_home', 'wpaam_options_page');
    // $wpaam_settings_page = add_submenu_page('wpaam', __( 'VAT Manager', 'wpaam' ), __( 'VAT Values ', 'wpaam' ), 'manage_options', 'wpaam_show_vats', 'wpaam_render_vats' );
    // $wpaam_settings_page = add_submenu_page('wpaam' , __( 'Product Manager', 'wpaam' ), __( 'Products', 'wpaam' ), 'manage_options', 'wpaam_show_products', 'wpaam_render_products' );
    // $wpaam_settings_page = add_submenu_page('wpaam' , __( 'Quotation Manager', 'wpaam' ), __( 'Quotations', 'wpaam' ), 'manage_options', 'wpaam_show_quotations', 'wpaam_render_quotations' );
    // $wpaam_settings_page = add_submenu_page('wpaam' , __( 'Invoices Manager', 'wpaam' ), __( 'Invoices', 'wpaam' ), 'manage_options', 'wpaam_show_invoices', 'wpaam_render_invoices' );
    // $wpaam_settings_page = add_submenu_page('wpaam' , __('WPAAM Settings', 'wpaam'), __('WAAM Settings', 'wpaam'), 'manage_options', 'wpaam-settings', 'wpaam_options_page' );
    add_action('admin_head', 'wpaam_hide_admin_pages');
}
Example #21
0
/**
 * Glome user profile page
 */
function glome_profile_page()
{
    $current_user = wp_get_current_user();
    // check Glome API access and display the menu only for
    // Glome enabled accounts
    if (!$current_user->has_prop('glomeid')) {
        return;
    }
    function glome_user_page_content()
    {
        $current_user = wp_get_current_user();
        $pairs = glome_get_brothers();
        include __DIR__ . '/../templates/glome_profile.php';
    }
    add_users_page('Glome', 'Your Glome Profile', 'read', 'glome_profile', 'glome_profile_page_content');
}
Example #22
0
/**
 * Setup admin menus for OpenID options and ID management.
 *
 * @action: admin_menu
 **/
function openid_admin_panels() {
	add_filter('plugin_action_links', 'openid_plugin_action_links', 10, 2);

	// global options page
	$hookname = add_options_page(__('OpenID options', 'openid'), __('OpenID', 'openid'), 8, 'openid', 'openid_options_page' );
	add_action("load-$hookname", create_function('', 'add_thickbox();'));
	add_action("load-$hookname", 'openid_style');
	
	// all users can setup external OpenIDs
	$hookname =	add_users_page(__('Your OpenIDs', 'openid'), __('Your OpenIDs', 'openid'), 'read', 'your_openids', 'openid_profile_panel' );
	add_action("load-$hookname", create_function('', 'wp_enqueue_script("admin-forms");'));
	add_action("load-$hookname", 'openid_profile_management' );
	add_action("load-$hookname", 'openid_style' );

	// additional options for users authorized to use OpenID provider
	$user = wp_get_current_user();
	if ($user->has_cap('use_openid_provider')) {
		add_action('show_user_profile', 'openid_extend_profile', 5);
		add_action('profile_update', 'openid_profile_update');
		add_action('user_profile_update_errors', 'openid_profile_update_errors', 10, 3);
		add_action('load-profile.php', 'openid_style');

		if (!get_usermeta($user->ID, 'openid_delegate')) {
			$hookname =	add_submenu_page('profile.php', __('Your Trusted Sites', 'openid'), 
				__('Your Trusted Sites', 'openid'), 'read', 'openid_trusted_sites', 'openid_manage_trusted_sites' );
			add_action("load-$hookname", 'openid_style' );
			add_action("load-$hookname", create_function('', 'wp_enqueue_script("admin-forms");'));
		}
	}

	if ( function_exists('is_site_admin') ) {
		// add OpenID options to WPMU Site Admin page
		add_action('wpmu_options', 'openid_wpmu_options');
		add_action('update_wpmu_options', 'openid_update_wpmu_options');
	} else {
		// add OpenID options to General Settings page.  For now, the only option on this page is dependent on the
		// 'users_can_register' option, so only add the OpenID Settings if that is set.  If additional OpenID settings
		// are added to the General Settings page, this check may no longer be necessary
		if ( get_option('users_can_register') ) {
			add_settings_field('openid_general_settings', __('OpenID Settings', 'openid'), 'openid_general_settings', 
				'general', 'default');
		}
	}

	// add OpenID options to Discussion Settings page
	add_settings_field('openid_disucssion_settings', __('OpenID Settings', 'openid'), 'openid_discussion_settings', 'discussion', 'default');
}
    /**
     * used by the admin panel hook
     */
    function eshop_admin()
    {
        global $wp_version;
        $page[] = add_menu_page(__('eShop', 'eshop'), __('eShop', 'eshop'), 'eShop', 'eshop-orders.php', 'eshop_admin_orders', plugins_url('/eshop/eshop.png'));
        $page[] = add_submenu_page('eshop-orders.php', __('eShop Orders', 'eshop'), __('Orders', 'eshop'), 'eShop_admin', basename('eshop-orders.php'), 'eshop_admin_orders');
        $page[] = add_submenu_page('eshop-orders.php', __('eShop Shipping', 'eshop'), __('Shipping', 'eshop'), 'eShop_admin', basename('eshop-shipping.php'), 'eshop_admin_shipping');
        $page[] = add_submenu_page('eshop-orders.php', __('eShop Products', 'eshop'), __('Products', 'eshop'), 'eShop', basename('eshop-products.php'), 'eshop_admin_products');
        $page[] = add_submenu_page('eshop-orders.php', __('eShop Options', 'eshop'), __('Option Sets', 'eshop'), 'eShop', basename('eshop-options.php'), 'eshop_admin_options');
        $page[] = add_submenu_page('eshop-orders.php', __('eShop Downloads', 'eshop'), __('Downloads', 'eshop'), 'eShop_admin', basename('eshop-downloads.php'), 'eshop_admin_downloads');
        $page[] = add_submenu_page('eshop-orders.php', __('eShop Discount Codes', 'eshop'), __('Discount Codes', 'eshop'), 'eShop_admin', basename('eshop-discount-codes.php'), 'eshop_discount_codes');
        $page[] = add_submenu_page('eshop-orders.php', __('eShop Base', 'eshop'), __('Base', 'eshop'), 'eShop_admin', basename('eshop-base.php'), 'eshop_admin_base');
        $page[] = add_submenu_page('eshop-orders.php', __('eShop Email Templates', 'eshop'), __('Emails', 'eshop'), 'eShop_admin', basename('eshop-templates.php'), 'eshop_admin_templates');
        $page[] = add_submenu_page('eshop-orders.php', __('eShop About', 'eshop'), __('About &amp; Help', 'eshop'), 'eShop', basename('eshop-about.php'), 'eshop_admin_about');
        if (eshop_wp_version('3')) {
            $page[] = add_users_page(__('eShop Orders', 'eshop'), __('My Orders', 'eshop'), 'read', basename('my-orders.php'), 'eshop_user_orders');
        }
        //only add if you can edit it!
        if (@(!file_exists(get_stylesheet_directory() . '/eshop.css'))) {
            $page[] = add_theme_page(__('eShop Style', 'eshop'), __('eShop', 'eshop'), 'eShop_admin', basename('eshop-style.php'), 'eshop_admin_style');
        }
        $page[] = add_submenu_page('plugins.php', __('eShop Uninstall', 'eshop'), __('eShop Uninstall', 'eshop'), 'eShop_admin', basename('eshop-uninstall.php'), 'eshop_admin_uninstall');
        $help = '
		<p><strong>' . __('eShop Help', 'eshop') . '</strong></p>
		<ul>
		<li>' . __('<a href="http://quirm.net/wiki/eshop/">eShop Wiki</a>', 'eshop') . '</li>
		<li>' . __('<a href="http://wordpress.org/support/plugin/eshop">Wordpress forums</a>', 'eshop') . '</li>
		<li>' . __('<a href="http://quirm.net/forum/forum.php?id=14">Quirm.net</a>', 'eshop') . '</li>
		</ul>';
        foreach ($page as $paged) {
            add_action('admin_print_styles-' . $paged, 'eshop_admin_styles');
            if ($paged != 'users_page_my_orders' && $paged != '') {
                eshop_helptab($paged, $help);
            }
            //add_contextual_help($paged,$help);
        }
        if (is_admin()) {
            include ESHOP_PATH . 'user.php';
        }
    }
/**
 * Glome user profile page
 */
function glome_profile_page()
{
    // check Glome API access and display the menu only for
    // Glome enabled accounts
    $current_user = wp_get_current_user();
    if (!$current_user->has_prop('glomeid')) {
        return;
    }
    if (isset($_POST, $_POST['glome_plugin_settings'])) {
        $checkbox = (int) isset($_POST['glome_plugin_settings']['allow_tracking_me']);
        update_user_meta($current_user->ID, 'allow_tracking_me', $checkbox);
    }
    /* load the JS */
    add_action('admin_enqueue_scripts', 'glome_add_scripts');
    function glome_profile_page_content()
    {
        $current_user = wp_get_current_user();
        $pairs = glome_get_brothers();
        $settings = array('allow_tracking_me' => $current_user->get('allow_tracking_me'));
        include plugin_dir_path(__FILE__) . '../templates/glome_profile.php';
    }
    add_users_page('Glome', 'Your Glome Profile', 'read', 'glome_profile', 'glome_profile_page_content');
}
Example #25
0
/**
 * Setup admin menus for OpenID options and ID management.
 *
 * @action: admin_menu
 **/
function openid_admin_panels()
{
    // global options page
    $hookname = add_options_page(__('OpenID options', 'openid'), __('OpenID', 'openid'), 8, 'global-openid-options', 'openid_options_page');
    add_action("load-{$hookname}", 'openid_js_setup');
    add_action("admin_head-{$hookname}", 'openid_style');
    // all users can setup external OpenIDs
    $hookname = add_users_page(__('Your OpenIDs', 'openid'), __('Your OpenIDs', 'openid'), 'read', 'your_openids', 'openid_profile_panel');
    add_action("admin_head-{$hookname}", 'openid_style');
    add_action("load-{$hookname}", create_function('', 'wp_enqueue_script("admin-forms");'));
    add_action("load-{$hookname}", 'openid_profile_management');
    // additional options for users authorized to use OpenID provider
    $user = wp_get_current_user();
    if ($user->has_cap('use_openid_provider')) {
        add_action('show_user_profile', 'openid_extend_profile', 5);
        add_action('profile_update', 'openid_profile_update');
        add_action('admin_head-profile.php', 'openid_style');
        if (!get_usermeta($user->ID, 'openid_delegate')) {
            $hookname = add_submenu_page('profile.php', __('Your Trusted Sites', 'openid'), __('Your Trusted Sites', 'openid'), 'read', 'openid_trusted_sites', 'openid_manage_trusted_sites');
            add_action("admin_head-{$hookname}", 'openid_style');
            add_action("load-{$hookname}", create_function('', 'wp_enqueue_script("admin-forms");'));
        }
    }
}
 /**
  * Create the All Users / Profile > Edit Profile and All Users Signups submenus.
  *
  * @since 2.0.0
  *
  */
 public function admin_menus()
 {
     // Setup the hooks array.
     $hooks = array();
     // Manage user's profile.
     $hooks['user'] = $this->user_page = add_submenu_page($this->user_profile . '.php', __('Edit Profile', 'buddypress'), __('Edit Profile', 'buddypress'), 'read', 'bp-profile-edit', array($this, 'user_admin'));
     // Only show sign-ups where they belong.
     if (!bp_is_network_activated() && !is_network_admin() || is_network_admin() && bp_is_network_activated()) {
         // Manage signups.
         $hooks['signups'] = $this->signups_page = add_users_page(__('Manage Signups', 'buddypress'), __('Manage Signups', 'buddypress'), $this->capability, 'bp-signups', array($this, 'signups_admin'));
     }
     $edit_page = 'user-edit';
     $profile_page = 'profile';
     $this->users_page = 'users';
     // Self profile check is needed for this pages.
     $page_head = array($edit_page . '.php', $profile_page . '.php', $this->user_page, $this->users_page . '.php');
     // Append '-network' to each array item if in network admin.
     if (is_network_admin()) {
         $edit_page .= '-network';
         $profile_page .= '-network';
         $this->user_page .= '-network';
         $this->users_page .= '-network';
         $this->signups_page .= '-network';
     }
     // Setup the screen ID's.
     $this->screen_id = array($edit_page, $this->user_page, $profile_page);
     // Loop through new hooks and add method actions.
     foreach ($hooks as $key => $hook) {
         add_action("load-{$hook}", array($this, $key . '_admin_load'));
     }
     // Add the profile_admin_head method to proper admin_head actions.
     foreach ($page_head as $head) {
         add_action("admin_head-{$head}", array($this, 'profile_admin_head'));
     }
 }
function manage_students_link()
{
    if (count(getStudents(true)) > 0 || isSoft($_REQUEST, 'submitted', 'true')) {
        add_users_page("Manage CS Circles Students", "Manage Students", "read", "cscircles-students", "cscircles_students_page");
    }
}
 /**
  * Add admin menu page
  *
  * @access public
  * @return void
  * @author Ralf Hortt
  **/
 public function admin_menu()
 {
     add_users_page(_x('Confirm User Registration', 'confirm-user-registration'), _x('Confirm User Registration', 'confirm-user-registration'), 'promote_users', 'confirm-user-registration', array($this, 'management'));
 }
function wpecomgmt()
{
    add_users_page('E-Commerce User Management', 'E-Commerce User Management', 'edit_users', 'wpecomgmt', 'wpecom_user_mgmt');
}
Example #30
0
 public function cme_menu()
 {
     $cap_name = is_super_admin() ? 'manage_capabilities' : 'restore_roles';
     add_management_page(__('Capability Manager', 'capsman-enhanced'), __('Capability Manager', 'capsman-enhanced'), $cap_name, $this->ID . '-tool', array($this, 'backupTool'));
     if (did_action('pp_admin_menu')) {
         // Put Capabilities link on Permissions menu if Press Permit is active and user has access to it
         global $pp_admin;
         $menu_caption = defined('WPLANG') && WPLANG && 'en_EN' != WPLANG ? __('Capabilities', 'capsman-enhanced') : 'Role Capabilities';
         add_submenu_page($pp_admin->get_menu('options'), __('Capability Manager', 'capsman-enhanced'), $menu_caption, 'manage_capabilities', $this->ID, array($this, 'generalManager'));
     } else {
         add_users_page(__('Capability Manager', 'capsman-enhanced'), __('Capabilities', 'capsman-enhanced'), 'manage_capabilities', $this->ID, array($this, 'generalManager'));
     }
 }