Add product attribute columns to Woocommerce backend grid

If you have to extend the backend product grid of Woocommerce by an custom attribute , you have to follow the steps below to add product attribute columns to Woocommerce backend grid: Register and sort  the new columns via a filter hook (‘manage_edit-product_columns’): <?php add_filter( ‘manage_edit-product_columns’, ‘add_columns_to_product_grid’, 10, 1 ); const BACKEND_PRODUCT_GRID_FIELD_SORTORDER = [ ‘cb’, ‘thumb’, ‘name’, […]

wordpress cron: using wp_mail function

Today I had to solve the problem, that my wordpress cron throws an exception like this when sending an email via wp_mail function inside a cron scheduled event function. PHP Fatal error: Uncaught exception ‘phpmailerException’ with message ‘Invalid address: (setFrom) wordpress@’ in /var/www/clients/client2/web8/web/wp-base/wp-includes/class-phpmailer.php:1023 Stack trace: #0 /var/www/clients/client2/web8/web/wp-base/wp-includes/pluggable.php(352): PHPMailer->setFrom(‘wordpress@’, ‘WordPress’, false) #1 /var/www/clients/client2/web8/web/wp-base/wp-content/plugins/sheldon_misc/admin/class-sheldon_misc-admin.php(183): wp_mail(‘info@ask-sheldon.com….’, ‘Statusmailing i…’, […]

Force HTTPS for WordPress Installations

Just add this snippet to the beginning of your rewrite section of your .htaccess file to force HTTPS: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On # FORCE HTTPS: RewriteCond %{HTTPS} !=on RewriteRule ^(.*) https://%{SERVER_NAME}/$1 [R,L] … </IfModule> # END WordPress As you can see, I placed it directly under “RewriteEngine On”. Or you can also […]

Change the basedomian of your blog

Sometimes you have to change the base domains of your blog. Therefore there are the following possibilities (ATTENTION: These snippets are thought to be used with a single site installation): Backend settings If you have access to the Backend of your WordPress installation, you can change the basedomain of your blog under: Settings -> General -> WordPress […]