Created
August 3, 2016 13:39
-
-
Save AlkarE/2ba020802b50471e62b71eb80f5e1fd4 to your computer and use it in GitHub Desktop.
wordpress disable embed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function disable_embeds_init() { | |
// Remove the REST API endpoint. | |
remove_action('rest_api_init', 'wp_oembed_register_route'); | |
// Turn off oEmbed auto discovery. | |
// Don't filter oEmbed results. | |
remove_filter('oembed_dataparse', 'wp_filter_oembed_result', 10); | |
// Remove oEmbed discovery links. | |
remove_action('wp_head', 'wp_oembed_add_discovery_links'); | |
// Remove oEmbed-specific JavaScript from the front-end and back-end. | |
remove_action('wp_head', 'wp_oembed_add_host_js'); | |
} | |
add_action('init', 'disable_embeds_init', 9999); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment