WP_Embed::maybe_run_ajax_cache

Advertisement

Summery Summery

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

Syntax Syntax

WP_Embed::maybe_run_ajax_cache()

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
	}

Advertisement

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.