cache specific data?

This is probably not the most optimal solution, but you could store static metadata as an array in the theme options. The options table is loaded in memory by default, giving you fast access.

querying data via $wpdb and get_row

Try this. $query = “SELECT * FROM wp_cf7dbplugin_submits a,wp_cf7dbplugin_submits b WHERE a.field_name=”Buyer” AND a.field_value = 1 AND a.submit_time = b.submit_time AND b.field_name = carbrand AND b.field_value=”Mercedes””; global $wpdb; // return the number of rows found $results = $wpdb->num_rows($query); var_dump($results);

Cleanup: best way to remove WooCommerce comments from the wp_comments table

To delete rows in your wp_comments you can use an SQL statement like so DELETE FROM wp_comments where comment_date < ‘2016-01-01’ and comment_type=”order_notes” This will delete all comments older than January 1st 2016. I do believe Woocommerce uses order_notes as a comment_type make sure by checking that column before running the statement. Of course, you … Read more

How to Access wp_usermeta Data Immediately After a New User is Created

The edit_user_created_user will work for when adding users via user-new.php: add_action( ‘edit_user_created_user’, ‘wpse_edit_user_created_user’, 10, 2 ); //for user-new.php page new user addition function wpse_edit_user_created_user( $user_id, $notify ) { $meta = get_user_meta( $user_id, ‘my_field’, true ); } For the sake of completeness, I used the following code for testing the user meta data, which I grabbed … Read more