after an error occurred with my website, I received an email from WordPress saying a fatal error happened with Elementor. After I recovered access to the website, a line of code is appearing at the top of every page of my non-logged-in users
This is what is appearing: home1/shap71/public_html/wp-includes/functions.php on line 5379
So I went to the file manager on cPanel, downloaded this file to inspect this line. Here is what it says from line 5368 to 5415:
if ( WP_DEBUG && apply_filters( 'deprecated_function_trigger_error', true ) ) {
if ( function_exists( '__' ) ) {
if ( $replacement ) {
trigger_error(
sprintf(
/* translators: 1: PHP function name, 2: Version number, 3: Alternative function name. */
__( 'Function %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.' ),
$function,
$version,
$replacement
),
E_USER_DEPRECATED
);
} else {
trigger_error(
sprintf(
/* translators: 1: PHP function name, 2: Version number. */
__( 'Function %1$s is <strong>deprecated</strong> since version %2$s with no alternative available.' ),
$function,
$version
),
E_USER_DEPRECATED
);
}
} else {
if ( $replacement ) {
trigger_error(
sprintf(
'Function %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.',
$function,
$version,
$replacement
),
E_USER_DEPRECATED
);
} else {
trigger_error(
sprintf(
'Function %1$s is <strong>deprecated</strong> since version %2$s with no alternative available.',
$function,
$version
),
E_USER_DEPRECATED
);
}
}
}
}
But then the line 5379 only says: E_USER_DEPRECATED
as it says in other lines too...
What do you guys think I should do to make this code go away from my pages?
CodePudding user response:
Important note: You should never do any edits in WordPress core files.
This is the place that will tell the system what type of error it is. It is not the error itself. You just need to go to the wp-config.php file and change the WP_DEBUG
from true to false.
like so: define('WP_DEBUG', false);
This will stop showing the warning.