我试图将四个脚本文件排队,并不断出现以下错误:Fatal error: Allowed memory size of 103809024 bytes exhausted ... wp-includes/class.wp-dependencies.php on line 175.
我使用的wp\\u register\\u脚本如下:
wp_register_script(
\'sat-ba-cond\',
$scriptsrc . \'jquery.ba-cond.min.js\',
array(\'jquery\'),
\'1.0\',
true
);
wp_register_script(
\'sat-slitsl\',
$scriptsrc . \'jquery.slitslider.js\',
array(\'jquery\'),
\'1.0\',
true
);
wp_register_script(
\'sat-moderni\',
$scriptsrc . \'modernizr.custom.79639.js\',
array(\'jquery\'),
\'1.0\',
false
);
wp_register_script(
\'sat-callslit\',
$scriptsrc . \'call_slitslider.js\',
array(\'jquery\'),
\'1.0\',
false
);
wp\\u enqueue\\u脚本如下:
wp_enqueue_script( \'sat-moderni\' );
wp_enqueue_script( \'sat-slitsl\' );
wp_enqueue_script( \'sat-ba-cond\' );
wp_enqueue_script( \'sat-callslit\' );
什么可能导致此问题?我还注册了其他脚本并将其加入队列,但我没有将其包括在这里,因为它们一直在工作到现在。只有这四个和
wp_enqueue_script
尤其是造成了问题。会发生什么事?
add_action( \'wp_enqueue_scripts\', \'sat_load_javascript_files\' );
function sat_load_javascript_files() {
$scriptsrc = get_template_directory_uri() . \'/js/\';
wp_deregister_script(\'jquery\');
wp_register_script(
\'jquery\',
\'http://code.jquery.com/jquery-1.7.2.min.js\'
);
wp_register_script(
\'sat-bootstrap\',
$scriptsrc . \'bootstrap.min.js\',
array(\'jquery\'),
\'2.2.1\',
true
);
wp_register_script(
\'sat-masonry\',
$scriptsrc . \'jquery.masonry.min.js\',
array(\'jquery\'),
\'1.0\',
true
);
wp_register_script(
\'sat-fitvid\',
$scriptsrc . \'jquery.fitvids.js\',
array(\'jquery\'),
\'1.0\',
true
);
wp_register_script(
\'sat-callfitvid\',
$scriptsrc . \'call_fitvid.js\',
array(\'jquery\', \'sat-fitvid\'),
\'1.0\',
true
);
wp_register_script(
\'sat-flexslider\',
$scriptsrc . \'jquery.flexslider-min.js\',
array(\'jquery\'),
\'1.0\',
true
);
wp_register_script(
\'sat-callflexslider\',
$scriptsrc . \'call_flexslider.js\',
array(\'jquery\', \'sat-flexslider\'),
\'1.0\',
true
);
wp_register_script(
\'sat-mobcust\',
$scriptsrc . \'jquery.mobile.customized.min.js\',
array(\'jquery\'),
\'1.0\',
true
);
wp_register_script(
\'sat-infinite\',
$scriptsrc . \'jquery.infinitescroll.js\',
array(\'jquery\'),
\'1.0\',
true
);
wp_register_script(
\'sat-trigger\',
$scriptsrc . \'manual-trigger.js\',
array(\'jquery\'),
\'1.0\',
true
);
wp_register_script(
\'sat-biggtoggle\',
$scriptsrc . \'call_biotoggle.js\',
array(\'jquery\'),
\'1.0\',
false
);
wp_register_script(
\'sat-mas-inf-blg\',
$scriptsrc . \'masonry_isotope.js\',
array(\'jquery\', \'sat-masonry\', \'sat-infinite\'),
\'1.0\',
true
);
wp_register_script(
\'sat-maslin-blg\',
$scriptsrc . \'infinite_scroll_lin.js\',
array(\'jquery\', \'sat-infinite\'),
\'1.0\',
true
);
wp_register_script(
\'sat-mas_hyb\',
$scriptsrc . \'masonry_hybrid.js\',
array(\'jquery\', \'sat-masonry\', \'sat-infinite\'),
\'1.0\',
true
);
wp_register_script(
\'sat-ba-cond\',
$scriptsrc . \'jquery.ba-cond.min.js\',
array(\'jquery\'),
\'1.0\',
true
);
wp_register_script(
\'sat-slitsl\',
$scriptsrc . \'jquery.slitslider.js\',
array(\'jquery\'),
\'1.0\',
true
);
wp_register_script(
\'sat-moderni\',
$scriptsrc . \'modernizr.custom.79639.js\',
array(\'jquery\'),
\'1.0\',
false
);
wp_register_script(
\'sat-callslit\',
$scriptsrc . \'call_slitslider.js\',
array(\'jquery\'),
\'1.0\',
false
);
wp_enqueue_script( \'jquery\' );
wp_enqueue_script( \'sat-fitvid\' );
wp_enqueue_script( \'sat-flexslider\' );
wp_enqueue_script( \'sat-infinite\' );
wp_enqueue_script( \'sat-trigger\' );
wp_enqueue_script( \'sat-masonry\' );
wp_enqueue_script( \'sat-biggtoggle\' );
wp_enqueue_script( \'sat-callflexslider\' );
wp_enqueue_script( \'sat-callfitvid\' );
wp_enqueue_script( \'sat-moderni\' );
wp_enqueue_script( \'sat-slitsl\' );
wp_enqueue_script( \'sat-ba-cond\' );
wp_enqueue_script( \'sat-callslit\' );
if ( is_singular() && get_option( \'thread_comments\' ) ) wp_enqueue_script( \'comment-reply\' );
}