【问题标题】:NextGen Gallery issues with Iframe plugins与 iframe 插件有关的 NextGen Gallery 问题
【发布时间】:2023-03-21 10:12:01
【问题描述】:

我已经尝试了几个基于 iframe 的弹出插件和 WordPress Nextgen 库。它总是从 frame_event_publisher.js 文件中生成一个 js 错误。

有没有办法阻止在另一个插件中加载这个文件?

【问题讨论】:

  • 您遇到的错误是什么?
  • 我收到 TypeError: this.find_parent(...) is undefined this.find_parent(child).register_child(child.Frame_Event_Publisher);
  • 我可以确认这种情况仍在发生。要复制,只需在 iframe 中打开任何管理页面,就会出现错误。

标签: wordpress plugins nextgen-gallery


【解决方案1】:

解决此问题的一种方法是强制使脚本出队。您必须添加一个条件以仅在需要时将其出列,因为 NextGEN 可能需要此脚本才能工作。

add_action( 'wp_print_scripts', 'dequeue_frame_event_publisher', 100 );
function dequeue_frame_event_publisher() {
    if ( is_admin() ) { // Add another condition to check if in an iframe.
        wp_dequeue_script( 'frame_event_publisher' );
    }
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-04-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-09-04
    相关资源
    最近更新 更多