Automatically Delete Woocommerce Images After Deleting a Product

// Automatically Delete Woocommerce Images After Deleting a Product add_action( ‘before_delete_post’, ‘delete_product_images’, 10, 1 ); function delete_product_images( $post_id ) { $product = wc_get_product( $post_id ); if ( !$product ) { return; } $featured_image_id = $product->get_image_id(); $image_galleries_id = $product->get_gallery_image_ids(); if( !empty(…Continue reading

User preferences

echo ‘The current logged in user ID is: ‘.get_current_user_id(); echo ; $all_meta_for_user = get_user_meta( get_current_user_id() ); print_r( $all_meta_for_user ); echo ; $last_name = $all_meta_for_user[‘last_name’][0]; echo ; echo ‘Last name:’.$last_name;Continue reading

Display WPForm Entries

/** * Custom shortcode to display WPForms form entries in table view. * * Basic usage: [wpforms_entries_table id=”FORMID”]. * * Possible shortcode attributes: * id (required) Form ID of which to show entries. * user User ID, or “current” to…Continue reading