Filter hook 'oembed_linktypes'

in WP Core File wp-includes/class-wp-oembed.php at line 473

View Source

oembed_linktypes

Filter Hook
Description
Filters the link types that contain oEmbed provider URLs.

Hook Information

File Location wp-includes/class-wp-oembed.php View on GitHub
Hook Type Filter
Line Number 473

Hook Parameters

Type Name Description
string[] $format Array of oEmbed link types. Accepts 'application/json+oembed', 'text/xml+oembed', and 'application/xml+oembed' (incorrect, used by at least Vimeo).

Usage Examples

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

function my_custom_filter($format) {
    // Your custom filtering logic here
    return $format;
}

Source Code Context

wp-includes/class-wp-oembed.php:473 - How this hook is used in WordPress core
<?php
 468  			 *
 469  			 * @param string[] $format Array of oEmbed link types. Accepts 'application/json+oembed',
 470  			 *                         'text/xml+oembed', and 'application/xml+oembed' (incorrect,
 471  			 *                         used by at least Vimeo).
 472  			 */
 473  			$linktypes = apply_filters(
 474  				'oembed_linktypes',
 475  				array(
 476  					'application/json+oembed' => 'json',
 477  					'text/xml+oembed'         => 'xml',
 478  					'application/xml+oembed'  => 'xml',

PHP Documentation

<?php
/**
			 * Filters the link types that contain oEmbed provider URLs.
			 *
			 * @since 2.9.0
			 *
			 * @param string[] $format Array of oEmbed link types. Accepts 'application/json+oembed',
			 *                         'text/xml+oembed', and 'application/xml+oembed' (incorrect,
			 *                         used by at least Vimeo).
			 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/class-wp-oembed.php
Related Hooks

Related hooks will be displayed here in future updates.