WP_Embed::maybe_run_ajax_cache()

If a post/page was saved, then output JavaScript to make an Ajax request that will call WP_Embed::cache_oembed().


Source Source

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
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.