[ Index ]

PHP Cross Reference of WordPress




/wp-includes/ -> https-migration.php (summary)

HTTPS migration functions.

File Size: 140 lines (5 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 4 functions


Functions that are not part of a class:

wp_should_replace_insecure_home_url()   X-Ref
Checks 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`, causing WordPress to
add frontend filters to replace insecure site URLs that may be present in older database content. The
{@see 'wp_should_replace_insecure_home_url'} filter can be used to modify that behavior.

since: 5.7.0
return: bool True if insecure URLs should replaced, false otherwise.

wp_replace_insecure_home_url( $content )   X-Ref
Replaces insecure HTTP URLs to the site in the given content, if configured to do so.

This function replaces all occurrences of the HTTP version of the site's URL with its HTTPS counterpart, if
determined via {@see wp_should_replace_insecure_home_url()}.

param: string $content Content to replace URLs in.
since: 5.7.0
return: string Filtered content.

wp_update_urls_to_https()   X-Ref
Update the 'home' and 'siteurl' option to use the HTTPS variant of their URL.

If this update does not result in WordPress recognizing that the site is now using HTTPS (e.g. due to constants
overriding the URLs used), the changes will be reverted. In such a case the function will return false.

since: 5.7.0
return: bool True on success, false on failure.

wp_update_https_migration_required( $old_url, $new_url )   X-Ref
Updates the 'https_migration_required' option if needed when the given URL has been updated from HTTP to HTTPS.

If this is a fresh site, a migration will not be required, so the option will be set as `false`.

This is hooked into the {@see 'update_option_home'} action.

param: mixed $old_url Previous value of the URL option.
param: mixed $new_url New value of the URL option.
since: 5.7.0

Generated: Wed Jun 23 01:00:04 2021 Cross-referenced by PHPXref 0.7.1