Ticket #7239: 7239-3.patch
| File 7239-3.patch, 25.7 KB (added by , 10 years ago) |
|---|
-
src/bp-activity/bp-activity-loader.php
17 17 } 18 18 19 19 /** 20 * Bootstrap the Activity component.20 * Set up the bp-activity component. 21 21 * 22 22 * @since 1.6.0 23 23 */ -
src/bp-blogs/bp-blogs-loader.php
20 20 21 21 /** 22 22 * Set up the bp-blogs component. 23 * 24 * @since 1.5.0 23 25 */ 24 26 function bp_setup_blogs() { 25 27 buddypress()->blogs = new BP_Blogs_Component(); -
src/bp-core/bp-core-loader.php
18 18 } 19 19 20 20 /** 21 * Set up the BuddyPress Core component.21 * Set up the bp-core component. 22 22 * 23 23 * @since 1.6.0 24 *25 * @global BuddyPress $bp BuddyPress global settings object.26 24 */ 27 25 function bp_setup_core() { 28 26 buddypress()->core = new BP_Core(); -
src/bp-forums/bp-forums-loader.php
15 15 // Exit if accessed directly. 16 16 defined( 'ABSPATH' ) || exit; 17 17 18 /** 19 * Sets up the forums component. 20 * 21 * @since 1.5.0 22 */ 23 class BP_Forums_Component extends BP_Component { 24 25 /** 26 * Start the forums component creation process. 27 * 28 * @since 1.5.0 29 */ 30 public function __construct() { 31 parent::start( 32 'forums', 33 __( 'Discussion Forums', 'buddypress' ), 34 buddypress()->plugin_dir, 35 array( 36 'adminbar_myaccount_order' => 80 37 ) 38 ); 39 } 40 41 /** 42 * Set up bp-forums global settings. 43 * 44 * The BP_FORUMS_SLUG constant is deprecated, and only used here for 45 * backwards compatibility. 46 * 47 * @since 1.5.0 48 * 49 * @see BP_Component::setup_globals() for description of parameters. 50 * 51 * @param array $args See {@link BP_Component::setup_globals()}. 52 */ 53 public function setup_globals( $args = array() ) { 54 $bp = buddypress(); 55 56 // Define the parent forum ID. 57 if ( ! defined( 'BP_FORUMS_PARENT_FORUM_ID' ) ) { 58 define( 'BP_FORUMS_PARENT_FORUM_ID', 1 ); 59 } 60 61 // Define a slug, if necessary. 62 if ( ! defined( 'BP_FORUMS_SLUG' ) ) { 63 define( 'BP_FORUMS_SLUG', $this->id ); 64 } 65 66 // The location of the bbPress stand-alone config file. 67 $bbconfig = bp_core_get_root_option( 'bb-config-location' ); 68 if ( '' !== $bbconfig ) { 69 $this->bbconfig = $bbconfig; 70 } 71 72 // All globals for messaging component. 73 // Note that global_tables is included in this array. 74 $globals = array( 75 'slug' => BP_FORUMS_SLUG, 76 'root_slug' => isset( $bp->pages->forums->slug ) ? $bp->pages->forums->slug : BP_FORUMS_SLUG, 77 'has_directory' => true, 78 'notification_callback' => 'messages_format_notifications', 79 'search_string' => __( 'Search Forums...', 'buddypress' ), 80 ); 81 82 parent::setup_globals( $globals ); 83 } 84 85 /** 86 * Include bp-forums files. 87 * 88 * @since 1.5.0 89 * 90 * @see BP_Component::includes() for description of parameters. 91 * 92 * @param array $includes See {@link BP_Component::includes()}. 93 */ 94 public function includes( $includes = array() ) { 95 96 // Files to include. 97 $includes = array( 98 'actions', 99 'screens', 100 'classes', 101 'filters', 102 'template', 103 'functions', 104 ); 105 106 // bbPress stand-alone. 107 if ( ! defined( 'BB_PATH' ) ) { 108 $includes[] = 'bbpress-sa'; 109 } 110 111 // Admin-specific code. 112 if ( is_admin() ) { 113 $includes[] = 'deprecated/1.6'; 114 $includes[] = 'deprecated/1.7'; 115 } 116 117 parent::includes( $includes ); 118 } 119 120 /** 121 * Set up component navigation. 122 * 123 * @since 1.5.0 124 * 125 * @see BP_Component::setup_nav() for a description of arguments. 126 * 127 * @param array $main_nav Optional. See BP_Component::setup_nav() for 128 * description. 129 * @param array $sub_nav Optional. See BP_Component::setup_nav() for 130 * description. 131 */ 132 public function setup_nav( $main_nav = array(), $sub_nav = array() ) { 133 134 // Stop if forums haven't been set up yet. 135 if ( ! bp_forums_is_installed_correctly() ) { 136 return; 137 } 138 139 // Stop if there is no user displayed or logged in. 140 if ( ! is_user_logged_in() && ! bp_displayed_user_id() ) { 141 return; 142 } 143 144 // Determine user to use. 145 if ( bp_displayed_user_domain() ) { 146 $user_domain = bp_displayed_user_domain(); 147 } elseif ( bp_loggedin_user_domain() ) { 148 $user_domain = bp_loggedin_user_domain(); 149 } else { 150 return; 151 } 152 153 // User link. 154 $slug = bp_get_forums_slug(); 155 $forums_link = trailingslashit( $user_domain . $slug ); 156 157 // Add 'Forums' to the main navigation. 158 $main_nav = array( 159 'name' => __( 'Forums', 'buddypress' ), 160 'slug' => $slug, 161 'position' => 80, 162 'screen_function' => 'bp_member_forums_screen_topics', 163 'default_subnav_slug' => 'topics', 164 'item_css_id' => $this->id 165 ); 166 167 // Topics started. 168 $sub_nav[] = array( 169 'name' => __( 'Topics Started', 'buddypress' ), 170 'slug' => 'topics', 171 'parent_url' => $forums_link, 172 'parent_slug' => $slug, 173 'screen_function' => 'bp_member_forums_screen_topics', 174 'position' => 20, 175 'item_css_id' => 'topics' 176 ); 177 178 // Topics replied to. 179 $sub_nav[] = array( 180 'name' => __( 'Replied To', 'buddypress' ), 181 'slug' => 'replies', 182 'parent_url' => $forums_link, 183 'parent_slug' => $slug, 184 'screen_function' => 'bp_member_forums_screen_replies', 185 'position' => 40, 186 'item_css_id' => 'replies' 187 ); 188 189 parent::setup_nav( $main_nav, $sub_nav ); 190 } 191 192 /** 193 * Set up bp-forums integration with the WordPress admin bar. 194 * 195 * @since 1.5.0 196 * 197 * @see BP_Component::setup_admin_bar() for a description of arguments. 198 * 199 * @param array $wp_admin_nav See BP_Component::setup_admin_bar() 200 * for description. 201 */ 202 public function setup_admin_bar( $wp_admin_nav = array() ) { 203 204 // Menus for logged in user. 205 if ( is_user_logged_in() ) { 206 207 // Setup the logged in user variables. 208 $forums_link = trailingslashit( bp_loggedin_user_domain() . bp_get_forums_slug() ); 209 210 // Add the "My Account" sub menus. 211 $wp_admin_nav[] = array( 212 'parent' => buddypress()->my_account_menu_id, 213 'id' => 'my-account-' . $this->id, 214 'title' => __( 'Forums', 'buddypress' ), 215 'href' => $forums_link 216 ); 217 218 // Topics. 219 $wp_admin_nav[] = array( 220 'parent' => 'my-account-' . $this->id, 221 'id' => 'my-account-' . $this->id . '-topics-started', 222 'title' => __( 'Topics Started', 'buddypress' ), 223 'href' => $forums_link 224 ); 225 226 // Replies. 227 $wp_admin_nav[] = array( 228 'parent' => 'my-account-' . $this->id, 229 'id' => 'my-account-' . $this->id . '-replies', 230 'title' => __( 'Replies', 'buddypress' ), 231 'href' => trailingslashit( $forums_link . 'replies' ) 232 ); 233 234 // Favorites. 235 $wp_admin_nav[] = array( 236 'parent' => 'my-account-' . $this->id, 237 'id' => 'my-account-' . $this->id . '-favorite-topics', 238 'title' => __( 'Favorite Topics', 'buddypress' ), 239 'href' => trailingslashit( $forums_link . 'favorites' ) 240 ); 241 } 242 243 parent::setup_admin_bar( $wp_admin_nav ); 244 } 245 246 /** 247 * Set up the title for pages and the <title> element. 248 * 249 * @since 1.5.0 250 */ 251 public function setup_title() { 252 253 // Adjust title based on view. 254 if ( bp_is_forums_component() ) { 255 $bp = buddypress(); 256 257 if ( bp_is_my_profile() ) { 258 $bp->bp_options_title = __( 'Forums', 'buddypress' ); 259 } else { 260 $bp->bp_options_avatar = bp_core_fetch_avatar( array( 261 'item_id' => bp_displayed_user_id(), 262 'type' => 'thumb', 263 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() ) 264 ) ); 265 $bp->bp_options_title = bp_get_displayed_user_fullname(); 266 } 267 } 268 269 parent::setup_title(); 270 } 18 if ( ! buddypress()->do_autoload ) { 19 require dirname( __FILE__ ) . '/classes/class-bp-forums-component.php'; 271 20 } 272 21 273 22 /** -
src/bp-forums/classes/class-bp-forums-component.php
1 <?php 2 /** 3 * BuddyPress Forumns Loader. 4 * 5 * @package BuddyPress 6 * @subpackage Forums 7 * @since 1.5.0 8 */ 9 10 // Exit if accessed directly. 11 defined( 'ABSPATH' ) || exit; 12 13 /** 14 * Sets up the forums component. 15 * 16 * @since 1.5.0 17 */ 18 class BP_Forums_Component extends BP_Component { 19 20 /** 21 * Start the forums component creation process. 22 * 23 * @since 1.5.0 24 */ 25 public function __construct() { 26 parent::start( 27 'forums', 28 __( 'Discussion Forums', 'buddypress' ), 29 buddypress()->plugin_dir, 30 array( 31 'adminbar_myaccount_order' => 80 32 ) 33 ); 34 } 35 36 /** 37 * Set up bp-forums global settings. 38 * 39 * The BP_FORUMS_SLUG constant is deprecated, and only used here for 40 * backwards compatibility. 41 * 42 * @since 1.5.0 43 * 44 * @see BP_Component::setup_globals() for description of parameters. 45 * 46 * @param array $args See {@link BP_Component::setup_globals()}. 47 */ 48 public function setup_globals( $args = array() ) { 49 $bp = buddypress(); 50 51 // Define the parent forum ID. 52 if ( ! defined( 'BP_FORUMS_PARENT_FORUM_ID' ) ) { 53 define( 'BP_FORUMS_PARENT_FORUM_ID', 1 ); 54 } 55 56 // Define a slug, if necessary. 57 if ( ! defined( 'BP_FORUMS_SLUG' ) ) { 58 define( 'BP_FORUMS_SLUG', $this->id ); 59 } 60 61 // The location of the bbPress stand-alone config file. 62 $bbconfig = bp_core_get_root_option( 'bb-config-location' ); 63 if ( '' !== $bbconfig ) { 64 $this->bbconfig = $bbconfig; 65 } 66 67 // All globals for messaging component. 68 // Note that global_tables is included in this array. 69 $globals = array( 70 'slug' => BP_FORUMS_SLUG, 71 'root_slug' => isset( $bp->pages->forums->slug ) ? $bp->pages->forums->slug : BP_FORUMS_SLUG, 72 'has_directory' => true, 73 'notification_callback' => 'messages_format_notifications', 74 'search_string' => __( 'Search Forums...', 'buddypress' ), 75 ); 76 77 parent::setup_globals( $globals ); 78 } 79 80 /** 81 * Include bp-forums files. 82 * 83 * @since 1.5.0 84 * 85 * @see BP_Component::includes() for description of parameters. 86 * 87 * @param array $includes See {@link BP_Component::includes()}. 88 */ 89 public function includes( $includes = array() ) { 90 91 // Files to include. 92 $includes = array( 93 'actions', 94 'screens', 95 'classes', 96 'filters', 97 'template', 98 'functions', 99 ); 100 101 // bbPress stand-alone. 102 if ( ! defined( 'BB_PATH' ) ) { 103 $includes[] = 'bbpress-sa'; 104 } 105 106 // Admin-specific code. 107 if ( is_admin() ) { 108 $includes[] = 'deprecated/1.6'; 109 $includes[] = 'deprecated/1.7'; 110 } 111 112 parent::includes( $includes ); 113 } 114 115 /** 116 * Set up component navigation. 117 * 118 * @since 1.5.0 119 * 120 * @see BP_Component::setup_nav() for a description of arguments. 121 * 122 * @param array $main_nav Optional. See BP_Component::setup_nav() for 123 * description. 124 * @param array $sub_nav Optional. See BP_Component::setup_nav() for 125 * description. 126 */ 127 public function setup_nav( $main_nav = array(), $sub_nav = array() ) { 128 129 // Stop if forums haven't been set up yet. 130 if ( ! bp_forums_is_installed_correctly() ) { 131 return; 132 } 133 134 // Stop if there is no user displayed or logged in. 135 if ( ! is_user_logged_in() && ! bp_displayed_user_id() ) { 136 return; 137 } 138 139 // Determine user to use. 140 if ( bp_displayed_user_domain() ) { 141 $user_domain = bp_displayed_user_domain(); 142 } elseif ( bp_loggedin_user_domain() ) { 143 $user_domain = bp_loggedin_user_domain(); 144 } else { 145 return; 146 } 147 148 // User link. 149 $slug = bp_get_forums_slug(); 150 $forums_link = trailingslashit( $user_domain . $slug ); 151 152 // Add 'Forums' to the main navigation. 153 $main_nav = array( 154 'name' => __( 'Forums', 'buddypress' ), 155 'slug' => $slug, 156 'position' => 80, 157 'screen_function' => 'bp_member_forums_screen_topics', 158 'default_subnav_slug' => 'topics', 159 'item_css_id' => $this->id 160 ); 161 162 // Topics started. 163 $sub_nav[] = array( 164 'name' => __( 'Topics Started', 'buddypress' ), 165 'slug' => 'topics', 166 'parent_url' => $forums_link, 167 'parent_slug' => $slug, 168 'screen_function' => 'bp_member_forums_screen_topics', 169 'position' => 20, 170 'item_css_id' => 'topics' 171 ); 172 173 // Topics replied to. 174 $sub_nav[] = array( 175 'name' => __( 'Replied To', 'buddypress' ), 176 'slug' => 'replies', 177 'parent_url' => $forums_link, 178 'parent_slug' => $slug, 179 'screen_function' => 'bp_member_forums_screen_replies', 180 'position' => 40, 181 'item_css_id' => 'replies' 182 ); 183 184 parent::setup_nav( $main_nav, $sub_nav ); 185 } 186 187 /** 188 * Set up bp-forums integration with the WordPress admin bar. 189 * 190 * @since 1.5.0 191 * 192 * @see BP_Component::setup_admin_bar() for a description of arguments. 193 * 194 * @param array $wp_admin_nav See BP_Component::setup_admin_bar() 195 * for description. 196 */ 197 public function setup_admin_bar( $wp_admin_nav = array() ) { 198 199 // Menus for logged in user. 200 if ( is_user_logged_in() ) { 201 202 // Setup the logged in user variables. 203 $forums_link = trailingslashit( bp_loggedin_user_domain() . bp_get_forums_slug() ); 204 205 // Add the "My Account" sub menus. 206 $wp_admin_nav[] = array( 207 'parent' => buddypress()->my_account_menu_id, 208 'id' => 'my-account-' . $this->id, 209 'title' => __( 'Forums', 'buddypress' ), 210 'href' => $forums_link 211 ); 212 213 // Topics. 214 $wp_admin_nav[] = array( 215 'parent' => 'my-account-' . $this->id, 216 'id' => 'my-account-' . $this->id . '-topics-started', 217 'title' => __( 'Topics Started', 'buddypress' ), 218 'href' => $forums_link 219 ); 220 221 // Replies. 222 $wp_admin_nav[] = array( 223 'parent' => 'my-account-' . $this->id, 224 'id' => 'my-account-' . $this->id . '-replies', 225 'title' => __( 'Replies', 'buddypress' ), 226 'href' => trailingslashit( $forums_link . 'replies' ) 227 ); 228 229 // Favorites. 230 $wp_admin_nav[] = array( 231 'parent' => 'my-account-' . $this->id, 232 'id' => 'my-account-' . $this->id . '-favorite-topics', 233 'title' => __( 'Favorite Topics', 'buddypress' ), 234 'href' => trailingslashit( $forums_link . 'favorites' ) 235 ); 236 } 237 238 parent::setup_admin_bar( $wp_admin_nav ); 239 } 240 241 /** 242 * Set up the title for pages and the <title> element. 243 * 244 * @since 1.5.0 245 */ 246 public function setup_title() { 247 248 // Adjust title based on view. 249 if ( bp_is_forums_component() ) { 250 $bp = buddypress(); 251 252 if ( bp_is_my_profile() ) { 253 $bp->bp_options_title = __( 'Forums', 'buddypress' ); 254 } else { 255 $bp->bp_options_avatar = bp_core_fetch_avatar( array( 256 'item_id' => bp_displayed_user_id(), 257 'type' => 'thumb', 258 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() ) 259 ) ); 260 $bp->bp_options_title = bp_get_displayed_user_fullname(); 261 } 262 } 263 264 parent::setup_title(); 265 } 266 } -
src/bp-forums/classes/class-bp-forums-component.php
1 <?php 2 /** 3 * BuddyPress Forumns Loader. 4 * 5 * @package BuddyPress 6 * @subpackage Forums 7 * @since 1.5.0 8 */ 9 10 // Exit if accessed directly. 11 defined( 'ABSPATH' ) || exit; 12 13 /** 14 * Sets up the forums component. 15 * 16 * @since 1.5.0 17 */ 18 class BP_Forums_Component extends BP_Component { 19 20 /** 21 * Start the forums component creation process. 22 * 23 * @since 1.5.0 24 */ 25 public function __construct() { 26 parent::start( 27 'forums', 28 __( 'Discussion Forums', 'buddypress' ), 29 buddypress()->plugin_dir, 30 array( 31 'adminbar_myaccount_order' => 80 32 ) 33 ); 34 } 35 36 /** 37 * Set up bp-forums global settings. 38 * 39 * The BP_FORUMS_SLUG constant is deprecated, and only used here for 40 * backwards compatibility. 41 * 42 * @since 1.5.0 43 * 44 * @see BP_Component::setup_globals() for description of parameters. 45 * 46 * @param array $args See {@link BP_Component::setup_globals()}. 47 */ 48 public function setup_globals( $args = array() ) { 49 $bp = buddypress(); 50 51 // Define the parent forum ID. 52 if ( ! defined( 'BP_FORUMS_PARENT_FORUM_ID' ) ) { 53 define( 'BP_FORUMS_PARENT_FORUM_ID', 1 ); 54 } 55 56 // Define a slug, if necessary. 57 if ( ! defined( 'BP_FORUMS_SLUG' ) ) { 58 define( 'BP_FORUMS_SLUG', $this->id ); 59 } 60 61 // The location of the bbPress stand-alone config file. 62 $bbconfig = bp_core_get_root_option( 'bb-config-location' ); 63 if ( '' !== $bbconfig ) { 64 $this->bbconfig = $bbconfig; 65 } 66 67 // All globals for messaging component. 68 // Note that global_tables is included in this array. 69 $globals = array( 70 'slug' => BP_FORUMS_SLUG, 71 'root_slug' => isset( $bp->pages->forums->slug ) ? $bp->pages->forums->slug : BP_FORUMS_SLUG, 72 'has_directory' => true, 73 'notification_callback' => 'messages_format_notifications', 74 'search_string' => __( 'Search Forums...', 'buddypress' ), 75 ); 76 77 parent::setup_globals( $globals ); 78 } 79 80 /** 81 * Include bp-forums files. 82 * 83 * @since 1.5.0 84 * 85 * @see BP_Component::includes() for description of parameters. 86 * 87 * @param array $includes See {@link BP_Component::includes()}. 88 */ 89 public function includes( $includes = array() ) { 90 91 // Files to include. 92 $includes = array( 93 'actions', 94 'screens', 95 'classes', 96 'filters', 97 'template', 98 'functions', 99 ); 100 101 // bbPress stand-alone. 102 if ( ! defined( 'BB_PATH' ) ) { 103 $includes[] = 'bbpress-sa'; 104 } 105 106 // Admin-specific code. 107 if ( is_admin() ) { 108 $includes[] = 'deprecated/1.6'; 109 $includes[] = 'deprecated/1.7'; 110 } 111 112 parent::includes( $includes ); 113 } 114 115 /** 116 * Set up component navigation. 117 * 118 * @since 1.5.0 119 * 120 * @see BP_Component::setup_nav() for a description of arguments. 121 * 122 * @param array $main_nav Optional. See BP_Component::setup_nav() for 123 * description. 124 * @param array $sub_nav Optional. See BP_Component::setup_nav() for 125 * description. 126 */ 127 public function setup_nav( $main_nav = array(), $sub_nav = array() ) { 128 129 // Stop if forums haven't been set up yet. 130 if ( ! bp_forums_is_installed_correctly() ) { 131 return; 132 } 133 134 // Stop if there is no user displayed or logged in. 135 if ( ! is_user_logged_in() && ! bp_displayed_user_id() ) { 136 return; 137 } 138 139 // Determine user to use. 140 if ( bp_displayed_user_domain() ) { 141 $user_domain = bp_displayed_user_domain(); 142 } elseif ( bp_loggedin_user_domain() ) { 143 $user_domain = bp_loggedin_user_domain(); 144 } else { 145 return; 146 } 147 148 // User link. 149 $slug = bp_get_forums_slug(); 150 $forums_link = trailingslashit( $user_domain . $slug ); 151 152 // Add 'Forums' to the main navigation. 153 $main_nav = array( 154 'name' => __( 'Forums', 'buddypress' ), 155 'slug' => $slug, 156 'position' => 80, 157 'screen_function' => 'bp_member_forums_screen_topics', 158 'default_subnav_slug' => 'topics', 159 'item_css_id' => $this->id 160 ); 161 162 // Topics started. 163 $sub_nav[] = array( 164 'name' => __( 'Topics Started', 'buddypress' ), 165 'slug' => 'topics', 166 'parent_url' => $forums_link, 167 'parent_slug' => $slug, 168 'screen_function' => 'bp_member_forums_screen_topics', 169 'position' => 20, 170 'item_css_id' => 'topics' 171 ); 172 173 // Topics replied to. 174 $sub_nav[] = array( 175 'name' => __( 'Replied To', 'buddypress' ), 176 'slug' => 'replies', 177 'parent_url' => $forums_link, 178 'parent_slug' => $slug, 179 'screen_function' => 'bp_member_forums_screen_replies', 180 'position' => 40, 181 'item_css_id' => 'replies' 182 ); 183 184 parent::setup_nav( $main_nav, $sub_nav ); 185 } 186 187 /** 188 * Set up bp-forums integration with the WordPress admin bar. 189 * 190 * @since 1.5.0 191 * 192 * @see BP_Component::setup_admin_bar() for a description of arguments. 193 * 194 * @param array $wp_admin_nav See BP_Component::setup_admin_bar() 195 * for description. 196 */ 197 public function setup_admin_bar( $wp_admin_nav = array() ) { 198 199 // Menus for logged in user. 200 if ( is_user_logged_in() ) { 201 202 // Setup the logged in user variables. 203 $forums_link = trailingslashit( bp_loggedin_user_domain() . bp_get_forums_slug() ); 204 205 // Add the "My Account" sub menus. 206 $wp_admin_nav[] = array( 207 'parent' => buddypress()->my_account_menu_id, 208 'id' => 'my-account-' . $this->id, 209 'title' => __( 'Forums', 'buddypress' ), 210 'href' => $forums_link 211 ); 212 213 // Topics. 214 $wp_admin_nav[] = array( 215 'parent' => 'my-account-' . $this->id, 216 'id' => 'my-account-' . $this->id . '-topics-started', 217 'title' => __( 'Topics Started', 'buddypress' ), 218 'href' => $forums_link 219 ); 220 221 // Replies. 222 $wp_admin_nav[] = array( 223 'parent' => 'my-account-' . $this->id, 224 'id' => 'my-account-' . $this->id . '-replies', 225 'title' => __( 'Replies', 'buddypress' ), 226 'href' => trailingslashit( $forums_link . 'replies' ) 227 ); 228 229 // Favorites. 230 $wp_admin_nav[] = array( 231 'parent' => 'my-account-' . $this->id, 232 'id' => 'my-account-' . $this->id . '-favorite-topics', 233 'title' => __( 'Favorite Topics', 'buddypress' ), 234 'href' => trailingslashit( $forums_link . 'favorites' ) 235 ); 236 } 237 238 parent::setup_admin_bar( $wp_admin_nav ); 239 } 240 241 /** 242 * Set up the title for pages and the <title> element. 243 * 244 * @since 1.5.0 245 */ 246 public function setup_title() { 247 248 // Adjust title based on view. 249 if ( bp_is_forums_component() ) { 250 $bp = buddypress(); 251 252 if ( bp_is_my_profile() ) { 253 $bp->bp_options_title = __( 'Forums', 'buddypress' ); 254 } else { 255 $bp->bp_options_avatar = bp_core_fetch_avatar( array( 256 'item_id' => bp_displayed_user_id(), 257 'type' => 'thumb', 258 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() ) 259 ) ); 260 $bp->bp_options_title = bp_get_displayed_user_fullname(); 261 } 262 } 263 264 parent::setup_title(); 265 } 266 } -
src/bp-friends/bp-friends-loader.php
17 17 } 18 18 19 19 /** 20 * Set up the bp-f orums component.20 * Set up the bp-friends component. 21 21 * 22 22 * @since 1.6.0 23 23 */ -
src/bp-groups/bp-groups-loader.php
19 19 } 20 20 21 21 /** 22 * Bootstrap the Notifications component.22 * Set up the bp-groups component. 23 23 * 24 24 * @since 1.5.0 25 25 */ -
src/bp-messages/bp-messages-loader.php
17 17 } 18 18 19 19 /** 20 * Bootstrap the Messages component. 20 * Set up the bp-messages component. 21 * 22 * @since 1.5.0 21 23 */ 22 24 function bp_setup_messages() { 23 25 buddypress()->messages = new BP_Messages_Component(); -
src/bp-notifications/bp-notifications-loader.php
17 17 } 18 18 19 19 /** 20 * Bootstrap the Notifications component.20 * Set up the bp-notifications component. 21 21 * 22 22 * @since 1.9.0 23 23 */ -
src/bp-settings/bp-settings-loader.php
15 15 } 16 16 17 17 /** 18 * Instantiates thesettings component.18 * Set up the bp-settings component. 19 19 * 20 20 * @since 1.6.0 21 21 */ -
src/bp-xprofile/bp-xprofile-loader.php
18 18 } 19 19 20 20 /** 21 * Bootstrap the XProfile component.21 * Set up the bp-xprofile component. 22 22 * 23 23 * @since 1.6.0 24 24 */