コード例 #1
0
 /**
  * Register the new post type "portfolio"
  */
 function register_post_types()
 {
     $labels = array('name' => __('Projects', 'bp-portfolio'), 'singular' => __('Project', 'bp-portfolio'));
     // Set up the argument array for register_post_type()
     $args = array('label' => __('Projects', 'bp-portfolio'), 'labels' => $labels, 'public' => false, 'show_ui' => true, 'supports' => array('title'), 'rewrite' => TRUE, 'rewrite' => array('slug' => 'project', 'with_front' => FALSE));
     register_post_type('portfolio', $args);
     parent::register_post_types();
 }
コード例 #2
0
 /**
  * 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);
 }
コード例 #3
0
 /**
  * Plugin settings
  */
 function __construct()
 {
     parent::start('bp_smp', __('BuddyPress Social Media Profiles', 'bp-smp'), BP_SMP_PLUGIN_DIR);
     $this->setup_hooks();
     if (is_super_admin() && (is_admin() || is_network_admin())) {
         include BP_SMP_PLUGIN_DIR . 'includes/admin.php';
         $this->admin = new BP_SMP_Admin();
     }
 }
コード例 #4
0
ファイル: cp-bp.php プロジェクト: clarkewd/CollabPress
 /**
  * Set up navigation
  *
  * @since 1.3
  */
 function setup_nav($main_nav = array(), $sub_nav = array())
 {
     // Add 'Example' to the main navigation
     $main_nav = array('name' => __('Projects', 'collabpress'), 'slug' => $this->slug, 'position' => 44, 'screen_function' => array($this, 'template_loader'), 'default_subnav_slug' => 'tasks', 'show_for_displayed_user' => array($this, 'show_tab_for_current_user'));
     $projects_link = trailingslashit(bp_loggedin_user_domain() . $this->slug);
     // Add a few subnav items under the main Example tab
     $sub_nav[] = array('name' => bp_is_my_profile() ? __('My Tasks', 'collabpress') : sprintf(__('%s&#8217s Tasks', 'collabpress'), bp_get_user_firstname()), 'slug' => 'tasks', 'parent_url' => $projects_link, 'parent_slug' => $this->slug, 'screen_function' => array($this, 'template_loader'), 'position' => 10);
     parent::setup_nav($main_nav, $sub_nav);
 }
コード例 #5
0
 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);
 }
コード例 #6
0
 /**
  * Set up actions necessary for the component.
  *
  * @since BuddyPress (1.6)
  */
 public function setup_actions()
 {
     add_action('humcore_deposits_results_deposit_sub_types', array($this, 'humcore_deposits_results_deposit_sub_types'));
     add_action('bp_before_directory_deposits_content', array($this, 'humcore_before_directory_deposits_content'));
     add_action('humcore_deposits_list_entry_content', 'humcore_deposits_list_entry_content');
     add_action('humcore_deposits_entry_content', 'humcore_deposits_entry_content');
     add_action('humcore_deposit_item_content', 'humcore_deposit_item_content');
     add_action('humcore_deposit_item_review_content', 'humcore_deposit_item_review_content');
     add_action('bp_activity_filter_options', array($this, 'display_activity_actions'));
     add_action('bp_member_activity_filter_options', array($this, 'display_activity_actions'));
     add_action('bp_setup_nav', array($this, 'humcore_setup_deposit_group_nav'));
     parent::setup_actions();
 }
コード例 #7
0
ファイル: bmt-class.php プロジェクト: tvolmari/hammydowns
 /**
  * SETUP ACTIONS
  *
  * @since  BuddyBoss BMT 1.0
  */
 public function setup_actions()
 {
     // Add body class
     add_filter('body_class', array($this, 'body_class'));
     add_action('bp_members_directory_member_types', array($this, 'bpt_members_directory'));
     add_action('bp_pre_user_query_construct', array($this, 'bpt_members_query'), 1, 1);
     //Check hide member is not checked in setting
     $is_member_type_field_visible = buddyboss_bmt()->option('hide_member_type_field');
     if (empty($is_member_type_field_visible)) {
         add_action('bp_signup_profile_fields', array($this, 'bmt_member_type_option'));
     }
     // For welcome exp
     if (function_exists('bwe_load_admin')) {
         add_action('bwe_after_signup_profile_fields', array($this, 'bmt_member_type_option'));
     }
     add_action('admin_enqueue_scripts', array($this, 'bmt_member_type_admin_style'));
     parent::setup_actions();
 }
