本文整理汇总了PHP中bp_core_do_network_admin函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_core_do_network_admin函数的具体用法?PHP bp_core_do_network_admin怎么用?PHP bp_core_do_network_admin使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bp_core_do_network_admin函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: bp_forums_add_admin_menu
function bp_forums_add_admin_menu()
{
if (!is_super_admin()) {
return false;
}
$page = bp_core_do_network_admin() ? 'settings.php' : 'options-general.php';
// Add the administration tab under the "Site Admin" tab for site administrators.
$hook = add_submenu_page($page, __('Forums', 'buddypress'), __('Forums', 'buddypress'), 'manage_options', 'bb-forums-setup', "bp_forums_bbpress_admin");
// Fudge the highlighted subnav item when on the BuddyPress Forums admin page.
add_action("admin_head-{$hook}", 'bp_core_modify_admin_menu_highlight');
}
开发者ID:mawilliamson,项目名称:wordpress,代码行数:11,代码来源:1.7.php
示例2: test_has_htaccess
public function test_has_htaccess()
{
if (!function_exists('buddydrive_admin')) {
require_once buddydrive()->includes_dir . 'admin/buddydrive-admin.php';
}
// Load the admin
buddydrive_admin();
set_current_screen('plugins' . $this->suffix);
$notice_hook = bp_core_do_network_admin() ? 'network_admin_notices' : 'admin_notices';
do_action($notice_hook);
$this->assertTrue(file_exists(buddydrive()->upload_dir . '/.htaccess'));
}
开发者ID:MrVibe,项目名称:buddydrive,代码行数:12,代码来源:admin.php
示例3: etivite_bp_activity_block_admin_add_action_link
function etivite_bp_activity_block_admin_add_action_link($links, $file)
{
if ('buddypress-block-activity-stream-types/bp-activity-block-loader.php' != $file) {
return $links;
}
if (function_exists('bp_core_do_network_admin')) {
$settings_url = add_query_arg('page', 'bp-activity-block-settings', bp_core_do_network_admin() ? network_admin_url('admin.php') : admin_url('admin.php'));
} else {
$settings_url = add_query_arg('page', 'bp-activity-block-settings', is_multisite() ? network_admin_url('admin.php') : admin_url('admin.php'));
}
$settings_link = '<a href="' . $settings_url . '">' . __('Settings', 'bp-activity-block') . '</a>';
array_unshift($links, $settings_link);
return $links;
}
开发者ID:kosir,项目名称:thatcamp-org,代码行数:14,代码来源:bp-activity-block-loader.php
示例4: invite_anyone_admin_add_action_link
function invite_anyone_admin_add_action_link($links, $file)
{
if ('invite-anyone/invite-anyone.php' != $file) {
return $links;
}
if (function_exists('bp_core_do_network_admin')) {
$settings_url = add_query_arg('page', 'invite-anyone', bp_core_do_network_admin() ? network_admin_url('admin.php') : admin_url('admin.php'));
} else {
$settings_url = add_query_arg('page', 'invite-anyone', is_multisite() ? network_admin_url('admin.php') : admin_url('admin.php'));
}
$settings_link = '<a href="' . $settings_url . '">' . __('Settings', 'invite-anyone') . '</a>';
array_unshift($links, $settings_link);
return $links;
}
开发者ID:socialray,项目名称:surfied-2-0,代码行数:14,代码来源:admin-panel.php
示例5: bp_checkins_needs_activity
function bp_checkins_needs_activity()
{
if (!bp_is_active('activity')) {
$buddy_settings_page = bp_core_do_network_admin() ? 'settings.php' : 'options-general.php';
?>
<div id="message" class="updated">
<p><?php
printf(__('If you want to use BP Checkins, you need to activate the Activity Stream BuddyPress component, to do so, please activate it in <a href="%s">BuddyPress settings</a>', 'bp-checkins'), bp_get_admin_url(add_query_arg(array('page' => 'bp-components'), $buddy_settings_page)));
?>
</p>
</div>
<?php
}
}
开发者ID:socialray,项目名称:surfied-2-0,代码行数:14,代码来源:bp-checkins.php
示例6: setup_admin
/**
* Setup our admin settings page and hooks
*/
public function setup_admin()
{
// Temporary workaround for the fact that WP's settings API doesn't work with MS
if (bp_core_do_network_admin()) {
if (!bp_is_root_blog()) {
return;
}
$parent = 'options-general.php';
} else {
$parent = 'bp-general-settings';
}
$page = add_submenu_page($parent, __('BuddyPress Reply By Email', 'bp-rbe'), __('BP Reply By Email', 'bp-rbe'), 'manage_options', 'bp-rbe', array($this, 'load'));
add_action("admin_head-{$page}", array($this, 'head'));
add_action("admin_footer-{$page}", array($this, 'footer'));
}
开发者ID:r-a-y,项目名称:bp-reply-by-email,代码行数:18,代码来源:bp-rbe-admin.php
示例7: setup_globals
/**
* Admin globals
*
* @since BuddyPress (1.6)
* @access private
*/
private function setup_globals()
{
$bp = buddypress();
// Paths and URLs
$this->admin_dir = trailingslashit($bp->plugin_dir . 'bp-core/admin');
// Admin path
$this->admin_url = trailingslashit($bp->plugin_url . 'bp-core/admin');
// Admin url
$this->images_url = trailingslashit($this->admin_url . 'images');
// Admin images URL
$this->css_url = trailingslashit($this->admin_url . 'css');
// Admin css URL
$this->js_url = trailingslashit($this->admin_url . 'js');
// Admin css URL
// Main settings page
$this->settings_page = bp_core_do_network_admin() ? 'settings.php' : 'options-general.php';
}
开发者ID:pyropictures,项目名称:wordpress-plugins,代码行数:23,代码来源:bp-core-admin.php
示例8: bp_core_admin_settings_save
/**
* Save our settings
*
* @since BuddyPress (1.6)
*/
function bp_core_admin_settings_save()
{
global $wp_settings_fields;
if (isset($_GET['page']) && 'bp-settings' == $_GET['page'] && !empty($_POST['submit'])) {
check_admin_referer('buddypress-options');
// Because many settings are saved with checkboxes, and thus will have no values
// in the $_POST array when unchecked, we loop through the registered settings
if (isset($wp_settings_fields['buddypress'])) {
foreach ((array) $wp_settings_fields['buddypress'] as $section => $settings) {
foreach ($settings as $setting_name => $setting) {
$value = isset($_POST[$setting_name]) ? $_POST[$setting_name] : '';
bp_update_option($setting_name, $value);
}
}
}
// Some legacy options are not registered with the Settings API
$legacy_options = array('bp-disable-account-deletion', 'bp-disable-avatar-uploads', 'bp_disable_blogforum_comments', 'bp-disable-profile-sync', 'bp_restrict_group_creation', 'hide-loggedout-adminbar');
foreach ($legacy_options as $legacy_option) {
// Note: Each of these options is represented by its opposite in the UI
// Ie, the Profile Syncing option reads "Enable Sync", so when it's checked,
// the corresponding option should be unset
$value = isset($_POST[$legacy_option]) ? '' : 1;
bp_update_option($legacy_option, $value);
}
bp_core_redirect(add_query_arg('page', 'bp-settings', bp_core_do_network_admin() ? network_admin_url('admin.php') : admin_url('admin.php')));
}
}
开发者ID:adisonc,项目名称:MaineLearning,代码行数:32,代码来源:bp-core-settings.php
示例9: checked
<label><input type="checkbox" name="group-show-forum"
id="group-show-forum"
value="1"<?php
checked(bp_get_new_group_enable_forum(), true, true);
?>
/> <?php
_e('Enable discussion forum', 'vibe');
?>
</label>
</div>
<?php
} elseif (is_super_admin()) {
?>
<p><?php
printf(__('<strong>Attention Site Admin:</strong> Group forums require the <a href="%s">correct setup and configuration</a> of a bbPress installation.', 'vibe'), bp_core_do_network_admin() ? network_admin_url('settings.php?page=bb-forums-setup') : admin_url('admin.php?page=bb-forums-setup'));
?>
</p>
<?php
}
?>
<?php
}
?>
<?php
do_action('bp_after_group_settings_creation_step');
?>
开发者ID:inetbiz,项目名称:wordpress-lms,代码行数:30,代码来源:create.php
示例10: bp_core_admin_hook
/**
* Return the action name that BuddyPress nav setup callbacks should be hooked to.
*
* Functions used to set up BP Dashboard pages (wrapping such admin-panel
* functions as add_submenu_page()) should use bp_core_admin_hook() for the
* first parameter in add_action(). BuddyPress will then determine
* automatically whether to load the panels in the Network Admin. Ie:
*
* add_action( bp_core_admin_hook(), 'myplugin_dashboard_panel_setup' );
*
* @return string $hook The proper hook ('network_admin_menu' or 'admin_menu').
*/
function bp_core_admin_hook()
{
$hook = bp_core_do_network_admin() ? 'network_admin_menu' : 'admin_menu';
return apply_filters('bp_core_admin_hook', $hook);
}
开发者ID:antares-ff,项目名称:ANTARES-Test,代码行数:17,代码来源:bp-core-functions.php
示例11: bp_checkins_16_new_admin
/**
* BP 1.6beta1 new admin area
*/
function bp_checkins_16_new_admin()
{
if (defined('BP_VERSION') && version_compare(BP_VERSION, '1.6-beta2-6162', '>=')) {
$page = bp_core_do_network_admin() ? 'settings.php' : 'options-general.php';
return $page;
} else {
return 'bp-general-settings.php';
}
}
开发者ID:socialray,项目名称:surfied-2-0,代码行数:12,代码来源:bp-checkins-admin.php
示例12: bp_core_activation_notice
/**
* Verify that some BP prerequisites are set up properly, and notify the admin if not
*
* On every Dashboard page, this function checks the following:
* - that pretty permalinks are enabled
* - that a BP-compatible theme is activated
* - that every BP component that needs a WP page for a directory has one
* - that no WP page has multiple BP components associated with it
* The administrator will be shown a notice for each check that fails.
*
* @package BuddyPress Core
*/
function bp_core_activation_notice()
{
global $wp_rewrite, $wpdb, $bp;
// Only the super admin gets warnings
if (!bp_current_user_can('bp_moderate')) {
return;
}
// On multisite installs, don't load on a non-root blog, unless do_network_admin is
// overridden
if (is_multisite() && bp_core_do_network_admin() && !bp_is_root_blog()) {
return;
}
// Don't show these messages during setup or upgrade
if (!empty($bp->maintenance_mode)) {
return;
}
/**
* Check to make sure that the blog setup routine has run. This can't happen during the
* wizard because of the order which the components are loaded. We check for multisite here
* on the off chance that someone has activated the blogs component and then disabled MS
*/
if (bp_is_active('blogs')) {
$count = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM {$bp->blogs->table_name}"));
if (empty($count)) {
bp_blogs_record_existing_blogs();
}
}
/**
* Are pretty permalinks enabled?
*/
if (isset($_POST['permalink_structure'])) {
return false;
}
if (empty($wp_rewrite->permalink_structure)) {
bp_core_add_admin_notice(sprintf(__('<strong>BuddyPress is almost ready</strong>. You must <a href="%s">update your permalink structure</a> to something other than the default for it to work.', 'buddypress'), admin_url('options-permalink.php')));
}
/**
* Are you using a BP-compatible theme?
*/
// Get current theme info
$ct = wp_get_theme();
// Make sure tags is an array to suppress notices
if (!isset($ct->tags)) {
$ct->tags = array();
} else {
$ct->tags = (array) $ct->tags;
}
// The best way to remove this notice is to add a "buddypress" tag to
// your active theme's CSS header.
if (!defined('BP_SILENCE_THEME_NOTICE') && !in_array('buddypress', $ct->tags)) {
bp_core_add_admin_notice(sprintf(__("You'll need to <a href='%s'>activate a <strong>BuddyPress-compatible theme</strong></a> to take advantage of all of BuddyPress's features. We've bundled a default theme, but you can always <a href='%s'>install some other compatible themes</a> or <a href='%s'>update your existing WordPress theme</a>.", 'buddypress'), admin_url('themes.php'), network_admin_url('theme-install.php?type=tag&s=buddypress&tab=search'), network_admin_url('plugin-install.php?type=term&tab=search&s=%22bp-template-pack%22')));
}
/**
* Check for orphaned BP components (BP component is enabled, no WP page exists)
*/
$orphaned_components = array();
$wp_page_components = array();
// Only components with 'has_directory' require a WP page to function
foreach ($bp->loaded_components as $component_id => $is_active) {
if (!empty($bp->{$component_id}->has_directory)) {
$wp_page_components[] = array('id' => $component_id, 'name' => isset($bp->{$component_id}->name) ? $bp->{$component_id}->name : ucwords($bp->{$component_id}->id));
}
}
// Activate and Register are special cases. They are not components but they need WP pages.
// If user registration is disabled, we can skip this step.
if (bp_get_signup_allowed()) {
$wp_page_components[] = array('id' => 'activate', 'name' => __('Activate', 'buddypress'));
$wp_page_components[] = array('id' => 'register', 'name' => __('Register', 'buddypress'));
}
foreach ($wp_page_components as $component) {
if (!isset($bp->pages->{$component['id']})) {
$orphaned_components[] = $component['name'];
}
}
// Special case: If the Forums component is orphaned, but the bbPress 1.x installation is
// not correctly set up, don't show a nag. (In these cases, it's probably the case that the
// user is using bbPress 2.x; see https://buddypress.trac.wordpress.org/ticket/4292
if (isset($bp->forums->name) && in_array($bp->forums->name, $orphaned_components) && !bp_forums_is_installed_correctly()) {
$forum_key = array_search($bp->forums->name, $orphaned_components);
unset($orphaned_components[$forum_key]);
$orphaned_components = array_values($orphaned_components);
}
if (!empty($orphaned_components)) {
$admin_url = bp_get_admin_url(add_query_arg(array('page' => 'bp-page-settings'), 'admin.php'));
$notice = sprintf(__('The following active BuddyPress Components do not have associated WordPress Pages: %2$s. <a href="%1$s" class="button-secondary">Repair</a>', 'buddypress'), $admin_url, '<strong>' . implode('</strong>, <strong>', $orphaned_components) . '</strong>');
bp_core_add_admin_notice($notice);
}
/**
//.........这里部分代码省略.........
开发者ID:vsalx,项目名称:rattieinfo,代码行数:101,代码来源:bp-core-functions.php
示例13: bp_get_admin_url
/**
* Return the correct URL based on BuddyPress and NXTClass configuration
*
* @package BuddyPress
* @since 1.5
*
* @param string $path
* @param string $scheme
*
* @uses bp_core_do_network_admin()
* @uses network_admin_url()
* @uses admin_url()
*/
function bp_get_admin_url($path = '', $scheme = 'admin')
{
// Links belong in network admin
if (bp_core_do_network_admin()) {
$url = network_admin_url($path, $scheme);
} else {
$url = admin_url($path, $scheme);
}
return $url;
}
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:23,代码来源:bp-core-functions.php
示例14: admin_head
/**
* Hide submenu
*
* @package Rendez Vous
* @subpackage Admin
*
* @since Rendez Vous (1.2.0)
*/
public function admin_head()
{
$page = bp_core_do_network_admin() ? 'settings.php' : 'options-general.php';
remove_submenu_page($page, 'rendez-vous');
}
开发者ID:socialray,项目名称:surfied-2-0,代码行数:13,代码来源:rendez-vous-admin.php
示例15: buddydrive_admin_settings
/**
* Displays the settings page
*
* @uses is_multisite() to check for multisite
* @uses add_query_arg() to add arguments to query in case of multisite
* @uses bp_get_admin_url to build the settings url in case of multisite
* @uses screen_icon() to show BuddyDrive icon
* @uses settings_fields()
* @uses do_settings_sections()
* @uses wp_nonce_field() for security reason in case of multisite
*/
function buddydrive_admin_settings()
{
$form_action = 'options.php';
if (bp_core_do_network_admin()) {
do_action('buddydrive_multisite_options');
$form_action = add_query_arg('page', 'buddydrive', bp_get_admin_url('settings.php'));
}
?>
<div class="wrap">
<?php
screen_icon('buddydrive');
?>
<h2><?php
_e('BuddyDrive Settings', 'buddydrive');
?>
</h2>
<form action="<?php
echo esc_url($form_action);
?>
" method="post">
<?php
settings_fields('buddydrive');
?>
<?php
do_settings_sections('buddydrive');
?>
<p class="submit">
<?php
if (bp_core_do_network_admin()) {
?>
<?php
wp_nonce_field('buddydrive_settings', '_wpnonce_buddydrive_setting');
?>
<?php
}
?>
<input type="submit" name="submit" class="button-primary" value="<?php
esc_attr_e('Save Changes', 'buddydrive');
?>
" />
</p>
</form>
</div>
<?php
}
开发者ID:MrVibe,项目名称:buddydrive,代码行数:64,代码来源:buddydrive-settings.php
示例16: step_finish_save
function step_finish_save()
{
if (isset($_POST['submit'])) {
check_admin_referer('bpwizard_finish');
// Update the DB version in the database
bp_version_bump();
// Delete the setup cookie
@setcookie('bp-wizard-step', '', time() - 3600, COOKIEPATH);
// Redirect to the BuddyPress dashboard
$redirect = bp_core_do_network_admin() ? network_admin_url('settings.php') : admin_url('options-general.php');
$redirect = add_query_arg(array('page' => 'bp-components'), $redirect);
wp_safe_redirect($redirect);
// That's all!
exit;
}
return false;
}
开发者ID:adisonc,项目名称:MaineLearning,代码行数:17,代码来源:bp-core-update.php
示例17: admin_menus
/**
* Register site- or network-admin nav menu elements.
*
* Contextually hooked to site or network-admin depending on current configuration.
*
* @since 1.6.0
*
* @uses add_management_page() To add the Recount page in Tools section.
* @uses add_options_page() To add the Forums settings page in Settings
* section.
*/
public function admin_menus()
{
// Bail if user cannot moderate.
if (!bp_current_user_can('manage_options')) {
return;
}
// About.
add_dashboard_page(__('Welcome to BuddyPress', 'buddypress'), __('Welcome to BuddyPress', 'buddypress'), 'manage_options', 'bp-about', array($this, 'about_screen'));
// Credits.
add_dashboard_page(__('Welcome to BuddyPress', 'buddypress'), __('Welcome to BuddyPress', 'buddypress'), 'manage_options', 'bp-credits', array($this, 'credits_screen'));
$hooks = array();
// Changed in BP 1.6 . See bp_core_admin_backpat_menu().
$hooks[] = add_menu_page(__('BuddyPress', 'buddypress'), __('BuddyPress', 'buddypress'), $this->capability, 'bp-general-settings', 'bp_core_admin_backpat_menu', 'div');
$hooks[] = add_submenu_page('bp-general-settings', __('BuddyPress Help', 'buddypress'), __('Help', 'buddypress'), $this->capability, 'bp-general-settings', 'bp_core_admin_backpat_page');
// Add the option pages.
$hooks[] = add_submenu_page($this->settings_page, __('BuddyPress Components', 'buddypress'), __('BuddyPress', 'buddypress'), $this->capability, 'bp-components', 'bp_core_admin_components_settings');
$hooks[] = add_submenu_page($this->settings_page, __('BuddyPress Pages', 'buddypress'), __('BuddyPress Pages', 'buddypress'), $this->capability, 'bp-page-settings', 'bp_core_admin_slugs_settings');
$hooks[] = add_submenu_page($this->settings_page, __('BuddyPress Options', 'buddypress'), __('BuddyPress Options', 'buddypress'), $this->capability, 'bp-settings', 'bp_core_admin_settings');
// For consistency with non-Multisite, we add a Tools menu in
// the Network Admin as a home for our Tools panel.
if (is_multisite() && bp_core_do_network_admin()) {
$tools_parent = 'network-tools';
$hooks[] = add_menu_page(__('Tools', 'buddypress'), __('Tools', 'buddypress'), $this->capability, $tools_parent, 'bp_core_tools_top_level_item', '', 24);
$hooks[] = add_submenu_page($tools_parent, __('Available Tools', 'buddypress'), __('Available Tools', 'buddypress'), $this->capability, 'available-tools', 'bp_core_admin_available_tools_page');
} else {
$tools_parent = 'tools.php';
}
$hooks[] = add_submenu_page($tools_parent, __('BuddyPress Tools', 'buddypress'), __('BuddyPress', 'buddypress'), $this->capability, 'bp-tools', 'bp_core_admin_tools');
// For network-wide configs, add a link to (the root site's) Emails screen.
if (is_network_admin() && bp_is_network_activated()) {
$email_labels = bp_get_email_post_type_labels();
$email_url = get_admin_url(bp_get_root_blog_id(), 'edit.php?post_type=' . bp_get_email_post_type());
$hooks[] = add_menu_page($email_labels['name'], $email_labels['menu_name'], $this->capability, '', '', 'dashicons-email', 26);
// Hack: change the link to point to the root site's admin, not the network admin.
$GLOBALS['menu'][26][2] = esc_url_raw($email_url);
}
foreach ($hooks as $hook) {
add_action("admin_head-{$hook}", 'bp_core_modify_admin_menu_highlight');
}
}
开发者ID:dcavins,项目名称:buddypress-svn,代码行数:51,代码来源:class-bp-admin.php
示例18: bp_group_documents_find_admin_location
/**
* Finds the url of settings page
* @global type $wpdb
* @return string
* @since v 0.6
* @author lenasterg
* @version 1, 4/6/2013
*/
function bp_group_documents_find_admin_location()
{
global $wpdb;
$bp = buddypress();
if (!is_super_admin()) {
return false;
}
// test for BP1.6+ (truncated to allow testing on beta versions)
if (version_compare(substr(BP_VERSION, 0, 3), '1.6', '>=')) {
// BuddyPress 1.6 moves its admin pages elsewhere, so use Settings menu
$locationMu = 'settings.php';
} else {
// versions prior to 1.6 have a BuddyPress top-level menu
$locationMu = 'bp-general-settings';
}
$location = bp_core_do_network_admin() ? $locationMu : 'options-general.php';
return $location;
}
开发者ID:igniterealtime,项目名称:community-plugins,代码行数:26,代码来源:admin.php
示例19: admin_menus
/**
* Add the navigational menu elements.
*
* @since BuddyPress (1.6)
*
* @uses add_management_page() To add the Recount page in Tools section.
* @uses add_options_page() To add the Forums settings page in Settings
* section.
*/
public function admin_menus()
{
// Bail if user cannot moderate
if (!bp_current_user_can('manage_options')) {
return;
}
// About
add_dashboard_page(__('Welcome to BuddyPress', 'buddypress'), __('Welcome to BuddyPress', 'buddypress'), 'manage_options', 'bp-about', array($this, 'about_screen'));
// Credits
add_dashboard_page(__('Welcome to BuddyPress', 'buddypress'), __('Welcome to BuddyPress', 'buddypress'), 'manage_options', 'bp-credits', array($this, 'credits_screen'));
$hooks = array();
// Changed in BP 1.6 . See bp_core_admin_backpat_menu()
$hooks[] = add_menu_page(__('BuddyPress', 'buddypress'), __('BuddyPress', 'buddypress'), $this->capability, 'bp-general-settings', 'bp_core_admin_backpat_menu', 'div');
$hooks[] = add_submenu_page('bp-general-settings', __('BuddyPress Help', 'buddypress'), __('Help', 'buddypress'), $this->capability, 'bp-general-settings', 'bp_core_admin_backpat_page');
// Add the option pages
$hooks[] = add_submenu_page($this->settings_page, __('BuddyPress Components', 'buddypress'), __('BuddyPress', 'buddypress'), $this->capability, 'bp-components', 'bp_core_admin_components_settings');
$hooks[] = add_submenu_page($this->settings_page, __('BuddyPress Pages', 'buddypress'), __('BuddyPress Pages', 'buddypress'), $this->capability, 'bp-page-settings', 'bp_core_admin_slugs_settings');
$hooks[] = add_submenu_page($this->settings_page, __('BuddyPress Settings', 'buddypress'), __('BuddyPress Settings', 'buddypress'), $this->capability, 'bp-settings', 'bp_core_admin_settings');
// For consistency with non-Multisite, we add a Tools menu in
// the Network Admin as a home for our Tools panel
if (is_multisite() && bp_core_do_network_admin()) {
$tools_parent = 'network-tools';
$hooks[] = add_menu_page(__('Tools', 'buddypress'), __('Tools', 'buddypress'), $this->capability, $tools_parent, 'bp_core_tools_top_level_item', '', 24);
$hooks[] = add_submenu_page($tools_parent, __('Available Tools', 'buddypress'), __('Available Tools', 'buddypress'), $this->capability, 'available-tools', 'bp_core_admin_available_tools_page');
} else {
$tools_parent = 'tools.php';
}
$hooks[] = add_submenu_page($tools_parent, __('BuddyPress Tools', 'buddypress'), __('BuddyPress', 'buddypress'), $this->capability, 'bp-tools', 'bp_core_admin_tools');
// Fudge the highlighted subnav item when on a BuddyPress admin page
foreach ($hooks as $hook) {
add_action("admin_head-{$hook}", 'bp_core_modify_admin_menu_highlight');
}
}
开发者ID:sdh100shaun,项目名称:pantheon,代码行数:42,代码来源:bp-core-admin.php
示例20: signups_admin_load
/**
* Set up the signups admin page.
*
* Loaded before the page is rendered, this function does all initial
* setup, including: processing form requests, registering contextual
* help, and setting up screen options.
*
* @since BuddyPress (2.0.0)
*
* @global $bp_members_signup_list_table
*/
public function signups_admin_load()
{
global $bp_members_signup_list_table;
// Build redirection URL
$redirect_to = remove_query_arg(array('action', 'error', 'updated', 'activated', 'notactivated', 'deleted', 'notdeleted', 'resent', 'notresent', 'do_delete', 'do_resend', 'do_activate', '_wpnonce', 'signup_ids'), $_SERVER['REQUEST_URI']);
$doaction = bp_admin_list_table_current_bulk_action();
/**
* Fires at the start of the signups admin load.
*
* @since BuddyPress (2.0.0)
*
* @param string $doaction Current bulk action being processed.
* @param array $_REQUEST Current $_REQUEST global.
*/
do_action('bp_signups_admin_load', $doaction, $_REQUEST);
/**
* Filters the allowed actions for use in the user signups admin page.
*
* @since BuddyPress (2.0.0)
*
* @param array $value Array of allowed actions to use.
*/
$allowed_actions = apply_filters('bp_signups_admin_allowed_actions', array('do_delete', 'do_activate', 'do_resend'));
// Prepare the display of the Community Profile screen
if (!in_array($doaction, $allowed_actions) || -1 == $doaction) {
if (bp_core_do_network_admin()) {
$bp_members_signup_list_table = self::get_list_table_class('BP_Members_MS_List_Table', 'ms-users');
} else {
$bp_members_signup_list_table = self::get_list_table_class('BP_Members_List_Table', 'users');
}
// per_page screen option
add_screen_option('per_page', array('label' => _x('Pending Accounts', 'Pending Accounts per page (screen options)', 'buddypress')));
get_current_screen()->add_help_tab(array('id' => 'bp-signups-overview', 'title' => __('Overview', 'buddypress'), 'content' => '<p>' . __('This is the administration screen for pending accounts on your site.', 'buddypress') . '</p>' . '<p>' . __('From the screen options, you can customize the displayed columns and the pagination of this screen.', 'buddypress') . '</p>' . '<p>' . __('You can reorder the list of your pending accounts by clicking on the Username, Email or Registered column headers.', 'buddypress') . '</p>' . '<p>' . __('Using the search form, you can find pending accounts more easily. The Username and Email fields will be included in the search.', 'buddypress') . '</p>'));
get_current_screen()->add_help_tab(array('id' => 'bp-signups-actions', 'title' => __('Actions', 'buddypress'), 'content' => '<p>' . __('Hovering over a row in the pending accounts list will display action links that allow you to manage pending accounts. You can perform the following actions:', 'buddypress') . '</p>' . '<ul><li>' . __('"Email" takes you to the confirmation screen before being able to send the activation link to the desired pending account. You can only send the activation email once per day.', 'buddypress') . '</li>' . '<li>' . __('"Delete" allows you to delete a pending account from your site. You will be asked to confirm this deletion.', 'buddypress') . '</li></ul>' . '<p>' . __('By clicking on a Username you will be able to activate a pending account from the confirmation screen.', 'buddypress') . '</p>' . '<p>' . __('Bulk actions allow you to perform these 3 actions for the selected rows.', 'buddypress') . '</p>'));
// Help panel - sidebar links
get_current_screen()->set_help_sidebar('<p><strong>' . __('For more information:', 'buddypress') . '</strong></p>' . '<p>' . __('<a href="https://buddypress.org/support/">Support Forums</a>', 'buddypress') . '</p>');
} else {
if (!empty($_REQUEST['signup_ids'])) {
$signups = wp_parse_id_list($_REQUEST['signup_ids']);
}
// Handle resent activation links
if ('do_resend' == $doaction) {
// nonce check
check_admin_referer('signups_resend');
$resent = BP_Signup::resend($signups);
if (empty($resent)) {
$redirect_to = add_query_arg('error', $doaction, $redirect_to);
} else {
$query_arg = array('updated' => 'resent');
if (!empty($resent['resent'])) {
$query_arg['resent'] = count($resent['resent']);
}
if (!empty($resent['errors'])) {
$query_arg['notsent'] = count($resent['errors']);
set_transient('_bp_admin_signups_errors', $resent['errors'], 30);
}
$redirect_to = add_query_arg($query_arg, $redirect_to);
}
bp_core_redirect($redirect_to);
// Handle activated accounts
} elseif ('do_activate' == $doaction) {
// nonce check
check_admin_referer('signups_activate');
$activated = BP_Signup::activate($signups);
if (empty($activated)) {
$redirect_to = add_query_arg('error', $doaction, $redirect_to);
} else {
$query_arg = array('updated' => 'activated');
if (!empty($activated['activated'])) {
$query_arg['activated'] = count($activated['activated']);
}
if (!empty($activated['errors'])) {
$query_arg['notactivated'] = count($activated['errors']);
set_transient('_bp_admin_signups_errors', $activated['errors'], 30);
}
$redirect_to = add_query_arg($query_arg, $redirect_to);
}
bp_core_redirect($redirect_to);
// Handle sign-ups delete
} elseif ('do_delete' == $doaction) {
// nonce check
check_admin_referer('signups_delete');
$deleted = BP_Signup::delete($signups);
if (empty($deleted)) {
$redirect_to = add_query_arg('error', $doaction, $redirect_to);
} else {
$query_arg = array('updated' => 'deleted');
if (!empty($deleted['deleted'])) {
$query_arg['deleted'] = count($deleted['deleted']);
//.........这里部分代码省略.........
开发者ID:kosir,项目名称:thatcamp-org,代码行数:101,代码来源:bp-members-admin.php
注:本文中的bp_core_do_network_admin函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论