WC_Admin_Meta_Boxes
in package
WC_Admin_Meta_Boxes.
Table of Contents
- ERROR_STORE = 'woocommerce_meta_box_errors'
- Name of the option used to store errors to be displayed at the next suitable opportunity.
- $meta_box_errors : array<string|int, mixed>
- Meta box error messages.
- $saved_meta_boxes : bool
- Is meta boxes saved once?
- __construct() : mixed
- Constructor.
- add_error() : mixed
- Add an error message.
- add_meta_boxes() : mixed
- Add WC Meta boxes.
- add_product_boxes_sort_order() : mixed
- Add default sort order for meta boxes on product page.
- append_to_error_store() : mixed
- If additional errors have been added in the current request (ie, via the add_error() method) then they will be added to the persistent error store via the Options API.
- output_errors() : mixed
- Show any stored error messages.
- remove_block_templates() : array<string|int, string>
- Remove irrelevant block templates from the list of available templates for products.
- remove_meta_boxes() : mixed
- Remove bloat.
- rename_meta_boxes() : mixed
- Rename core meta boxes.
- save_errors() : mixed
- Save errors to an option.
- save_meta_boxes() : mixed
- Check if we're saving, the trigger an action based on the post type.
Constants
ERROR_STORE
Name of the option used to store errors to be displayed at the next suitable opportunity.
public
mixed
ERROR_STORE
= 'woocommerce_meta_box_errors'
Tags
Properties
$meta_box_errors
Meta box error messages.
public
static array<string|int, mixed>
$meta_box_errors
= array()
$saved_meta_boxes
Is meta boxes saved once?
private
static bool
$saved_meta_boxes
= alse
Methods
__construct()
Constructor.
public
__construct() : mixed
Return values
mixed —add_error()
Add an error message.
public
static add_error(string $text) : mixed
Parameters
- $text : string
-
Error to add.
Return values
mixed —add_meta_boxes()
Add WC Meta boxes.
public
add_meta_boxes() : mixed
Return values
mixed —add_product_boxes_sort_order()
Add default sort order for meta boxes on product page.
public
add_product_boxes_sort_order() : mixed
Return values
mixed —append_to_error_store()
If additional errors have been added in the current request (ie, via the add_error() method) then they will be added to the persistent error store via the Options API.
public
append_to_error_store() : mixed
Tags
Return values
mixed —output_errors()
Show any stored error messages.
public
output_errors() : mixed
Return values
mixed —remove_block_templates()
Remove irrelevant block templates from the list of available templates for products.
public
remove_block_templates(array<string|int, string> $templates) : array<string|int, string>
This will also remove custom created templates.
Parameters
- $templates : array<string|int, string>
-
Array of template header names keyed by the template file name.
Return values
array<string|int, string> — Templates array excluding block-based templates.remove_meta_boxes()
Remove bloat.
public
remove_meta_boxes() : mixed
Return values
mixed —rename_meta_boxes()
Rename core meta boxes.
public
rename_meta_boxes() : mixed
Return values
mixed —save_errors()
Save errors to an option.
public
save_errors() : mixed
Note that calling this will overwrite any errors that have already been stored via the Options API. Unless you are sure you want this, consider using the append_to_error_store() method instead.
Return values
mixed —save_meta_boxes()
Check if we're saving, the trigger an action based on the post type.
public
save_meta_boxes(int $post_id, object $post) : mixed
Parameters
- $post_id : int
-
Post ID.
- $post : object
-
Post object.