Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
WC_Admin_Attributes::process_add_attribute()
Add an attribute.
Description Description
Return Return
(bool|WP_Error)
Source Source
File: includes/admin/class-wc-admin-attributes.php
private static function process_add_attribute() { check_admin_referer( 'woocommerce-add-new_attribute' ); $attribute = self::get_posted_attribute(); $args = array( 'name' => $attribute['attribute_label'], 'slug' => $attribute['attribute_name'], 'type' => $attribute['attribute_type'], 'order_by' => $attribute['attribute_orderby'], 'has_archives' => $attribute['attribute_public'], ); $id = wc_create_attribute( $args ); if ( is_wp_error( $id ) ) { return $id; } return true; }