Attribute extends Component
Handles model attributes.
Table of Contents
- $attributes : array<string|int, mixed>
- Model attributes.
- $models : array<string|int, mixed>
- Model parameters.
- __construct() : mixed
- Class constructor.
- add_admin_fields() : array<string|int, mixed>
- Adds admin fields.
- add_block_settings() : array<string|int, mixed>
- Adds block settings.
- add_category_options() : array<string|int, mixed>
- Adds category options.
- add_edit_fields() : array<string|int, mixed>
- Adds edit fields.
- add_field_settings() : array<string|int, mixed>
- Adds field settings.
- add_meta_boxes() : array<string|int, mixed>
- Adds meta boxes.
- add_model_fields() : array<string|int, mixed>
- Adds model fields.
- add_register_fields() : array<string|int, mixed>
- Adds register fields.
- add_search_fields() : array<string|int, mixed>
- Adds search fields.
- add_settings() : array<string|int, mixed>
- Adds settings.
- add_sort_options() : array<string|int, mixed>
- Adds sort options.
- add_submit_fields() : array<string|int, mixed>
- Adds submit fields.
- disable_jetpack_search() : bool
- Disables Jetpack search.
- get_attribute_name() : string
- Gets attribute name.
- get_attributes() : array<string|int, mixed>
- Gets attributes.
- get_models() : array<string|int, mixed>
- Gets model names.
- get_query_args() : array<string|int, mixed>
- Gets query arguments.
- import_attribute() : array<string|int, mixed>
- Imports attribute.
- redirect_archive_page() : mixed
- Redirects archive page.
- register_attributes() : mixed
- Registers attributes.
- register_models() : mixed
- Registers models.
- register_post_types() : array<string|int, mixed>
- Registers post types.
- register_taxonomies() : array<string|int, mixed>
- Registers taxonomies.
- remove_meta_boxes() : mixed
- Removes meta boxes.
- set_category_value() : array<string|int, mixed>
- Sets category field value.
- set_range_values() : array<string|int, mixed>
- Sets number range field values.
- set_search_query() : mixed
- Sets WP search query.
- update_attribute() : mixed
- Updates attribute.
- update_model_snippet() : mixed
- Updates model search snippet.
- boot() : mixed
- Bootstraps component properties.
- get_attribute_fields() : array<string|int, mixed>
- Gets attribute fields.
- get_category_id() : mixed
- Gets current category ID.
- get_category_ids() : array<string|int, mixed>
- Gets category model IDs.
- get_category_model() : string
- Gets category model name.
- get_range_values() : array<string|int, mixed>
- Gets number range field values.
- get_term_id() : mixed
- Gets current term ID.
- requires_category_model() : bool
- Checks if category model required.
- set_callbacks() : mixed
- Sets the action and filter callbacks.
- set_property() : mixed
- Sets a property value.
Properties
$attributes
Model attributes.
protected
array<string|int, mixed>
$attributes
= []
$models
Model parameters.
protected
array<string|int, mixed>
$models
= []
Methods
__construct()
Class constructor.
public
__construct([array<string|int, mixed> $args = [] ]) : mixed
Parameters
- $args : array<string|int, mixed> = []
-
Component arguments.
Return values
mixed —add_admin_fields()
Adds admin fields.
public
add_admin_fields(array<string|int, mixed> $meta_box) : array<string|int, mixed>
Parameters
- $meta_box : array<string|int, mixed>
-
Meta box arguments.
Return values
array<string|int, mixed> —add_block_settings()
Adds block settings.
public
add_block_settings(array<string|int, mixed> $meta) : array<string|int, mixed>
Parameters
- $meta : array<string|int, mixed>
-
Block meta.
Return values
array<string|int, mixed> —add_category_options()
Adds category options.
public
add_category_options(array<string|int, mixed> $form_args, object $form) : array<string|int, mixed>
Parameters
- $form_args : array<string|int, mixed>
-
Form arguments.
- $form : object
-
Form object.
Return values
array<string|int, mixed> —add_edit_fields()
Adds edit fields.
public
add_edit_fields(array<string|int, mixed> $form_args, object $form) : array<string|int, mixed>
Parameters
- $form_args : array<string|int, mixed>
-
Form arguments.
- $form : object
-
Form object.
Return values
array<string|int, mixed> —add_field_settings()
Adds field settings.
public
add_field_settings(array<string|int, mixed> $meta_box) : array<string|int, mixed>
Parameters
- $meta_box : array<string|int, mixed>
-
Meta box arguments.
Return values
array<string|int, mixed> —add_meta_boxes()
Adds meta boxes.
public
add_meta_boxes(array<string|int, mixed> $meta_boxes) : array<string|int, mixed>
Parameters
- $meta_boxes : array<string|int, mixed>
-
Meta box arguments.
Return values
array<string|int, mixed> —add_model_fields()
Adds model fields.
public
add_model_fields(array<string|int, mixed> $fields, object $object) : array<string|int, mixed>
Parameters
- $fields : array<string|int, mixed>
-
Model fields.
- $object : object
-
Model object.
Return values
array<string|int, mixed> —add_register_fields()
Adds register fields.
public
add_register_fields(array<string|int, mixed> $form) : array<string|int, mixed>
Parameters
- $form : array<string|int, mixed>
-
Form arguments.
Return values
array<string|int, mixed> —add_search_fields()
Adds search fields.
public
add_search_fields(array<string|int, mixed> $form_args, object $form) : array<string|int, mixed>
Parameters
- $form_args : array<string|int, mixed>
-
Form arguments.
- $form : object
-
Form object.
Return values
array<string|int, mixed> —add_settings()
Adds settings.
public
add_settings(array<string|int, mixed> $settings) : array<string|int, mixed>
Parameters
- $settings : array<string|int, mixed>
-
Settings configuration.
Return values
array<string|int, mixed> —add_sort_options()
Adds sort options.
public
add_sort_options(array<string|int, mixed> $form_args, object $form) : array<string|int, mixed>
Parameters
- $form_args : array<string|int, mixed>
-
Form arguments.
- $form : object
-
Form object.
Return values
array<string|int, mixed> —add_submit_fields()
Adds submit fields.
public
add_submit_fields(array<string|int, mixed> $form_args, object $form) : array<string|int, mixed>
Parameters
- $form_args : array<string|int, mixed>
-
Form arguments.
- $form : object
-
Form object.
Return values
array<string|int, mixed> —disable_jetpack_search()
Disables Jetpack search.
public
disable_jetpack_search(mixed $enabled, WP_Query $query) : bool
Parameters
- $enabled : mixed
-
Is search enabled?
- $query : WP_Query
-
Search query.
Return values
bool —get_attribute_name()
Gets attribute name.
public
get_attribute_name(string $slug[, string $prefix = '' ]) : string
Parameters
- $slug : string
-
Attribute slug.
- $prefix : string = ''
-
Attribute prefix.
Return values
string —get_attributes()
Gets attributes.
public
get_attributes(string $model[, array<string|int, mixed> $category_ids = null ]) : array<string|int, mixed>
Parameters
- $model : string
-
Model name.
- $category_ids : array<string|int, mixed> = null
-
Category IDs.
Return values
array<string|int, mixed> —get_models()
Gets model names.
public
get_models([string $type = null ]) : array<string|int, mixed>
Parameters
- $type : string = null
-
Model type.
Return values
array<string|int, mixed> —get_query_args()
Gets query arguments.
public
get_query_args(string $model[, array<string|int, mixed> $values = [] ]) : array<string|int, mixed>
Parameters
- $model : string
-
Model name.
- $values : array<string|int, mixed> = []
-
Attribute values.
Return values
array<string|int, mixed> —import_attribute()
Imports attribute.
public
import_attribute(array<string|int, mixed> $term) : array<string|int, mixed>
Parameters
- $term : array<string|int, mixed>
-
Term arguments.
Return values
array<string|int, mixed> —redirect_archive_page()
Redirects archive page.
public
redirect_archive_page() : mixed
Return values
mixed —register_attributes()
Registers attributes.
public
register_attributes() : mixed
Return values
mixed —register_models()
Registers models.
public
register_models() : mixed
Return values
mixed —register_post_types()
Registers post types.
public
register_post_types(array<string|int, mixed> $post_types) : array<string|int, mixed>
Parameters
- $post_types : array<string|int, mixed>
-
Post types.
Return values
array<string|int, mixed> —register_taxonomies()
Registers taxonomies.
public
register_taxonomies(array<string|int, mixed> $taxonomies) : array<string|int, mixed>
Parameters
- $taxonomies : array<string|int, mixed>
-
Taxonomies.
Return values
array<string|int, mixed> —remove_meta_boxes()
Removes meta boxes.
public
remove_meta_boxes() : mixed
Return values
mixed —set_category_value()
Sets category field value.
public
set_category_value(array<string|int, mixed> $form_args, object $form) : array<string|int, mixed>
Parameters
- $form_args : array<string|int, mixed>
-
Form arguments.
- $form : object
-
Form object.
Return values
array<string|int, mixed> —set_range_values()
Sets number range field values.
public
set_range_values(array<string|int, mixed> $form_args, object $form) : array<string|int, mixed>
Parameters
- $form_args : array<string|int, mixed>
-
Form arguments.
- $form : object
-
Form object.
Return values
array<string|int, mixed> —set_search_query()
Sets WP search query.
public
set_search_query(WP_Query $query) : mixed
Parameters
- $query : WP_Query
-
Search query.
Return values
mixed —update_attribute()
Updates attribute.
public
update_attribute(int $attribute_id) : mixed
Parameters
- $attribute_id : int
-
Attribute ID.
Return values
mixed —update_model_snippet()
Updates model search snippet.
public
update_model_snippet(int $model_id, object $model) : mixed
Parameters
- $model_id : int
-
Model ID.
- $model : object
-
Model object.
Return values
mixed —boot()
Bootstraps component properties.
protected
boot() : mixed
Return values
mixed —get_attribute_fields()
Gets attribute fields.
protected
get_attribute_fields(string $model, array<string|int, mixed> $values) : array<string|int, mixed>
Parameters
- $model : string
-
Model name.
- $values : array<string|int, mixed>
-
Attribute values.
Return values
array<string|int, mixed> —get_category_id()
Gets current category ID.
protected
get_category_id(string $model) : mixed
Parameters
- $model : string
-
Model name.
Return values
mixed —get_category_ids()
Gets category model IDs.
protected
get_category_ids(string $model[, object $object = null ]) : array<string|int, mixed>
Parameters
- $model : string
-
Model name.
- $object : object = null
-
Model object.
Return values
array<string|int, mixed> —get_category_model()
Gets category model name.
protected
get_category_model(string $model) : string
Parameters
- $model : string
-
Model name.
Return values
string —get_range_values()
Gets number range field values.
protected
get_range_values(string $model, string $field) : array<string|int, mixed>
Parameters
- $model : string
-
Model name.
- $field : string
-
Field name.
Return values
array<string|int, mixed> —get_term_id()
Gets current term ID.
protected
get_term_id(string $model) : mixed
Parameters
- $model : string
-
Model name.
Return values
mixed —requires_category_model()
Checks if category model required.
protected
requires_category_model(string $model) : bool
Parameters
- $model : string
-
Model name.
Return values
bool —set_callbacks()
Sets the action and filter callbacks.
protected
final set_callbacks(array<string|int, mixed> $callbacks) : mixed
Parameters
- $callbacks : array<string|int, mixed>
-
Callback arguments.
Return values
mixed —set_property()
Sets a property value.
protected
final set_property(string $name, mixed $value[, string $prefix = '' ]) : mixed
Parameters
- $name : string
-
Property name.
- $value : mixed
-
Property value.
- $prefix : string = ''
-
Method prefix.