欢迎来到元素模板WWW.YS720.COM,本站提供专业的织梦模板网站模板ASPCMS模板
当前位置:主页 > 程序教程 > wordpress教程 >
wordpress教程

wordpress 去google 谷歌JS公共库替换(不用360)

(元素模板) / 2017-11-29 16:50
谷歌的JS 国内都封了,wordpress根本无法使用
如何替换呢?

找到/wp-includes/script-loader.php

搜索 google 找到如下代码

$scripts->add( 'prototype', '//ajax.googleapis.com/ajax/libs/prototype/1.7.1.0/prototype.js', array(), '1.7.1');
$scripts->add( 'scriptaculous-root', '//ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/scriptaculous.js', array('prototype'), '1.9.0');
$scripts->add( 'scriptaculous-builder', '//ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/builder.js', array('scriptaculous-root'), '1.9.0');
$scripts->add( 'scriptaculous-dragdrop', '//ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/dragdrop.js', array('scriptaculous-builder', 'scriptaculous-effects'), '1.9.0');
$scripts->add( 'scriptaculous-effects', '//ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/effects.js', array('scriptaculous-root'), '1.9.0');
$scripts->add( 'scriptaculous-slider', '//ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/slider.js', array('scriptaculous-effects'), '1.9.0');
$scripts->add( 'scriptaculous-sound', '//ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/sound.js', array( 'scriptaculous-root' ), '1.9.0' );
$scripts->add( 'scriptaculous-controls', '//ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/controls.js', array('scriptaculous-root'), '1.9.0');

统统替换成下面的代码

$scripts->add( 'prototype', '//cdn.cdnjs.net/prototype/1.7.1.0/prototype.js', array(), '1.7.1');  
$scripts->add( 'scriptaculous-root', '//cdn.cdnjs.net/scriptaculous/1.9.0/scriptaculous.js', array('prototype'), '1.9.0');  
$scripts->add( 'scriptaculous-builder', '//cdn.cdnjs.net/scriptaculous/1.9.0/builder.js', array('scriptaculous-root'), '1.9.0');  
$scripts->add( 'scriptaculous-dragdrop', '//cdn.cdnjs.net/scriptaculous/1.9.0/dragdrop.js', array('scriptaculous-builder', 'scriptaculous-effects'), '1.9.0');  
$scripts->add( 'scriptaculous-effects', '//cdn.cdnjs.net/scriptaculous/1.9.0/effects.js', array('scriptaculous-root'), '1.9.0');  
$scripts->add( 'scriptaculous-slider', '//cdn.cdnjs.net/scriptaculous/1.9.0/slider.js', array('scriptaculous-effects'), '1.9.0');  
$scripts->add( 'scriptaculous-sound', '//cdn.cdnjs.net/scriptaculous/1.9.0/sound.js', array( 'scriptaculous-root' ), '1.9.0' );  
$scripts->add( 'scriptaculous-controls', '//cdn.cdnjs.net/scriptaculous/1.9.0/controls.js', array('scriptaculous-root'), '1.9.0');  

Copyright @ 2013-2019 元素模板 YS720.COM All Rights Reserved. 版权所有 元素模板 YS720.COM