警告:call_user_func_array()期望参数1是有效的回调,找不到函数'wordpress_footer_menu'或函数名无效 [英] Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ' wordpress_footer_menu' not found or invalid function name
问题描述
警告:call_user_func_array()期望参数1是有效的回调,函数'wordpress_footer_menu'未找到或C中的函数名无效:\ xampp \\\ htdocs \ wordpress \ wp-includes \class-wp-第286行的hook.php
function.php
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ' wordpress_footer_menu' not found or invalid function name in C:\xampp\htdocs\wordpress\wp-includes\class-wp-hook.php on line 286
function.php
<?php
function wordpress_menu() {
register_nav_menu('primary','Top Navigation');
}
add_action('init','wordpress_menu');
function wordpress_footer_menu() {
register_nav_menu('footer','Footer Navigation');
}
add_action('init',' wordpress_footer_menu');
add_theme_support('post-thumbnails');
?>
header.php
header.php
<!DOCTYPE HTML>
<meta charset= "<?php bloginfo('charset'); ?>" />
<title><?php bloginfo('name'); ?> | <?php wp_title(); ?>
<?php wp_head(); ?>
<div id="wrapper">
<div id="header">
<div id="logo">
<h2><?php bloginfo('name'); ?></h2>
<h4><?php bloginfo('description'); ?></h4>
</div>
<div id="menu">
<?php wp_nav_menu(array('theme_location' => 'primary')); ?>
</div>
</div>
footer.php
footer.php
</div>
<div id="footer">
© wordpress.com All rights reserved.
</div>
<?php wp_footer(); ?>
index.php
index.php
<?php get_header(); ?>
<div id="body_content"></div>
<?php get_footer(); ?>
class-wp-hook.php
class-wp-hook.php
foreach ( $this->callbacks[ $priority ] as $the_ ) {
if( ! $this->doing_action ) {
$args[ 0 ] = $value;
}
// Avoid the array_slice if possible.
if ( $the_['accepted_args'] == 0 ) {
$value = call_user_func_array( $the_['function'], array() );
} elseif ( $the_['accepted_args'] >= $num_args ) {
$value = call_user_func_array( $the_['function'], $args );
} else {
$value = call_user_func_array( $the_['function'], array_slice( $args, 0, (int)$the_['accepted_args'] ) );
}
}
} while ( false !== next( $this->iterations[ $nesting_level ] ) );
unset( $this->iterations[ $nesting_level ] );
unset( $this->current_priority[ $nesting_level ] );
$this->nesting_level--;
return $value;
}
我的尝试:
警告:call_user_func_array()期望参数1是有效的回调,函数'wordpress_footer_menu'未找到或C中的函数名无效:\ xampp \\\ htdocs \ wordpress \ wp-includes \ class第286行-wp-hook.php
What I have tried:
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ' wordpress_footer_menu' not found or invalid function name in C:\xampp\htdocs\wordpress\wp-includes\class-wp-hook.php on line 286
推荐答案
this-> callbacks [
this->callbacks[
priority] as
priority ] as
the_){
if(!
the_ ) { if( !
这篇关于警告:call_user_func_array()期望参数1是有效的回调,找不到函数'wordpress_footer_menu'或函数名无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!