Unregisters an ability.
Description
Do not use this method directly. Instead, use the wp_unregister_ability() function.
See also
Parameters
$namestringrequired- The name of the registered ability, with its namespace.
Source
public function unregister( string $name ): ?WP_Ability {
if ( ! $this->is_registered( $name ) ) {
_doing_it_wrong(
__METHOD__,
/* translators: %s: Ability name. */
sprintf( __( 'Ability "%s" not found.' ), esc_html( $name ) ),
'6.9.0'
);
return null;
}
$unregistered_ability = $this->registered_abilities[ $name ];
unset( $this->registered_abilities[ $name ] );
return $unregistered_ability;
}
Changelog
| Version | Description |
|---|---|
| 6.9.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.