예제 #1
0
/**
 * Return an array of timezones for use in a visual composer element.
 *
 * @since   1.0.0
 *
 * @param   string  $context  The context to pass to our filter.
 *
 * @return  array             The array of timezones.
 */
function mm_get_timezones_for_vc($context = '')
{
    $empty_option = array(__('Select A Timezone', 'mm-components') => '');
    return $empty_option + array_flip(mm_get_timezones($context));
}
예제 #2
0
 /**
  * Output the Widget settings form.
  *
  * @since  1.0.0
  *
  * @param  array  $instance  The options for the widget instance.
  */
 public function form($instance)
 {
     $defaults = array('title' => '', 'date' => '', 'time' => '', 'timezone' => '');
     // Use our instance args if they are there, otherwise use the defaults.
     $instance = wp_parse_args($instance, $defaults);
     $title = $instance['title'];
     $date = $instance['date'];
     $time = $instance['time'];
     $timezone = $instance['timezone'];
     $classname = $this->options['classname'];
     // Title.
     $this->field_text(__('Title', 'mm-components'), '', $classname . '-title widefat', 'title', $title);
     // Date.
     $this->field_date(__('Date', 'mm-components'), __('Must be in the format MM/DD/YYYY. Example: 12/25/2015 would be Christmas of 2015.', 'mm-components'), $classname . '-date widefat', 'date', $date);
     // Time.
     $this->field_text(__('Time', 'mm-components'), __('Must be in the format HH:MM:SS. Example: 18:30:00 would be 6:30 PM.', 'mm-components'), $classname . '-time widefat', 'time', $time);
     // Timezone.
     $this->field_select(__('Timezone', 'mm-components'), __('', 'mm-components'), $classname . '-timezone widefat', 'timezone', $timezone, mm_get_timezones('mm-countdown'));
 }