How remove trashed WooCommerce orders from wc_get_orders() result?

Use Wp_Query instead it will give you the option to get data with status. $args = array( ‘post_type’ => ‘shop_order’, ‘posts_per_page’ => ‘-1’, ‘post_status’ => array(‘publish’, ‘pending’, ‘draft’, ‘auto-draft’, ‘future’,’private’, ‘inherit’, ‘trash’) ); $my_query = new WP_Query($args); $orders = $my_query->posts; echo “<pre>”; print_r($orders); echo “</pre>”; it will display All of your order. hope this will … Read more

Does is_admin() really provide a plugin performance improvement?

The is_admin() function is basically used to check whether the running request is routing on /wp-admin/. Calling the is_admin() conditional function, you can restrict files you only want to load when a request goes through the /wp-admin/. Note that is_admin() and is_super_admin() are not the same and both handle different conditions. Looking forward, when sending … Read more

Creating two tables in database on activation hook

You’re not using the proper table name in your CONSTRAINT clause: CONSTRAINT `booking_timeslots_ibfk_1` FOREIGN KEY (`bid`) REFERENCES `booking_dates` (`id`) That should be: CONSTRAINT `booking_timeslots_ibfk_1` FOREIGN KEY (`bid`) REFERENCES `$date_table_name` (`id`) where $date_table_name (as I could see) is the correct table name.