コード例 #8
0
 function setup_admin_bar($wp_admin_nav = array())
 {
     global $bp;
     $directWorkflow = isDirectWorkflow();
     if (is_user_logged_in()) {
         if ($directWorkflow) {
             $postCount = custom_get_user_posts_count(array("publish", "draft"));
         } else {
             $postCount = custom_get_user_posts_count(array("publish", "pending", "draft"));
         }
         $user_domain = bp_loggedin_user_domain();
         $wp_admin_nav[] = array('parent' => 'my-account-buddypress', 'id' => 'my-account-social-articles', 'title' => __('Social Articles', 'social-articles'), 'href' => trailingslashit($user_domain . 'articles'));
         $wp_admin_nav[] = array('parent' => 'my-account-social-articles', 'title' => sprintf(__('My Articles <span class="count">%d</span>', 'social-articles'), $postCount), 'href' => trailingslashit($user_domain . 'articles'));
         $wp_admin_nav[] = array('parent' => 'my-account-social-articles', 'title' => sprintf(__('New Article', 'social-articles')), 'href' => trailingslashit($user_domain . 'articles/new'));
     }
     if ($this->check_visibility()) {
         parent::setup_admin_bar($wp_admin_nav);
     }
 }
コード例 #9
0
ファイル: bp-em-core.php プロジェクト: rajankz/webspace
 function setup_nav()
 {
     global $blog_id;
     //check multisite or normal mode for correct permission checking
     if (is_multisite() && $blog_id != BP_ROOT_BLOG) {
         //FIXME MS mode doesn't seem to recognize cross subsite caps, using the proper functions, for now we use switch_blog.
         $current_blog = $blog_id;
         switch_to_blog(BP_ROOT_BLOG);
         $can_manage_events = current_user_can_for_blog(BP_ROOT_BLOG, 'edit_events');
         $can_manage_locations = current_user_can_for_blog(BP_ROOT_BLOG, 'edit_locations');
         $can_manage_bookings = current_user_can_for_blog(BP_ROOT_BLOG, 'manage_bookings');
         switch_to_blog($current_blog);
     } else {
         $can_manage_events = current_user_can('edit_events');
         $can_manage_locations = current_user_can('edit_locations');
         $can_manage_bookings = current_user_can('manage_bookings');
     }
     /* Add 'Events' to the main user profile navigation */
     $main_nav = array('name' => __('Events', 'dbem'), 'slug' => em_bp_get_slug(), 'position' => 80, 'screen_function' => 'bp_em_events', 'default_subnav_slug' => 'profile');
     $em_link = trailingslashit(bp_loggedin_user_domain() . em_bp_get_slug());
     /* Create SubNav Items */
     $sub_nav[] = array('name' => __('My Profile', 'dbem'), 'slug' => 'profile', 'parent_slug' => em_bp_get_slug(), 'parent_url' => $em_link, 'screen_function' => 'bp_em_events', 'position' => 10);
     $sub_nav[] = array('name' => __('Events I\'m Attending', 'dbem'), 'slug' => 'attending', 'parent_slug' => em_bp_get_slug(), 'parent_url' => $em_link, 'screen_function' => 'bp_em_attending', 'position' => 20, 'user_has_access' => bp_is_my_profile());
     if ($can_manage_events) {
         $sub_nav[] = array('name' => __('My Events', 'dbem'), 'slug' => 'my-events', 'parent_slug' => em_bp_get_slug(), 'parent_url' => $em_link, 'screen_function' => 'bp_em_my_events', 'position' => 30, 'user_has_access' => bp_is_my_profile());
     }
     if ($can_manage_locations && get_option('dbem_locations_enabled')) {
         $sub_nav[] = array('name' => __('My Locations', 'dbem'), 'slug' => 'my-locations', 'parent_slug' => em_bp_get_slug(), 'parent_url' => $em_link, 'screen_function' => 'bp_em_my_locations', 'position' => 40, 'user_has_access' => bp_is_my_profile());
     }
     if ($can_manage_bookings && get_option('dbem_rsvp_enabled')) {
         $sub_nav[] = array('name' => __('My Event Bookings', 'dbem'), 'slug' => 'my-bookings', 'parent_slug' => em_bp_get_slug(), 'parent_url' => $em_link, 'screen_function' => 'bp_em_my_bookings', 'position' => 50, 'user_has_access' => bp_is_my_profile());
     }
     if (bp_is_active('groups')) {
         /* Create Profile Group Sub-Nav */
         $sub_nav[] = array('name' => __('Events', 'dbem'), 'slug' => 'group-events', 'parent_slug' => bp_get_groups_slug(), 'parent_url' => trailingslashit(bp_loggedin_user_domain() . bp_get_groups_slug()), 'screen_function' => 'bp_em_my_group_events', 'position' => 60, 'user_has_access' => bp_is_my_profile());
     }
     parent::setup_nav($main_nav, $sub_nav);
     add_action('bp_init', array(&$this, 'setup_group_nav'));
 }
