/
home
/
desid573
/
verdenaturopathy.com.au
/
site3
/
wp-content
/
plugins
/
meta-box
/
inc
/
fields
/
/home/desid573/verdenaturopathy.com.au/site3/wp-content/plugins/meta-box/inc/fields
mkdir
upload
Name
Size
Mode
Actions
autocomplete.php
3146
0644
edit
dl
rm
background.php
5605
0644
edit
dl
rm
button-group.php
1965
0644
edit
dl
rm
button.php
1346
0644
edit
dl
rm
checkbox-list.php
501
0644
edit
dl
rm
checkbox.php
1405
0644
edit
dl
rm
choice.php
1885
0644
edit
dl
rm
color.php
2607
0644
edit
dl
rm
custom-html.php
638
0644
edit
dl
rm
date.php
735
0644
edit
dl
rm
datetime.php
8834
0644
edit
dl
rm
divider.php
893
0644
edit
dl
rm
fieldset-text.php
3318
0644
edit
dl
rm
file-input.php
1637
0644
edit
dl
rm
file-upload.php
1165
0644
edit
dl
rm
file.php
15916
0644
edit
dl
rm
heading.php
959
0644
edit
dl
rm
image-advanced.php
2533
0644
edit
dl
rm
image-select.php
2415
0644
edit
dl
rm
image-upload.php
1021
0644
edit
dl
rm
image.php
4814
0644
edit
dl
rm
input-list.php
2690
0644
edit
dl
rm
input.php
3139
0644
edit
dl
rm
key-value.php
3748
0644
edit
dl
rm
map.php
6714
0644
edit
dl
rm
media.php
7140
0644
edit
dl
rm
multiple-values.php
1396
0644
edit
dl
rm
number.php
971
0644
edit
dl
rm
object-choice.php
4174
0644
edit
dl
rm
oembed.php
4114
0644
edit
dl
rm
osm.php
5182
0644
edit
dl
rm
password.php
564
0644
edit
dl
rm
post.php
5737
0644
edit
dl
rm
radio.php
405
0644
edit
dl
rm
range.php
1529
0644
edit
dl
rm
select-advanced.php
2396
0644
edit
dl
rm
select-tree.php
1536
0644
edit
dl
rm
select.php
2585
0644
edit
dl
rm
sidebar.php
1533
0644
edit
dl
rm
single-image.php
1830
0644
edit
dl
rm
slider.php
2091
0644
edit
dl
rm
switch.php
2390
0644
edit
dl
rm
taxonomy-advanced.php
3031
0644
edit
dl
rm
taxonomy.php
10111
0644
edit
dl
rm
text-list.php
3463
0644
edit
dl
rm
text.php
1019
0644
edit
dl
rm
textarea.php
1891
0644
edit
dl
rm
time.php
721
0644
edit
dl
rm
user.php
4684
0644
edit
dl
rm
video.php
4142
0644
edit
dl
rm
wysiwyg.php
2417
0644
edit
dl
rm
Edit:
/home/desid573/verdenaturopathy.com.au/site3/wp-content/plugins/meta-box/inc/fields/datetime.php
(8834B)
<?php /** * The date and time picker field which allows users to select both date and time via jQueryUI datetime picker. * * @package Meta Box */ /** * Datetime field class. */ class RWMB_Datetime_Field extends RWMB_Text_Field { /** * Translate date format from jQuery UI date picker to PHP date(). * It's used to store timestamp value of the field. * Missing: '!' => '', 'oo' => '', '@' => '', "''" => "'". * * @var array */ protected static $date_formats = array( 'd' => 'j', 'dd' => 'd', 'oo' => 'z', 'D' => 'D', 'DD' => 'l', 'm' => 'n', 'mm' => 'm', 'M' => 'M', 'MM' => 'F', 'y' => 'y', 'yy' => 'Y', 'o' => 'z', ); /** * Translate time format from jQuery UI time picker to PHP date(). * It's used to store timestamp value of the field. * Missing: 't' => '', T' => '', 'm' => '', 's' => ''. * * @var array */ protected static $time_formats = array( 'H' => 'G', 'HH' => 'H', 'h' => 'g', 'hh' => 'h', 'mm' => 'i', 'ss' => 's', 'l' => 'u', 'tt' => 'a', 'TT' => 'A', ); public static function register_assets() { // jQueryUI base theme: https://github.com/jquery/jquery-ui/tree/1.12.1/themes/base $url = RWMB_CSS_URL . 'jqueryui'; wp_register_style( 'jquery-ui-core', "$url/core.css", [], '1.12.1' ); wp_register_style( 'jquery-ui-theme', "$url/theme.css", [], '1.12.1' ); wp_register_style( 'jquery-ui-datepicker', "$url/datepicker.css", ['jquery-ui-core', 'jquery-ui-theme'], '1.12.1' ); wp_register_style( 'jquery-ui-slider', "$url/slider.css", ['jquery-ui-core', 'jquery-ui-theme'], '1.12.1' ); // jQueryUI timepicker addon: https://github.com/trentrichardson/jQuery-Timepicker-Addon wp_register_style( 'jquery-ui-timepicker', "$url/jquery-ui-timepicker-addon.min.css", ['rwmb-date', 'jquery-ui-slider'], '1.6.3' ); wp_register_style( 'rwmb-date', RWMB_CSS_URL . 'date.css', ['jquery-ui-datepicker'], RWMB_VER ); // Scripts. $url = RWMB_JS_URL . 'jqueryui'; wp_register_script( 'jquery-ui-timepicker', "$url/jquery-ui-timepicker-addon.min.js", ['jquery-ui-datepicker', 'jquery-ui-slider'], '1.6.3', true ); wp_register_script( 'jquery-ui-timepicker-i18n', "$url/jquery-ui-timepicker-addon-i18n.min.js", ['jquery-ui-timepicker'], '1.6.3', true ); wp_register_script( 'rwmb-datetime', RWMB_JS_URL . 'datetime.js', ['jquery-ui-datepicker', 'jquery-ui-timepicker-i18n', 'underscore'], RWMB_VER, true ); wp_register_script( 'rwmb-date', RWMB_JS_URL . 'date.js', ['jquery-ui-datepicker', 'underscore'], RWMB_VER, true ); wp_register_script( 'rwmb-time', RWMB_JS_URL . 'time.js', ['jquery-ui-timepicker-i18n'], RWMB_VER, true ); $handles = ['datetime', 'time']; $locale = str_replace( '_', '-', get_locale() ); $locale_short = substr( $locale, 0, 2 ); $data = array( 'locale' => $locale, 'localeShort' => $locale_short, ); foreach ( $handles as $handle ) { RWMB_Helpers_Field::localize_script_once( "rwmb-$handle", 'RWMB_' . ucfirst( $handle ), $data ); } } /** * Enqueue scripts and styles. */ public static function admin_enqueue_scripts() { self::register_assets(); wp_enqueue_style( 'jquery-ui-timepicker' ); wp_enqueue_script( 'rwmb-datetime' ); } /** * Get field HTML. * * @param mixed $meta The field meta value. * @param array $field The field parameters. * * @return string */ public static function html( $meta, $field ) { $output = ''; if ( $field['timestamp'] ) { $name = $field['field_name']; $field = wp_parse_args( array( 'field_name' => $name . '[formatted]', ), $field ); $output .= sprintf( '<input type="hidden" name="%s" class="rwmb-datetime-timestamp" value="%s">', esc_attr( $name . '[timestamp]' ), isset( $meta['timestamp'] ) ? intval( $meta['timestamp'] ) : '' ); $meta = isset( $meta['formatted'] ) ? $meta['formatted'] : ''; } $output .= parent::html( $meta, $field ); if ( $field['inline'] ) { $output .= '<div class="rwmb-datetime-inline"></div>'; } return $output; } /** * Calculates the timestamp from the datetime string and returns it if $field['timestamp'] is set or the datetime string if not. * * @param mixed $new The submitted meta value. * @param mixed $old The existing meta value. * @param int $post_id The post ID. * @param array $field The field parameters. * * @return string|int */ public static function value( $new, $old, $post_id, $field ) { if ( $field['timestamp'] ) { return $new['timestamp']; } if ( $field['save_format'] ) { $date = DateTime::createFromFormat( $field['php_format'], $new ); $new = false === $date ? $new : $date->format( $field['save_format'] ); } return $new; } /** * Get meta value. * * @param int $post_id The post ID. * @param bool $saved Whether the meta box is saved at least once. * @param array $field The field parameters. * * @return mixed */ public static function meta( $post_id, $saved, $field ) { $meta = parent::meta( $post_id, $saved, $field ); if ( $field['timestamp'] ) { return RWMB_Helpers_Array::map( $meta, __CLASS__ . '::from_timestamp', $field ); } if ( $field['save_format'] && $meta ) { return RWMB_Helpers_Array::map( $meta, __CLASS__ . '::from_save_format', $field ); } return $meta; } /** * Format meta value if set 'timestamp'. * * @param string $meta The meta value. * @param array $field Field parameters. * @return array */ public static function from_timestamp( $meta, $field ) { return array( 'timestamp' => $meta ? $meta : null, 'formatted' => $meta ? gmdate( $field['php_format'], intval( $meta ) ) : '', ); } /** * Transform meta value from save format to the JS format. * * @param string $meta The meta value. * @param array $field Field parameters. * @return array */ public static function from_save_format( $meta, $field ) { $date = DateTime::createFromFormat( $field['save_format'], $meta ); return false === $date ? $meta : $date->format( $field['php_format'] ); } /** * Normalize parameters for field. * * @param array $field The field parameters. * @return array */ public static function normalize( $field ) { $field = wp_parse_args( $field, array( 'timestamp' => false, 'inline' => false, 'js_options' => array(), 'save_format' => '', 'autocomplete' => 'off', ) ); // Deprecate 'format', but keep it for backward compatible. // Use 'js_options' instead. $field['js_options'] = wp_parse_args( $field['js_options'], array( 'timeFormat' => 'HH:mm', 'separator' => ' ', 'dateFormat' => empty( $field['format'] ) ? 'yy-mm-dd' : $field['format'], 'showButtonPanel' => true, ) ); if ( $field['inline'] ) { $field['js_options'] = wp_parse_args( $field['js_options'], array( 'altFieldTimeOnly' => false, ) ); } $field['php_format'] = static::get_php_format( $field['js_options'] ); $field = parent::normalize( $field ); return $field; } /** * Get the attributes for a field. * * @param array $field The field parameters. * @param mixed $value The meta value. * * @return array */ public static function get_attributes( $field, $value = null ) { $attributes = parent::get_attributes( $field, $value ); $attributes = wp_parse_args( $attributes, array( 'data-options' => wp_json_encode( $field['js_options'] ), ) ); $attributes['type'] = 'text'; return $attributes; } /** * Returns a date() compatible format string from the JavaScript format. * * @link http://www.php.net/manual/en/function.date.php * @param array $js_options JavaScript options. * * @return string */ protected static function get_php_format( $js_options ) { return strtr( $js_options['dateFormat'], self::$date_formats ) . $js_options['separator'] . strtr( $js_options['timeFormat'], self::$time_formats ); } /** * Format a single value for the helper functions. Sub-fields should overwrite this method if necessary. * * @param array $field Field parameters. * @param string $value The value. * @param array $args Additional arguments. Rarely used. See specific fields for details. * @param int|null $post_id Post ID. null for current post. Optional. * * @return string */ public static function format_single_value( $field, $value, $args, $post_id ) { if ( $field['timestamp'] ) { $value = self::from_timestamp( $value, $field ); } else { $value = array( 'timestamp' => strtotime( $value ), 'formatted' => $value, ); } return empty( $args['format'] ) ? $value['formatted'] : gmdate( $args['format'], $value['timestamp'] ); } }
Save
cmd:
run