/**
  * Processes widget options to be saved
  */
 public function update($new_instance, $old_instance)
 {
     global $mycred;
     $instance = $old_instance;
     $allowed = $mycred->allowed_html_tags();
     $instance['title'] = wp_kses($new_instance['title'], $allowed);
     $instance['show_balance'] = isset($new_instance['show_balance']) ? $new_instance['show_balance'] : 0;
     $instance['show_limit'] = isset($new_instance['show_limit']) ? $new_instance['show_balance'] : 0;
     $instance['button'] = sanitize_text_field($new_instance['button']);
     mycred_flush_widget_cache('mycred_widget_transfer');
     return $instance;
 }
예제 #2
0
 /**
  * Processes widget options to be saved
  */
 function update($new_instance, $old_instance)
 {
     $instance = $old_instance;
     update_option('gabe_widget', $new_instance);
     $instance['title'] = trim($new_instance['title']);
     $instance['types'] = (array) $new_instance['types'];
     $instance['row'] = trim($new_instance['row']);
     $instance['show_visitors'] = isset($new_instance['show_visitors']) ? 1 : 0;
     $instance['message'] = trim($new_instance['message']);
     mycred_flush_widget_cache('mycred_widget_wallet');
     return $instance;
 }
예제 #3
0
 public function update($new_instance, $old_instance)
 {
     $instance = $old_instance;
     $instance['number'] = (int) $new_instance['number'];
     $instance['title'] = trim($new_instance['title']);
     $instance['show_visitors'] = $new_instance['show_visitors'];
     if (isset($new_instance['reset_leaderboard']) && $this->id !== false) {
         WL_Leaderboard::invalidate($this->id);
     }
     mycred_flush_widget_cache('wl_widget_leaderboard');
     return $instance;
 }
예제 #4
0
 /**
  * Processes widget options to be saved
  */
 public function update($new_instance, $old_instance)
 {
     global $mycred;
     $instance = $old_instance;
     $allowed = $mycred->allowed_html_tags();
     $instance['title'] = wp_kses($new_instance['title'], $allowed);
     $instance['types'] = (array) $new_instance['types'];
     $instance['row'] = wp_kses($new_instance['row'], $allowed);
     $instance['show_visitors'] = isset($new_instance['show_visitors']) ? 1 : 0;
     $instance['message'] = wp_kses($new_instance['message'], $allowed);
     mycred_flush_widget_cache('mycred_widget_wallet');
     return $instance;
 }
예제 #5
0
 /**
  * Processes widget options to be saved
  */
 function update($new_instance, $old_instance)
 {
     $instance = $old_instance;
     $instance['title'] = trim($new_instance['title']);
     $instance['show_balance'] = isset($new_instance['show_balance']) ? $new_instance['show_balance'] : 0;
     $instance['show_limit'] = isset($new_instance['show_limit']) ? $new_instance['show_balance'] : 0;
     mycred_flush_widget_cache('mycred_widget_transfer');
     return $instance;
 }