GC_Embed::maybe_run_ajax_cache()

最后更新于:2021-11-27 14:40:56

GC_Embed::maybe_run_ajax_cache()

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

源文件

文件: gc-includes/class-gc-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 esc_url( admin_url( 'admin-ajax.php', 'relative' ) ) . '?action=oembed-cache&post=' . $post->ID; ?>");
	});
</script>
		<?php
	}