Skip to:
Content

BuddyPress.org

Ticket #8474: 8474-messagesUI.patch

File 8474-messagesUI.patch, 3.2 KB (added by imath, 3 years ago)
  • src/bp-templates/bp-nouveau/buddypress/common/js-templates/messages/index.php

    diff --git src/bp-templates/bp-nouveau/buddypress/common/js-templates/messages/index.php src/bp-templates/bp-nouveau/buddypress/common/js-templates/messages/index.php
    index b75b16b14..d36a30ba3 100644
     
    88 * @since 3.0.0
    99 * @version 10.0.0
    1010 */
    11 ?>
    12 <div class="subnav-filters filters user-subnav bp-messages-filters" id="subsubnav"></div>
    1311
    14 <div class="bp-messages-feedback"></div>
    15 <div class="bp-messages-content"></div>
     12// Backward Compatibility for plugins still needing the placeholders to be located into this file.
     13if ( ! did_action( '_bp_nouveau_messages_print_placeholders' ) ) {
     14        bp_nouveau_messages_print_placeholders();
     15}
     16?>
    1617
    1718<script type="text/html" id="tmpl-bp-messages-feedback">
    1819        <div class="bp-feedback {{data.type}}">
  • src/bp-templates/bp-nouveau/buddypress/members/single/messages.php

    diff --git src/bp-templates/bp-nouveau/buddypress/members/single/messages.php src/bp-templates/bp-nouveau/buddypress/members/single/messages.php
    index a4f7b588a..d509bd235 100644
     
    22/**
    33 * BuddyPress - Users Messages
    44 *
     5 * @since 3.0.0
    56 * @version 3.0.0
    67 */
    78?>
  • src/bp-templates/bp-nouveau/includes/messages/template-tags.php

    diff --git src/bp-templates/bp-nouveau/includes/messages/template-tags.php src/bp-templates/bp-nouveau/includes/messages/template-tags.php
    index 9dcc4ea64..003f34a46 100644
    function bp_nouveau_messages_hook( $when = '', $suffix = '' ) { 
    3838        bp_nouveau_hook( $hook );
    3939}
    4040
     41/**
     42 * Prints the JS Templates of the private messages UI.
     43 *
     44 * @since 10.0.0
     45 */
     46function bp_nouveau_messages_print_templates() {
     47        bp_get_template_part( 'common/js-templates/messages/index' );
     48}
     49
     50/**
     51 * Prints the HTML placeholders of the private messages UI.
     52 *
     53 * @since 10.0.0
     54 */
     55function bp_nouveau_messages_print_placeholders() {
     56        ?>
     57        <div class="subnav-filters filters user-subnav bp-messages-filters" id="subsubnav"></div>
     58
     59        <div class="bp-messages-feedback"></div>
     60        <div class="bp-messages-content"></div>
     61        <?php
     62}
     63
    4164/**
    4265 * Load the new Messages User Interface
    4366 *
    function bp_nouveau_messages_member_interface() { 
    5174         */
    5275        do_action( 'bp_before_member_messages_content' );
    5376
     77        /**
     78         * Load the JS templates to manage Priveate Messages into site's footer.
     79         *
     80         * @since 10.0.0 Hook to the `wp_footer` action to print the JS templates.
     81         */
     82        add_action( 'wp_footer', 'bp_nouveau_messages_print_templates' );
     83        bp_nouveau_messages_print_placeholders();
     84
     85        /**
     86         * Private hook to preserve backward compatibility with plugins needing the above placeholders to be located
     87         * into: `bp-templates/bp-nouveau/buddypress/common/js-templates/messahges/index.php`.
     88         *
     89         * @since 10.0.0
     90         */
     91        do_action( '_bp_nouveau_messages_print_placeholders' );
     92
    5493        // Load the Private messages UI
    55         bp_get_template_part( 'common/js-templates/messages/index' );
     94
    5695
    5796        /**
    5897         * Fires after the member messages content.