Filter hook 'post_embed_url'

in WP Core File wp-includes/embed.php at line 430

View Source

post_embed_url

Filter Hook
Description
Filters the URL to embed a specific post.

Hook Information

File Location wp-includes/embed.php View on GitHub
Hook Type Filter
Line Number 430

Hook Parameters

Type Name Description
string $embed_url The post embed URL.
WP_Post $post The corresponding post object.

Usage Examples

Basic Usage
<?php
// Hook into post_embed_url
add_filter('post_embed_url', 'my_custom_filter', 10, 2);

function my_custom_filter($embed_url, $post) {
    // Your custom filtering logic here
    return $embed_url;
}

Source Code Context

wp-includes/embed.php:430 - How this hook is used in WordPress core
<?php
 425  	 * @since 4.4.0
 426  	 *
 427  	 * @param string  $embed_url The post embed URL.
 428  	 * @param WP_Post $post      The corresponding post object.
 429  	 */
 430  	return sanitize_url( apply_filters( 'post_embed_url', $embed_url, $post ) );
 431  }
 432  
 433  /**
 434   * Retrieves the oEmbed endpoint URL for a given permalink.
 435   *

PHP Documentation

<?php
/**
	 * Filters the URL to embed a specific post.
	 *
	 * @since 4.4.0
	 *
	 * @param string  $embed_url The post embed URL.
	 * @param WP_Post $post      The corresponding post object.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/embed.php
Related Hooks

Related hooks will be displayed here in future updates.