Changing Multile free units at one time

Home Forums Legacy Support Support queries How-to & Troubleshooting Changing Multile free units at one time

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #16801
    hantaah
    Participant
    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
    #16913
    Anshuman Sahu
    Keymaster
    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 .
    #17020
    hantaah
    Participant
    Worked lovely, thank you
Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Changing Multile free units at one time’ is closed to new replies.