Changeset 9112
- Timestamp:
- 10/30/2014 11:58:29 PM (10 years ago)
- Location:
- trunk/src/bp-activity
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/bp-activity-loader.php
r8754 r9112 61 61 // Load Akismet support if Akismet is configured 62 62 $akismet_key = bp_get_option( 'wordpress_api_key' ); 63 64 /** This filter is documented in bp-activity/bp-activity-actions.php */ 63 65 if ( defined( 'AKISMET_VERSION' ) && ( !empty( $akismet_key ) || defined( 'WPCOM_API_KEY' ) ) && apply_filters( 'bp_activity_use_akismet', bp_is_akismet_active() ) ) { 64 66 $includes[] = 'akismet'; -
trunk/src/bp-activity/bp-activity-screens.php
r9062 r9112 18 18 * Load the Activity directory. 19 19 * 20 * @since BuddyPress (1.5 )20 * @since BuddyPress (1.5.0) 21 21 * 22 22 * @uses bp_displayed_user_id() … … 32 32 bp_update_is_directory( true, 'activity' ); 33 33 34 /** 35 * Fires right before the loading of the Activity directory screen template file. 36 * 37 * @since BuddyPress (1.5.0) 38 */ 34 39 do_action( 'bp_activity_screen_index' ); 35 40 41 /** 42 * Filters the template to load for the Activity directory screen. 43 * 44 * @since BuddyPress (1.5.0) 45 * 46 * @param string $template Path to the activity template to load. 47 */ 36 48 bp_core_load_template( apply_filters( 'bp_activity_screen_index', 'activity/index' ) ); 37 49 } … … 42 54 * Load the 'My Activity' page. 43 55 * 44 * @since BuddyPress (1.0 )56 * @since BuddyPress (1.0.0) 45 57 * 46 58 * @uses do_action() To call the 'bp_activity_screen_my_activity' hook. … … 49 61 */ 50 62 function bp_activity_screen_my_activity() { 63 64 /** 65 * Fires right before the loading of the "My Activity" screen template file. 66 * 67 * @since BuddyPress (1.0.0) 68 */ 51 69 do_action( 'bp_activity_screen_my_activity' ); 70 71 /** 72 * Filters the template to load for the "My Activity" screen. 73 * 74 * @since BuddyPress (1.0.0) 75 * 76 * @param string $template Path to the activity template to load. 77 */ 52 78 bp_core_load_template( apply_filters( 'bp_activity_template_my_activity', 'members/single/home' ) ); 53 79 } … … 56 82 * Load the 'My Friends' activity page. 57 83 * 58 * @since BuddyPress (1.0 )84 * @since BuddyPress (1.0.0) 59 85 * 60 86 * @uses bp_is_active() … … 70 96 71 97 bp_update_is_item_admin( bp_current_user_can( 'bp_moderate' ), 'activity' ); 98 99 /** 100 * Fires right before the loading of the "My Friends" screen template file. 101 * 102 * @since BuddyPress (1.2.0) 103 */ 72 104 do_action( 'bp_activity_screen_friends' ); 105 106 /** 107 * Filters the template to load for the "My Friends" screen. 108 * 109 * @since BuddyPress (1.0.0) 110 * 111 * @param string $template Path to the activity template to load. 112 */ 73 113 bp_core_load_template( apply_filters( 'bp_activity_template_friends_activity', 'members/single/home' ) ); 74 114 } … … 77 117 * Load the 'My Groups' activity page. 78 118 * 79 * @since BuddyPress (1.2 )119 * @since BuddyPress (1.2.0) 80 120 * 81 121 * @uses bp_is_active() … … 91 131 92 132 bp_update_is_item_admin( bp_current_user_can( 'bp_moderate' ), 'activity' ); 133 134 /** 135 * Fires right before the loading of the "My Groups" screen template file. 136 * 137 * @since BuddyPress (1.2.0) 138 */ 93 139 do_action( 'bp_activity_screen_groups' ); 140 141 /** 142 * Filters the template to load for the "My Groups" screen. 143 * 144 * @since BuddyPress (1.2.0) 145 * 146 * @param string $template Path to the activity template to load. 147 */ 94 148 bp_core_load_template( apply_filters( 'bp_activity_template_groups_activity', 'members/single/home' ) ); 95 149 } … … 98 152 * Load the 'Favorites' activity page. 99 153 * 100 * @since BuddyPress (1.2 )154 * @since BuddyPress (1.2.0) 101 155 * 102 156 * @uses bp_update_is_item_admin() … … 108 162 function bp_activity_screen_favorites() { 109 163 bp_update_is_item_admin( bp_current_user_can( 'bp_moderate' ), 'activity' ); 164 165 /** 166 * Fires right before the loading of the "Favorites" screen template file. 167 * 168 * @since BuddyPress (1.2.0) 169 */ 110 170 do_action( 'bp_activity_screen_favorites' ); 171 172 /** 173 * Filters the template to load for the "Favorites" screen. 174 * 175 * @since BuddyPress (1.2.0) 176 * 177 * @param string $template Path to the activity template to load. 178 */ 111 179 bp_core_load_template( apply_filters( 'bp_activity_template_favorite_activity', 'members/single/home' ) ); 112 180 } … … 115 183 * Load the 'Mentions' activity page. 116 184 * 117 * @since BuddyPress (1.2 )185 * @since BuddyPress (1.2.0) 118 186 * 119 187 * @uses bp_update_is_item_admin() … … 125 193 function bp_activity_screen_mentions() { 126 194 bp_update_is_item_admin( bp_current_user_can( 'bp_moderate' ), 'activity' ); 195 196 /** 197 * Fires right before the loading of the "Mentions" screen template file. 198 * 199 * @since BuddyPress (1.2.0) 200 */ 127 201 do_action( 'bp_activity_screen_mentions' ); 202 203 /** 204 * Filters the template to load for the "Mentions" screen. 205 * 206 * @since BuddyPress (1.2.0) 207 * 208 * @param string $template Path to the activity template to load. 209 */ 128 210 bp_core_load_template( apply_filters( 'bp_activity_template_mention_activity', 'members/single/home' ) ); 129 211 } … … 132 214 * Reset the logged-in user's new mentions data when he visits his mentions screen. 133 215 * 134 * @since BuddyPress (1.5 )216 * @since BuddyPress (1.5.0) 135 217 * 136 218 * @uses bp_is_my_profile() … … 147 229 * Load the page for a single activity item. 148 230 * 149 * @since BuddyPress (1.2 )231 * @since BuddyPress (1.2.0) 150 232 * 151 233 * @global object $bp BuddyPress global settings … … 219 301 } 220 302 221 // Allow access to be filtered 303 /** 304 * Filters the access permission for a single activity view. 305 * 306 * @since BuddyPress (1.2.0) 307 * 308 * @param array $access Array holding the current $has_access value and current activity item instance. 309 */ 222 310 $has_access = apply_filters_ref_array( 'bp_activity_permalink_access', array( $has_access, &$activity ) ); 223 311 224 // Allow additional code execution 312 /** 313 * Fires before the loading of a single activity template file. 314 * 315 * @since BuddyPress (1.2.0) 316 * 317 * @param BP_Activity_Activity $activity Object representing the current activity item being displayed. 318 * @param bool $has_access Whether or not the current user has access to view activity. 319 */ 225 320 do_action( 'bp_activity_screen_single_activity_permalink', $activity, $has_access ); 226 321 … … 245 340 } 246 341 342 /** 343 * Filters the template to load for a single activity screen. 344 * 345 * @since BuddyPress (1.0.0) 346 * 347 * @param string $template Path to the activity template to load. 348 */ 247 349 bp_core_load_template( apply_filters( 'bp_activity_template_profile_activity_permalink', 'members/single/activity/permalink' ) ); 248 350 } … … 252 354 * Add activity notifications settings to the notifications settings page. 253 355 * 254 * @since BuddyPress (1.2 )356 * @since BuddyPress (1.2.0) 255 357 * 256 358 * @uses bp_get_user_meta() … … 299 401 </tr> 300 402 301 <?php do_action( 'bp_activity_screen_notification_settings' ) ?> 403 <?php 404 405 /** 406 * Fires inside the closing </tbody> tag for activity screen notification settings. 407 * 408 * @since BuddyPress (1.2.0) 409 */ 410 do_action( 'bp_activity_screen_notification_settings' ) ?> 302 411 </tbody> 303 412 </table> … … 315 424 * activity template parts to the_title and the_content areas of a theme. 316 425 * 317 * @since BuddyPress (1.7 )426 * @since BuddyPress (1.7.0) 318 427 */ 319 428 class BP_Activity_Theme_Compat { … … 322 431 * Set up the activity component theme compatibility. 323 432 * 324 * @since BuddyPress (1.7 )433 * @since BuddyPress (1.7.0) 325 434 */ 326 435 public function __construct() { … … 331 440 * Set up the theme compatibility hooks, if we're looking at an activity page. 332 441 * 333 * @since BuddyPress (1.7 )442 * @since BuddyPress (1.7.0) 334 443 */ 335 444 public function is_activity() { … … 343 452 bp_update_is_directory( true, 'activity' ); 344 453 454 /** This action is documented in bp-activity/bp-activity-screens.php */ 345 455 do_action( 'bp_activity_screen_index' ); 346 456 … … 364 474 * This is to mirror how WordPress has {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}. 365 475 * 366 * @since BuddyPress (1.8 )476 * @since BuddyPress (1.8.0) 367 477 * 368 478 * @param string $templates The templates from bp_get_theme_compat_templates(). … … 370 480 */ 371 481 public function directory_template_hierarchy( $templates ) { 372 // Setup our templates based on priority 482 483 /** 484 * Filters the template hierarchy for the activity directory page. 485 * 486 * @since BuddyPress (1.8.0) 487 * 488 * @param array $index-directory Array holding template names to be merged into template list. 489 */ 373 490 $new_templates = apply_filters( 'bp_template_hierarchy_activity_directory', array( 374 491 'activity/index-directory.php' … … 385 502 * Update the global $post with directory data. 386 503 * 387 * @since BuddyPress (1.7 )504 * @since BuddyPress (1.7.0) 388 505 */ 389 506 public function directory_dummy_post() { … … 404 521 * Filter the_content with the groups index template part. 405 522 * 406 * @since BuddyPress (1.7 )523 * @since BuddyPress (1.7.0) 407 524 */ 408 525 public function directory_content() { … … 417 534 * This is to mirror how WordPress has {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}. 418 535 * 419 * @since BuddyPress (1.8 )536 * @since BuddyPress (1.8.0) 420 537 * 421 538 * @param string $templates The templates from bp_get_theme_compat_templates(). … … 423 540 */ 424 541 public function single_template_hierarchy( $templates ) { 425 // Setup our templates based on priority 542 543 /** 544 * Filters the template hierarchy for the activity permalink pages. 545 * 546 * @since BuddyPress (1.8.0) 547 * 548 * @param array $index Array holding template names to be merged into template list. 549 */ 426 550 $new_templates = apply_filters( 'bp_template_hierarchy_activity_single_item', array( 427 551 'activity/single/index.php' … … 438 562 * Update the global $post with the displayed user's data. 439 563 * 440 * @since BuddyPress (1.7 )564 * @since BuddyPress (1.7.0) 441 565 */ 442 566 public function single_dummy_post() { … … 457 581 * Filter the_content with the members' activity permalink template part. 458 582 * 459 * @since BuddyPress (1.7 )583 * @since BuddyPress (1.7.0) 460 584 */ 461 585 public function single_dummy_content() {
Note: See TracChangeset
for help on using the changeset viewer.