wordpress4.4 优化wp-json链接、embeds功能

  1. add_filter('rest_enabled', '_return_false');
  2. add_filter('rest_jsonp_enabled', '_return_false');
  3. remove_action( 'wp_head', 'rest_output_link_wp_head', 10 );
  4. remove_action( 'wp_head', 'wp_oembed_add_discovery_links', 10 );
  1. function disable_embeds_init() {
  2. global $wp;
  3. $wp->public_query_vars = array_diff( $wp->public_query_vars, array( 'embed', ) );
  4. remove_action( 'rest_api_init', 'wp_oembed_register_route' );
  5. add_filter( 'embed_oembed_discover',