PHP 클래스 RWMB_Datetime_Field

파일 보기 프로젝트 열기: rilwis/meta-box 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$date_formats array Translate date format from jQuery UI date picker to PHP date() It's used to store timestamp value of the field Missing: '!' => '', 'oo' => '', '@' => '', "''" => "'"
$time_formats array 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' => ''

공개 메소드들

메소드 설명
admin_enqueue_scripts ( ) Enqueue scripts and styles
admin_register_scripts ( ) Register scripts and styles.
get_attributes ( array $field, mixed $value = null ) : array Get the attributes for a field
html ( mixed $meta, array $field ) : string Get field HTML
meta ( integer $post_id, boolean $saved, array $field ) : mixed Get meta value
normalize ( array $field ) : array Normalize parameters for field
translate_format ( array $field ) : string Returns a date() compatible format string from the JavaScript format
value ( mixed $new, mixed $old, integer $post_id, array $field ) : string | integer Calculates the timestamp from the datetime string and returns it if $field['timestamp'] is set or the datetime string if not

보호된 메소드들

메소드 설명
prepare_meta ( array | string $meta, array $field ) : array Format meta value if set 'timestamp'

메소드 상세

admin_enqueue_scripts() 공개 정적인 메소드

Enqueue scripts and styles
public static admin_enqueue_scripts ( )

admin_register_scripts() 공개 정적인 메소드

Register scripts and styles.
public static admin_register_scripts ( )

get_attributes() 공개 정적인 메소드

Get the attributes for a field
public static get_attributes ( array $field, mixed $value = null ) : array
$field array
$value mixed
리턴 array

html() 공개 정적인 메소드

Get field HTML
public static html ( mixed $meta, array $field ) : string
$meta mixed
$field array
리턴 string

meta() 공개 정적인 메소드

Get meta value
public static meta ( integer $post_id, boolean $saved, array $field ) : mixed
$post_id integer
$saved boolean
$field array
리턴 mixed

normalize() 공개 정적인 메소드

Normalize parameters for field
public static normalize ( array $field ) : array
$field array
리턴 array

prepare_meta() 보호된 정적인 메소드

Format meta value if set 'timestamp'
protected static prepare_meta ( array | string $meta, array $field ) : array
$meta array | string The meta value
$field array Field parameter
리턴 array

translate_format() 공개 정적인 메소드

Returns a date() compatible format string from the JavaScript format
public static translate_format ( array $field ) : string
$field array
리턴 string

value() 공개 정적인 메소드

Calculates the timestamp from the datetime string and returns it if $field['timestamp'] is set or the datetime string if not
public static value ( mixed $new, mixed $old, integer $post_id, array $field ) : string | integer
$new mixed
$old mixed
$post_id integer
$field array
리턴 string | integer

프로퍼티 상세

$date_formats 보호되어 있는 정적으로 프로퍼티

Translate date format from jQuery UI date picker to PHP date() It's used to store timestamp value of the field Missing: '!' => '', 'oo' => '', '@' => '', "''" => "'"
protected static array $date_formats
리턴 array

$time_formats 보호되어 있는 정적으로 프로퍼티

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' => ''
protected static array $time_formats
리턴 array