コード例 #10
0
 /**
  * Sets up the title for pages and <title>
  *
  * @global obj $bp
  */
 function setup_title()
 {
     global $bp;
     if (bp_is_my_profile()) {
         $bp->bp_options_title = __('You', 'buddypress');
     } elseif (bp_is_user()) {
         $bp->bp_options_avatar = bp_core_fetch_avatar(array('item_id' => bp_displayed_user_id(), 'type' => 'thumb'));
         $bp->bp_options_title = $bp->displayed_user->fullname;
     }
     parent::setup_title();
 }
コード例 #11
0
 /**
  * Set-up our buddypress navigation which
  * are accesible in members and groups nav
  *
  * @param  array $main_nav The main navigation for groups.
  * @param  array $sub_nav The sub navigation of groups.
  * @return void
  */
 function setup_nav($main_nav = array(), $sub_nav = array())
 {
     $main_nav = array('name' => $this->name, 'slug' => $this->id, 'position' => 80, 'screen_function' => 'task_breaker_bp_projects_main_screen_function', 'default_subnav_slug' => 'all');
     // Add a few subnav items under the main tab.
     $sub_nav[] = array('name' => __('My Projects', 'task_breaker'), 'slug' => 'all', 'parent_url' => bp_loggedin_user_domain() . '' . $this->id . '/', 'parent_slug' => 'projects', 'screen_function' => 'task_breaker_bp_projects_main_screen_function', 'position' => 10);
     // Edit subnav.
     $sub_nav[] = array('name' => __('New Project', 'task_breaker'), 'slug' => 'new', 'parent_url' => bp_loggedin_user_domain() . '' . $this->id . '/', 'parent_slug' => 'projects', 'screen_function' => 'task_breaker_bp_projects_main_screen_function_new_project', 'position' => 10);
     parent::setup_nav($main_nav, $sub_nav);
     return;
 }
