Hi
Can you tell me how I can change multiple free units to non free units all in one time instead of changing them all manually one by one?
Many thanks
Please add the given code in your wplms-customizer.php file in wplms customizer plugin .
and reload any page in your website and its done .
add_action('init','change_all_units_to_paid');
function change_all_units_to_paid(){
global $wpdb;
$units= $wpdb->get_results($wpdb->prepare("SELECT DISTINCT unit.id from {$wpdb->posts} as unit WHERE unit.post_type=%s",'unit'));
foreach( $units as $unit){
update_post_meta($unit->id,'vibe_free','H');
}
}
after loading any page in your website please remove the code from the wplms customizer file .