WordPress at Your Fingertips
function is not described

WC_Admin_Attributes::process_add_attribute() private WC 1.0

Add an attribute.

{} It's a method of the class: WC_Admin_Attributes{}

No Hooks.

Return

true|false|WP_Error.

Usage

$result = WC_Admin_Attributes::process_add_attribute();

Code of WC_Admin_Attributes::process_add_attribute() WC 5.8.0

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;
}