wp_should_replace_insecure_home_url
Filter HookDescription
Filters whether WordPress should replace old HTTP URLs to the site with their HTTPS counterpart. If a WordPress site had its URL changed from HTTP to HTTPS, by default this will return `true`. This filter can be used to disable that behavior, e.g. after having replaced URLs manually in the database.Hook Information
File Location |
wp-includes/https-migration.php
View on GitHub
|
Hook Type | Filter |
Line Number | 37 |
Hook Parameters
Type | Name | Description |
---|---|---|
bool
|
$should_replace_insecure_home_url
|
Whether insecure HTTP URLs to the site should be replaced. |
Usage Examples
Basic Usage
<?php
// Hook into wp_should_replace_insecure_home_url
add_filter('wp_should_replace_insecure_home_url', 'my_custom_filter', 10, 1);
function my_custom_filter($should_replace_insecure_home_url) {
// Your custom filtering logic here
return $should_replace_insecure_home_url;
}
Source Code Context
wp-includes/https-migration.php:37
- How this hook is used in WordPress core
<?php
32 *
33 * @since 5.7.0
34 *
35 * @param bool $should_replace_insecure_home_url Whether insecure HTTP URLs to the site should be replaced.
36 */
37 return apply_filters( 'wp_should_replace_insecure_home_url', $should_replace_insecure_home_url );
38 }
39
40 /**
41 * Replaces insecure HTTP URLs to the site in the given content, if configured to do so.
42 *
PHP Documentation
<?php
/**
* Filters whether WordPress should replace old HTTP URLs to the site with their HTTPS counterpart.
*
* If a WordPress site had its URL changed from HTTP to HTTPS, by default this will return `true`. This filter can
* be used to disable that behavior, e.g. after having replaced URLs manually in the database.
*
* @since 5.7.0
*
* @param bool $should_replace_insecure_home_url Whether insecure HTTP URLs to the site should be replaced.
*/
Quick Info
- Hook Type: Filter
- Parameters: 1
- File: wp-includes/https-migration.php
Related Hooks
Related hooks will be displayed here in future updates.