Skip to:
Content
Pages
Categories
Search
Top
Bottom

Does filter ’bp_activity_thumbnail_content_images’ with WordPress functions really work ?

  • I’ve tried to filter `bp_activity_thumbnail_content_images` to display post thumbnails, as they doesn’t belong to post content, but it doesn’t work perfectly, and I have to push a second time on the publish button to display all the data of the image `src` tag :
    `function my_activity_thumbnail_content_images( $content ) {
    if ( (function_exists ( ‘has_post_thumbnail’ ) ) && ( has_post_thumbnail ( get_post( bp_get_activity_secondary_item_id() )->ID ) ) ) {
    $content = preg_replace(‘/]*>/Ui’, ”, $content );
    $content = get_the_post_thumbnail( get_post( bp_get_activity_secondary_item_id() )->ID, ‘vignette’, array( ‘class’ => ‘align-left thumbnail’, ‘alt’ => my_get_thumb_name( get_post( bp_get_activity_secondary_item_id() )->ID ), ‘title’ => get_post( bp_get_activity_secondary_item_id() )->post_title ) ) . $content;
    } else {
    $content = $content;
    }
    return apply_filters( ‘my_activity_video_content_images’, $content );
    }

    add_filter( ‘bp_activity_thumbnail_content_images’, ‘my_activity_thumbnail_content_images’ );`
    Last but not least, not displaying data are changing whether the server I’m testing the code…

  • The topic ‘Does filter ’bp_activity_thumbnail_content_images’ with WordPress functions really work ?’ is closed to new replies.
Skip to toolbar