PHP and WordPress Error

So I was using WordPress and decided to install a plugin called “Page scroll to id”.

After installing this plugin, everything was working fine for a little while and then my entire site decided to go haywire and give me the error message “Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘custom_modify_title’ not found or invalid function name in /home/sentryind/public_html/wp-includes/class-wp-hook.php on line 298”.

The code in this class-wp-hook.php file is as followed:

// 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'] ) );

With line 298 being the statement inside the elseif statement. So, after doing some more research, I noticed that some people were modifying their functions.php file to include this function, so I created

function custom_modify_title{} inside my functions.php file. This gets rid of the error, however, now my site has lost a lot of functionality with all areas that were using menus no longer being visible.

So I am guessing that after installing the plugin, it deleted this function and I have no idea how to recover this function or fix the issue. Any help is appreciated. Thank you!

Read more here: PHP and WordPress Error

Leave a Reply

Your email address will not be published. Required fields are marked *