Skip to content

Commit

Permalink
Don't add code when previewing in Customizer
Browse files Browse the repository at this point in the history
  • Loading branch information
ajaydsouza committed Sep 21, 2016
1 parent ecc630d commit 812e386
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion includes/tracker.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
function tptn_enqueue_scripts() {
global $post, $tptn_settings;

if ( is_singular() && 'draft' !== $post->post_status ) {
if ( is_singular() && 'draft' !== $post->post_status && ! is_customize_preview() ) {

$current_user = wp_get_current_user(); // Let's get the current user
$post_author = ( $current_user->ID === $post->post_author ) ? true : false; // Is the current user the post author?
Expand Down
2 changes: 2 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ add_filter( 'manage_edit-projects_sortable_columns', 'tptn_column_register_sorta
* Bug fixes:
* Attachments now work with the widget and elsewhere
* New tracker now works when jQuery is loaded in the footer
* Don't add tracker code when previewing in customizer
* Doesn't report an error if no author is assigned to a post

* Deprecated:
* `tptn_add_tracker` and `tptn_add_viewed_count` have been deprecated. These should no longer be needed with the new tracker option.
Expand Down

0 comments on commit 812e386

Please sign in to comment.