rest_pre_insert_application_password filter-hookWP 5.6.0

Filters an application password before it is inserted via the REST API.

Usage

add_filter( 'rest_pre_insert_application_password', 'wp_kama_rest_pre_insert_application_password_filter', 10, 2 );

/**
 * Function for `rest_pre_insert_application_password` filter-hook.
 * 
 * @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 stdClass
 */
function wp_kama_rest_pre_insert_application_password_filter( $prepared, $request ){

	// filter...
	return $prepared;
}
$prepared(stdClass)
An object representing a single application password prepared for inserting or updating the database.
$request(WP_REST_Request)
Request object.

Changelog

Since 5.6.0 Introduced.

Where the hook is called

WP_REST_Application_Passwords_Controller::prepare_item_for_database()
rest_pre_insert_application_password
wp-includes/rest-api/endpoints/class-wp-rest-application-passwords-controller.php 594
return apply_filters( 'rest_pre_insert_application_password', $prepared, $request );

Where the hook is used in WordPress

Usage not found.