summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/modules/carousel/jetpack-carousel.php')
-rw-r--r--plugins/jetpack/modules/carousel/jetpack-carousel.php26
1 files changed, 22 insertions, 4 deletions
diff --git a/plugins/jetpack/modules/carousel/jetpack-carousel.php b/plugins/jetpack/modules/carousel/jetpack-carousel.php
index b3d5302d..3c128c26 100644
--- a/plugins/jetpack/modules/carousel/jetpack-carousel.php
+++ b/plugins/jetpack/modules/carousel/jetpack-carousel.php
@@ -82,7 +82,7 @@ class Jetpack_Carousel {
*
* @since 1.6.0
*
- * @param bool false Should Carousel be disabled? Default to fase.
+ * @param bool false Should Carousel be disabled? Default to false.
*/
return apply_filters( 'jp_carousel_maybe_disable', false );
}
@@ -166,9 +166,9 @@ class Jetpack_Carousel {
'lang' => strtolower( substr( get_locale(), 0, 2 ) ),
'ajaxurl' => set_url_scheme( admin_url( 'admin-ajax.php' ) ),
'nonce' => wp_create_nonce( 'carousel_nonce' ),
- 'display_exif' => $this->test_1or0_option( get_option( 'carousel_display_exif' ), true ),
- 'display_geo' => $this->test_1or0_option( get_option( 'carousel_display_geo' ), true ),
- 'background_color' => $this->carousel_background_color_sanitize( get_option( 'carousel_background_color' ) ),
+ 'display_exif' => $this->test_1or0_option( Jetpack_Options::get_option_and_ensure_autoload( 'carousel_display_exif', true ) ),
+ 'display_geo' => $this->test_1or0_option( Jetpack_Options::get_option_and_ensure_autoload( 'carousel_display_geo', true ) ),
+ 'background_color' => $this->carousel_background_color_sanitize( Jetpack_Options::get_option_and_ensure_autoload( 'carousel_background_color', '' ) ),
'comment' => __( 'Comment', 'jetpack' ),
'post_comment' => __( 'Post Comment', 'jetpack' ),
'write_comment' => __( 'Write a Comment...', 'jetpack' ),
@@ -212,6 +212,24 @@ class Jetpack_Carousel {
}
/**
+ * Handle WP stats for images in full-screen.
+ * Build string with tracking info.
+ */
+ if ( in_array( 'stats', Jetpack::get_active_modules() ) && ! Jetpack::is_development_mode() ) {
+ $localize_strings['stats'] = 'blog=' . Jetpack_Options::get_option( 'id' ) . '&host=' . parse_url( get_option( 'home' ), PHP_URL_HOST ) . '&v=ext&j=' . JETPACK__API_VERSION . ':' . JETPACK__VERSION;
+
+ // Set the stats as empty if user is logged in but logged-in users shouldn't be tracked.
+ if ( is_user_logged_in() && function_exists( 'stats_get_options' ) ) {
+ $stats_options = stats_get_options();
+ $track_loggedin_users = isset( $stats_options['reg_users'] ) ? (bool) $stats_options['reg_users'] : false;
+
+ if ( ! $track_loggedin_users ) {
+ $localize_strings['stats'] = '';
+ }
+ }
+ }
+
+ /**
* Filter the strings passed to the Carousel's js file.
*
* @module carousel