コード例 #12
0
ファイル: bp-em-core.php プロジェクト: batruji/metareading
 function setup_admin_bar()
 {
     global $bp, $blog_id;
     // Prevent debug notices
     $wp_admin_nav = array();
     // Menus for logged in user
     if (is_user_logged_in()) {
         //check multisite or normal mode for correct permission checking
         if (is_multisite() && $blog_id != BP_ROOT_BLOG) {
             //FIXME MS mode doesn't seem to recognize cross subsite caps, using the proper functions, for now we use switch_blog.
             $current_blog = $blog_id;
             switch_to_blog(BP_ROOT_BLOG);
             $can_manage_events = current_user_can_for_blog(BP_ROOT_BLOG, 'edit_events');
             $can_manage_locations = current_user_can_for_blog(BP_ROOT_BLOG, 'edit_locations');
             $can_manage_bookings = current_user_can_for_blog(BP_ROOT_BLOG, 'manage_bookings');
             switch_to_blog($current_blog);
         } else {
             $can_manage_events = current_user_can('edit_events');
             $can_manage_locations = current_user_can('edit_locations');
             $can_manage_bookings = current_user_can('manage_bookings');
         }
         $em_link = trailingslashit(bp_loggedin_user_domain() . em_bp_get_slug());
         /* Add 'Events' to the main user profile navigation */
         $wp_admin_nav[] = array('parent' => $bp->my_account_menu_id, 'id' => 'my-em-' . $this->id, 'title' => __('Events', 'dbem'), 'href' => $em_link);
         /* Create SubNav Items */
         $wp_admin_nav[] = array('parent' => 'my-em-' . $this->id, 'id' => 'my-em-' . $this->id . '-profile', 'title' => __('My Profile', 'dbem'), 'href' => $em_link . 'profile/');
         $wp_admin_nav[] = array('parent' => 'my-em-' . $this->id, 'id' => 'my-em-' . $this->id . '-attending', 'title' => __('Events I\'m Attending', 'dbem'), 'href' => $em_link . 'attending/');
         if ($can_manage_events) {
             $wp_admin_nav[] = array('parent' => 'my-em-' . $this->id, 'id' => 'my-em-' . $this->id . '-my-events', 'title' => __('My Events', 'dbem'), 'href' => $em_link . 'my-events/');
         }
         if ($can_manage_locations && get_option('dbem_locations_enabled')) {
             $wp_admin_nav[] = array('parent' => 'my-em-' . $this->id, 'id' => 'my-em-' . $this->id . '-my-locations', 'title' => __('My Locations', 'dbem'), 'href' => $em_link . 'my-locations/');
         }
         if ($can_manage_bookings && get_option('dbem_rsvp_enabled')) {
             $wp_admin_nav[] = array('parent' => 'my-em-' . $this->id, 'id' => 'my-em-' . $this->id . '-my-bookings', 'title' => __('My Event Bookings', 'dbem'), 'href' => $em_link . 'my-bookings/');
         }
         if (bp_is_active('groups')) {
             /* Create Profile Group Sub-Nav */
             $wp_admin_nav[] = array('parent' => 'my-account-groups', 'id' => 'my-account-groups-' . $this->id, 'title' => __('Events', 'dbem'), 'href' => trailingslashit(bp_loggedin_user_domain() . bp_get_groups_slug()) . 'group-events/');
         }
     }
     parent::setup_admin_bar($wp_admin_nav);
 }
コード例 #13
0
 /**
  * Builds the user's navigation in WP Admin Bar
  *
  * @package WP Idea Stream
  * @subpackage buddypress/loader
  *
  * @since 2.0.0
  *
  * @uses is_user_logged_in() to check if the user is logged in
  * @uses bp_loggedin_user_domain() to get current user's profile link
  */
 public function setup_admin_bar($wp_admin_nav = array())
 {
     // Menus for logged in user
     if (!is_user_logged_in()) {
         return;
     }
     // Build logged in user's ideas BuddyPress profile link
     $idea_link = trailingslashit(bp_loggedin_user_domain() . $this->slug);
     // Build logged in user main nav
     $wp_admin_nav[] = array('parent' => 'my-account-buddypress', 'id' => 'my-account-' . $this->slug, 'title' => $this->name, 'href' => $idea_link);
     foreach ($this->idea_nav as $key => $nav) {
         $wp_admin_nav[] = array('parent' => 'my-account-' . $this->slug, 'id' => 'my-account-' . $this->slug . '-' . $key, 'title' => $nav['name'], 'href' => trailingslashit($idea_link . $nav['slug']));
     }
     parent::setup_admin_bar($wp_admin_nav);
 }
コード例 #14
0
 /**
  * Setup cache groups
  *
  * @since 2.2.0
  */
 public function setup_cache_groups()
 {
     // Global groups.
     wp_cache_add_global_groups(array('bp_groups', 'bp_group_admins', 'bp_group_invite_count', 'group_meta'));
     parent::setup_cache_groups();
 }
コード例 #15
0
 /**
  * Setup cache groups
  *
  * @since 2.2.0
  */
 public function setup_cache_groups()
 {
     // Global groups
     wp_cache_add_global_groups(array('bp_messages', 'bp_messages_threads', 'bp_messages_unread_count', 'message_meta'));
     parent::setup_cache_groups();
 }
