Skip to:
Content
Pages
Categories
Search
Top
Bottom

Error When Adding Custom Post Type to Activity Feed

Viewing 5 replies - 1 through 5 (of 5 total)

  • producist
    Participant

    @producist

    I also saw this about multisite installs in the thread you posted:

    “On multisite configurations, the post types that are registered on any sub-site will need to be registered on the root site in order to be listed in the Activity dropdown filters. That’s the case for the post and page post types”

    The site I’m trying to create a custom post type for is a subsite. I assume the Page Post Type is registered for the root install, so this shouldn’t be causing the problem right?


    danbp
    Moderator

    @danbp

    @producist

    don’t know what happens, but i just tested the latest snippet from the codex page and it works flawlessly on a multi and on a single install.

    Which PHP version is used on your site ?


    producist
    Participant

    @producist

    Hi danbp,

    The PHP version is 5.3.2. I’m using WPEngine as a host.


    producist
    Participant

    @producist

    I just tried adding the snippets and again and that problem isn’t happening anymore. However, the filter functionality isn’t working…

    See Screenshot —

    http://postimg.org/image/5ulodg0wz/

    Here’s the code I used….

    <?php
    // hacks and mods will go here ok
    
    // Don't forget to add the 'buddypress-activity' support!
    add_post_type_support( 'page', 'buddypress-activity' );
     
    function customize_page_tracking_args() {
        // Check if the Activity component is active before using it.
        if ( ! bp_is_active( 'activity' ) ) {
            return;
        }
     
        bp_activity_set_post_type_tracking_args( 'page', array(
            'component_id'             => buddypress()->blogs->id,
            'action_id'                => 'new_blog_page',
            'bp_activity_admin_filter' => __( 'Published a new page', 'custom-domain' ),
            'bp_activity_front_filter' => __( 'Pages', 'custom-domain' ),
            'contexts'                 => array( 'activity', 'member' ),
            'activity_comment'         => true,
            'bp_activity_new_post'     => __( '%1$s posted a new <a href="%2$s">page</a>', 'custom-textdomain' ),
            'bp_activity_new_post_ms'  => __( '%1$s posted a new <a href="%2$s">page</a>, on the site %3$s', 'custom-textdomain' ),
            'position'                 => 100,
        ) );
    }
    add_action( 'bp_init', 'customize_page_tracking_args' );
    
    ?>

    Is there anything I need to add or change in the above code in order to make PAGES show in the filter area?

    Hi there,

    There’s a chance your theme hasn’t updated its templates. In order to have the activity dropdowns populated, please check your templates are up to date see https://codex.buddypress.org/themes/activity-dropdown-filters-in-templates/#use-bp_activity_show_filters-within-your-bp-default-child-theme

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Error When Adding Custom Post Type to Activity Feed’ is closed to new replies.
Skip to toolbar