0

我正在使用 WordPress。

我将此代码添加到functions.php:

function modify_jquery() {
        wp_deregister_script('jquery');
        wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js', false, '1.4.4');
        wp_enqueue_script('jquery');
}
add_action('init', 'modify_jquery');

后来我发现“快速编辑”坏了,当试图快速编辑一个帖子时它就消失了。

任何建议如何解决这个问题?

4

1 回答 1

1

你为什么使用 jQuery 的 1.4.4 版本?你不能使用最新的:http ://code.jquery.com/jquery-latest.min.js吗?

我在操作wp_enqueue_scripts上使用最后一个, 这对我来说很好。

add_action('wp_enqueue_scripts', 'actionRegisterAssets', 0);
function actionRegisterAssets()
{
// Unregister default scripts
wp_deregister_script('jquery');
wp_register_script('jquery', 'http://code.jquery.com/jquery-latest.min.js', array(), '1.7.2');
wp_enqueue_script('jquery');
}
于 2012-06-26T09:41:02.000 回答