コード例 #16
0
 /**
  * Set up the Toolbar.
  *
  * @param array $wp_admin_nav See {BP_Component::setup_admin_bar()}
  *        for details.
  */
 public function setup_admin_bar($wp_admin_nav = array())
 {
     $bp = buddypress();
     // Menus for logged in user if the members gallery is enabled
     if (is_user_logged_in() && mpp_is_enabled('members', bp_loggedin_user_id())) {
         $component = 'members';
         $component_id = get_current_user_id();
         $gallery_link = trailingslashit(mpp_get_gallery_base_url($component, $component_id));
         $title = __('Gallery', 'mediapress');
         $my_galleries = __('My Gallery', 'mediapress');
         $create = __('Create', 'mediapress');
         // Add main mediapress menu
         $wp_admin_nav[] = array('parent' => $bp->my_account_menu_id, 'id' => 'my-account-' . $this->id, 'title' => $title, 'href' => trailingslashit($gallery_link));
         // Add main mediapress menu
         $wp_admin_nav[] = array('parent' => 'my-account-' . $this->id, 'id' => 'my-account-' . $this->id . '-my-galleries', 'title' => $my_galleries, 'href' => trailingslashit($gallery_link));
         if (mpp_user_can_create_gallery($component, $component_id)) {
             $wp_admin_nav[] = array('parent' => 'my-account-' . $this->id, 'id' => 'my-account-' . $this->id . '-create', 'title' => $create, 'href' => mpp_get_gallery_create_url($component, $component_id));
         }
     }
     parent::setup_admin_bar($wp_admin_nav);
 }
コード例 #17
0
 /**
  * Setup cache groups
  *
  * @since BuddyPress (2.2.0)
  */
 public function setup_cache_groups()
 {
     // Global groups
     wp_cache_add_global_groups(array('bp_xprofile', 'bp_xprofile_data', 'bp_xprofile_groups', 'xprofile_meta'));
     parent::setup_cache_groups();
 }
コード例 #18
0
 /**
  * Sets up the title for pages and <title>
  *
  * @global obj $bp
  */
 function setup_title()
 {
     global $bp;
     if (bp_is_messages_component()) {
         if (bp_is_my_profile()) {
             $bp->bp_options_title = __('My Messages', 'buddypress');
         } else {
             $bp->bp_options_avatar = bp_core_fetch_avatar(array('item_id' => $bp->displayed_user->id, 'type' => 'thumb'));
             $bp->bp_options_title = $bp->displayed_user->fullname;
         }
     }
     parent::setup_title();
 }
コード例 #19
0
 /**
  * Sets up the title for pages and <title>
  *
  * @global BuddyPress $bp The one true BuddyPress instance
  */
 function setup_title()
 {
     global $bp;
     // Adjust title
     if (bp_is_friends_component()) {
         if (bp_is_my_profile()) {
             $bp->bp_options_title = __('Friendships', 'buddypress');
         } else {
             $bp->bp_options_avatar = bp_core_fetch_avatar(array('item_id' => bp_displayed_user_id(), 'type' => 'thumb', 'alt' => sprintf(__('Profile picture of %s', 'buddypress'), bp_get_displayed_user_fullname())));
             $bp->bp_options_title = bp_get_displayed_user_fullname();
         }
     }
     parent::setup_title();
 }
コード例 #20
0
 /**
  * Set up the Toolbar
  *
  * @global BuddyPress $bp The one true BuddyPress instance
  */
 function setup_admin_bar()
 {
     global $bp;
     // Prevent debug notices
     $wp_admin_nav = array();
     // Menus for logged in user
     if (is_user_logged_in()) {
         // Setup the logged in user variables
         $user_domain = bp_loggedin_user_domain();
         $settings_link = trailingslashit($user_domain . $this->slug);
         // Add main Settings menu
         $wp_admin_nav[] = array('parent' => $bp->my_account_menu_id, 'id' => 'my-account-' . $this->id, 'title' => __('Settings', 'buddypress'), 'href' => trailingslashit($settings_link));
         // General Account
         $wp_admin_nav[] = array('parent' => 'my-account-' . $this->id, 'id' => 'my-account-' . $this->id . '-general', 'title' => __('General', 'buddypress'), 'href' => trailingslashit($settings_link . 'general'));
         // Notifications
         $wp_admin_nav[] = array('parent' => 'my-account-' . $this->id, 'id' => 'my-account-' . $this->id . '-notifications', 'title' => __('Notifications', 'buddypress'), 'href' => trailingslashit($settings_link . 'notifications'));
         // Delete Account
         if (!bp_current_user_can('bp_moderate') && empty($bp->site_options['bp-disable-account-deletion'])) {
             $wp_admin_nav[] = array('parent' => 'my-account-' . $this->id, 'id' => 'my-account-' . $this->id . '-delete-account', 'title' => __('Delete Account', 'buddypress'), 'href' => trailingslashit($settings_link . 'delete-account'));
         }
     }
     parent::setup_admin_bar($wp_admin_nav);
 }
