Skip to:
Content
Pages
Categories
Search
Top
Bottom

Put “delete” button on single message page


  • Suzanne
    Participant

    @ahjira

    Does anyone have a quick way to put a delete button on a single message page? I was monkeying with bp_message_thread_delete_link() and bp_get_message_thread_delete_link() but I think both of those assume you’re on the message index.

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

  • Steven Word
    Participant

    @stevenkword

    I’m looking for this same information. Did you figure this out?

    I noticed a call to `bp_message_thread_id()` also returns empty regardless of its placement inside or outside of the loop.

    @Ahjira @stevenkword
    As Suzanne mentioned, the `bp_message_thread_delete_link()` functions are only for the message index. On single message pages, the `$thread_template` global is used in place of the `$messages_template` global, and the usable template tags all begin with `bp_the_thread_` instead of `bp_message_thread_`. While there is no `bp_the_thread_delete_link()` function, it’s pretty easy to just directly add the code from the `bp_get_message_thread_delete_link()` function with appropriate substitutions.

    First, at the top of the members/single/messages/single.php template file, add this line:

    Then, wherever you want to add a delete link, add something like the following:
    `<a href="loggedin_user->domain . $bp->messages->slug . ‘/inbox/delete/’ . $thread_template->thread->thread_id, ‘messages_delete_thread’ ) ); ?>” title=”Delete this message” class=”button”>Delete`

    the “ code block above contains the adapted version of the `bp_message_thread_delete_link()` function.


    3dperuna
    Participant

    @3dperuna

    I realize this is a really old thread, but it appears there is code missing.

    I’m trying to add a delete button to a message reply…


    danbp
    Participant

    @danbp

    @3dperuna,

    please open a new topic. This tread is old and defect anyway.

    Topic is now closed.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Put “delete” button on single message page’ is closed to new replies.
Skip to toolbar