Prepares an application password for a create or update operation.
Parameters
$request
WP_REST_Requestrequired- Request object.
Source
protected function prepare_item_for_database( $request ) {
$prepared = (object) array(
'name' => $request['name'],
);
if ( $request['app_id'] && ! $request['uuid'] ) {
$prepared->app_id = $request['app_id'];
}
/**
* Filters an application password before it is inserted via the REST API.
*
* @since 5.6.0
*
* @param stdClass $prepared An object representing a single application password prepared for inserting or updating the database.
* @param WP_REST_Request $request Request object.
*/
return apply_filters( 'rest_pre_insert_application_password', $prepared, $request );
}
Hooks
- apply_filters( ‘rest_pre_insert_application_password’,
stdClass $prepared ,WP_REST_Request $request ) Filters an application password before it is inserted via the REST API.
Changelog
Version | Description |
---|---|
5.6.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.