Skip to:
Content
Pages
Categories
Search
Top
Bottom

Question about ( bp_message_threads )


  • mitchellbc
    Participant

    @mitchellbc

    Im making a custom WP theme, And im wondering if i can remove the formatting from these examples

    <?php bp_message_thread_from() ?>
    output = example

    *just noticed this acts as a link on the forum so this is what its outputting just remove the **
    < a ** href=”http://localhost/wordpress/members/example/&#8221; > example < ** / a >

    Desired output = example

    So im hoping to wrap my own formating around it
    Like so

    <span class=”text”><?php bp_message_thread_from() ?></span>
    Desired output = <span class=”text”>example</span>

    tldr
    is there a way to remove the set formatting of these

    <!– Example template tags you can use –>
    <?php bp_message_thread_id() ?>
    <?php bp_message_thread_has_unread() ?>
    <?php bp_message_thread_unread_count() ?>
    <?php bp_message_thread_avatar(); ?>
    <?php bp_message_thread_from() ?>
    <?php bp_message_thread_last_post_date() ?>
    <?php bp_message_thread_view_link() ?>
    <?php bp_message_thread_subject() ?>
    <?php bp_message_thread_excerpt() ?>
    <?php bp_message_thread_delete_link() ?>

    Sorry for the incomplete example.
    hoping someone can help me answer this.

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

  • shanebp
    Moderator

    @shanebp

    Use the filter hooks to modify the output.
    For example, see the filter hook for: bp_message_thread_from()


    mitchellbc
    Participant

    @mitchellbc

    sorry but this doesnt show me much to work with. can you point out the example?


    shanebp
    Moderator

    @shanebp

    I provided a link to show you how to find the filter hooks for any of the functions that you listed. You use them like any other WP filter hook.
    For example:

    function mitchellbc_bp_get_message_thread_from( $from ) {
    
        // manipulate $from however you want
        $from = '<span class="text">' . $from .  '</span>'; 
    
        return $from; 
    }
    add_filter( 'bp_get_message_thread_from', 'mitchellbc_bp_get_message_thread_from', 1, 1 );
Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Skip to toolbar