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

Unregisters an ability category.

Description

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

See also

Parameters

$slugstringrequired
The slug of the registered ability category.

Return

WP_Ability_Category|null The unregistered ability category instance on success, null on failure.

Source

public function unregister( 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;
	}

	$unregistered_category = $this->registered_categories[ $slug ];
	unset( $this->registered_categories[ $slug ] );

	return $unregistered_category;
}

Changelog

VersionDescription
6.9.0Introduced.

User Contributed Notes

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