Skip to:
Content

BuddyPress.org

Ticket #6306: 6306.alt.patch

File 6306.alt.patch, 1.2 KB (added by imath, 10 years ago)
  • src/bp-blogs/bp-blogs-loader.php

    diff --git src/bp-blogs/bp-blogs-loader.php src/bp-blogs/bp-blogs-loader.php
    index 36c2799..56123f4 100644
    class BP_Blogs_Component extends BP_Component { 
    8888                         * Filters the post types to track for the Blog component.
    8989                         *
    9090                         * @since BuddyPress (1.5.0)
     91                         * @deprecated BuddyPress (2.2.2)
    9192                         *
    9293                         * @param array $value Array of post types to track.
    9394                         */
    class BP_Blogs_Component extends BP_Component { 
    298299         * @see bp_activity_get_post_type_tracking_args() for information on parameters.
    299300         */
    300301        public function post_tracking_args( $params = array(), $post_type = 0 ) {
    301                 if ( 'post' != $post_type ) {
     302                /**
     303                 * Make sure plugins still using 'bp_blogs_record_comment_post_types'
     304                 * to track comments about their post types will generate :
     305                 * - new_blog_post activities for the published items
     306                 * - new_blog_comment activities for the comments
     307                 * See https://buddypress.trac.wordpress.org/ticket/6306
     308                 */
     309                $post_types = apply_filters( 'bp_blogs_record_comment_post_types', array( 'post' ) );
     310                $post_types_array = array_flip( $post_types );
     311
     312                if ( ! isset( $post_types_array[ $post_type ] ) ) {
    302313                        return $params;
    303314                }
    304315