-
Notifications
You must be signed in to change notification settings - Fork 1
/
foogallery-polaroid-template.php
74 lines (67 loc) · 2.32 KB
/
foogallery-polaroid-template.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
/**
* FooGallery Polaroid Gallery Template
*
* Adds a new gallery template to FooGallery, which uses a popular polaroid layout and effect
*
* @package FooGalleryPolaroidGalleryTemplate
* @author Brad Vincent <[email protected]>
* @license GPL-2.0+
* @link https://github.com/fooplugins/foogallery-polaroid-template
* @copyright 2014 FooPlugins LLC
*
* @wordpress-plugin
* Plugin Name: FooGallery - Polaroid Gallery Template Extension
* Description: Adds an Polaroid Gallery Template
* Version: 1.0.3
* Author: bradvin
* Author URI: http://fooplugins.com
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
*/
if ( !class_exists( 'FooGallery_Polaroid_Template_Extension' ) ) {
class FooGallery_Polaroid_Template_Extension {
function __construct() {
add_filter( 'foogallery_gallery_templates', array( $this, 'add_template' ) );
add_filter( 'foogallery_gallery_templates_files', array( $this, 'register_myself' ) );
}
function register_myself( $extensions ) {
$extensions[] = __FILE__;
return $extensions;
}
function add_template( $gallery_templates ) {
$gallery_templates[] = array(
'slug' => 'polaroid',
'name' => __( 'Polaroid Image Gallery', 'foogallery'),
'fields' => array(
array(
'id' => 'thumbnail_size',
'title' => __('Thumbnail Size', 'foogallery'),
'desc' => __('Choose the size of your thumbnails.', 'foogallery'),
'type' => 'thumb_size',
'default' => array(
'width' => get_option( 'thumbnail_size_w' ),
'height' => get_option( 'thumbnail_size_h' ),
'crop' => true
)
),
array(
'id' => 'thumbnail_link',
'title' => __('Thumbnail Link', 'foogallery'),
'default' => 'image' ,
'type' => 'thumb_link',
'spacer' => '<span class="spacer"></span>',
'desc' => __('You can choose to link each thumbnail to the full size image, or to the image\'s attachment page, or you can choose to not link to anything.', 'foogallery')
),
array(
'id' => 'lightbox',
'title' => __('Lightbox', 'foogallery'),
'desc' => __('Choose which lightbox you want to use in the gallery.', 'foogallery'),
'type' => 'lightbox',
),
)
);
return $gallery_templates;
}
}
}