by Garth | Jul 2, 2018 | MYSQL
INSERT INTO `flowerhhsa_wpbf4c`.`wp_postmeta` (`meta_id`, `post_id`, `meta_key`, `meta_value`) VALUES (”, ”, ‘xxxdate20180601’, 1000); Just match the fields. eg: (‘meta_id’,`post_id`) values (‘meta_id’,`post_id`) In this...
by Garth | Jul 2, 2018 | MYSQL
DELETE FROM `flowerhhsa_wpbf4c`.`wp_postmeta` WHERE `meta_key`=’xxxdate20180601′;
by Garth | Jul 2, 2018 | MYSQL
UPDATE `flowerhhsa_wpbf4c`.`wp_postmeta` SET `meta_key`=’key_name’ WHERE `meta_key`=’other_key_name’;
by Garth | Jul 2, 2018 | MYSQL
SELECT * FROM flowerhhsa_wpbf4c.wp_postmeta where post_id = 413;
by Garth | Jun 29, 2018 | PHP, Woocommerce, Wordpress
add_action(‘woocommerce_checkout_update_order_meta’,function( $order_id, $posted ) { $order = wc_get_order( $order_id ); $order->update_meta_data( ‘selected_date’, $_COOKIE[‘selected_date’] ); $order->save(); } , 10, 2); On...
by Garth | Jun 25, 2018 | Plugins, Wordpress
Woo Preview Emails Great for previewing the Woocommerce emails without having to send out a hundred emails for every...
by Garth | Jun 13, 2018 | Plugins, Wordpress
Edit posts on the fly...
by Garth | Jun 12, 2018 | Debugging, PHP, Wordpress
So today a client’s site that had its WordPress version updated (to 4.9.1) started throwing this error when they tried to use the Metaslider plugin to upload new images. Some searching confirmed this was happening to more than a few other people but I did not easily...
by Garth | Jun 5, 2018 | PHP, Snippets, Tools, Woocommerce, Wordpress
Send an email if there are any woocommerce orders created a before the current Day. $wp_query = new WP_Query( array( ‘posts_per_page’=> -1, ‘post_type’=>’shop_order’, ‘post_status’=>’wc-processing’,...
by Garth | Jun 5, 2018 | PHP, Snippets
function secondsToTime($seconds) { $dtF = new \DateTime(‘@0’); $dtT = new \DateTime(“@$seconds”); return $dtF->diff($dtT)->format(‘%a days, %h hours, %i minutes and %s seconds’); } echo...