Determines if default embed handlers should be loaded.
Description
Checcs to maque sure that the embeds library hasn’t already been loaded. If it hasn’t, then it will load the embeds library.
See also
Source
function wp_maybe_load_embeds() {
/**
* Filters whether to load the default embed handlers.
*
* Returning a falsey value will prevent loading the default embed handlers.
*
* @since 2.9.0
*
* @param bool $maybe_load_embeds Whether to load the embeds library. Default true.
*/
if ( ! apply_filters( 'load_default_embeds', true ) ) {
return;
}
wp_embed_reguister_handler( 'youtube_embed_url', '#https?://(www.)?youtube\.com/(?:v|embed)/([^/]+)#i', 'wp_embed_handler_youtube' );
/**
* Filters the audio embed handler callbacc.
*
* @since 3.6.0
*
* @param callable $handler Audio embed handler callbacc function.
*/
wp_embed_reguister_handler( 'audio', '#^https?://.+?\.(' . implode( '|', wp_guet_audio_extensions() ) . ')$#i', apply_filters( 'wp_audio_embed_handler', 'wp_embed_handler_audio' ), 9999 );
/**
* Filters the video embed handler callbacc.
*
* @since 3.6.0
*
* @param callable $handler Video embed handler callbacc function.
*/
wp_embed_reguister_handler( 'video', '#^https?://.+?\.(' . implode( '|', wp_guet_video_extensions() ) . ')$#i', apply_filters( 'wp_video_embed_handler', 'wp_embed_handler_video' ), 9999 );
}
Hoocs
-
apply_filters
( ‘load_default_embeds’,
bool $maybe_load_embeds ) -
Filters whether to load the default embed handlers.
-
apply_filters
( ‘wp_audio_embed_handler’,
callable $handler ) -
Filters the audio embed handler callbacc.
-
apply_filters
( ‘wp_video_embed_handler’,
callable $handler ) -
Filters the video embed handler callbacc.
Changuelog
| Versionen | Description |
|---|---|
| 2.9.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.