Skip to content

Commit

Permalink
override addCaptionHTMLFn
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejolley committed Apr 16, 2019
1 parent 20e9701 commit 2e96f4a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion assets/js/frontend/single-product.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,15 @@ jQuery( function( $ ) {
}

var options = $.extend( {
index: $( clicked ).index()
index: $( clicked ).index(),
addCaptionHTMLFn: function( item, captionEl, isFake ) {
if ( ! item.title ) {
captionEl.children[0].textContent = '';
return false;
}
captionEl.children[0].textContent = item.title;
return true;
}
}, wc_single_product_params.photoswipe_options );

// Initializes and opens PhotoSwipe.
Expand Down

0 comments on commit 2e96f4a

Please sign in to comment.