PHP 클래스 Papi_Property_Flexible, papi

상속: extends Papi_Property_Repeater
파일 보기 프로젝트 열기: wp-papi/papi

공개 프로퍼티들

프로퍼티 타입 설명
$convert_type string The convert type.
$default_value array The default value.

보호된 프로퍼티들

프로퍼티 타입 설명
$counter integer Flexible repeater counter number.
$exclude_properties array Exclude properties that is not allowed in a repeater.
$layout_key string The layout key.
$layout_value_regex string Layout value regex.

공개 메소드들

메소드 설명
delete_value ( string $slug, integer $post_id, string $type ) : boolean Delete value from the database.
format_value ( mixed $values, string $repeater_slug, integer $post_id ) : array Format the value of the property before it's returned to WordPress admin or the site.
load_value ( mixed $value, string $repeater_slug, integer $post_id ) : array Change value after it's loaded from the database and populate every property in the flexible with the right property type.
render_ajax_request ( ) Render AJAX request.
render_repeater_row_template ( ) Render repeater row template.

보호된 메소드들

메소드 설명
get_json_id ( string $key, string $extra = '' ) : string Generate layout slug.
get_layout ( string $slug ) : string Get layout by slug.
get_layout_value ( string $layout ) : string Get layout value.
get_results ( integer $value, string $repeater_slug, integer $post_id ) : array Get results from the database.
get_settings_layouts ( ) : array Get layouts.
is_layout_key ( string $key ) : boolean Check if the given key is a valid layout key.
prepare_properties ( array $layouts ) : array Prepare properties.
render_json_template ( string $slug ) Render layout JSON template.
render_layout_input ( string $value ) Render layout input.
render_properties ( array $row, array | boolean $value ) Render properties.
render_repeater ( object $options ) Render repeater html.
render_repeater_row ( ) Render repeater row.
setup_actions ( ) Setup actions.
valid_layout ( array $layout ) : boolean Check if the layout is valid or not.

메소드 상세

delete_value() 공개 메소드

Delete value from the database.
public delete_value ( string $slug, integer $post_id, string $type ) : boolean
$slug string
$post_id integer
$type string
리턴 boolean

format_value() 공개 메소드

Format the value of the property before it's returned to WordPress admin or the site.
public format_value ( mixed $values, string $repeater_slug, integer $post_id ) : array
$values mixed
$repeater_slug string
$post_id integer
리턴 array

get_json_id() 보호된 메소드

Generate layout slug.
protected get_json_id ( string $key, string $extra = '' ) : string
$key string
$extra string
리턴 string

get_layout() 보호된 메소드

Get layout by slug.
protected get_layout ( string $slug ) : string
$slug string
리턴 string

get_layout_value() 보호된 메소드

Get layout value.
protected get_layout_value ( string $layout ) : string
$layout string
리턴 string

get_results() 보호된 메소드

Get results from the database.
protected get_results ( integer $value, string $repeater_slug, integer $post_id ) : array
$value integer
$repeater_slug string
$post_id integer
리턴 array

get_settings_layouts() 보호된 메소드

Get layouts.
protected get_settings_layouts ( ) : array
리턴 array

is_layout_key() 보호된 메소드

Check if the given key is a valid layout key.
protected is_layout_key ( string $key ) : boolean
$key string
리턴 boolean

load_value() 공개 메소드

Change value after it's loaded from the database and populate every property in the flexible with the right property type.
public load_value ( mixed $value, string $repeater_slug, integer $post_id ) : array
$value mixed
$repeater_slug string
$post_id integer
리턴 array

prepare_properties() 보호된 메소드

Not the best name for this function, but since property repeater using this we can't rename it.
protected prepare_properties ( array $layouts ) : array
$layouts array
리턴 array

render_ajax_request() 공개 메소드

Render AJAX request.
public render_ajax_request ( )

render_json_template() 보호된 메소드

Render layout JSON template.
protected render_json_template ( string $slug )
$slug string

render_layout_input() 보호된 메소드

Render layout input.
protected render_layout_input ( string $value )
$value string

render_properties() 보호된 메소드

Render properties.
protected render_properties ( array $row, array | boolean $value )
$row array
$value array | boolean

render_repeater() 보호된 메소드

Render repeater html.
protected render_repeater ( object $options )
$options object

render_repeater_row() 보호된 메소드

Render repeater row.
protected render_repeater_row ( )

render_repeater_row_template() 공개 메소드

Render repeater row template.

setup_actions() 보호된 메소드

Setup actions.
protected setup_actions ( )

valid_layout() 보호된 메소드

Check if the layout is valid or not.
protected valid_layout ( array $layout ) : boolean
$layout array
리턴 boolean

프로퍼티 상세

$convert_type 공개적으로 프로퍼티

The convert type.
public string $convert_type
리턴 string

$counter 보호되어 있는 프로퍼티

Flexible repeater counter number.
protected int $counter
리턴 integer

$default_value 공개적으로 프로퍼티

The default value.
public array $default_value
리턴 array

$exclude_properties 보호되어 있는 프로퍼티

Exclude properties that is not allowed in a repeater.
protected array $exclude_properties
리턴 array

$layout_key 보호되어 있는 프로퍼티

The layout key.
protected string $layout_key
리턴 string

$layout_value_regex 보호되어 있는 프로퍼티

Layout value regex.
protected string $layout_value_regex
리턴 string