Advertisement
Guest User

Untitled

a guest
May 26th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. function disable_embeds_init() {
  2.  
  3. // Remove the REST API endpoint.
  4. remove_action('rest_api_init', 'wp_oembed_register_route');
  5.  
  6. // Turn off oEmbed auto discovery.
  7. // Don't filter oEmbed results.
  8. remove_filter('oembed_dataparse', 'wp_filter_oembed_result', 10);
  9.  
  10. // Remove oEmbed discovery links.
  11. remove_action('wp_head', 'wp_oembed_add_discovery_links');
  12.  
  13. // Remove oEmbed-specific JavaScript from the front-end and back-end.
  14. remove_action('wp_head', 'wp_oembed_add_host_js');
  15. }
  16.  
  17. add_action('init', 'disable_embeds_init', 9999);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement