Filter hook 'secure_auth_redirect'

in WP Core File wp-includes/pluggable.php at line 1205

View Source

secure_auth_redirect

Filter Hook
Description
Filters whether to use a secure authentication redirect.

Hook Information

File Location wp-includes/pluggable.php View on GitHub
Hook Type Filter
Line Number 1205

Hook Parameters

Type Name Description
bool $secure Whether to use a secure authentication redirect. Default false.

Usage Examples

Basic Usage
<?php
// Hook into secure_auth_redirect
add_filter('secure_auth_redirect', 'my_custom_filter', 10, 1);

function my_custom_filter($secure) {
    // Your custom filtering logic here
    return $secure;
}

Source Code Context

wp-includes/pluggable.php:1205 - How this hook is used in WordPress core
<?php
1200  		 *
1201  		 * @since 3.1.0
1202  		 *
1203  		 * @param bool $secure Whether to use a secure authentication redirect. Default false.
1204  		 */
1205  		$secure = apply_filters( 'secure_auth_redirect', $secure );
1206  
1207  		// If https is required and request is http, redirect.
1208  		if ( $secure && ! is_ssl() && str_contains( $_SERVER['REQUEST_URI'], 'wp-admin' ) ) {
1209  			if ( str_starts_with( $_SERVER['REQUEST_URI'], 'http' ) ) {
1210  				wp_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) );

PHP Documentation

<?php
/**
		 * Filters whether to use a secure authentication redirect.
		 *
		 * @since 3.1.0
		 *
		 * @param bool $secure Whether to use a secure authentication redirect. Default false.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/pluggable.php
Related Hooks

Related hooks will be displayed here in future updates.