wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
wp_is_authorize_application_password_request_valid › WordPress Function
Seit5.6.0
Veraltetn/v
› wp_is_authorize_application_password_request_valid ( $request, $user )
Parameter: (2) |
|
Gibt zurück: |
|
Definiert in: |
|
Codex: | |
Changelog: |
|
Checks if the Authorize Application Password request is valid.
Quellcode
function wp_is_authorize_application_password_request_valid( $request, $user ) { $error = new WP_Error(); $is_local = 'local' === wp_get_environment_type(); if ( ! empty( $request['success_url'] ) ) { $scheme = wp_parse_url( $request['success_url'], PHP_URL_SCHEME ); if ( 'http' === $scheme && ! $is_local ) { $error->add( 'invalid_redirect_scheme', __( 'The success URL must be served over a secure connection.' ) ); } } if ( ! empty( $request['reject_url'] ) ) { $scheme = wp_parse_url( $request['reject_url'], PHP_URL_SCHEME ); if ( 'http' === $scheme && ! $is_local ) { $error->add( 'invalid_redirect_scheme', __( 'The rejection URL must be served over a secure connection.' ) ); } } if ( ! empty( $request['app_id'] ) && ! wp_is_uuid( $request['app_id'] ) ) { $error->add( 'invalid_app_id', __( 'The application ID must be a UUID.' ) ); } /** * Fires before application password errors are returned. * * @since 5.6.0 * * @param WP_Error $error The error object. * @param array $request The array of request data. * @param WP_User $user The user authorizing the application. */ do_action( 'wp_authorize_application_password_request_errors', $error, $request, $user ); if ( $error->has_errors() ) { return $error; } return true; }