Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • @riddler84

    Participant

    Thanks! A dynamic filter name.. no wonder that i didn’t found it 😉

    @riddler84

    Participant

    Sry, i would have edit my previous post, but there’s no option 🙂

    I have an addendum. If i save the post, before i publish it, the meta_value is stored in the database and is also present in the activity item.

    But if i publish it directly, the meta_value is obviously not saved, when the activity is created, so my theory from above seems right.

    Maybe it’s important to mention, that i save the posts for this CPT from the Frontend. First i call the function wp_insert_post and immediately afterwards i call update_post_meta to add or update the corresponding meta values.

    @riddler84

    Participant

    So.. i have test it with the ID of an already existing post and the meta_value show up in the newly created activity.

    $existing_post_id = 12345;
    
    $cpt['content'] = get_post_meta( $existing_post_id, 'guide_description', true );

    Then i have tried it again with the dynamically generated ID and the meta_value doesn’t show up. If i put this ID also right behind the get_post_meta function, only the ID will be visible, but not the meta_value.

    $cpt['content'] = get_post_meta( $cpt['secondary_item_id'], 'guide_description', true ) . $cpt['secondary_item_id'];

    Any Ideas? I don’t know how to fix this..

    @riddler84

    Participant

    I cannot actually test it, but i guess it’s eventually a timing problem. Maybe the post meta data isn’t already stored into the database, when the activity is added.

    Something like this:

    1. Post is stored into the database
    2. bp_activity_add() creates the activity
    3. post_meta is stored into the database

    The variable $cpt['secondary_item_id'] is holding the correct post_id. I have checked it. But maybe the post_meta isn’t there, when bp_activity_add() is called.

    I will test it later with an already existing post.

    I have also tried to set the filter priority to a higher value, so it’ll be called later, but that didn’t work too. :/

    @riddler84

    Participant

    Thx for your answer. I didn’t want to be rude, but it was a bit frustrating for me 😉

    Reorganisation of the codex sounds really good. If i can contribute in any way, then i’ll be glad to do.

    @riddler84

    Participant

    Have found the solution by myself. If anyone interested, here’s the code i have added to my bp-custom.php. i think it works as well in the themes functions.php.

    function remove_wpautop_from_buddypress() {
    	if( bp_current_component() ) {
    		remove_filter( 'the_content', 'wpautop', 99 );
    	}
    }
    add_action('bp_init', 'remove_wpautop_from_buddypress');

    bp_current_component() is true, if you be on a buddypress page, so wpautop is only disabled there.
    But i still wonder, why it’s necessary to do something like that. 😉

Viewing 6 replies - 1 through 6 (of 6 total)
Skip to toolbar