0
我遇到了僅在一個頁面/組件上,BuddyPress腳本正在以文本形式打印到頁面的情況。這發生在用戶配置文件的「更改封面圖像」選項卡上,而我在其他任何地方都沒有看到此問題。BuddyPress腳本以純文本打印出來?
我試着用Google搜索關鍵字的每個組合,我可以想到,並試圖在BuddyPress支持論壇發帖,但一直沒能得到任何幫助。
也許這裏的某個人可能能夠給我提供一些見解?
Here's a screenshot of what the page looks like.
模板文件看起來像:
<?php
/**
* BuddyPress Cover Images main template.
*
* This template is used to inject the BuddyPress Backbone views
* dealing with cover images.
*
* It's also used to create the common Backbone views.
*
* @since 2.4.0
*
* @package BuddyPress
* @subpackage bp-attachments
*/
?>
<div class="bp-cover-image"></div>
<div class="bp-cover-image-status"></div>
<div class="bp-cover-image-manage"></div>
<?php bp_attachments_get_template_part('uploader'); ?>
<script id="tmpl-bp-cover-image-delete" type="text/html">
<# if ('user' === data.object) { #>
<p><?php _e("If you would like to delete your current cover image but not upload a new one, please use the delete Cover Image button.", 'buddypress'); ?></p>
<p><a class="button edit" id="bp-delete-cover-image" href="#"><?php esc_html_e('Delete My Cover Image', 'buddypress'); ?></a></p>
<# } else if ('group' === data.object) { #>
<p><?php _e("If you would like to remove the existing group cover image but not upload a new one, please use the delete group cover image button.", 'buddypress'); ?></p>
<p><a class="button edit" id="bp-delete-cover-image" href="#"><?php esc_html_e('Delete Group Cover Image', 'buddypress'); ?></a></p>
<# } else { #>
<?php do_action('bp_attachments_cover_image_delete_template'); ?>
<# } #>
</script>
<?php do_action('bp_attachments_cover_image_main_template'); ?>
和所有的實際上兩倍的頁面本身在內嵌腳本標記爲文章全文如圖所示的出現,一度再一次上面的截圖。
我沒有得到任何javascript錯誤,我可以在我的控制檯中看到。
我真的很感謝任何能夠幫助我排除故障的人。
謝謝!