WooCommerce Code Reference

Search results

WC_Meta_Box_Product_Data

WC_Meta_Box_Product_Data Class.

Table of Contents

output() Output the metabox. mixed
output_tabs() Show tab content/settings. mixed
get_product_type_options() Return array of product type options. array
get_product_data_tabs() Return array of tabs to show. array
product_data_tabs_sort() Callback to sort product data tabs on priority. bool
filter_variation_attributes() Filter callback for finding variation attributes. bool
output_variations() Show options for the variable product type. mixed
prepare_downloads() Prepare downloads for save. array
prepare_children() Prepare children for save. array
prepare_attributes() Prepare attributes for save. array
prepare_set_attributes() Prepare attributes for a specific variation or defaults. array
save() Save meta box data. mixed
save_variations() Save variation meta box data. mixed

Methods

output()

Output the metabox.

public static output( $post : WP_Post ) : mixed
Parameters
$post : WP_Post

Post object.

Return values
mixed

get_product_type_options()

Return array of product type options.

private static get_product_type_options( ) : array
Return values
array

product_data_tabs_sort()

Callback to sort product data tabs on priority.

private static product_data_tabs_sort( $a : int , $b : int ) : bool
Parameters
$a : int

First item.

$b : int

Second item.

Tags
since
Return values
bool

prepare_downloads()

Prepare downloads for save.

private static prepare_downloads( $file_names : array , $file_urls : array , $file_hashes : array ) : array
Parameters
$file_names : array

File names.

$file_urls : array

File urls.

$file_hashes : array

File hashes.

Return values
array

prepare_attributes()

Prepare attributes for save.

public static prepare_attributes( [ $data : array = false ] ) : array
Parameters
$data : array = false

Attribute data.

Return values
array

prepare_set_attributes()

Prepare attributes for a specific variation or defaults.

private static prepare_set_attributes( $all_attributes : array [, $key_prefix : string = 'attribute_' ] [, $index : int = null ] ) : array
Parameters
$all_attributes : array

List of attribute keys.

$key_prefix : string = 'attribute_'

Attribute key prefix.

$index : int = null

Attribute array index.

Return values
array

save()

Save meta box data.

public static save( $post_id : int , $post : WP_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( $post_id : int , $post : WP_Post ) : mixed
Parameters
$post_id : int

WP post id.

$post : WP_Post

Post object.

Return values
mixed
Back to the top