コード例 #21
0
 /**
  * Set up component navigation.
  *
  * @since BuddyPress (1.5.0)
  *
  * @see BP_Component::setup_nav() for a description of arguments.
  *
  * @param array $main_nav Optional. See BP_Component::setup_nav() for
  *        description.
  * @param array $sub_nav Optional. See BP_Component::setup_nav() for
  *        description.
  */
 public function setup_nav($main_nav = array(), $sub_nav = array())
 {
     $bp = buddypress();
     // If xprofile component is disabled, revert to WordPress profile
     if (!bp_is_active('xprofile')) {
         // Fallback values if xprofile is disabled
         if (!isset($bp->core->profile)) {
             $bp->core->profile = new stdClass();
         }
         $bp->core->profile->slug = 'profile';
         $bp->active_components[$bp->core->profile->slug] = $bp->core->profile->slug;
         // Add 'Profile' to the main navigation
         $main_nav = array('name' => __('Profile', 'buddypress'), 'slug' => $bp->core->profile->slug, 'position' => 20, 'screen_function' => 'bp_core_catch_profile_uri', 'default_subnav_slug' => 'public');
         $profile_link = trailingslashit(bp_loggedin_user_domain() . '/' . $bp->core->profile->slug);
         // Add the subnav items to the profile
         $sub_nav[] = array('name' => __('View', 'buddypress'), 'slug' => 'public', 'parent_url' => $profile_link, 'parent_slug' => $bp->core->profile->slug, 'screen_function' => 'bp_core_catch_profile_uri');
         parent::setup_nav($main_nav, $sub_nav);
     }
 }
コード例 #22
0
ファイル: buddyblog-loader.php プロジェクト: poweronio/mbsite
 /**
  * Sets up the title for pages and <title>
  *
  * @global BuddyPress $bp The one true BuddyPress instance
  */
 public function setup_title()
 {
     $bp = buddypress();
     if (bp_is_buddyblog_component()) {
         if (bp_is_my_profile() && !bp_is_single_item()) {
             $bp->bp_options_title = __('Posts', 'buddyblog');
         } elseif (!bp_is_my_profile() && !bp_is_single_item()) {
             $bp->bp_options_avatar = bp_core_fetch_avatar(array('item_id' => bp_displayed_user_id(), 'type' => 'thumb', 'alt' => sprintf(__('Profile picture of %s', 'buddyblog'), bp_get_displayed_user_fullname())));
             $bp->bp_options_title = bp_get_displayed_user_fullname();
             // We are viewing a single group, so set up the
             // group navigation menu using the $this->current_group global.
         }
     }
     parent::setup_title();
 }
コード例 #23
0
 /**
  * Set up the title for pages and the <title> element.
  */
 public function setup_title()
 {
     $bp = buddypress();
     // Adjust title based on view
     if (bp_is_forums_component()) {
         if (bp_is_my_profile()) {
             $bp->bp_options_title = __('Forums', 'buddypress');
         } else {
             $bp->bp_options_avatar = bp_core_fetch_avatar(array('item_id' => bp_displayed_user_id(), 'type' => 'thumb', 'alt' => sprintf(__('Profile picture of %s', 'buddypress'), bp_get_displayed_user_fullname())));
             $bp->bp_options_title = bp_get_displayed_user_fullname();
         }
     }
     parent::setup_title();
 }
