Make WordPress Core


Ignore:
Timestamp:
10/29/2015 10:50:13 PM (9 years ago)
Author:
pento
Message:

Embeds: Who put this REST API infrastructure in my WordPress?

Well, while it's here, we probably should make use of it. The oEmbed endpoint now uses the REST API infrastructure, instead of providing its own.

Props swissspidy.

Fixes #34207.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/default-filters.php

    r35423 r35436  
    440440
    441441// Embeds
    442 add_action( 'parse_query',          'wp_oembed_parse_query'                );
    443 
    444 add_action( 'wp_head',              'wp_oembed_add_discovery_links'        );
    445 add_action( 'wp_head',              'wp_oembed_add_host_js'                );
    446 
    447 add_action( 'embed_head',           'print_emoji_detection_script'         );
    448 add_action( 'embed_head',           'print_emoji_styles'                   );
    449 add_action( 'embed_head',           'print_embed_styles'                   );
    450 add_action( 'embed_head',           'wp_print_head_scripts',         20    );
    451 add_action( 'embed_head',           'wp_print_styles',               20    );
    452 add_action( 'embed_head',           'wp_no_robots'                         );
    453 add_action( 'embed_head',           'rel_canonical'                        );
    454 add_action( 'embed_head',           'locale_stylesheet'                    );
    455 
    456 add_action( 'embed_footer',         'print_embed_scripts'                  );
    457 add_action( 'embed_footer',         'wp_print_footer_scripts',       20    );
    458 
    459 add_filter( 'excerpt_more',         'wp_embed_excerpt_more',         20    );
    460 add_filter( 'the_excerpt_embed',    'wptexturize'                          );
    461 add_filter( 'the_excerpt_embed',    'convert_chars'                        );
    462 add_filter( 'the_excerpt_embed',    'wpautop'                              );
    463 add_filter( 'the_excerpt_embed',    'shortcode_unautop'                    );
    464 add_filter( 'the_excerpt_embed',    'wp_embed_excerpt_attachment'          );
    465 
    466 add_filter( 'oembed_dataparse',     'wp_filter_oembed_result',       10, 3 );
    467 add_filter( 'oembed_response_data', 'get_oembed_response_data_rich', 10, 4 );
     442add_action( 'rest_api_init',          'wp_oembed_register_route'              );
     443add_filter( 'rest_pre_serve_request', '_oembed_rest_pre_serve_request', 10, 4 );
     444
     445add_action( 'wp_head',                'wp_oembed_add_discovery_links'         );
     446add_action( 'wp_head',                'wp_oembed_add_host_js'                 );
     447
     448add_action( 'embed_head',             'print_emoji_detection_script'          );
     449add_action( 'embed_head',             'print_emoji_styles'                    );
     450add_action( 'embed_head',             'print_embed_styles'                    );
     451add_action( 'embed_head',             'wp_print_head_scripts',          20    );
     452add_action( 'embed_head',             'wp_print_styles',                20    );
     453add_action( 'embed_head',             'wp_no_robots'                          );
     454add_action( 'embed_head',             'rel_canonical'                         );
     455add_action( 'embed_head',             'locale_stylesheet'                     );
     456
     457add_action( 'embed_footer',           'print_embed_scripts'                   );
     458add_action( 'embed_footer',           'wp_print_footer_scripts',        20    );
     459
     460add_filter( 'excerpt_more',           'wp_embed_excerpt_more',          20    );
     461add_filter( 'the_excerpt_embed',      'wptexturize'                           );
     462add_filter( 'the_excerpt_embed',      'convert_chars'                         );
     463add_filter( 'the_excerpt_embed',      'wpautop'                               );
     464add_filter( 'the_excerpt_embed',      'shortcode_unautop'                     );
     465add_filter( 'the_excerpt_embed',      'wp_embed_excerpt_attachment'           );
     466
     467add_filter( 'oembed_dataparse',       'wp_filter_oembed_result',        10, 3 );
     468add_filter( 'oembed_response_data',   'get_oembed_response_data_rich',  10, 4 );
    468469
    469470unset( $filter, $action );
Note: See TracChangeset for help on using the changeset viewer.