Preserve old values on error in setting API

Unfortunately WordPress does not provide the old value as an additional argument to your sanitize_callback callable. This is supported in general by the option validator hook that WordPress calls when saving the updated setting… return apply_filters( “sanitize_option_{$option}”, $value, $option, $original_value ); …but in practice it is not actually registered with any additional arguments when the … Read more

403 error on admin login page

I managed to enter the admin page finally! So I added these two lines to wp_admin.php: define(‘WP_HOME’,’http://example.com’); define(‘WP_SITEURL’,’http://example.com’); afterward deleted the .htaccess file, then deleted browsing history, cleared cache and cookies. After all of this I could enter the admin page. Then I went to options/general and options/permalinks and saved the setting, it generated a … Read more

Accidentally Broke Site (Please Help) [closed]

Via FTP, go into the /wp-content/plugins/ folder and delete the wp-date-remover/ folder. That will disable the plugin on the code level. If you need help with FTP, visit your web host control panel and navigate around, view their docs, andor talk to their support. (A very good reminder to always back up your website!)

Fatal error in wp-admin/customize.php after fresh install due to null $wp_customize

It seems I got some faulty nginx configuration from an article on how to configure WordPress in a subdirectory. Config Before location @wp { rewrite ^/blog(.*) /blog/index.php?q=$1; } location ^~ /blog { root /home/user; index index.php index.html index.htm; try_files $uri $uri/ @wp; location ~ \.php$ { include fastcgi_params; fastcgi_index index.php; fastcgi_intercept_errors on; # Deleted this … Read more

Console error, even if everything is working?

The colour picker is working fine because it’s a separate script being enqueued as a dependency of custom-script-handle. So even if custom-script-handle isn’t loading because the URL is wrong the colour picker script will still load. If you don’t enqueue custom-script-handle then the colour picker won’t work because the script is being enqueued at all. … Read more

PHP Fatal error: Call to a member function get() on null in /wp-includes/cache.php on line 123

That line 123 references the WordPress object cache, see https://github.com/WordPress/wordpress-develop/blob/7c38750b162c784d92f54d9a36044c0f5318fe24/src/wp-includes/cache.php#L123 Sounds like you have an external object cache (Memcached, Redis, etc.) that isn’t set up properly or a plugin that wrongly modifies WordPress’ internal object cache (which is basically a no-op). This could be configured by your host too. Try disabling all plugins to see … Read more