WFMattR on "[Plugin: Wordfence Security] Wordfence CSS/Javascript inserted in front-end if logged in"

ساخت وبلاگ

This was throwing issues on our site and affecting other jQuery.

I simply swapped out the jQuery ColourBox plugin that WordFence is loading for the most recent, using the wp_enqueue_scripts action hook:

// after all other scripts are queued (priority 11), run our own un-queue and re-queue
add_action( 'wp_enqueue_scripts', 'register_own_colorbox_script', 11 );
function register_own_colorbox_script(){ // deregister WordFence's version wp_deregister_script('jquery.wfcolorbox'); // register the up-to-date 1.6.4 version instead wp_enqueue_script('jquery.wfcolorbox', 'https://cdnjs.cloudflare.com/ajax/libs/jquery.colorbox/1.6.4/jquery.colorbox-min.js', array('jquery'), '1.6.4');
}

You might also want to queue the CSS for most recent ColorBox too.

WordPress ...
ما را در سایت WordPress دنبال می کنید

برچسب : نویسنده : استخدام کار wpss بازدید : 200 تاريخ : چهارشنبه 2 تير 1395 ساعت: 6:33