WC_Meta_Box_Product_Data
in package
WC_Meta_Box_Product_Data Class.
Table of Contents
- output() : mixed
- Output the metabox.
- output_variations() : mixed
- Show options for the variable product type.
- prepare_attributes() : array<string|int, mixed>
- Prepare attributes for save.
- save() : mixed
- Save meta box data.
- save_variations() : mixed
- Save variation meta box data.
- filter_non_variation_attributes() : bool
- Filter callback for finding non-variation attributes.
- filter_variation_attributes() : bool
- Filter callback for finding variation attributes.
- get_product_data_tabs() : array<string|int, mixed>
- Return array of tabs to show.
- get_product_type_options() : array<string|int, mixed>
- Return array of product type options.
- output_tabs() : mixed
- Show tab content/settings.
- prepare_children() : array<string|int, mixed>
- Prepare children for save.
- prepare_downloads() : array<string|int, mixed>
- Prepare downloads for save.
- prepare_set_attributes() : array<string|int, mixed>
- Prepare attributes for a specific variation or defaults.
- product_data_tabs_sort() : bool
- Callback to sort product data tabs on priority.
Methods
output()
Output the metabox.
public
static output(WP_Post $post) : mixed
Parameters
- $post : WP_Post
-
Post object.
Return values
mixed —output_variations()
Show options for the variable product type.
public
static output_variations() : mixed
Return values
mixed —prepare_attributes()
Prepare attributes for save.
public
static prepare_attributes([array<string|int, mixed> $data = false ]) : array<string|int, mixed>
Parameters
- $data : array<string|int, mixed> = false
-
Attribute data.
Return values
array<string|int, mixed> —save()
Save meta box data.
public
static save(int $post_id, WP_Post $post) : mixed
Parameters
- $post_id : int
-
WP post id.
- $post : WP_Post
-
Post object.
Return values
mixed —save_variations()
Save variation meta box data.
public
static save_variations(int $post_id, WP_Post $post) : mixed
Parameters
- $post_id : int
-
WP post id.
- $post : WP_Post
-
Post object.
Return values
mixed —filter_non_variation_attributes()
Filter callback for finding non-variation attributes.
private
static filter_non_variation_attributes(WC_Product_Attribute $attribute) : bool
Parameters
- $attribute : WC_Product_Attribute
-
Product attribute.
Return values
bool —filter_variation_attributes()
Filter callback for finding variation attributes.
private
static filter_variation_attributes(WC_Product_Attribute $attribute) : bool
Parameters
- $attribute : WC_Product_Attribute
-
Product attribute.
Return values
bool —get_product_data_tabs()
Return array of tabs to show.
private
static get_product_data_tabs() : array<string|int, mixed>
Return values
array<string|int, mixed> —get_product_type_options()
Return array of product type options.
private
static get_product_type_options() : array<string|int, mixed>
Return values
array<string|int, mixed> —output_tabs()
Show tab content/settings.
private
static output_tabs() : mixed
Return values
mixed —prepare_children()
Prepare children for save.
private
static prepare_children() : array<string|int, mixed>
Return values
array<string|int, mixed> —prepare_downloads()
Prepare downloads for save.
private
static prepare_downloads(array<string|int, mixed> $file_names, array<string|int, mixed> $file_urls, array<string|int, mixed> $file_hashes) : array<string|int, mixed>
Parameters
- $file_names : array<string|int, mixed>
-
File names.
- $file_urls : array<string|int, mixed>
-
File urls.
- $file_hashes : array<string|int, mixed>
-
File hashes.
Return values
array<string|int, mixed> —prepare_set_attributes()
Prepare attributes for a specific variation or defaults.
private
static prepare_set_attributes(array<string|int, mixed> $all_attributes[, string $key_prefix = 'attribute_' ][, int $index = null ]) : array<string|int, mixed>
Parameters
- $all_attributes : array<string|int, mixed>
-
List of attribute keys.
- $key_prefix : string = 'attribute_'
-
Attribute key prefix.
- $index : int = null
-
Attribute array index.
Return values
array<string|int, mixed> —product_data_tabs_sort()
Callback to sort product data tabs on priority.
private
static product_data_tabs_sort(int $a, int $b) : bool
Parameters
- $a : int
-
First item.
- $b : int
-
Second item.