Skip to content

Commit

Permalink
Added new filter (#34)
Browse files Browse the repository at this point in the history
* Added new filter

* - Use innerHTML instead of textContent to fetch the content of figcaption. This way html `<br>` can be used to create line breaks.

* Updated changelog with PR link
  • Loading branch information
pederan authored Feb 24, 2020
1 parent 0b88228 commit 10b19e2
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 4 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 1.3.6
- Added filter to override the post values for the gallery item (`hogan/module/gallery/item`)
- Use innerHTML instead of textContent to fetch the content of figcaption. This way html `<br>` can be used to create line breaks.
- PR [#34](https://github.com/DekodeInteraktiv/hogan-gallery/pull/34)

## 1.3.5
- Fixed problem with lots of space under galleries: [https://prosjekt.dekode.no/desk/#/tickets/3444695](https://prosjekt.dekode.no/desk/#/tickets/3444695)

## 1.3.4
- Fixed offset vertical margins for grid layout [#22](https://github.com/DekodeInteraktiv/hogan-gallery/pull/22)

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ Install the module using Composer `composer require dekodeinteraktiv/hogan-galle
- `hogan/module/gallery/inner_wrapper_classes` for inner HTML `<div>` wrapper classes.
- `hogan/module/gallery/heading/enabled` for enabling heading field, default true.
- `hogan/module/gallery/slider/flickity` flickity options. See https://flickity.metafizzy.co/options.html
- `hogan/module/gallery/item` for overriding the post values for the gallery item.
2 changes: 1 addition & 1 deletion assets/js/hogan-photoswipe.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions assets/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
$index = 0;

foreach ( $this->items as $item ) :
$item = apply_filters( 'hogan/module/gallery/item', $item );

$classnames = hogan_classnames( 'hogan-gallery-cell', [
'hogan-gallery-cell-hidden' => $index >= 6 && $is_masonry,
] );
Expand Down
4 changes: 2 additions & 2 deletions hogan-gallery.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin URI: https://github.com/dekodeinteraktiv/hogan-gallery
* GitHub Plugin URI: https://github.com/dekodeinteraktiv/hogan-gallery
* Description: Image Gallery Module for Hogan
* Version: 1.3.4
* Version: 1.3.6
* Author: Dekode
* Author URI: https://en.dekode.no
* License: GPL-3.0-or-later
Expand All @@ -24,7 +24,7 @@
exit; // Exit if accessed directly.
}

define( 'HOGAN_GALLERY_VERSION', '1.3.4' );
define( 'HOGAN_GALLERY_VERSION', '1.3.6' );

add_action( 'plugins_loaded', __NAMESPACE__ . '\\hogan_load_textdomain' );
add_action( 'hogan/include_modules', __NAMESPACE__ . '\\hogan_register_module', 10, 1 );
Expand Down
2 changes: 1 addition & 1 deletion src/shared/photoswipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class HoganPhotoSwipe {
};

if ( caption ) {
item.title = caption.textContent;
item.title = caption.innerHTML;
}

item.el = images[ i ];
Expand Down

0 comments on commit 10b19e2

Please sign in to comment.