rtForm::get_switch PHP Method

get_switch() public method

Get rtmedia html input type checkbox (get_switch) in admin options.
public get_switch ( string/array $attributes = '' ) : string
$attributes string/array
return string
        public function get_switch($attributes = '')
        {
            $attributes['switch'] = true;
            return $this->generate_checkbox($attributes);
        }

Usage Example

 public static function checkbox($args, $echo = true)
 {
     global $rtmedia;
     $options = $rtmedia->options;
     $defaults = array('key' => '', 'desc' => '', 'show_desc' => false);
     $args = wp_parse_args($args, $defaults);
     extract($args);
     if (!isset($value)) {
         trigger_error(__('Please provide "value" in the argument.', 'rtmedia'));
         return;
     }
     if (!empty($key)) {
         $args['name'] = 'rtmedia-options[' . $key . ']';
     }
     $args['rtForm_options'] = array(array('' => 1, 'checked' => $value));
     $chkObj = new rtForm();
     //		echo $chkObj->get_checkbox($args);
     if ($echo) {
         echo $chkObj->get_switch($args);
     } else {
         return $chkObj->get_switch($args);
     }
     //		echo $chkObj->get_switch_square($args);
 }
All Usage Examples Of rtForm::get_switch