Changeset 50131 for trunk/src/wp-includes/functions.php
- Timestamp:
- 02/02/2021 12:08:01 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/functions.php
r50129 r50131 7582 7582 7583 7583 /** 7584 * Gets the URL to learn more about updating the site to use HTTPS. 7585 * 7586 * This URL can be overridden by specifying an environment variable `WP_UPDATE_HTTPS_URL` or by using the 7587 * {@see 'wp_update_https_url'} filter. Providing an empty string is not allowed and will result in the 7588 * default URL being used. Furthermore the page the URL links to should preferably be localized in the 7589 * site language. 7590 * 7591 * @since 5.7.0 7592 * 7593 * @return string URL to learn more about updating to HTTPS. 7594 */ 7595 function wp_get_update_https_url() { 7596 $default_url = wp_get_default_update_https_url(); 7597 7598 $update_url = $default_url; 7599 if ( false !== getenv( 'WP_UPDATE_HTTPS_URL' ) ) { 7600 $update_url = getenv( 'WP_UPDATE_HTTPS_URL' ); 7601 } 7602 7603 /** 7604 * Filters the URL to learn more about updating the HTTPS version the site is running on. 7605 * 7606 * Providing an empty string is not allowed and will result in the default URL being used. Furthermore 7607 * the page the URL links to should preferably be localized in the site language. 7608 * 7609 * @since 5.7.0 7610 * 7611 * @param string $update_url URL to learn more about updating HTTPS. 7612 */ 7613 $update_url = apply_filters( 'wp_update_https_url', $update_url ); 7614 if ( empty( $update_url ) ) { 7615 $update_url = $default_url; 7616 } 7617 7618 return $update_url; 7619 } 7620 7621 /** 7622 * Gets the default URL to learn more about updating the site to use HTTPS. 7623 * 7624 * Do not use this function to retrieve this URL. Instead, use {@see wp_get_update_https_url()} when relying on the URL. 7625 * This function does not allow modifying the returned URL, and is only used to compare the actually used URL with the 7626 * default one. 7627 * 7628 * @since 5.7.0 7629 * @access private 7630 * 7631 * @return string Default URL to learn more about updating to HTTPS. 7632 */ 7633 function wp_get_default_update_https_url() { 7634 /* translators: Documentation explaining HTTPS and why it should be used. */ 7635 return __( 'https://wordpress.org/support/article/why-should-i-use-https/' ); 7636 } 7637 7638 /** 7639 * Gets the URL for directly updating the site to use HTTPS. 7640 * 7641 * A URL will only be returned if the `WP_DIRECT_UPDATE_HTTPS_URL` environment variable is specified or 7642 * by using the {@see 'wp_direct_update_https_url'} filter. This allows hosts to send users directly to 7643 * the page where they can update their site to use HTTPS. 7644 * 7645 * @since 5.7.0 7646 * 7647 * @return string URL for directly updating to HTTPS or empty string. 7648 */ 7649 function wp_get_direct_update_https_url() { 7650 $direct_update_url = ''; 7651 7652 if ( false !== getenv( 'WP_DIRECT_UPDATE_HTTPS_URL' ) ) { 7653 $direct_update_url = getenv( 'WP_DIRECT_UPDATE_HTTPS_URL' ); 7654 } 7655 7656 /** 7657 * Filters the URL for directly updating the PHP version the site is running on from the host. 7658 * 7659 * @since 5.7.0 7660 * 7661 * @param string $direct_update_url URL for directly updating PHP. 7662 */ 7663 $direct_update_url = apply_filters( 'wp_direct_update_https_url', $direct_update_url ); 7664 7665 return $direct_update_url; 7666 } 7667 7668 /** 7584 7669 * Get the size of a directory. 7585 7670 *
Note: See TracChangeset
for help on using the changeset viewer.