简体   繁体   中英

Wordpress - The7 Template - On every page I have 4 Warnings and do not know how to disable it in menu or php site/content

I have a problem with my Wordpress site, more specifically, The7 template. On every page, including the main page at the bottom of page below footer I have 4 Warnings which are the same:

“Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'wp_filter_content_tags' not found or invalid function name in on line”

I do not know how to solve it/turn it off. Could you tell me which PHP page or what exactly cause this problem to appear? It's really annoying. Due to the fact that it is in the main body and not in any div/b/p/etc. tag I cannot hide it with CSS just for a while.

Kind regards Peter

Hiding error reporting on prod

On prod you want to avoid showing errors, due to security and user experience reasons. To achieve this, in PHP you can run

error_reporting(0);

or, even better, in php.ini , you can have this line

error_reporting = off

What the error means

The error tells you that a function is to be called by name, but it does not exist. wp_filter_content_tags does not exist in your context.

Solution to the error

Even though you have hidden error reporting on prod, you still need to show errors on dev and that function might do something very useful. From the doc you can see that it's located in wp-includes/media.php . So, if you do not need to call this function , then search for its calls and remove them. If you need this function, then require or include it into your files. If, for some reason you cannot remove this function (for ex. you do not want to hack a template that might have some versions in the future), but the function /file is not helpful for you, then you can implement a function with the same name.

Thank you very much for answer. I used it to find solution and in my case there is a need to change wp-config.php a little bit. It means to add these specific lines to code:

ini_set('display_errors','Off');
ini_set('error_reporting', E_ALL );
define('WP_DEBUG', false);
define('WP_DEBUG_DISPLAY', false)

In my case it worked and no more errors / warnings showed on every / main pages.

Kind Regards Peter

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM