Title: WP_Ability_Category::prepare_properties
Published: February 24, 2026

---

# WP_Ability_Category::prepare_properties( $args ): array<string,

## In this article

 * [Parameters](https://developer.wordpress.org/reference/classes/wp_ability_category/prepare_properties/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/classes/wp_ability_category/prepare_properties/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/wp_ability_category/prepare_properties/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_ability_category/prepare_properties/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_ability_category/prepare_properties/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_ability_category/prepare_properties/?output_format=md#wp--skip-link--target)

Prepares and validates the properties used to instantiate the ability category.

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/wp_ability_category/prepare_properties/?output_format=md#parameters)󠁿

mixed> $args $args { An associative array of arguments used to instantiate the ability
category class.
 @type string $label The human-readable label for the ability category.
@type string $description A description of the ability category. @type array<string,
mixed> $meta Optional. Additional metadata for the ability category. }

## 󠀁[Return](https://developer.wordpress.org/reference/classes/wp_ability_category/prepare_properties/?output_format=md#return)󠁿

 array<string, mixed> $args { An associative array with validated and prepared ability
category properties.
 @type string $label The human-readable label for the ability
category. @type string $description A description of the ability category. @type
array<string, mixed> $meta Optional. Additional metadata for the ability category.}

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_ability_category/prepare_properties/?output_format=md#source)󠁿

    ```php
    protected function prepare_properties( array $args ): array {
    	// Required args must be present and of the correct type.
    	if ( empty( $args['label'] ) || ! is_string( $args['label'] ) ) {
    		throw new InvalidArgumentException(
    			__( 'The ability category properties must contain a `label` string.' )
    		);
    	}

    	if ( empty( $args['description'] ) || ! is_string( $args['description'] ) ) {
    		throw new InvalidArgumentException(
    			__( 'The ability category properties must contain a `description` string.' )
    		);
    	}

    	// Optional args only need to be of the correct type if they are present.
    	if ( isset( $args['meta'] ) && ! is_array( $args['meta'] ) ) {
    		throw new InvalidArgumentException(
    			__( 'The ability category properties should provide a valid `meta` array.' )
    		);
    	}

    	return $args;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/abilities-api/class-wp-ability-category.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/abilities-api/class-wp-ability-category.php#L127)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/abilities-api/class-wp-ability-category.php#L127-L149)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_ability_category/prepare_properties/?output_format=md#related)󠁿

| Uses | Description | 
| [__()](https://developer.wordpress.org/reference/functions/__/)`wp-includes/l10n.php` |

Retrieves the translation of $text.

  |

| Used by | Description | 
| [WP_Ability_Category::__construct()](https://developer.wordpress.org/reference/classes/wp_ability_category/__construct/)`wp-includes/abilities-api/class-wp-ability-category.php` |

Constructor.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_ability_category/prepare_properties/?output_format=md#changelog)󠁿

| Version | Description | 
| [6.9.0](https://developer.wordpress.org/reference/since/6.9.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_ability_category%2Fprepare_properties%2F)
before being able to contribute a note or feedback.