010007.php
23 lines
| 1 | <?php #comp-page builds: premium |
| 2 | |
| 3 | /** |
| 4 | * Updates for altering the table used to store statistics data. |
| 5 | * Adds new columns and renames existing ones in order to add support for the new social buttons. |
| 6 | */ |
| 7 | class WDNUpdate010007 extends Wbcr_Factory480_Update { |
| 8 | |
| 9 | public function install() |
| 10 | { |
| 11 | global $wpdb; |
| 12 | |
| 13 | $hidden_notices = $this->plugin->getPopulateOption('hidden_notices'); |
| 14 | |
| 15 | $all_users = $wpdb->get_col("SELECT ID FROM {$wpdb->users}"); |
| 16 | |
| 17 | if( !empty($all_users) && !empty($hidden_notices) ) { |
| 18 | foreach($all_users as $user_id) { |
| 19 | update_user_meta($user_id, $this->plugin->getOptionName('hidden_notices'), $hidden_notices); |
| 20 | } |
| 21 | } |
| 22 | } |
| 23 | } |