本文整理汇总了PHP中bp_core_admin_hook函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_core_admin_hook函数的具体用法?PHP bp_core_admin_hook怎么用?PHP bp_core_admin_hook使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bp_core_admin_hook函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct()
{
global $bp;
// Ensure that we have access to some utility functions. Must use require_once()
// because BP Core is loaded during incremental upgrades
require_once BP_PLUGIN_DIR . '/bp-core/bp-core-functions.php';
// Get current DB version
$this->database_version = !empty($bp->database_version) ? (int) $bp->database_version : 0;
if (!empty($bp->is_network_activate)) {
$this->is_network_activate = $bp->is_network_activate;
} elseif (!$this->current_step()) {
setcookie('bp-wizard-step', 0, time() + 60 * 60 * 24, COOKIEPATH);
$_COOKIE['bp-wizard-step'] = 0;
}
$this->new_version = constant('BP_DB_VERSION');
$this->setup_type = !empty($bp->maintenance_mode) ? $bp->maintenance_mode : '';
$this->current_step = $this->current_step();
// Remove the admin menu while we update/install
remove_action(bp_core_admin_hook(), 'bp_core_add_admin_menu', 9);
// Call the save method that will save data and modify $current_step
if (isset($_POST['save'])) {
$this->save($_POST['save']);
}
// Build the steps needed for update or new installations
$this->steps = $this->add_steps();
}
示例2: etivite_bp_activity_block_init
function etivite_bp_activity_block_init()
{
if (file_exists(dirname(__FILE__) . '/languages/' . get_locale() . '.mo')) {
load_textdomain('bp-activity-block', dirname(__FILE__) . '/languages/' . get_locale() . '.mo');
}
require dirname(__FILE__) . '/bp-activity-block.php';
add_action(bp_core_admin_hook(), 'etivite_bp_activity_block_admin_add_admin_menu');
}
示例3: setup_hooks
/**
* Set the actions & filters
*
* @package Rendez Vous
* @subpackage Admin
*
* @since Rendez Vous (1.2.0)
*/
private function setup_hooks()
{
// update plugin's db version
add_action('bp_admin_init', array($this, 'maybe_update'));
// javascript
add_action('bp_admin_enqueue_scripts', array($this, 'enqueue_script'));
// Page
add_action(bp_core_admin_hook(), array($this, 'admin_menu'));
add_action('admin_head', array($this, 'admin_head'), 999);
add_action('bp_admin_tabs', array($this, 'admin_tab'));
}
示例4: setup_actions
/**
* Setup the admin hooks, actions and filters
*
* @package BP Reshare
* @subpackage Admin
* @since version 1.0
*
* @uses bp_core_admin_hook() to hook the right menu (network or not)
* @uses buddyreshare() to get plugin's main instance
*/
private function setup_actions()
{
$buddyreshare = buddyreshare();
// Current blog is not the one where BuddyPress is activated so let's warn the administrator
if (!$buddyreshare::buddypress_site_check()) {
add_action('admin_notices', array($this, 'warning_notice'));
} else {
add_action($this->notice_hook, array($this, 'activation_notice'));
add_action(bp_core_admin_hook(), array($this, 'admin_menus'));
add_action('bp_register_admin_settings', array($this, 'register_settings'));
}
}
示例5: BPSP_NXTClass
/**
* BPSP_NXTClass()
*
* Constructor, loads all the required hooks
*/
function BPSP_NXTClass()
{
// Add our screen to BuddyPress menu
add_action(bp_core_admin_hook(), array(__CLASS__, 'menus'));
// Ensure compatibility
add_action('admin_notices', 'bpsp_check');
// Help Screen
add_action('admin_head', array(__CLASS__, 'screen_help'));
// Support link
add_filter('plugin_row_meta', array(__CLASS__, 'support_link'), 10, 2);
// Settings link
add_action('plugin_action_links_' . BPSP_PLUGIN_FILE, array(__CLASS__, 'action_link'), 10, 4);
// Initialize our options
add_option('bpsp_allow_only_admins');
add_option('bpsp_global_status');
add_option('bpsp_gradebook_format');
add_option('bpsp_private_responses');
add_option('bpsp_worldcat_key');
add_option('bpsp_isbndb_key');
add_option('bpsp_load_css');
}
示例6: setup_actions
/**
* Set up the admin hooks, actions, and filters.
*
* @access private
* @since BuddyPress (1.6.0)
*
* @uses add_action() To add various actions.
* @uses add_filter() To add various filters.
*/
private function setup_actions()
{
/** General Actions ***************************************************/
// Add some page specific output to the <head>
add_action('bp_admin_head', array($this, 'admin_head'), 999);
// Add menu item to settings menu
add_action(bp_core_admin_hook(), array($this, 'admin_menus'), 5);
// Enqueue all admin JS and CSS
add_action('bp_admin_enqueue_scripts', array($this, 'enqueue_scripts'));
/** BuddyPress Actions ************************************************/
// Load the BuddyPress metabox in the WP Nav Menu Admin UI
add_action('load-nav-menus.php', 'bp_admin_wp_nav_menu_meta_box');
// Add settings
add_action('bp_register_admin_settings', array($this, 'register_admin_settings'));
// Add a link to BuddyPress About page to the admin bar
add_action('admin_bar_menu', array($this, 'admin_bar_about_link'), 15);
// Add a description of new BuddyPress tools in the available tools page
add_action('tool_box', 'bp_core_admin_available_tools_intro');
add_action('bp_network_tool_box', 'bp_core_admin_available_tools_intro');
// On non-multisite, catch
add_action('load-users.php', 'bp_core_admin_user_manage_spammers');
/** Filters ***********************************************************/
// Add link to settings page
add_filter('plugin_action_links', array($this, 'modify_plugin_action_links'), 10, 2);
add_filter('network_admin_plugin_action_links', array($this, 'modify_plugin_action_links'), 10, 2);
// Add "Mark as Spam" row actions on users.php
add_filter('ms_user_row_actions', 'bp_core_admin_user_row_actions', 10, 2);
add_filter('user_row_actions', 'bp_core_admin_user_row_actions', 10, 2);
}
示例7: bp_example_add_admin_menu
* bp_example_add_admin_menu()
*
* This function will add a WordPress wp-admin admin menu for your component under the
* "BuddyPress" menu.
*/
function bp_example_add_admin_menu()
{
global $bp;
if (!is_super_admin()) {
return false;
}
add_submenu_page('bp-general-settings', __('Example Admin', 'bp-example'), __('Example Admin', 'bp-example'), 'manage_options', 'bp-example-settings', 'bp_example_admin');
}
// The bp_core_admin_hook() function returns the correct hook (admin_menu or network_admin_menu),
// depending on how WordPress and BuddyPress are configured
add_action(bp_core_admin_hook(), 'bp_example_add_admin_menu');
/**
* bp_example_admin()
*
* Checks for form submission, saves component settings and outputs admin screen HTML.
*/
function bp_example_admin()
{
global $bp;
/* If the form has been submitted and the admin referrer checks out, save the settings */
if (isset($_POST['submit']) && check_admin_referer('example-settings')) {
update_option('example-setting-one', $_POST['example-setting-one']);
update_option('example-setting-two', $_POST['example-setting-two']);
$updated = true;
}
$setting_one = get_option('example-setting-one');
示例8: bpdd_init
function bpdd_init()
{
add_action(bp_core_admin_hook(), 'bpdd_admin_page', 99);
}
示例9: xprofile_add_admin_css
exit;
}
function xprofile_add_admin_css()
{
if (!empty($_GET['page']) && strpos($_GET['page'], 'bp-profile-setup') !== false) {
if (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) {
wp_enqueue_style('xprofile-admin-css', BP_PLUGIN_URL . '/bp-xprofile/admin/css/admin.dev.css', array(), '20110723');
} else {
wp_enqueue_style('xprofile-admin-css', BP_PLUGIN_URL . '/bp-xprofile/admin/css/admin.css', array(), '20110723');
}
}
}
add_action(bp_core_admin_hook(), 'xprofile_add_admin_css');
function xprofile_add_admin_js()
{
if (!empty($_GET['page']) && strpos($_GET['page'], 'bp-profile-setup') !== false) {
wp_enqueue_script('jquery-ui-core');
wp_enqueue_script('jquery-ui-tabs');
wp_enqueue_script('jquery-ui-mouse');
wp_enqueue_script('jquery-ui-draggable');
wp_enqueue_script('jquery-ui-droppable');
wp_enqueue_script('jquery-ui-sortable');
if (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) {
wp_enqueue_script('xprofile-admin-js', BP_PLUGIN_URL . '/bp-xprofile/admin/js/admin.dev.js', array('jquery', 'jquery-ui-sortable'), '20110723');
} else {
wp_enqueue_script('xprofile-admin-js', BP_PLUGIN_URL . '/bp-xprofile/admin/js/admin.js', array('jquery', 'jquery-ui-sortable'), '20110723');
}
}
}
add_action(bp_core_admin_hook(), 'xprofile_add_admin_js', 1);
示例10: xprofile_add_admin_menu
* @uses bp_xprofile_install() runs the installation of DB tables for the xprofile component
* @uses nxt_enqueue_script() Adds a JS file to the JS queue ready for output
* @uses add_submenu_page() Adds a submenu tab to a top level tab in the admin area
* @uses xprofile_install() Runs the DB table installation function
* @return
*/
function xprofile_add_admin_menu()
{
global $nxtdb, $bp;
if (!is_super_admin()) {
return false;
}
$hook = add_submenu_page('bp-general-settings', __('Profile Fields', 'buddypress'), __('Profile Fields', 'buddypress'), 'manage_options', 'bp-profile-setup', 'xprofile_admin');
add_action("admin_print_styles-{$hook}", 'bp_core_add_admin_menu_styles');
}
add_action(bp_core_admin_hook(), 'xprofile_add_admin_menu');
/**
* Handles all actions for the admin area for creating, editing and deleting
* profile groups and fields.
*/
function xprofile_admin($message = '', $type = 'error')
{
global $bp;
$type = preg_replace('|[^a-z]|i', '', $type);
$groups = BP_XProfile_Group::get(array('fetch_fields' => true));
if (isset($_GET['mode']) && isset($_GET['group_id']) && 'add_field' == $_GET['mode']) {
xprofile_admin_manage_field($_GET['group_id']);
} else {
if (isset($_GET['mode']) && isset($_GET['group_id']) && isset($_GET['field_id']) && 'edit_field' == $_GET['mode']) {
xprofile_admin_manage_field($_GET['group_id'], $_GET['field_id']);
} else {
示例11: setup_actions
/**
* Setup the admin hooks, actions and filters
*
* @since BuddyPress (1.6)
* @access private
*
* @uses add_action() To add various actions
* @uses add_filter() To add various filters
*/
private function setup_actions()
{
/** General Actions ***************************************************/
// Add some page specific output to the <head>
add_action('bp_admin_head', array($this, 'admin_head'), 999);
// Add menu item to settings menu
add_action(bp_core_admin_hook(), array($this, 'admin_menus'), 5);
// Enqueue all admin JS and CSS
add_action('bp_admin_enqueue_scripts', array($this, 'enqueue_scripts'));
/** BuddyPress Actions ************************************************/
// Add settings
add_action('bp_register_admin_settings', array($this, 'register_admin_settings'));
/** Filters ***********************************************************/
// Add link to settings page
add_filter('plugin_action_links', array($this, 'modify_plugin_action_links'), 10, 2);
add_filter('network_admin_plugin_action_links', array($this, 'modify_plugin_action_links'), 10, 2);
}
示例12: add_action
include WP_PLUGIN_DIR . '/bebop/core/templates/admin/bebop-content.php';
} else {
if ($_GET['page'] == 'bebop_error_log') {
include WP_PLUGIN_DIR . '/bebop/core/templates/admin/bebop-error-log.php';
} else {
if ($_GET['page'] == 'bebop_general_log') {
include WP_PLUGIN_DIR . '/bebop/core/templates/admin/bebop-general-log.php';
}
}
}
}
}
}
}
add_action(bp_core_admin_hook(), 'bebop_admin_menu');
function bebop_admin_stylesheets()
{
wp_register_style('bebop-admin-styles', plugins_url() . '/bebop/core/resources/css/admin.css');
wp_enqueue_style('bebop-admin-styles');
}
add_action(bp_core_admin_hook(), 'bebop_admin_stylesheets');
//wp_adminbar
function bebop_admin_bar_resources()
{
global $wp_admin_bar;
global $bp;
$wp_admin_bar->add_node(array('id' => 'my-account-buddypress-bebop', 'title' => __('Resources', 'bebop'), 'href' => bp_displayed_user_domain() . 'bebop/', 'parent' => 'my-account-buddypress'));
$wp_admin_bar->add_node(array('id' => 'my-account-buddypress-bebop-content', 'title' => __('Content', 'bebop'), 'href' => bp_displayed_user_domain() . 'bebop/bebop-content', 'parent' => 'my-account-buddypress-bebop'));
$wp_admin_bar->add_node(array('id' => 'my-account-buddypress-bebop-content-manager', 'title' => __('Content Manager', 'bebop'), 'href' => bp_displayed_user_domain() . 'bebop/bebop-manager', 'parent' => 'my-account-buddypress-bebop'));
$wp_admin_bar->add_node(array('id' => 'my-account-buddypress-bebop-accounts', 'title' => __('Accounts', 'bebop'), 'href' => bp_displayed_user_domain() . 'bebop/bebop-accounts', 'parent' => 'my-account-buddypress-bebop'));
}
示例13: bp_core_admin_menu_init
/**
* Initializes the wp-admin area "BuddyPress" menus and sub menus.
*
* @uses bp_current_user_can() returns true if the current user is a site admin, false if not.
*/
function bp_core_admin_menu_init()
{
add_action(bp_core_admin_hook(), 'bp_core_add_admin_menu', 9);
}
示例14: bp_group_documents_group_add_admin_menu
* @return boolean
* @version 3, 4/6/2013, stergatu, fix the admin menu link for single wp installation
* @since 0.5
* @todo write the bp_group_documents_add_admin_style (minor)
*/
function bp_group_documents_group_add_admin_menu()
{
global $wpdb;
$bp = buddypress();
/* Add the administration tab under the "Site Admin" tab for site administrators */
$page = add_submenu_page(bp_group_documents_find_admin_location(), 'Buddypress Group Documents ' . __('Settings'), '<span class="bp-group-documents-admin-menu-header">' . __('Buddypress Group Documents', 'bp-group-documents') . '</span>', 'manage_options', 'bp-group-documents-settings', 'bp_group_documents_admin');
// add styles only on bp-group-documents admin page, see:
// http://codex.wordpress.org/Function_Reference/wp_enqueue_script#Load_scripts_only_on_plugin_pages
//add_action( 'admin_print_styles-'.$page, 'bp_group_documents_add_admin_style' );
}
add_action(bp_core_admin_hook(), 'bp_group_documents_group_add_admin_menu', 10);
/**
* Add settings link on plugin page
* @param type $links
* @param type $file
* @return array
* @since version 0.6
* @version 3, 21/4/2015 esc_url
* v2, 3/9/2013, fix the BP_GROUP_DOCUMENTS_DIR
* version 1, 4/6/2013 stergtu
*
*/
function bp_group_documents_settings_link($links, $file)
{
$this_plugin = BP_GROUP_DOCUMENTS_DIR . '/loader.php';
if ($file == $this_plugin) {
示例15: setup_actions
/**
* Set admin-related actions and filters.
*
* @access private
* @since BuddyPress (2.0.0)
*/
private function setup_actions()
{
/** Extended Profile *****************************************/
// Add some page specific output to the <head>
add_action('bp_admin_head', array($this, 'admin_head'), 999);
// Add menu item to all users menu
add_action(bp_core_admin_hook(), array($this, 'admin_menus'), 5);
// Enqueue all admin JS and CSS
add_action('bp_admin_enqueue_scripts', array($this, 'enqueue_scripts'));
// Create the Profile Navigation (Profile/Extended Profile)
add_action('edit_user_profile', array($this, 'profile_nav'), 99, 1);
// Add a row action to users listing
add_filter(bp_core_do_network_admin() ? 'ms_user_row_actions' : 'user_row_actions', array($this, 'row_actions'), 10, 2);
/** Signups **************************************************************/
if (is_admin()) {
if (!is_multisite()) {
add_action('pre_user_query', array($this, 'remove_signups_from_user_query'), 10, 1);
}
// Reorganise the views navigation in users.php and signups page
if (current_user_can($this->capability)) {
add_filter("views_{$this->users_screen}", array($this, 'signup_filter_view'), 10, 1);
add_filter('set-screen-option', array($this, 'signup_screen_options'), 10, 3);
}
}
}