Skip to:
Content

BuddyPress.org

Changeset 4829


Ignore:
Timestamp:
07/23/2011 10:05:47 PM (9 years ago)
Author:
djpaul
Message:

Add oembed support into private messages. See #2707

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-classes.php

    r4820 r4829  
    11241124            add_filter( 'bp_get_the_topic_post_content', array( &$this, 'run_shortcode' ), 7 );
    11251125        }
     1126
     1127        if ( bp_use_embed_in_private_messages() ) {
     1128            add_filter( 'bp_get_the_thread_message_content', array( &$this, 'autoembed' ), 8 );
     1129            add_filter( 'bp_get_the_thread_message_content', array( &$this, 'run_shortcode' ), 7 );
     1130        }
     1131
     1132        do_action_ref_array( 'bp_core_setup_oembed', array( &$this ) );
    11261133    }
    11271134
  • trunk/bp-core/bp-core-functions.php

    r4820 r4829  
    12981298
    12991299/**
    1300  * Are oembeds allwoed in acitivity replies?
     1300 * Are oembeds allwoed in activity replies?
    13011301 *
    13021302 * @return bool False when activity replies embed support is disabled; true when enabled (default)
     
    13081308
    13091309/**
    1310  * Are oembeds allowed on forum posts?
     1310 * Are oembeds allowed in forum posts?
    13111311 *
    13121312 * @return bool False when form post embed support is disabled; true when enabled (default)
     
    13151315function bp_use_embed_in_forum_posts() {
    13161316    return apply_filters( 'bp_use_embed_in_forum_posts', !defined( 'BP_EMBED_DISABLE_FORUM_POSTS' ) || !BP_EMBED_DISABLE_FORUM_POSTS );
     1317}
     1318
     1319/**
     1320 * Are oembeds allowed in private messages?
     1321 *
     1322 * @return bool False when form post embed support is disabled; true when enabled (default)
     1323 * @since 1.3
     1324 */
     1325function bp_use_embed_in_private_messages() {
     1326    return apply_filters( 'bp_use_embed_in_private_messages', !defined( 'BP_EMBED_DISABLE_PRIVATE_MESSAGES' ) || !BP_EMBED_DISABLE_PRIVATE_MESSAGES );
    13171327}
    13181328
  • trunk/bp-messages/bp-messages-template.php

    r4825 r4829  
    860860    }
    861861
     862/** Embeds *******************************************************************/
     863
     864/**
     865 * Enable oembed support for Messages.
     866 *
     867 * There's no caching as BP 1.3 does not have a Messages meta API.
     868 *
     869 * @see BP_Embed
     870 * @since 1.3
     871 * @todo Add Messages meta?
     872 */
     873function bp_messages_embed() {
     874    add_filter( 'embed_post_id', 'bp_get_message_thread_id' );
     875}
     876add_action( 'messages_box_loop_start', 'bp_messages_embed' );
    862877?>
Note: See TracChangeset for help on using the changeset viewer.