WooCommerce Code Reference

WC_Meta_Box_Product_Data

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_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

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>

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>