PHP Класс Papi_Property_Flexible, papi

Наследование: extends Papi_Property_Repeater
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$convert_type string The convert type.
$default_value array The default value.

Защищенные свойства (Protected)

Свойство Тип Описание
$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