コード例 #24
0
 /**
  * Sets up the title for pages and <title>
  *
  * @since 1.5.0
  *
  * @global object $bp BuddyPress global settings
  * @uses bp_is_activity_component()
  * @uses bp_is_my_profile()
  * @uses bp_core_fetch_avatar()
  */
 function setup_title()
 {
     global $bp;
     // Adjust title based on view
     if (bp_is_activity_component()) {
         if (bp_is_my_profile()) {
             $bp->bp_options_title = __('My Activity', 'buddypress');
         } else {
             $bp->bp_options_avatar = bp_core_fetch_avatar(array('item_id' => $bp->displayed_user->id, 'type' => 'thumb'));
             $bp->bp_options_title = $bp->displayed_user->fullname;
         }
     }
     parent::setup_title();
 }
 /**
  * Setup cache groups.
  *
  * @since 2.2.0
  */
 public function setup_cache_groups()
 {
     // Global groups.
     wp_cache_add_global_groups(array('bp_notifications', 'notification_meta'));
     parent::setup_cache_groups();
 }
コード例 #26
0
 /**
  * Set up actions necessary for the component.
  *
  * @since BuddyPress (1.6)
  */
 public function setup_actions()
 {
     // Spam prevention
     add_action('bp_include', 'bp_activity_setup_akismet');
     parent::setup_actions();
 }
コード例 #27
0
 /**
  * Setup cache groups
  *
  * @since BuddyPress (2.2.0)
  */
 public function setup_cache_groups()
 {
     // Global groups
     wp_cache_add_global_groups(array('bp_last_activity', 'bp_member_type'));
     parent::setup_cache_groups();
 }
コード例 #28
0
 /**
  * Setup cache groups.
  *
  * @since 2.2.0
  */
 public function setup_cache_groups()
 {
     // Global groups.
     wp_cache_add_global_groups(array('bp_activity', 'bp_activity_comments', 'activity_meta'));
     parent::setup_cache_groups();
 }
コード例 #29
0
 /**
  * Set up the Toolbar.
  *
  * @param array $wp_admin_nav Array of Admin Bar items.
  */
 public function setup_admin_bar($wp_admin_nav = array())
 {
     // Menus for logged in user
     if (is_user_logged_in()) {
         // Setup the logged in user variables
         $settings_link = trailingslashit(bp_loggedin_user_domain() . bp_get_settings_slug());
         // Add main Settings menu
         $wp_admin_nav[] = array('parent' => buddypress()->my_account_menu_id, 'id' => 'my-account-' . $this->id, 'title' => __('Settings', 'buddypress'), 'href' => $settings_link);
         // General Account
         $wp_admin_nav[] = array('parent' => 'my-account-' . $this->id, 'id' => 'my-account-' . $this->id . '-general', 'title' => __('General', 'buddypress'), 'href' => $settings_link);
         // Notifications - only add the tab when there is something to display there.
         if (has_action('bp_notification_settings')) {
             $wp_admin_nav[] = array('parent' => 'my-account-' . $this->id, 'id' => 'my-account-' . $this->id . '-notifications', 'title' => __('Email', 'buddypress'), 'href' => trailingslashit($settings_link . 'notifications'));
         }
         // Delete Account
         if (!bp_current_user_can('bp_moderate') && !bp_core_get_root_option('bp-disable-account-deletion')) {
             $wp_admin_nav[] = array('parent' => 'my-account-' . $this->id, 'id' => 'my-account-' . $this->id . '-delete-account', 'title' => __('Delete Account', 'buddypress'), 'href' => trailingslashit($settings_link . 'delete-account'));
         }
     }
     parent::setup_admin_bar($wp_admin_nav);
 }
コード例 #30
0
 /**
  * Setup globals.
  *
  * @since 0.0.1
  * @package BuddyPress_Compliments
  *
  * @global object $bp BuddyPress instance.
  * @param array $args Not being used.
  */
 public function setup_globals($args = array())
 {
     global $bp;
     // Set up the $globals array
     $globals = array('notification_callback' => 'bp_compliments_format_notifications', 'global_tables' => array('table_name' => BP_COMPLIMENTS_TABLE));
     // 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->compliments->compliments = new stdClass();
     $bp->compliments->compliments->slug = constant('BP_COMPLIMENTS_SLUG');
     // locally cache total count values for logged-in user
     if (is_user_logged_in()) {
         $bp->loggedin_user->total_compliment_counts = bp_compliments_total_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_compliment_counts = bp_compliments_total_counts(array('user_id' => bp_displayed_user_id()));
     }
 }