Critical Error message of WordPress adming

If you can access your dashboard, deactivate all the plugins and activate it one by one, and check your website. If you are not able to access your WP Dashboard because of this error. Go to your hosting Cpanel > File Manager > Public_html > wp-content, rename the plugin folder, and then check your website. … Read more

How to add a default predefined thumbnail when creating a brand new post?

I found an adequate solution. Generally, I used the save_post_{$post->post_type} hook which gave me a $post_ID and a $post object. I was just checking to see if there was a thumbnail and if is not there to add it. That is all. add_action( ‘save_post_book’, function ($post_ID, $post){ if ( get_post_meta($post_ID, ‘_thumbnail_id’, true) ) : return; … Read more

Detect if requested page is PWA on server side

You’re not passing the actual querystring to remove_query_arg(). After some quick testing, I think your $location value is probably an empty string, and the location you’re attempting to redirect to is ?isPwa. The 2nd parameter to remove_query_arg() should be the $referer value. function addIsPwaQueryArg() { $referer = wp_get_referer(); if (strpos($referer, ‘isPwa’) !== false) { $location … Read more