Skip to:
Content

BuddyPress.org

Changeset 10572


Ignore:
Timestamp:
02/08/2016 10:39:28 PM (4 years ago)
Author:
r-a-y
Message:

Support emojis for those using WordPress 4.2+.

WordPress introduced a function in WP 4.2 to encode emojis,
wp_encode_emoji().

We're using this function to encode emojis in activity streams, private
messages and group descriptions.

🍕

Fixes #6529.

Location:
trunk/src
Files:
3 edited

Legend:

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

    r10549 r10572  
    3333add_filter( 'bp_activity_content_before_save',       'force_balance_tags' );
    3434add_filter( 'bp_activity_action_before_save',        'force_balance_tags' );
     35
     36if ( function_exists( 'wp_encode_emoji' ) ) {
     37    add_filter( 'bp_activity_content_before_save', 'wp_encode_emoji' );
     38}
    3539
    3640add_filter( 'bp_get_activity_action',                'wptexturize' );
  • trunk/src/bp-groups/bp-groups-filters.php

    r10554 r10572  
    5454add_filter( 'groups_group_name_before_save',        'trim' );
    5555add_filter( 'groups_group_description_before_save', 'trim' );
     56
     57// Support emojis.
     58if ( function_exists( 'wp_encode_emoji' ) ) {
     59    add_filter( 'groups_group_description_before_save', 'wp_encode_emoji' );
     60}
    5661
    5762// Escape output of new group creation details.
  • trunk/src/bp-messages/bp-messages-filters.php

    r10417 r10572  
    3333add_filter( 'messages_notice_message_before_save',  'force_balance_tags' );
    3434add_filter( 'messages_notice_subject_before_save',  'force_balance_tags' );
     35
     36if ( function_exists( 'wp_encode_emoji' ) ) {
     37    add_filter( 'messages_message_subject_before_save', 'wp_encode_emoji' );
     38    add_filter( 'messages_message_content_before_save', 'wp_encode_emoji' );
     39    add_filter( 'messages_notice_message_before_save',  'wp_encode_emoji' );
     40    add_filter( 'messages_notice_subject_before_save',  'wp_encode_emoji' );
     41}
    3542
    3643add_filter( 'bp_get_message_notice_subject',     'wptexturize' );
Note: See TracChangeset for help on using the changeset viewer.