WC_Admin_Attributes
in package
WC_Admin_Attributes Class.
Table of Contents
- $edited_attribute_id : int
- Edited attribute ID.
- add_attribute() : mixed
- Add Attribute admin panel.
- edit_attribute() : mixed
- Edit Attribute admin panel.
- output() : mixed
- Handles output of the attributes page in admin.
- get_posted_attribute() : array<string|int, mixed>
- Get and sanitize posted attribute data.
- process_add_attribute() : bool|WP_Error
- Add an attribute.
- process_delete_attribute() : bool
- Delete an attribute.
- process_edit_attribute() : bool|WP_Error
- Edit an attribute.
- slug_byte_counter_script() : void
- Output an inline script that shows a live UTF-8 byte count next to the slug input and visually warns when the value approaches or exceeds the server-side byte limit.
- slug_field_description() : string
- Build the slug field description shown to users (and served to search engines and no-JavaScript clients as the static copy).
Properties
$edited_attribute_id
Edited attribute ID.
private
static int
$edited_attribute_id
Methods
add_attribute()
Add Attribute admin panel.
public
static add_attribute() : mixed
Shows the interface for adding new attributes.
Return values
mixed —edit_attribute()
Edit Attribute admin panel.
public
static edit_attribute() : mixed
Shows the interface for changing an attributes type between select and text.
Return values
mixed —output()
Handles output of the attributes page in admin.
public
static output() : mixed
Shows the created attributes and lets you add new ones or edit existing ones. The added attributes are stored in the database and can be used for layered navigation.
Return values
mixed —get_posted_attribute()
Get and sanitize posted attribute data.
private
static get_posted_attribute() : array<string|int, mixed>
Return values
array<string|int, mixed> —process_add_attribute()
Add an attribute.
private
static process_add_attribute() : bool|WP_Error
Return values
bool|WP_Error —process_delete_attribute()
Delete an attribute.
private
static process_delete_attribute() : bool
Return values
bool —process_edit_attribute()
Edit an attribute.
private
static process_edit_attribute() : bool|WP_Error
Return values
bool|WP_Error —slug_byte_counter_script()
Output an inline script that shows a live UTF-8 byte count next to the slug input and visually warns when the value approaches or exceeds the server-side byte limit.
private
static slug_byte_counter_script() : void
The HTML maxlength attribute counts characters, not bytes, so a
multibyte slug (e.g. Cyrillic, Chinese) can pass the browser's guard
and still be rejected by register_taxonomy()'s 32-byte name limit.
This counter closes that feedback gap before submission.
When the live counter activates, it also swaps the server-rendered field description for a leaner note: the counter now carries the concrete byte numbers, so the locale-tailored character estimate becomes redundant.
Return values
void —slug_field_description()
Build the slug field description shown to users (and served to search engines and no-JavaScript clients as the static copy).
private
static slug_field_description() : string
States the authoritative byte limit alongside a character estimate tailored to the script of the user's language, so users on non-Latin scripts get a meaningful figure rather than a raw byte count they must translate into characters themselves.
