diff options
Diffstat (limited to 'plugins/jetpack/modules/minileven')
4 files changed, 40 insertions, 8 deletions
diff --git a/plugins/jetpack/modules/minileven/minileven.php b/plugins/jetpack/modules/minileven/minileven.php index abfec53d..2e649dd1 100644 --- a/plugins/jetpack/modules/minileven/minileven.php +++ b/plugins/jetpack/modules/minileven/minileven.php @@ -8,7 +8,7 @@ // http://alexking.org/projects/wordpress // // Released under the GPL license -// http://www.opensource.org/licenses/gpl-license.php +// https://www.opensource.org/licenses/gpl-license.php // // ********************************************************************** // This program is distributed in the hope that it will be useful, but @@ -117,13 +117,26 @@ function jetpack_mobile_template( $theme ) { } function jetpack_mobile_available() { - echo '<div class="jetpack-mobile-link" style="text-align:center;margin:10px 0;"><a href="'. esc_url( home_url( add_query_arg('ak_action', 'accept_mobile') ) ) . '">' . __( 'View Mobile Site', 'jetpack' ) . '</a></div>'; + /* + * Create HTML markup with a link to "View Mobile Site". + * The link adds "ak_action=accept_mobile" to the current URL. + */ + global $wp; + $url_params = array( + 'ak_action' => 'accept_mobile', + ); + if ( is_array( $_GET ) && ! empty( $_GET ) ) { + $url_params[] = $_GET; + } + $target_url = home_url( add_query_arg( $url_params, $wp->request ) ); + $anchor = '<a href="' . esc_url( $target_url ) . '">' . __( 'View Mobile Site', 'jetpack' ) . '</a>'; + echo '<div class="jetpack-mobile-link" style="text-align:center;margin:10px 0;">' . $anchor . '</div>'; } function jetpack_mobile_request_handler() { global $wpdb; if (isset($_GET['ak_action'])) { - $url = parse_url( get_bloginfo( 'url' ) ); + $url = wp_parse_url( get_bloginfo( 'url' ) ); $domain = $url['host']; if (!empty($url['path'])) { $path = $url['path']; @@ -207,7 +220,7 @@ function jetpack_mobile_theme_setup() { exit; break; case 'ios': - header( 'Location: http://itunes.apple.com/us/app/wordpress/id335703880?mt=8' ); + header( 'Location: https://itunes.apple.com/us/app/wordpress/id335703880?mt=8' ); exit; break; case 'blackberry': diff --git a/plugins/jetpack/modules/minileven/theme/pub/minileven/footer.php b/plugins/jetpack/modules/minileven/theme/pub/minileven/footer.php index 964165f0..bab105bf 100644 --- a/plugins/jetpack/modules/minileven/theme/pub/minileven/footer.php +++ b/plugins/jetpack/modules/minileven/theme/pub/minileven/footer.php @@ -27,7 +27,24 @@ <footer id="colophon" role="contentinfo"> <div id="site-generator"> - <a href="<?php echo esc_url( home_url( add_query_arg('ak_action', 'reject_mobile') ) ); ?>"><?php _e( 'View Full Site', 'jetpack' ); ?></a><br /> + + <?php + /* + * Construct "$target_url", which adds "ak_action=reject_mobile" + * to the current URL. + */ + global $wp; + $url_params = array( + 'ak_action' => 'reject_mobile', + ); + if ( is_array( $_GET ) && ! empty( $_GET ) ) { + $url_params[] = $_GET; + } + $target_url = home_url( add_query_arg( $url_params, $wp->request ) ); + ?> + + <a href="<?php echo esc_url( $target_url ); ?>"><?php _e( 'View Full Site', 'jetpack' ); ?></a> + <br /> <?php /** diff --git a/plugins/jetpack/modules/minileven/theme/pub/minileven/functions.php b/plugins/jetpack/modules/minileven/theme/pub/minileven/functions.php index fadd678c..cd702872 100644 --- a/plugins/jetpack/modules/minileven/theme/pub/minileven/functions.php +++ b/plugins/jetpack/modules/minileven/theme/pub/minileven/functions.php @@ -1,4 +1,7 @@ <?php + +use Automattic\Jetpack\Assets; + /** * Minileven functions and definitions * @@ -78,10 +81,9 @@ function minileven_scripts() { global $post; wp_enqueue_style( 'style', get_stylesheet_uri() ); - wp_enqueue_script( 'small-menu', - Jetpack::get_file_url_for_environment( + Assets::get_file_url_for_environment( '_inc/build/minileven/theme/pub/minileven/js/small-menu.min.js', 'modules/minileven/theme/pub/minileven/js/small-menu.js' ), diff --git a/plugins/jetpack/modules/minileven/theme/pub/minileven/index.php b/plugins/jetpack/modules/minileven/theme/pub/minileven/index.php index 63a51a19..14a1afdc 100644 --- a/plugins/jetpack/modules/minileven/theme/pub/minileven/index.php +++ b/plugins/jetpack/modules/minileven/theme/pub/minileven/index.php @@ -6,7 +6,7 @@ * and one of the two required files for a theme (the other being style.css). * It is used to display a page when nothing more specific matches a query. * E.g., it puts together the home page when no home.php file exists. - * Learn more: http://codex.wordpress.org/Template_Hierarchy + * Learn more: https://codex.wordpress.org/Template_Hierarchy * * @package Minileven */ |