500 error after update

In phpmyadmin search : SELECT * FROM wp_options WHERE option_name=”template” OR option_name=”stylesheet” OR option_name=”current_theme”; then : UPDATE wp_options SET option_value=”yourthemename” WHERE option_name=”template”; UPDATE wp_options SET option_value=”yourthemename” WHERE option_name=”stylesheet”; UPDATE wp_options SET option_value=”yourthemename” WHERE option_name=”current_theme”; or if you want to go back to default (presuming some default exists) SET option_value=”default” WHERE option_name=”template”; UPDATE wp_options SET option_value=”default” … Read more

Filter Hook callback error, is it due to using $this inside a filter or something else?

Problem The issue is that WordPress uses call_user_func() or call_user_func_array() to allow plugin/theme developers to add callables to hooks. Callables, or callback functions, can be simple functions, object methods, or static class methods. We need to format the callable as either a string or array depending on the type of callback we want. Simple Functions … Read more

“Cannot modify header information” means I can’t use wp_redirect

As Milo stated, you can’t send header information after PHP has begun sending request response body. Redirects belong in a function hooked into wp_loaded to ensure they run before the request body is generated. You need something like the following in your functions.php file: function hook_wp_loaded_require_login() { $uri = ( isset( $_SERVER[‘REQUEST_URI’] ) ) ? … Read more

class-wp-hook.php on line 288

Reinstalling core should fix this issue. This is more than likely related to a botched update from 5.3 to 5.3.1. Edit: To clarify, 5.3.1 included some hardening with relation to kses (specifically wp_kses_bad_protocol()) as noted in the release post. In the error output above, a core file was referencing a core function that didn’t exist, … Read more

Which is the correct way to conditionally enqueue a CSS file?

I agreed with @PatJ — you should check if get_queried_object() returns an object or not. But you could simplify your code by simply using is_category() and in_category() which are conditional tags in WordPress: if ( is_category( 3 ) || in_category( ‘arta’ ) ) { wp_enqueue_style( ‘twentytwenty-style-2’, get_stylesheet_directory_uri() . ‘/style-arta.css’, array(), $theme_version ); }