| 95 | // If the frontend and the admin are served from the same domain, load the |
| 96 | // preview over ssl if the customizer is being loaded over ssl. This avoids |
| 97 | // insecure content warnings. This is not attempted if the admin and frontend |
| 98 | // are on different domains to avoid the case where the frontend doesn't have |
| 99 | // ssl certs. Domain mapping plugins can force ssl in these conditions using |
| 100 | // the customizer_preview_link filter. |
| 101 | $admin_origin = parse_url( admin_url() ); |
| 102 | $home_origin = parse_url( home_url() ); |
| 103 | $scheme = null; |
| 104 | if ( is_ssl() && ( $admin_origin[ 'host' ] == $home_origin[ 'host' ] ) ) |
| 105 | $scheme = 'https'; |
| 106 | |
| 107 | $preview_url = apply_filters( 'customizer_preview_link', home_url( '/', $scheme ) ); |
| 108 | |