Filter hook 'pre_wp_get_https_detection_errors'

in WP Core File wp-includes/https-detection.php at line 106

View Source

pre_wp_get_https_detection_errors

Filter Hook
Description
Short-circuits the process of detecting errors related to HTTPS support. Returning a `WP_Error` from the filter will effectively short-circuit the default logic of trying a remote request to the site over HTTPS, storing the errors array from the returned `WP_Error` instead.

Hook Information

File Location wp-includes/https-detection.php View on GitHub
Hook Type Filter
Line Number 106

Hook Parameters

Type Name Description
null|WP_Error $pre Error object to short-circuit detection, or null to continue with the default behavior.

Usage Examples

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

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

Source Code Context

wp-includes/https-detection.php:106 - How this hook is used in WordPress core
<?php
 101  	 * @since 6.4.0
 102  	 *
 103  	 * @param null|WP_Error $pre Error object to short-circuit detection,
 104  	 *                           or null to continue with the default behavior.
 105  	 */
 106  	$support_errors = apply_filters( 'pre_wp_get_https_detection_errors', null );
 107  	if ( is_wp_error( $support_errors ) ) {
 108  		return $support_errors->errors;
 109  	}
 110  
 111  	$support_errors = new WP_Error();

PHP Documentation

<?php
/**
	 * Short-circuits the process of detecting errors related to HTTPS support.
	 *
	 * Returning a `WP_Error` from the filter will effectively short-circuit the default logic of trying a remote
	 * request to the site over HTTPS, storing the errors array from the returned `WP_Error` instead.
	 *
	 * @since 6.4.0
	 *
	 * @param null|WP_Error $pre Error object to short-circuit detection,
	 *                           or null to continue with the default behavior.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/https-detection.php
Related Hooks

Related hooks will be displayed here in future updates.