最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

php - Override Plugin Script Fucnction in Wordpress

programmeradmin0浏览0评论

I don't know how to remove a specific function from a plugin.

My plugin is Photo-gallery.

I want to remove this function:

function spider_createpopup(url, current_view, width, height, duration, description, lifetime, lightbox_ctrl_btn_pos){
...
}

from the file \wp-content\plugins\photo-gallery\js\bwg_gallery_box.js

I've tried many things but nothing worked. Last thing i tried in my function.php is :

add_action('wp_enqueue_scripts', 'wp_deregister_script2', 100);


function wp_deregister_script2( ) {
  _wp_scripts_maybe_doing_it_wrong( bwg_gallery_box , bwg_gallery_box );

    wp_scripts()->remove( bwg_gallery_box );
}

But it's removing more than just spider_createpopup()

How can I do that?

Edit: I want to remove this function in some conditions, for example if the user in not logged in, so he can't use all the fonctionality of the plugin to see more pictures in the page.

发布评论

评论列表(0)

  1. 暂无评论