WordPress开发者和主题制作者的搜索引擎



wp_embed_register_handler ›

Since2.9.0
已弃用n/a
wp_embed_register_handler ( $id, $regex, $callback, $priority = 10 )
参数: (4)
  • (string) $id An internal ID/name for the handler. Needs to be unique.
    Required: Yes
  • (string) $regex The regex that will be used to see if this handler should be used for a URL.
    Required: Yes
  • (callable) $callback The callback function that will be called if the regex is matched.
    Required: Yes
  • (int) $priority Optional. Used to specify the order in which the registered handlers will be tested. Default 10.
    Required: No
    默认: 10
定义在:
文档:

Registers an embed handler.

Should probably only be used for sites that do not support oEmbed.



源码

function wp_embed_register_handler( $id, $regex, $callback, $priority = 10 ) {
	global $wp_embed;
	$wp_embed->register_handler( $id, $regex, $callback, $priority );
}