Skip to:
Content

BuddyPress.org

Changeset 13510


Ignore:
Timestamp:
07/02/2023 06:55:15 AM (15 months ago)
Author:
imath
Message:

Messages: use WP Emojis in subject, excerpt & content

  • Add filters to subject, excerpt & content template functions using the wp_staticize_emoji callback.
  • Update some Nouveau templates/ajax functions to make sure these WP Emojis are rightly rendered.

Props niftythree

Fixes #8928
Closes https://github.com/buddypress/buddypress/pull/123

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-messages/bp-messages-filters.php

    r12757 r13510  
    7878add_filter( 'bp_get_message_thread_content',          'stripslashes_deep', 1 );
    7979
     80add_filter( 'bp_get_the_thread_subject', 'wp_staticize_emoji', 12 );
     81add_filter( 'bp_get_message_thread_subject', 'wp_staticize_emoji', 12 );
     82add_filter( 'bp_get_message_thread_excerpt', 'wp_staticize_emoji', 12 );
     83add_filter( 'bp_get_the_thread_message_content', 'wp_staticize_emoji', 12 );
     84add_filter( 'bp_get_message_thread_content', 'wp_staticize_emoji', 12 );
     85
    8086add_filter( 'bp_get_the_thread_message_content', 'bp_core_add_loading_lazy_attribute' );
    8187
  • trunk/src/bp-templates/bp-nouveau/buddypress/common/js-templates/messages/index.php

    r13415 r13510  
    77 *
    88 * @since 3.0.0
    9  * @version 10.0.0
     9 * @version 12.0.0
    1010 */
    1111
     
    156156        <div class="thread-subject">
    157157            <span class="thread-count">({{data.count}})</span>
    158             <a class="subject" href="./view/{{data.id}}/">{{data.subject}}</a>
    159         </div>
    160         <p class="excerpt">{{data.excerpt}}</p>
     158            <a class="subject" href="./view/{{data.id}}/">{{{data.subject}}}</a>
     159        </div>
     160        <p class="excerpt">{{{data.excerpt}}}</p>
    161161    </div>
    162162    <div class="thread-date">
  • trunk/src/bp-templates/bp-nouveau/includes/messages/ajax.php

    r13433 r13510  
    44 *
    55 * @since 3.0.0
    6  * @version 10.0.0
     6 * @version 12.0.0
    77 */
    88
     
    337337            'id'            => bp_get_message_thread_id(),
    338338            'message_id'    => (int) $last_message_id,
    339             'subject'       => strip_tags( bp_get_message_thread_subject() ),
    340             'excerpt'       => strip_tags( bp_get_message_thread_excerpt() ),
     339            'subject'       => bp_get_message_thread_subject(),
     340            'excerpt'       => bp_get_message_thread_excerpt(),
    341341            'content'       => do_shortcode( bp_get_message_thread_content() ),
    342342            'unread'        => bp_message_thread_has_unread(),
Note: See TracChangeset for help on using the changeset viewer.