Uses
Uses | Description |
---|---|
wp-includes/link-template.php: admin_url() | Retrieves the URL to the admin area for the current site. |
wp-includes/post.php: get_post() | Retrieves post data given a post ID or post object. |
If a post/page was saved, then output JavaScript to make an Ajax request that will call WP_Embed::cache_oembed().
File: wp-includes/class-wp-embed.php
public function maybe_run_ajax_cache() { $post = get_post(); if ( ! $post || empty( $_GET['message'] ) ) { return; } ?> <script type="text/javascript"> jQuery(document).ready(function($){ $.get("<?php echo admin_url( 'admin-ajax.php?action=oembed-cache&post=' . $post->ID, 'relative' ); ?>"); }); </script> <?php }
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_embed/maybe_run_ajax_cache