It seems somewhere in your theme or plugins you are using a deprecated function.
Try to find where you are using wpdb::escape.
This is the row you mentioned from the functions.php file, it’s just a core hook that tell’s you when you are using deprecated core stuff:
function _deprecated_function( $function, $version, $replacement = null ) {
/**
* Fires when a deprecated function is called.
*
* @since 2.5.0
*
* @param string $function The function that was called.
* @param string $replacement The function that should have been called.
* @param string $version The version of WordPress that deprecated the function.
*/
do_action( 'deprecated_function_run', $function, $replacement, $version );
/**
* Filter whether to trigger an error for deprecated functions.
*
* @since 2.5.0
*
* @param bool $trigger Whether to trigger the error for deprecated functions. Default true.
*/
if ( WP_DEBUG && apply_filters( 'deprecated_function_trigger_error', true ) ) {
if ( function_exists( '__' ) ) {
if ( ! is_null( $replacement ) )
trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $function, $version, $replacement ) );
else
trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'), $function, $version ) );
} else {
if ( ! is_null( $replacement ) )
trigger_error( sprintf( '%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.', $function, $version, $replacement ) );
else
trigger_error( sprintf( '%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.', $function, $version ) );
}
}
}
If you aren’t using a proper IDE and can’t properly debug, I would recommend disabling all plugins and activating them one by one trying to find the problematic one.
wpdb::escape is probably being called from one of your plugins that hasn’t been updated for a long time.
Or, you can search the usage of this function in your code and find the problematic place.