Checks whether the ability has the necessary permissions.
Description
Please note that input is not automatically validated against the input schema.
Use validate_input() method to validate input before calling this method if needed.
See also
Parameters
$inputmixedoptional- The valid input data for permission checking. Default
null.Default:
null
Source
public function check_permissions( $input = null ) {
if ( ! is_callable( $this->permission_callback ) ) {
return new WP_Error(
'ability_invalid_permission_callback',
/* translators: %s ability name. */
sprintf( __( 'Ability "%s" does not have a valid permission callback.' ), esc_html( $this->name ) )
);
}
return $this->invoke_callback( $this->permission_callback, $input );
}
Changelog
| Version | Description |
|---|---|
| 6.9.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.