Does anyone know how to hide PHP warnings in specific folders? I’m getting a lot of PHP warnings from 3rd party WordPress plugins that I don’t maintain, and I’d like to disable them. Specifically, I see things like:
Implicitly marking parameter $suffix as nullable is deprecated, the explicit nullable type must be used instead
Creation of dynamic property Yoast\WP\SEO\Surfaces\Classes_Surface::$container is deprecated
Eventually, I expect the plugin authors will update these plugins so that these warnings go away. In the meantime, however, the site is littered with debug mode warning messages that ruin the layout of the pages unless I disable debug mode completely, which I don’t want to do because I want to see warnings for plugins and themes I maintain. I’m not looking for a way to disable warnings about implicitly marking a parameter as nullable or creating a dynamic property, because I want to see these warnings in code I maintain, but I need to be able to hide them in code I don’t maintain. The solution I’ve come up with so far is to manually edit the third party plugins, with the intention of overwriting them with updated versions and repeating my edits again if necessary, but this is very time consuming and I would prefer to be able to only hide warnings for folders I don’t maintain. Is there a way to do this?
#hide #php #warnings #specific #folders

