bp_get_message_activate_deactivate_link()

Get the URL for deactivating the current notice.

Description

Return

(string)

Source

File: bp-messages/bp-messages-template.php

1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
function bp_get_message_activate_deactivate_link() {
    global $messages_template;
 
    if ( 1 === (int) $messages_template->thread->is_active ) {
        $link = wp_nonce_url( trailingslashit( bp_loggedin_user_domain() . bp_get_messages_slug() . '/notices/deactivate/' . $messages_template->thread->id ), 'messages_deactivate_notice' );
    } else {
        $link = wp_nonce_url( trailingslashit( bp_loggedin_user_domain() . bp_get_messages_slug() . '/notices/activate/' . $messages_template->thread->id ), 'messages_activate_notice' );
    }
 
    /**
     * Filters the URL for deactivating the current notice.
     *
     * @since BuddyPress 1.0.0
     *
     * @param string $link URL for deactivating the current notice.
     */
    return apply_filters( 'bp_get_message_activate_deactivate_link', $link );
}

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.