OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Warning: call_user_func_array() expects parameter 1 to be a valid callback, no array or string given

  • Thread starter Thread starter Ryan Lovejoy
  • Start date Start date
R

Ryan Lovejoy

Guest
I am on my WordPress website and these duplicate messages pop up on my dashboard. I am using WordPress 4.7.1. I do NOT have the FeedWordPress plugin on my site as I saw they had an issue with this error as well.

Warning: call_user_func_array() expects parameter 1 to be a valid callback, no array or string given in /home/mydomain/public_html/wp-includes/class-wp-hook.php on line 298

Warning: call_user_func_array() expects parameter 1 to be a valid callback, no array or string given in /home/mydomain/public_html/wp-includes/class-wp-hook.php on line 298

This line is 298

Code:
$value = call_user_func_array( $the_['function'], $args );

This is the function that contains line 298

Code:
public function apply_filters( $value, $args ) {
    if ( ! $this->callbacks ) {
        return $value;
    }

    $nesting_level = $this->nesting_level++;

    $this->iterations[ $nesting_level ] = array_keys( $this->callbacks );
    $num_args = count( $args );

    do {
        $this->current_priority[ $nesting_level ] = $priority = current( $this->iterations[ $nesting_level ] );

        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;
}

Is this a serious warning? If so, how would I fix this?
<p>I am on my WordPress website and these duplicate messages pop up on my dashboard. I am using WordPress 4.7.1. I do NOT have the FeedWordPress plugin on my site as I saw they had an issue with this error as well.</p>

<blockquote>
<p>Warning: call_user_func_array() expects parameter 1 to be a valid
callback, no array or string given in
/home/mydomain/public_html/wp-includes/class-wp-hook.php on line 298</p>

<p>Warning: call_user_func_array() expects parameter 1 to be a valid
callback, no array or string given in
/home/mydomain/public_html/wp-includes/class-wp-hook.php on line 298</p>
</blockquote>

<p>This line is 298 </p>

<pre><code>$value = call_user_func_array( $the_['function'], $args );
</code></pre>

<p>This is the function that contains line 298</p>

<pre><code>public function apply_filters( $value, $args ) {
if ( ! $this->callbacks ) {
return $value;
}

$nesting_level = $this->nesting_level++;

$this->iterations[ $nesting_level ] = array_keys( $this->callbacks );
$num_args = count( $args );

do {
$this->current_priority[ $nesting_level ] = $priority = current( $this->iterations[ $nesting_level ] );

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;
}
</code></pre>

<p>Is this a serious warning? If so, how would I fix this?</p>
Continue reading...
 

Latest posts

Top