/** * Set up global settings for the blogs component. * * The BP_BLOGS_SLUG constant is deprecated, and only used here for * backwards compatibility. * * @since BuddyPress (1.5.0) * * @see BP_Component::setup_globals() for description of parameters. * * @param array $args See {@link BP_Component::setup_globals()}. */ public function setup_globals($args = array()) { $bp = buddypress(); if (!defined('BP_BLOGS_SLUG')) { define('BP_BLOGS_SLUG', $this->id); } // Global tables for messaging component $global_tables = array('table_name' => $bp->table_prefix . 'bp_user_blogs', 'table_name_blogmeta' => $bp->table_prefix . 'bp_user_blogs_blogmeta'); $meta_tables = array('blog' => $bp->table_prefix . 'bp_user_blogs_blogmeta'); // All globals for blogs component. $args = array('slug' => BP_BLOGS_SLUG, 'root_slug' => isset($bp->pages->blogs->slug) ? $bp->pages->blogs->slug : BP_BLOGS_SLUG, 'has_directory' => is_multisite(), 'notification_callback' => 'bp_blogs_format_notifications', 'search_string' => __('Search sites...', 'buddypress'), 'autocomplete_all' => defined('BP_MESSAGES_AUTOCOMPLETE_ALL'), 'global_tables' => $global_tables, 'meta_tables' => $meta_tables); // Setup the globals parent::setup_globals($args); /* * Set up the post post type to track. * * In case the config is not multisite, the blog_public option is ignored. */ if (0 !== apply_filters('bp_is_blog_public', (int) get_option('blog_public')) || !is_multisite()) { /** * Filters the post types to track for the Blog component. * * @since BuddyPress (1.5.0) * * @param array $value Array of post types to track. */ $post_types = apply_filters('bp_blogs_record_post_post_types', array('post')); foreach ($post_types as $post_type) { add_post_type_support($post_type, 'buddypress-activity'); } } // Filter the generic track parameters for the 'post' post type. add_filter('bp_activity_get_post_type_tracking_args', array($this, 'post_tracking_args'), 10, 2); }
/** * Setup globals. * * @global obj $bp BuddyPress instance */ public function setup_globals($args = array()) { global $bp; if (!defined('BP_FOLLOWERS_SLUG')) { define('BP_FOLLOWERS_SLUG', 'followers'); } if (!defined('BP_FOLLOWING_SLUG')) { define('BP_FOLLOWING_SLUG', 'following'); } // Set up the $globals array $globals = array('notification_callback' => 'bp_follow_format_notifications', 'global_tables' => array('table_name' => $bp->table_prefix . 'bp_follow')); // Let BP_Component::setup_globals() do its work. parent::setup_globals($globals); // register other globals since BP isn't really flexible enough to add it // in the setup_globals() method // // would rather do away with this, but keeping it for backpat $bp->follow->followers = new stdClass(); $bp->follow->following = new stdClass(); $bp->follow->followers->slug = constant('BP_FOLLOWERS_SLUG'); $bp->follow->following->slug = constant('BP_FOLLOWING_SLUG'); // locally cache total count values for logged-in user if (is_user_logged_in()) { $bp->loggedin_user->total_follow_counts = bp_follow_total_follow_counts(array('user_id' => bp_loggedin_user_id())); } // locally cache total count values for displayed user if (bp_is_user() && bp_loggedin_user_id() != bp_displayed_user_id()) { $bp->displayed_user->total_follow_counts = bp_follow_total_follow_counts(array('user_id' => bp_displayed_user_id())); } }
/** * Setting up buddypress component properties * This is an override * @return void */ public function setup_globals($args = array()) { if (!defined('BP_SITE_SUBSCRIBER_SLUG')) { define('BP_SITE_SUBSCRIBER_SLUG', $this->id); } $args = array('slug' => BP_SITE_SUBSCRIBER_SLUG, 'has_directory' => false, 'notification_callback' => 'bp_site_subscriber_notification_format'); parent::setup_globals($args); }
/** * Set up BuddyDrive globals * * @package BuddyDrive * @since 1.0 * * @global obj $bp BuddyPress's global object * @uses buddypress() to get the instance data * @uses buddydrive_get_slug() to get BuddyDrive root slug */ public function setup_globals($args = array()) { $bp = buddypress(); // Set up the $globals array to be passed along to parent::setup_globals() $globals = array('slug' => buddydrive_get_slug(), 'root_slug' => isset($bp->pages->{$this->id}->slug) ? $bp->pages->{$this->id}->slug : buddydrive_get_slug(), 'has_directory' => true, 'directory_title' => sprintf(__('%s download page', 'buddydrive'), buddydrive_get_name()), 'notification_callback' => 'buddydrive_format_notifications', 'search_string' => __('Search files...', 'buddydrive')); // Let BP_Component::setup_globals() do its work. parent::setup_globals($globals); }
/** * Set up bp-mutual-friends global settings. * @since BuddyPress (1.5.0) * * @see BP_Component::setup_globals() for description of parameters. * * @param array $args See {@link BP_Component::setup_globals()}. */ public function setup_globals($args = array()) { // Define a slug, if necessary if (!defined('BP_MUTUAL_FRIENDS_SLUG')) { define('BP_MUTUAL_FRIENDS_SLUG', $this->id); } parent::setup_globals($args); }
/** * Set up global data. * * @since 1.0.0 * @access public * * @param array $args See BP_Component::setup_globals(). */ function setup_globals($args = array()) { if (!defined('BP_MUTE_SLUG')) { define('BP_MUTE_SLUG', 'mute'); } $args = array('slug' => BP_MUTE_SLUG, 'global_tables' => array('table_name' => buddypress()->table_prefix . 'bp_mute'), 'notification_callback' => 'bp_mute_format_notifications'); parent::setup_globals($args); }
/** * Setup globals. * * The BP_SETTINGS_SLUG constant is deprecated, and only used here for * backwards compatibility. * * @param array $args Array of arguments. * * @since 1.5.0 */ public function setup_globals($args = array()) { // Define a slug, if necessary if (!defined('BP_SETTINGS_SLUG')) { define('BP_SETTINGS_SLUG', $this->id); } // All globals for settings component. parent::setup_globals(array('slug' => BP_SETTINGS_SLUG, 'has_directory' => false)); }
/** * Setup globals */ public function setup_globals($globals = array()) { // Define a slug, if necessary if (!defined('BP_BUDDYBLOG_SLUG')) { define('BP_BUDDYBLOG_SLUG', $this->id); } $globals = array('slug' => BP_BUDDYBLOG_SLUG, 'root_slug' => BP_BUDDYBLOG_SLUG, 'has_directory' => false, 'notification_callback' => 'buddyblog_format_notifications', 'search_string' => __('Search Posts...', 'buddyblog'), 'global_tables' => array()); parent::setup_globals($globals); }
function setup_globals() { $bp = buddypress(); $global_tables = array('table_name' => $bp->table_prefix . 'bp_links', 'table_name_categories' => $bp->table_prefix . 'bp_links_categories', 'table_name_votes' => $bp->table_prefix . 'bp_links_votes', 'table_name_linkmeta' => $bp->table_prefix . 'bp_links_linkmeta'); // Set up the $globals array to be passed along to parent::setup_globals() $globals = array('slug' => BP_LINKS_SLUG, 'root_slug' => isset($bp->pages->{$this->id}->slug) ? $bp->pages->{$this->id}->slug : BP_LINKS_SLUG, 'has_directory' => true, 'notification_callback' => 'bp_links_format_notifications', 'search_string' => __('Search Links...', 'buddypress-links'), 'global_tables' => $global_tables); // Let BP_Component::setup_globals() do its work. parent::setup_globals($globals); $this->forbidden_names = apply_filters('bp_links_forbidden_names', array('add', 'admin', 'all', 'create', 'delete', 'feed', 'links', 'my-links', 'submit', 'active', 'high-votes', 'most-votes', 'newest', 'popular', BP_LINKS_CAT_URL_SLUG)); }
function setup_globals($args = array()) { global $bp; if (!defined('SA_SLUG')) { define('SA_SLUG', $this->id); } $globals = array('slug' => SA_SLUG, 'root_slug' => isset($bp->pages->{$this->id}->slug) ? $bp->pages->{$this->id}->slug : SA_SLUG, 'has_directory' => false, 'notification_callback' => 'social_articles_format_notifications', 'search_string' => __('Search articles...', 'social-articles')); if ($this->check_visibility()) { parent::setup_globals($globals); } }
/** * Setup globals * * The BP_SETTINGS_SLUG constant is deprecated, and only used here for * backwards compatibility. * * @since 1.5 * @global obj $bp */ function setup_globals() { global $bp; // Define a slug, if necessary if (!defined('BP_SETTINGS_SLUG')) { define('BP_SETTINGS_SLUG', $this->id); } // All globals for settings component. $globals = array('slug' => BP_SETTINGS_SLUG, 'has_directory' => false); parent::setup_globals($globals); }
/** * Setup globals * * The BP_MEMBERS_SLUG constant is deprecated, and only used here for * backwards compatibility. * * @since 1.5 * @global obj $bp */ function setup_globals() { global $bp, $current_user, $displayed_user_id; // Define a slug, if necessary if (!defined('BP_MEMBERS_SLUG')) { define('BP_MEMBERS_SLUG', $this->id); } $globals = array('path' => BP_PLUGIN_DIR, 'slug' => BP_MEMBERS_SLUG, 'root_slug' => isset($bp->pages->members->slug) ? $bp->pages->members->slug : BP_MEMBERS_SLUG, 'has_directory' => true, 'search_string' => __('Search Members...', 'buddypress')); parent::setup_globals($globals); /** Logged in user ****************************************************/ // Fetch the full name for the logged in user $bp->loggedin_user->fullname = bp_core_get_user_displayname(bp_loggedin_user_id()); // Hits the DB on single WP installs so get this separately $bp->loggedin_user->is_super_admin = $bp->loggedin_user->is_site_admin = is_super_admin(bp_loggedin_user_id()); // The domain for the user currently logged in. eg: http://domain.com/members/andy $bp->loggedin_user->domain = bp_core_get_user_domain(bp_loggedin_user_id()); // The core userdata of the user who is currently logged in. $bp->loggedin_user->userdata = bp_core_get_core_userdata(bp_loggedin_user_id()); /** Displayed user ****************************************************/ // The domain for the user currently being displayed $bp->displayed_user->domain = bp_core_get_user_domain(bp_displayed_user_id()); // The core userdata of the user who is currently being displayed $bp->displayed_user->userdata = bp_core_get_core_userdata(bp_displayed_user_id()); // Fetch the full name displayed user $bp->displayed_user->fullname = bp_core_get_user_displayname(bp_displayed_user_id()); /** Profiles Fallback *************************************************/ if (!bp_is_active('xprofile')) { $bp->profile->slug = 'profile'; $bp->profile->id = 'profile'; } /** Default Profile Component *****************************************/ if (!defined('BP_DEFAULT_COMPONENT')) { if (bp_is_active('activity') && isset($bp->pages->activity)) { $bp->default_component = bp_get_activity_slug(); } else { $bp->default_component = 'xprofile' == $bp->profile->id ? 'profile' : $bp->profile->id; } } else { $bp->default_component = BP_DEFAULT_COMPONENT; } if (!bp_current_component() && bp_displayed_user_id()) { /** * BuddyPress will attempt to resolve to the most specific URL possible, * to avoid search-engine-unfriendly content reduplication. Filter * bp_guarantee_unique_uris (and return false) to avoid this behavior */ if (apply_filters('bp_guarantee_unique_uris', true)) { bp_core_redirect(bp_displayed_user_domain() . $bp->default_component); } else { $bp->current_component = $bp->default_component; } } }
function setup_globals() { global $bp; // Defining the slug in this way makes it possible for site admins to override it if (!defined('BUATP_SLUG')) { define('BUATP_SLUG', $this->id); } // Set up the $globals array to be passed along to parent::setup_globals() $globals = array('slug' => BUATP_SLUG, 'root_slug' => isset($bp->pages->{$this->id}->slug) ? $bp->pages->{$this->id}->slug : BUATP_SLUG, 'has_directory' => true, 'notification_callback' => 'buatp_format_notifications', 'search_string' => __('Search Members...', 'buddypress')); // Let BP_Component::setup_globals() do its work. parent::setup_globals($globals); }
/** * Set up component global data. * * @since BuddyPress (1.9.0) * * @see BP_Component::setup_globals() for a description of arguments. * * @param array $args See BP_Component::setup_globals() for a description. */ public function setup_globals($args = array()) { // Define a slug, if necessary if (!defined('BP_NOTIFICATIONS_SLUG')) { define('BP_NOTIFICATIONS_SLUG', $this->id); } // Global tables for the notifications component $global_tables = array('table_name' => bp_core_get_table_prefix() . 'bp_notifications'); // All globals for the notifications component. // Note that global_tables is included in this array. $args = array('slug' => BP_NOTIFICATIONS_SLUG, 'has_directory' => false, 'search_string' => __('Search Notifications...', 'buddypress'), 'global_tables' => $global_tables); parent::setup_globals($args); }
/** * SETUP BUDDYPRESS GLOBAL OPTIONS * * @since BuddyBoss 2.0 */ function setup_globals($args = array()) { global $buddyboss_pics_defaults, $activity_template; if (isset($options) && $options != null) { $this->options = $options; } else { $this->options = $buddyboss_pics_defaults; buddyboss_log("PICS Using default config"); } // Log buddyboss_log($this->options); parent::setup_globals(array('has_directory' => false)); }
/** * Sets up the global Events Manager BuddyPress Components */ function setup_globals() { global $bp, $wpdb; // Define a slug constant that will be used to view this components pages if (!defined('BP_EM_SLUG')) { define('BP_EM_SLUG', str_replace('/', '-', EM_POST_TYPE_EVENT_SLUG)); } // Set up the $globals array to be passed along to parent::setup_globals() $globals = array('slug' => BP_EM_SLUG, 'has_directory' => false, 'notification_callback' => 'bp_em_format_notifications', 'search_string' => sprintf(__('Search %s...', 'dbem'), __('Events', 'dbem'))); // Let BP_Component::setup_globals() do its work. parent::setup_globals($globals); //quick link shortcut - may need to revisit this $bp->{$this->id}->link = trailingslashit($bp->loggedin_user->domain) . BP_EM_SLUG . '/'; }
/** * Setup globals * * The BP_ACTIVITY_SLUG constant is deprecated, and only used here for * backwards compatibility. * * @since 1.5.0 * * @global object $bp BuddyPress global settings */ function setup_globals() { global $bp; // Define a slug, if necessary if (!defined('BP_ACTIVITY_SLUG')) { define('BP_ACTIVITY_SLUG', $this->id); } // Global tables for activity component $global_tables = array('table_name' => $bp->table_prefix . 'bp_activity', 'table_name_meta' => $bp->table_prefix . 'bp_activity_meta'); // All globals for activity component. // Note that global_tables is included in this array. $globals = array('path' => BP_PLUGIN_DIR, 'slug' => BP_ACTIVITY_SLUG, 'root_slug' => isset($bp->pages->activity->slug) ? $bp->pages->activity->slug : BP_ACTIVITY_SLUG, 'has_directory' => true, 'search_string' => __('Search Activity...', 'buddypress'), 'global_tables' => $global_tables, 'notification_callback' => 'bp_activity_format_notifications'); parent::setup_globals($globals); }
/** * GMW Location globals */ function setup_globals($args = array()) { global $bp; // Defining the slug in this way makes it possible for site admins to override it if (!defined('GMW_FL_SLUG')) { define('GMW_FL_SLUG', $this->id); } // Set up the $globals array to be passed along to parent::setup_globals() $globals = array('slug' => GMW_FL_SLUG, 'root_slug' => isset($bp->pages->{$this->id}->slug) ? $bp->pages->{$this->id}->slug : GMW_FL_SLUG, 'has_directory' => true, 'notification_callback' => false, 'search_string' => __('Search Location...', 'GMW')); // Let BP_Component::setup_globals() do its work. parent::setup_globals($globals); // we'll use this to avoid conflict with activity's $bp->ajax_querystring //$bp->{$this->id}->ajax_query = ''; }
/** * Set up global settings for the blogs component. * * The BP_BLOGS_SLUG constant is deprecated, and only used here for * backwards compatibility. * * @since BuddyPress (1.5.0) * * @see BP_Component::setup_globals() for description of parameters. * * @param array $args See {@link BP_Component::setup_globals()}. */ public function setup_globals($args = array()) { $bp = buddypress(); if (!defined('BP_BLOGS_SLUG')) { define('BP_BLOGS_SLUG', $this->id); } // Global tables for messaging component $global_tables = array('table_name' => $bp->table_prefix . 'bp_user_blogs', 'table_name_blogmeta' => $bp->table_prefix . 'bp_user_blogs_blogmeta'); $meta_tables = array('blog' => $bp->table_prefix . 'bp_user_blogs_blogmeta'); // All globals for blogs component. $args = array('slug' => BP_BLOGS_SLUG, 'root_slug' => isset($bp->pages->blogs->slug) ? $bp->pages->blogs->slug : BP_BLOGS_SLUG, 'has_directory' => is_multisite(), 'notification_callback' => 'bp_blogs_format_notifications', 'search_string' => __('Search sites...', 'buddypress'), 'autocomplete_all' => defined('BP_MESSAGES_AUTOCOMPLETE_ALL'), 'global_tables' => $global_tables, 'meta_tables' => $meta_tables); // Setup the globals parent::setup_globals($args); }
/** * Setup globals * * The BP_BLOGS_SLUG constant is deprecated, and only used here for * backwards compatibility. * * @since 1.5 * @global obj $bp */ function setup_globals() { global $bp; if (!defined('BP_BLOGS_SLUG')) { define('BP_BLOGS_SLUG', $this->id); } // Global tables for messaging component $global_tables = array('table_name' => $bp->table_prefix . 'bp_user_blogs', 'table_name_blogmeta' => $bp->table_prefix . 'bp_user_blogs_blogmeta'); // All globals for messaging component. // Note that global_tables is included in this array. $globals = array('path' => BP_PLUGIN_DIR, 'slug' => BP_BLOGS_SLUG, 'root_slug' => isset($bp->pages->blogs->slug) ? $bp->pages->blogs->slug : BP_BLOGS_SLUG, 'has_directory' => is_multisite(), 'notification_callback' => 'bp_blogs_format_notifications', 'search_string' => __('Search sites...', 'buddypress'), 'autocomplete_all' => defined('BP_MESSAGES_AUTOCOMPLETE_ALL'), 'global_tables' => $global_tables); // Setup the globals parent::setup_globals($globals); }
/** * Setup globals * * The BP_MEMBERS_SLUG constant is deprecated, and only used here for * backwards compatibility. * * @since 1.5 * @global obj $bp */ function setup_globals() { global $bp, $current_user, $displayed_user_id; // Define a slug, if necessary if (!defined('BP_MEMBERS_SLUG')) { define('BP_MEMBERS_SLUG', $this->id); } $globals = array('path' => BP_PLUGIN_DIR, 'slug' => BP_MEMBERS_SLUG, 'root_slug' => isset($bp->pages->members->slug) ? $bp->pages->members->slug : BP_MEMBERS_SLUG, 'has_directory' => true, 'search_string' => __('Search Members...', 'buddypress')); parent::setup_globals($globals); /** Logged in user ****************************************************/ // Fetch the full name for the logged in user $bp->loggedin_user->fullname = bp_core_get_user_displayname($bp->loggedin_user->id); // Hits the DB on single nxt installs so get this separately $bp->loggedin_user->is_super_admin = $bp->loggedin_user->is_site_admin = is_super_admin(); // The domain for the user currently logged in. eg: http://domain.com/members/andy $bp->loggedin_user->domain = bp_core_get_user_domain($bp->loggedin_user->id); // The core userdata of the user who is currently logged in. $bp->loggedin_user->userdata = bp_core_get_core_userdata($bp->loggedin_user->id); /** Displayed user ****************************************************/ // The user id of the user currently being viewed: // $bp->displayed_user->id is set in /bp-core/bp-core-catchuri.php if (empty($bp->displayed_user->id)) { $bp->displayed_user->id = 0; } // The domain for the user currently being displayed $bp->displayed_user->domain = bp_core_get_user_domain($bp->displayed_user->id); // The core userdata of the user who is currently being displayed $bp->displayed_user->userdata = bp_core_get_core_userdata($bp->displayed_user->id); // Fetch the full name displayed user $bp->displayed_user->fullname = bp_core_get_user_displayname($bp->displayed_user->id); /** Profiles Fallback *************************************************/ if (!bp_is_active('xprofile')) { $bp->profile->slug = 'profile'; $bp->profile->id = 'profile'; } /** Default Profile Component *****************************************/ if (!defined('BP_DEFAULT_COMPONENT')) { if (bp_is_active('activity') && isset($bp->pages->activity)) { $bp->default_component = bp_get_activity_slug(); } else { $bp->default_component = 'xprofile' == $bp->profile->id ? 'profile' : $bp->profile->id; } } else { $bp->default_component = BP_DEFAULT_COMPONENT; } if (!$bp->current_component && $bp->displayed_user->id) { $bp->current_component = $bp->default_component; } }
/** * Setup globals * * The BP_MESSAGES_SLUG constant is deprecated, and only used here for * backwards compatibility. * * @since 1.5 * @global obj $bp */ function setup_globals() { global $bp; // Define a slug, if necessary if (!defined('BP_MESSAGES_SLUG')) { define('BP_MESSAGES_SLUG', $this->id); } // Global tables for messaging component $global_tables = array('table_name_notices' => $bp->table_prefix . 'bp_messages_notices', 'table_name_messages' => $bp->table_prefix . 'bp_messages_messages', 'table_name_recipients' => $bp->table_prefix . 'bp_messages_recipients'); // All globals for messaging component. // Note that global_tables is included in this array. $globals = array('path' => BP_PLUGIN_DIR, 'slug' => BP_MESSAGES_SLUG, 'has_directory' => false, 'notification_callback' => 'messages_format_notifications', 'search_string' => __('Search Messages...', 'buddypress'), 'global_tables' => $global_tables); $this->autocomplete_all = defined('BP_MESSAGES_AUTOCOMPLETE_ALL'); parent::setup_globals($globals); }
/** * Setup globals * * The BP_FRIENDS_SLUG constant is deprecated, and only used here for * backwards compatibility. * * @since 1.5 * @global obj $bp */ function setup_globals() { global $bp; define('BP_FRIENDS_DB_VERSION', '1800'); // Define a slug, if necessary if (!defined('BP_FRIENDS_SLUG')) { define('BP_FRIENDS_SLUG', $this->id); } // Global tables for the friends component $global_tables = array('table_name' => $bp->table_prefix . 'bp_friends', 'table_name_meta' => $bp->table_prefix . 'bp_friends_meta'); // All globals for the friends component. // Note that global_tables is included in this array. $globals = array('path' => BP_PLUGIN_DIR, 'slug' => BP_FRIENDS_SLUG, 'has_directory' => false, 'search_string' => __('Search Friends...', 'buddypress'), 'notification_callback' => 'friends_format_notifications', 'global_tables' => $global_tables); parent::setup_globals($globals); }
/** * Set up component global variables. * * The BP_ACTIVITY_SLUG constant is deprecated, and only used here for * backwards compatibility. * * @since 1.5.0 * * @see BP_Component::setup_globals() for a description of arguments. * * @param array $args See BP_Component::setup_globals() for a description. */ public function setup_globals($args = array()) { $bp = buddypress(); // Define a slug, if necessary. if (!defined('BP_ACTIVITY_SLUG')) { define('BP_ACTIVITY_SLUG', $this->id); } // Global tables for activity component. $global_tables = array('table_name' => $bp->table_prefix . 'bp_activity', 'table_name_meta' => $bp->table_prefix . 'bp_activity_meta'); // Metadata tables for groups component. $meta_tables = array('activity' => $bp->table_prefix . 'bp_activity_meta'); // All globals for activity component. // Note that global_tables is included in this array. $args = array('slug' => BP_ACTIVITY_SLUG, 'root_slug' => isset($bp->pages->activity->slug) ? $bp->pages->activity->slug : BP_ACTIVITY_SLUG, 'has_directory' => true, 'directory_title' => _x('Site-Wide Activity', 'component directory title', 'buddypress'), 'notification_callback' => 'bp_activity_format_notifications', 'search_string' => __('Search Activity...', 'buddypress'), 'global_tables' => $global_tables, 'meta_tables' => $meta_tables); parent::setup_globals($args); }
/** * Set up plugin's globals */ function setup_globals() { global $bp; if (!defined('BP_PORTFOLIO_SLUG')) { define('BP_PORTFOLIO_SLUG', $this->id); } if (!defined('BP_PORTFOLIO_DESC_MAX_SIZE')) { define('BP_PORTFOLIO_DESC_MAX_SIZE', get_option('bp_portfolio_desc_max_size')); } if (!defined('BP_PORTFOLIO_TEMPLATE')) { define('BP_PORTFOLIO_TEMPLATE', get_option('bp_portfolio_template')); } $global_tables = array('table_items_name' => $bp->table_prefix . BP_PORTFOLIO_ITEMS_TABLE); $globals = array('slug' => BP_PORTFOLIO_SLUG, 'root_slug' => isset($bp->pages->{$this->id}->slug) ? $bp->pages->{$this->id}->slug : BP_PORTFOLIO_SLUG, 'has_directory' => true, 'notification_callback' => 'bp_portfolio_format_notifications', 'search_string' => __('Search projects...', 'bp-portfolio'), 'global_tables' => $global_tables); parent::setup_globals($globals); }
/** * Set up component global data. * * @since 1.9.0 * * @see BP_Component::setup_globals() for a description of arguments. * * @param array $args See BP_Component::setup_globals() for a description. */ public function setup_globals($args = array()) { $bp = buddypress(); // Define a slug, if necessary. if (!defined('BP_NOTIFICATIONS_SLUG')) { define('BP_NOTIFICATIONS_SLUG', $this->id); } // Global tables for the notifications component. $global_tables = array('table_name' => $bp->table_prefix . 'bp_notifications', 'table_name_meta' => $bp->table_prefix . 'bp_notifications_meta'); // Metadata tables for notifications component. $meta_tables = array('notification' => $bp->table_prefix . 'bp_notifications_meta'); // All globals for the notifications component. // Note that global_tables is included in this array. $args = array('slug' => BP_NOTIFICATIONS_SLUG, 'has_directory' => false, 'search_string' => __('Search Notifications...', 'buddypress'), 'global_tables' => $global_tables, 'meta_tables' => $meta_tables); parent::setup_globals($args); }
/** * SETUP BUDDYPRESS GLOBAL OPTIONS * * @since BuddyBoss 2.0 */ function setup_globals($args = array()) { global $activity_template; // DEFAULT CONFIGURATION OPTIONS $this->options = array("POST_IN_WIRE_OPTIONS" => array(), "UPDATE_MENUS" => TRUE, "PERSONAL_TAB_NAME" => __('Wall', 'buddyboss'), "FEED_TAB_NAME" => __('News Feed', 'buddyboss'), "FAV_TAB_NAME" => __('My Likes', 'buddyboss'), "MENU_NAME" => __('Wall', 'buddyboss')); // Log buddyboss_log($this->options); // Update menu text, this needs to be in the global // setup function because these actions will have ran already if (isset($this->options['UPDATE_MENUS']) && $this->options['UPDATE_MENUS'] === true) { add_action('wp_before_admin_bar_render', array($this, 'update_wp_menus'), 99); add_action('bp_setup_nav', array($this, 'update_bp_menus'), 98); add_action('bp_setup_nav', array($this, 'bbg_remove_activity_friends_subnav'), 99); add_filter('bp_get_displayed_user_nav_activity', array($this, 'bbg_replace_activity_link')); } parent::setup_globals(); }
/** * Setup globals * * The BP_XPROFILE_SLUG constant is deprecated, and only used here for * backwards compatibility. * * @since 1.5 * @global obj $bp */ function setup_globals() { global $bp; // Define a slug, if necessary if (!defined('BP_XPROFILE_SLUG')) { define('BP_XPROFILE_SLUG', 'profile'); } // Assign the base group and fullname field names to constants to use // in SQL statements define('BP_XPROFILE_BASE_GROUP_NAME', stripslashes($bp->site_options['bp-xprofile-base-group-name'])); define('BP_XPROFILE_FULLNAME_FIELD_NAME', stripslashes($bp->site_options['bp-xprofile-fullname-field-name'])); // Set the support field type ids $this->field_types = apply_filters('xprofile_field_types', array('textbox', 'textarea', 'radio', 'checkbox', 'selectbox', 'multiselectbox', 'datebox')); // Tables $global_tables = array('table_name_data' => $bp->table_prefix . 'bp_xprofile_data', 'table_name_groups' => $bp->table_prefix . 'bp_xprofile_groups', 'table_name_fields' => $bp->table_prefix . 'bp_xprofile_fields', 'table_name_meta' => $bp->table_prefix . 'bp_xprofile_meta'); $globals = array('slug' => BP_XPROFILE_SLUG, 'has_directory' => false, 'notification_callback' => 'xprofile_format_notifications', 'global_tables' => $global_tables); parent::setup_globals($globals); }
/** * Set up bp-friends global settings. * * The BP_FRIENDS_SLUG constant is deprecated, and only used here for * backwards compatibility. * * @since 1.5.0 * * @see BP_Component::setup_globals() for description of parameters. * * @param array $args See {@link BP_Component::setup_globals()}. */ public function setup_globals($args = array()) { $bp = buddypress(); // Deprecated. Do not use. // Defined conditionally to support unit tests. if (!defined('BP_FRIENDS_DB_VERSION')) { define('BP_FRIENDS_DB_VERSION', '1800'); } // Define a slug, if necessary. if (!defined('BP_FRIENDS_SLUG')) { define('BP_FRIENDS_SLUG', $this->id); } // Global tables for the friends component. $global_tables = array('table_name' => $bp->table_prefix . 'bp_friends', 'table_name_meta' => $bp->table_prefix . 'bp_friends_meta'); // All globals for the friends component. // Note that global_tables is included in this array. $args = array('slug' => BP_FRIENDS_SLUG, 'has_directory' => false, 'search_string' => __('Search Friends...', 'buddypress'), 'notification_callback' => 'friends_format_notifications', 'global_tables' => $global_tables); parent::setup_globals($args); }
/** * Set up globals * * @package Rendez_Vous * @subpackage Component * * @since Rendez Vous (1.0.0) */ function setup_globals($args = array()) { // Set up the $globals array to be passed along to parent::setup_globals() $args = array('slug' => rendez_vous()->get_component_slug(), 'notification_callback' => 'rendez_vous_format_notifications', 'search_string' => __('Search Rendez-vous...', 'rendez-vous')); // Let BP_Component::setup_globals() do its work. parent::setup_globals($args); /** * Filter to change user's default subnav * * @since Rendez Vous (1.1.0) * * @param string default subnav to use (shedule or attend) */ $this->default_subnav = apply_filters('rendez_vous_member_default_subnav', rendez_vous()->get_schedule_slug()); $this->subnav_position = array('schedule' => 10, 'attend' => 20); if (rendez_vous()->get_attend_slug() == $this->default_subnav) { $this->subnav_position['attend'] = 5; } }