Changeset 9194 for trunk/src/bp-blogs/bp-blogs-loader.php
- Timestamp:
- 11/27/2014 05:13:29 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-blogs/bp-blogs-loader.php
r8662 r9194 76 76 // Setup the globals 77 77 parent::setup_globals( $args ); 78 79 /* 80 * Set up the post post type to track. 81 * 82 * In case the config is not multisite, the blog_public option is ignored. 83 */ 84 if ( 0 !== (int) get_option( 'blog_public' ) || ! is_multisite() ) { 85 // Get all posts to track. 86 $post_types = apply_filters( 'bp_blogs_record_post_post_types', array( 'post' ) ); 87 88 foreach ( $post_types as $post_type ) { 89 add_post_type_support( $post_type, 'buddypress-activity' ); 90 } 91 } 92 93 // Filter the generic track parameters for the 'post' post type. 94 add_filter( 'bp_activity_get_post_type_tracking_args', array( $this, 'post_tracking_args' ), 10, 2 ); 78 95 } 79 96 … … 247 264 parent::setup_title(); 248 265 } 266 267 /** 268 * Set up the tracking arguments for the 'post' post type. 269 * 270 * @since BuddyPress (2.2.0) 271 * 272 * @see bp_activity_get_post_type_tracking_args() for information on parameters. 273 */ 274 public function post_tracking_args( $params = array(), $post_type = 0 ) { 275 if ( 'post' != $post_type ) { 276 return $params; 277 } 278 279 // Set specific params for the 'post' post type. 280 $params->component_id = $this->id; 281 $params->action_id = 'new_blog_post'; 282 $params->admin_filter = __( 'New post published', 'buddypress' ); 283 $params->format_callback = 'bp_blogs_format_activity_action_new_blog_post'; 284 $params->front_filter = __( 'Posts', 'buddypress' ); 285 $params->contexts = array( 'activity', 'member' ); 286 $params->position = 5; 287 288 return $params; 289 } 249 290 } 250 291
Note: See TracChangeset
for help on using the changeset viewer.