0
我試圖安裝wordpress插件「即時文章爲WP」(https://es.wordpress.org/plugins/fb-instant-articles/),我完成了這個過程,但是當我到達要發送5篇文章評論FB插件顯示我試圖檢查所有(5)的帖子來解決它的警告,我試圖編輯帖子,但包含即時文章的框正在加載,並沒有解決任何問題,在Chrome控制檯中,我得到「Uncaught ReferenceError:instant_articles_load_meta_box is沒有定義的」。我試圖將jquery聲明移到頂端,但錯誤仍然存在。有任何想法嗎? ):WordPress的Facebook即時文章不工作
即時文章-元box.js
function instant_articles_force_submit (post_ID) {
var data = {
'action': 'instant_articles_force_submit',
'post_ID': post_ID,
'force': jQuery('#instant_articles_force_submit').is(':checked'),
'security': jQuery('#instant_articles_force_submit').attr('data-security')
};
jQuery.post(ajaxurl, data, function(response) {
instant_articles_load_meta_box(post_ID);
});
}
function instant_articles_load_meta_box (post_ID) {
jQuery(document).ready(function($) {
var data = {
'action': 'instant_articles_meta_box',
'post_ID': post_ID
};
jQuery.post(ajaxurl, data, function(response) {
jQuery('#instant_article_meta_box .inside').html(response);
jQuery('#instant_articles_force_submit').click(function() {
instant_articles_force_submit(post_ID);
});
}, 'html');
jQuery('#instant_article_meta_box').delegate('.instant-articles-toggle-debug', 'click', function() {
jQuery('#instant_article_meta_box').toggleClass('instant-articles-show-debug');
return false;
});
});
}
元箱架的template.php
<span class="instant_articles_spinner" ></span>
<script>
instant_articles_load_meta_box(<?php echo absint($post->ID); ?>);
</script>
- WP版本4.7.3
- PHP版本5.4.17
- 插件版本3.3.3