On this page
WP_Customize_Manager::set_preview_url( string $preview_url )
Sets the initial URL to be previewed.
Description
URL is validated.
Parameters
$preview_urlstring Required-
URL to be previewed.
Source
File: wp-includes/class-wp-customize-manager.php. View all references
public function set_preview_url( $preview_url ) {
$preview_url = sanitize_url( $preview_url );
$this->preview_url = wp_validate_redirect( $preview_url, home_url( '/' ) );
}
Related
Uses
| Uses | Description |
|---|---|
| wp_validate_redirect() wp-includes/pluggable.php | Validates a URL for use in a redirect. |
| sanitize_url() wp-includes/formatting.php | Sanitizes a URL for database or redirect usage. |
| home_url() wp-includes/link-template.php | Retrieves the URL for the current site where the front end is accessible. |
Changelog
| Version | Description |
|---|---|
| 4.4.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_customize_manager/set_preview_url