IVCatalina
IVCatalina

Reputation: 356

Can't Hide Error Messages with Wordpress 5.0

Our Wordpress was updated to 5.0 overnight, and we now have an error message showing at the top of all webpages:

Everything still works accordingly, and I really just need to hide the error code, but since the update it seems the warning message can't be hidden. I have the following code already added to my wp-config.php file:

 ini_set('log_errors','On');
 ini_set('display_errors','Off');
 ini_set('error_reporting', E_ALL );
 define('WP_DEBUG', false);
 define('WP_DEBUG_LOG', true);
 define('WP_DEBUG_DISPLAY', false);

But I am still seeing the following error code:

Warning: Declaration of WC_Product_Booking::get_price() should be compatible with WC_Product::get_price($context = 'view') in /public_html/wp-content/plugins/woocommerce-bookings/includes/class-wc-product-booking.php on line 0

How can I hide this? Did 5.0 remove the ability to hide error codes?

Upvotes: 0

Views: 543

Answers (2)

Jayden Yoon ZK
Jayden Yoon ZK

Reputation: 11

Method 1

* Editing the display_errors :

Go to the website's cPanel, search for and click on Select PHP Version, inside PHP Selector, select Options, under PHP Options, untick the display_errors ☐ radio box.


* If Method 1 didn't work, try Method 2.


Method 2

* Editing the functions.php :

Add these codes into the functions.php file - located in the WordPress' Appearance > Theme File Editor > Theme Files :

ini_set('display_errors', 0);
ini_set('display_startup_errors', 0);
error_reporting(0);

* Please note that it is a better practice to fix the errors instead of hiding them.


Upvotes: 1

Okba
Okba

Reputation: 783

Try setting error_reporting to 0 instead of E_ALL and see if it works

 ini_set('error_reporting', 0);

Upvotes: 0

Related Questions