wp_oembed_add_discovery_links

Adds oEmbed discovery links in the website .

Description

wp_oembed_add_discovery_links(); 

Usage

  1. if ( !function_exists( 'wp_oembed_add_discovery_links' ) ) { 
  2. require_once ABSPATH . WPINC . '/embed.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = wp_oembed_add_discovery_links(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/embed.php  
  1. function wp_oembed_add_discovery_links() { 
  2. $output = ''; 
  3.  
  4. if ( is_singular() ) { 
  5. $output .= '<link rel="alternate" type="application/json+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink() ) ) . '" />' . "\n"; 
  6.  
  7. if ( class_exists( 'SimpleXMLElement' ) ) { 
  8. $output .= '<link rel="alternate" type="text/xml+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink(), 'xml' ) ) . '" />' . "\n"; 
  9.  
  10. /** 
  11. * Filters the oEmbed discovery links HTML. 
  12. * @since 4.4.0 
  13. * @param string $output HTML of the discovery links. 
  14. */