PHP Class Papi_Property_Flexible, papi

Inheritance: extends Papi_Property_Repeater
Afficher le fichier Open project: wp-papi/papi

Méthodes publiques

Свойство Type Description
$convert_type string The convert type.
$default_value array The default value.

Protected Properties

Свойство Type Description
$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.

Méthodes publiques

Méthode Description
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.

Méthodes protégées

Méthode Description
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.

Method Details

delete_value() public méthode

Delete value from the database.
public delete_value ( string $slug, integer $post_id, string $type ) : boolean
$slug string
$post_id integer
$type string
Résultat boolean

format_value() public méthode

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
Résultat array

get_json_id() protected méthode

Generate layout slug.
protected get_json_id ( string $key, string $extra = '' ) : string
$key string
$extra string
Résultat string

get_layout() protected méthode

Get layout by slug.
protected get_layout ( string $slug ) : string
$slug string
Résultat string

get_layout_value() protected méthode

Get layout value.
protected get_layout_value ( string $layout ) : string
$layout string
Résultat string

get_results() protected méthode

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
Résultat array

get_settings_layouts() protected méthode

Get layouts.
protected get_settings_layouts ( ) : array
Résultat array

is_layout_key() protected méthode

Check if the given key is a valid layout key.
protected is_layout_key ( string $key ) : boolean
$key string
Résultat boolean

load_value() public méthode

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
Résultat array

prepare_properties() protected méthode

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
Résultat array

render_ajax_request() public méthode

Render AJAX request.
public render_ajax_request ( )

render_json_template() protected méthode

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

render_layout_input() protected méthode

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

render_properties() protected méthode

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

render_repeater() protected méthode

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

render_repeater_row() protected méthode

Render repeater row.
protected render_repeater_row ( )

render_repeater_row_template() public méthode

Render repeater row template.

setup_actions() protected méthode

Setup actions.
protected setup_actions ( )

valid_layout() protected méthode

Check if the layout is valid or not.
protected valid_layout ( array $layout ) : boolean
$layout array
Résultat boolean

Property Details

$convert_type public_oe property

The convert type.
public string $convert_type
Résultat string

$counter protected_oe property

Flexible repeater counter number.
protected int $counter
Résultat integer

$default_value public_oe property

The default value.
public array $default_value
Résultat array

$exclude_properties protected_oe property

Exclude properties that is not allowed in a repeater.
protected array $exclude_properties
Résultat array

$layout_key protected_oe property

The layout key.
protected string $layout_key
Résultat string

$layout_value_regex protected_oe property

Layout value regex.
protected string $layout_value_regex
Résultat string