embed_post_id

  • apply_filters( 'embed_post_id', 0 )

    Source Reference:

    • Component: BuddyPress :: bp-core
      File: /bp-core/bp-core-classes.php :: Trac Source Line: 1180
      			foreach ( $handlers as $hid => $handler ) {
      				if ( preg_match( $handler['regex'], $url, $matches ) && is_callable( $handler['callback'] ) ) {
      					if ( false !== $return = call_user_func( $handler['callback'], $matches, $attr, $url, $rawattr ) )
      						return apply_filters( 'embed_handler_html', $return, $url, $attr );
      				}
      			}
      		}
      
      		// Get object ID
      		$id = apply_filters( 'embed_post_id', 0 );
      
      		// Is oEmbed discovery on?
      		$attr['discover'] = ( apply_filters( 'bp_embed_oembed_discover', false ) && current_user_can( 'unfiltered_html' ) );
      
      		// Set up a new WP oEmbed object to check URL with registered oEmbed providers
      		require_once( ABSPATH . WPINC . '/class-oembed.php' );
      		$oembed_obj = _wp_oembed_get_object();
      
      		// If oEmbed discovery is true, skip oEmbed provider check
      		$is_oembed_link = false;
      

Hook: add_filter: embed_post_id instances (5)

  • add_filter( 'embed_post_id',         'bp_get_the_topic_post_id'         )
    $tag: embed_post_id
    $function_to_add: bp_get_the_topic_post_id
    $priority: 0
    $accepted_args: 0

    Source Reference:

    • Component: BuddyPress :: bp-forums
      File: /bp-forums/bp-forums-functions.php :: Trac Source Line: 633
       * during the forum topic loop.  If no cache and link is embeddable, cache it.
       *
       * @see BP_Embed
       * @see bp_embed_forum_cache()
       * @see bp_embed_forum_save_cache()
       * @package BuddyPress_Forums
       * @since 1.5
       */
      function bp_forums_embed() {
      	add_filter( 'embed_post_id',         'bp_get_the_topic_post_id'         );
      	add_filter( 'bp_embed_get_cache',    'bp_embed_forum_cache',      10, 3 );
      	add_action( 'bp_embed_update_cache', 'bp_embed_forum_save_cache', 10, 3 );
      }
      add_action( 'topic_loop_start', 'bp_forums_embed' );
      
      /**
       * Wrapper function for {@link bb_get_postmeta()}.
       * Used during {@link BP_Embed::parse_oembed()} via {@link bp_forums_embed()}.
       *
       * @package BuddyPress_Forums
      
  • add_filter( 'embed_post_id', 'bp_get_message_thread_id' )
    $tag: embed_post_id
    $function_to_add: bp_get_message_thread_id
    $priority: 0
    $accepted_args: 0

    Source Reference:

  • add_filter( 'embed_post_id',         'bp_get_activity_id'                  )
    $tag: embed_post_id
    $function_to_add: bp_get_activity_id
    $priority: 0
    $accepted_args: 0

    Source Reference:

    • Component: BuddyPress :: bp-activity
      File: /bp-activity/bp-activity-functions.php :: Trac Source Line: 1343
       * @see BP_Embed
       * @see bp_embed_activity_cache()
       * @see bp_embed_activity_save_cache()
       *
       * @uses add_filter() To attach 'bp_get_activity_id' to 'embed_post_id'
       * @uses add_filter() To attach 'bp_embed_activity_cache' to 'bp_embed_get_cache'
       * @uses add_action() To attach 'bp_embed_activity_save_cache' to 'bp_embed_update_cache'
       */
      function bp_activity_embed() {
      	add_filter( 'embed_post_id',         'bp_get_activity_id'                  );
      	add_filter( 'bp_embed_get_cache',    'bp_embed_activity_cache',      10, 3 );
      	add_action( 'bp_embed_update_cache', 'bp_embed_activity_save_cache', 10, 3 );
      }
      add_action( 'activity_loop_start', 'bp_activity_embed' );
      
      /**
       * Grabs the activity comment ID and attempts to retrieve the oEmbed cache (if it exists)
       * when BP is recursing through activity comments {@link bp_activity_recurse_comments()}.
       * If no cache and link is embeddable, cache it.
       *
      
  • add_filter( 'embed_post_id',         'bp_get_activity_comment_id'          )
    $tag: embed_post_id
    $function_to_add: bp_get_activity_comment_id
    $priority: 0
    $accepted_args: 0

    Source Reference:

    • Component: BuddyPress :: bp-activity
      File: /bp-activity/bp-activity-functions.php :: Trac Source Line: 1365
       * @see BP_Embed
       * @see bp_embed_activity_cache()
       * @see bp_embed_activity_save_cache()
       *
       * @uses add_filter() To attach 'bp_get_activity_comment_id' to 'embed_post_id'
       * @uses add_filter() To attach 'bp_embed_activity_cache' to 'bp_embed_get_cache'
       * @uses add_action() To attach 'bp_embed_activity_save_cache' to 'bp_embed_update_cache'
       */
      function bp_activity_comment_embed() {
      	add_filter( 'embed_post_id',         'bp_get_activity_comment_id'          );
      	add_filter( 'bp_embed_get_cache',    'bp_embed_activity_cache',      10, 3 );
      	add_action( 'bp_embed_update_cache', 'bp_embed_activity_save_cache', 10, 3 );
      }
      add_action( 'bp_before_activity_comment', 'bp_activity_comment_embed' );
      
      /**
       * When a user clicks on a "Read More" item, make sure embeds are correctly parsed and shown for the expanded content.
       *
       * @since 1.5
       *
      
  • add_filter( 'embed_post_id',            create_function( '', 'global $bp; return $bp->activity->read_more_id;' ) )
    $tag: embed_post_id
    $function_to_add: create_function(
    $priority: 0
    $accepted_args: 0

    Source Reference:

    • Component: BuddyPress :: bp-activity
      File: /bp-activity/bp-activity-functions.php :: Trac Source Line: 1390
       * @uses add_filter() To attach create_function() to 'embed_post_id'
       * @uses add_filter() To attach 'bp_embed_activity_cache' to 'bp_embed_get_cache'
       * @uses add_action() To attach 'bp_embed_activity_save_cache' to 'bp_embed_update_cache'
       */
      function bp_dtheme_embed_read_more( $activity ) {
      	global $bp;
      
      	$bp->activity->read_more_id = $activity->id;
      
      	add_filter( 'embed_post_id',            create_function( '', 'global $bp; return $bp->activity->read_more_id;' ) );
      	add_filter( 'bp_embed_get_cache',       'bp_embed_activity_cache',      10, 3 );
      	add_action( 'bp_embed_update_cache',    'bp_embed_activity_save_cache', 10, 3 );
      }
      add_action( 'bp_dtheme_get_single_activity_content', 'bp_dtheme_embed_read_more' );
      
      /**
       * Removes the 'embed_post_id' filter after {@link bp_activity_recurse_comments()}
       * is rendered to avoid conflict with the 'embed_post_id' filter in
       * {@link bp_activity_embed()} or any other component embeds.
       *
      

Comments are closed.