/**
  * Constructor
  *
  * @param Integer $id
  * @param Array $settings
  */
 public function __construct($id, array $settings)
 {
     parent::__construct($id, $settings);
     if (isset($settings['size'])) {
         $this->_size = $settings['size'];
     }
     if (isset($settings['language'])) {
         $this->_language = $settings['language'];
     }
     if (isset($settings['smart'])) {
         $this->smart = $settings['smart'];
     }
 }
 public function __construct($id, array $settings)
 {
     parent::__construct($id, $settings);
     $opts = $this->get_options();
     if (isset($settings['name'])) {
         $this->name = $settings['name'];
         $this->shortname = preg_replace('/[^a-z0-9]*/', '', $settings['name']);
     }
     if (isset($settings['icon'])) {
         $this->icon = $settings['icon'];
         $new_icon = esc_url_raw(wp_specialchars_decode($this->icon, ENT_QUOTES));
         $i = 0;
         while ($new_icon != $this->icon) {
             if ($i > 5) {
                 $this->icon = false;
                 break;
             } else {
                 $this->icon = $new_icon;
                 $new_icon = esc_url_raw(wp_specialchars_decode($this->icon, ENT_QUOTES));
             }
             $i++;
         }
     }
     if (isset($settings['url'])) {
         $this->url = $settings['url'];
     }
 }
Example #3
0
 public function __construct($id, array $settings)
 {
     parent::__construct($id, $settings);
     $opts = $this->get_options();
     if (isset($settings['name'])) {
         $this->name = $settings['name'];
         $this->shortname = preg_replace('/[^a-z0-9]*/', '', $settings['name']);
     }
     if (isset($settings['icon'])) {
         $this->icon = $settings['icon'];
     }
     if (isset($settings['url'])) {
         $this->url = $settings['url'];
     }
 }
Example #4
0
 public function __construct($id, array $settings)
 {
     parent::__construct($id, $settings);
     if (isset($settings['name'])) {
         $this->name = $settings['name'];
     }
     if (isset($settings['icon'])) {
         $this->icon = $settings['icon'];
     }
     if (isset($settings['url'])) {
         $this->url = $settings['url'];
     }
 }