WP_Ability_Categories_Registry::get_registered( string $slug ): WP_Ability_Category|null

Retrieves a registered ability category.

Description

Do not use this method directly. Instead, use the wp_get_ability_category() function.

See also

Parameters

$slugstringrequired
The slug of the registered ability category.

Return

WP_Ability_Category|null The registered ability category instance, or null if it is not registered.

Source

public function get_registered( string $slug ): ?WP_Ability_Category {
	if ( ! $this->is_registered( $slug ) ) {
		_doing_it_wrong(
			__METHOD__,
			/* translators: %s: Ability category slug. */
			sprintf( __( 'Ability category "%s" not found.' ), esc_html( $slug ) ),
			'6.9.0'
		);
		return null;
	}
	return $this->registered_categories[ $slug ];
}

Changelog

VersionDescription
6.9.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.