diff --git src/bp-templates/bp-nouveau/includes/messages/functions.php src/bp-templates/bp-nouveau/includes/messages/functions.php
index 191a85381..b0017a28c 100644
|
|
|
function bp_nouveau_messages_localize_scripts( $params = array() ) { |
| 114 | 114 | 'one' => __( '(and 1 other)', 'buddypress' ), |
| 115 | 115 | 'more' => __( '(and %d others)', 'buddypress' ), |
| 116 | 116 | ), |
| | 117 | 'rootUrl' => trailingslashit( str_replace( home_url(), '', bp_displayed_user_domain() ) . bp_get_messages_slug() ), |
| 117 | 118 | ); |
| 118 | 119 | |
| 119 | 120 | // Star private messages. |
| … |
… |
function bp_nouveau_messages_adjust_nav() { |
| 179 | 180 | if ( 'notices' === $secondary_nav_item->slug ) { |
| 180 | 181 | bp_core_remove_subnav_item( bp_get_messages_slug(), $secondary_nav_item->slug, 'members' ); |
| 181 | 182 | } else { |
| 182 | | $params = array( 'link' => '#' . $secondary_nav_item->slug ); |
| | 183 | $params = array( 'link' => trailingslashit( $secondary_nav_item->link ) . $secondary_nav_item->slug ); |
| 183 | 184 | |
| 184 | 185 | // Make sure Admins won't write a messages from the user's account. |
| 185 | 186 | if ( 'compose' === $secondary_nav_item->slug ) { |
| … |
… |
function bp_nouveau_messages_adjust_admin_nav( $admin_nav ) { |
| 208 | 209 | if ( 'notices' === $nav_id ) { |
| 209 | 210 | $admin_nav[ $nav_iterator ]['href'] = esc_url( add_query_arg( array( 'page' => 'bp-notices' ), bp_get_admin_url( 'users.php' ) ) ); |
| 210 | 211 | } else { |
| 211 | | $admin_nav[ $nav_iterator ]['href'] = $user_messages_link . '#' . trim( $nav_id ); |
| | 212 | $admin_nav[ $nav_iterator ]['href'] = trailingslashit( $user_messages_link ) . trim( $nav_id ); |
| 212 | 213 | } |
| 213 | 214 | } |
| 214 | 215 | } |
| … |
… |
function bp_nouveau_messages_notification_filters() { |
| 444 | 445 | ) |
| 445 | 446 | ); |
| 446 | 447 | } |
| | 448 | |
| | 449 | /** |
| | 450 | * Avoid canonical redirects for the User's private message screens |
| | 451 | * |
| | 452 | * @since 3.0.1 |
| | 453 | * |
| | 454 | * @param boolean $redirect True to redirect to canonical url. False otherwise. |
| | 455 | * @return boolean True to redirect to canonical url. False otherwise. |
| | 456 | */ |
| | 457 | function bp_nouveau_messages_no_canonical_redirect( $redirect = true ) { |
| | 458 | if ( bp_is_user() && bp_is_current_component( 'messages' ) ) { |
| | 459 | $redirect = false; |
| | 460 | } |
| | 461 | |
| | 462 | return $redirect; |
| | 463 | } |
diff --git src/bp-templates/bp-nouveau/includes/messages/loader.php src/bp-templates/bp-nouveau/includes/messages/loader.php
index a041f2f6b..58697643a 100644
|
|
|
class BP_Nouveau_Messages { |
| 103 | 103 | |
| 104 | 104 | // Messages |
| 105 | 105 | add_filter( 'bp_messages_admin_nav', 'bp_nouveau_messages_adjust_admin_nav', 10, 1 ); |
| | 106 | add_filter( 'bp_do_redirect_canonical', 'bp_nouveau_messages_no_canonical_redirect', 10, 1 ); |
| 106 | 107 | } |
| 107 | 108 | } |
| 108 | 109 | |
diff --git src/bp-templates/bp-nouveau/js/buddypress-messages.js src/bp-templates/bp-nouveau/js/buddypress-messages.js
index 7c1ad32d4..2017e713b 100644
|
|
|
window.bp = window.bp || {}; |
| 37 | 37 | |
| 38 | 38 | this.setupNav(); |
| 39 | 39 | |
| 40 | | Backbone.history.start(); |
| | 40 | Backbone.history.start( { |
| | 41 | pushState: true, |
| | 42 | root: BP_Nouveau.messages.rootUrl |
| | 43 | } ); |
| 41 | 44 | }, |
| 42 | 45 | |
| 43 | 46 | setupNav: function() { |