Skip to content

Commit c4af5cd

Browse files
authored
gpeb-lightbox.php: Migrated.
1 parent e21b59b commit c4af5cd

File tree

1 file changed

+3
-41
lines changed

1 file changed

+3
-41
lines changed

experimental/gpeb-lightbox.php

Lines changed: 3 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,6 @@
11
<?php
22
/**
3-
* Gravity Perks // Entry Blocks // Lightbox
4-
* https://gravitywiz.com/documentation/gravity-forms-entry-blocks/
5-
*
6-
* A rough draft lightbox implementation for Entry Blocks!
7-
*
8-
* Instructions:
9-
*
10-
* 1. Install the Multi-file Merge Tag snippet.
11-
* https://gravitywiz.com/customizing-multi-file-merge-tag/
12-
*
13-
* 2. Copy and paste this snippet into your theme's functions.php or wherever you include custom PHP.
14-
*
15-
* 3. That's it. 😉
3+
* We're no longer using the experimental folder for experimental snippets. 🚧
4+
* You can now find the snippet here:
5+
* https://github.com/gravitywiz/snippet-library/blob/master/gp-entry-blocks/gpeb-lightbox.php
166
*/
17-
add_action( 'wp', function() {
18-
if ( is_callable( 'gw_multi_file_merge_tag' ) && has_block( 'gp-entry-blocks/entries' ) ) {
19-
gw_multi_file_merge_tag()->register_settings( array(
20-
'markup' => array(
21-
array(
22-
'file_types' => array( 'jpg', 'jpeg' ),
23-
'markup' => '<div class="gpeb-image"><a href="{url}" class="gpep-image-link"><img src="{url}" width="100%" /></a></div>',
24-
),
25-
),
26-
) );
27-
wp_enqueue_script( 'magnific', 'https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.1.0/jquery.magnific-popup.min.js', array( 'jquery' ), '1.1.0', true );
28-
wp_enqueue_style( 'magnific', 'https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.1.0/magnific-popup.min.css', array(), '1.1.0' );
29-
add_action( 'wp_footer', function() {
30-
?>
31-
<script>
32-
jQuery( document ).ready( function( $ ) {
33-
$( '.gpep-image-link' ).magnificPopup({
34-
type: 'image',
35-
gallery: {
36-
enabled: true
37-
}
38-
});
39-
});
40-
</script>
41-
<?php
42-
} );
43-
}
44-
} );

0 commit comments

Comments
 (0)