Skip to:
Content
Pages
Categories
Search
Top
Bottom

Custom Post Type


  • gatelli
    Participant

    @gatelli

    The last BP2.2 allow to add custom post type in activity feed, that’s great !
    I understood the filter is with the CPT name like ‘new_blog_page’
    How is it possible to save different activities according to taxonomies ? I mean I have a custom post type with 2 different taxonomies and I’d like to display in activity :
    “%1$s posted a new TAXONOMY 1
    “%1$s posted a new TAXONOMY 2” etc…
    all filtered by CPT taxonomy name…

    Is it possible ?

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

  • Henry Wright
    Moderator

    @henrywright

    I’m not sure I understand what you mean by “posted a new taxonomy”?

    Let’s take an example : Custom Tags for your custom post type.

    if the question is : “is it possible to have an activity generated each time a custom post type tag is created ?”

    My reply is it’s not included in core. And by the way, creating a post tag doesn’t generate an activity.

    Post types activities is easing the process of generating activities when an item of a ‘buddypress-activity’ supported post type is added.

    We still need to work on generating activitiies when a comment is made on a post type.

    About generating an activity when a taxonomy (hierarchical or not) is created is an interesting idea but seems inmho specific to a given post type. For example i have difficulties seeing an interest for post categories or post tags (but why not afterall!) but i do see an interest for one of my plugin. So i will explore this for the plugin i have in mind 😉


    gatelli
    Participant

    @gatelli

    Thanks for your answer. Actually I use an event plugin generating custom post types for each event. As I’m posting events with different categories (training / race / etc…) so I use tags.
    So my goal was to post activities differently since it’s for a training or a race.
    Like : “someone posted a new TRAINING SESSION” / “someone posted a new RACE”.
    I’m not sure I’m clear.

    Gatelli

    @gatelli

    So the question is ‘How can i edit the action string eg: someone wrote a new event, if the event was posted having a race tag or a training session tag ?’

    is this correct ?

    If so, you’ll need to filter ‘bp_activity_custom_post_type_post_action’, get the secondary item id which is the post type id, fetch the tag for this post type id and override the action string.


    gatelli
    Participant

    @gatelli

    Yes it’s correct,
    do you have an example of code I could put in bp-custom.php ? I’m not fluent in coding…

    Thank you so much !

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