Version Description
= 8.1.08 =
- This version addresses various bug fixes, feature requests and security fixes.
Download this release
Release Info
Developer | opajaap |
Plugin | WP Photo Album Plus |
Version | 8.2.02.003 |
Comparing to | |
See all releases |
Code changes from version 8.2.02.002 to 8.2.02.003
- blocks/potd/block.js +14 -5
- blocks/potd/index.php +2 -4
- blocks/slideshow/block.js +50 -11
- blocks/slideshow/editor.css +3 -0
- blocks/upload/block.js +54 -7
- wppa-filter.php +7 -1
- wppa-init.php +2 -1
- wppa.php +1 -1
blocks/potd/block.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
/**
|
2 |
* WPPA potd block
|
3 |
*
|
|
|
4 |
*/
|
5 |
|
6 |
( function ( blocks, editor, i18n, element, components, _, blockEditor ) {
|
@@ -47,11 +48,12 @@
|
|
47 |
placeholder: __('Enter widget caption', 'wp-photo-album-plus'),
|
48 |
value: attributes.widgetTitle,
|
49 |
onChange: function ( value ) {
|
50 |
-
props.setAttributes( {
|
|
|
|
|
51 |
},
|
52 |
}) : null,
|
53 |
-
|
54 |
-
el('small',null,__('Corresponding shortcode', 'wp-photo-album-plus')+': [wppa type="photo" photo="#potd"]' ) : null,
|
55 |
);
|
56 |
},
|
57 |
|
@@ -62,10 +64,17 @@
|
|
62 |
'div',
|
63 |
{},
|
64 |
el('h3',{},attributes.widgetTitle),
|
65 |
-
el('div',{},
|
66 |
);
|
67 |
},
|
68 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
} )(
|
70 |
window.wp.blocks,
|
71 |
window.wp.editor,
|
1 |
/**
|
2 |
* WPPA potd block
|
3 |
*
|
4 |
+
* Version: 8.2.02.003
|
5 |
*/
|
6 |
|
7 |
( function ( blocks, editor, i18n, element, components, _, blockEditor ) {
|
48 |
placeholder: __('Enter widget caption', 'wp-photo-album-plus'),
|
49 |
value: attributes.widgetTitle,
|
50 |
onChange: function ( value ) {
|
51 |
+
props.setAttributes( { widgetTitle: value,
|
52 |
+
wppaShortcode: evaluate(),
|
53 |
+
});
|
54 |
},
|
55 |
}) : null,
|
56 |
+
el('small',null,__('Corresponding shortcode', 'wp-photo-album-plus')+': '+evaluate(props)),
|
|
|
57 |
);
|
58 |
},
|
59 |
|
64 |
'div',
|
65 |
{},
|
66 |
el('h3',{},attributes.widgetTitle),
|
67 |
+
el('div',{},evaluate(props)),
|
68 |
);
|
69 |
},
|
70 |
+
});
|
71 |
+
|
72 |
+
function evaluate( props ) {
|
73 |
+
var shortcode = '[wppa type="photo" photo="#potd"'+(wppaOnWidgets() ? ' widget="potd"' : '')+']';
|
74 |
+
|
75 |
+
return shortcode;
|
76 |
+
}
|
77 |
+
|
78 |
} )(
|
79 |
window.wp.blocks,
|
80 |
window.wp.editor,
|
blocks/potd/index.php
CHANGED
@@ -13,7 +13,6 @@ defined( 'ABSPATH' ) || exit;
|
|
13 |
* the corresponding context.
|
14 |
*/
|
15 |
function wp_photo_album_plus_potd_register_block() {
|
16 |
-
global $wppa_domain_loaded;
|
17 |
|
18 |
if ( ! function_exists( 'register_block_type' ) ) {
|
19 |
|
@@ -23,10 +22,9 @@ global $wppa_domain_loaded;
|
|
23 |
|
24 |
register_block_type( __DIR__ );
|
25 |
|
26 |
-
if ( function_exists( 'wp_set_script_translations' )
|
27 |
|
28 |
-
wp_set_script_translations( '
|
29 |
-
$wppa_domain_loaded = true;
|
30 |
}
|
31 |
|
32 |
}
|
13 |
* the corresponding context.
|
14 |
*/
|
15 |
function wp_photo_album_plus_potd_register_block() {
|
|
|
16 |
|
17 |
if ( ! function_exists( 'register_block_type' ) ) {
|
18 |
|
22 |
|
23 |
register_block_type( __DIR__ );
|
24 |
|
25 |
+
if ( function_exists( 'wp_set_script_translations' ) ) {
|
26 |
|
27 |
+
wp_set_script_translations( 'wp-photo-album-plus-potd-editor-script', 'wp-photo-album-plus' );
|
|
|
28 |
}
|
29 |
|
30 |
}
|
blocks/slideshow/block.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
/**
|
2 |
* WPPA slideshow block
|
3 |
*
|
|
|
4 |
*/
|
5 |
|
6 |
( function ( blocks, editor, i18n, element, components, _, blockEditor ) {
|
@@ -14,6 +15,7 @@
|
|
14 |
title: __('WPPA Slideshow', 'wp-photo-album-plus'),
|
15 |
icon: 'universal-access-alt',
|
16 |
category: 'layout',
|
|
|
17 |
attributes: {
|
18 |
widgetTitle: {
|
19 |
type: 'string',
|
@@ -27,6 +29,10 @@
|
|
27 |
type: 'string',
|
28 |
value: '[wppa type="slideonly" album="#last"]',
|
29 |
},
|
|
|
|
|
|
|
|
|
30 |
cacheIt: {
|
31 |
type: 'boolean',
|
32 |
checked: false,
|
@@ -38,11 +44,11 @@
|
|
38 |
widgetTitle: 'Photo of the day',
|
39 |
wppaAlbum: 0,
|
40 |
wppaShortcode: '[wppa type="slideonly" album="#last"]',
|
|
|
41 |
cacheIt: false,
|
42 |
},
|
43 |
},
|
44 |
|
45 |
-
|
46 |
edit: function( props ) {
|
47 |
var blockProps = wp.blockEditor.useBlockProps();
|
48 |
var attributes = props.attributes;
|
@@ -67,24 +73,27 @@
|
|
67 |
value: attributes.wppaAlbum,
|
68 |
options: wppaSlideshowAlbumList,
|
69 |
onChange: function( val ) {
|
70 |
-
props.setAttributes( {
|
71 |
-
|
72 |
-
wppaShortcode: '[wppa type="slideonly" album="'+(parseInt(val)>0 ? val : '#last')+'"'+(attributes.cacheIt ? ' cache="inf"' : '')+']',
|
73 |
-
} );
|
74 |
},
|
75 |
}
|
76 |
-
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
el( wp.components.CheckboxControl, {
|
78 |
-
label: __('Cache this block
|
79 |
help: __('Cache uses WPPA embedded smart cache', 'wp-photo-album-plus'),
|
80 |
checked: attributes.cacheIt,
|
81 |
onChange: function ( value ) {
|
82 |
props.setAttributes( { cacheIt: value } );
|
83 |
},
|
84 |
}),
|
85 |
-
|
86 |
-
el('small',null,__( 'Corresponding shortcode', 'wp-photo-album-plus' )+
|
87 |
-
': [wppa type="slideonly" album="'+(attributes.wppaAlbum>0?attributes.wppaAlbum:'#last')+'"'+(attributes.cacheIt ? ' cache="inf"' : '')+']' ) : null,
|
88 |
);
|
89 |
},
|
90 |
|
@@ -94,10 +103,40 @@
|
|
94 |
'div',
|
95 |
{},
|
96 |
el('h3',{},attributes.widgetTitle),
|
97 |
-
el('div',{},
|
98 |
);
|
99 |
},
|
100 |
} );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
} )(
|
102 |
window.wp.blocks,
|
103 |
window.wp.editor,
|
1 |
/**
|
2 |
* WPPA slideshow block
|
3 |
*
|
4 |
+
* Version: 8.2.02.003
|
5 |
*/
|
6 |
|
7 |
( function ( blocks, editor, i18n, element, components, _, blockEditor ) {
|
15 |
title: __('WPPA Slideshow', 'wp-photo-album-plus'),
|
16 |
icon: 'universal-access-alt',
|
17 |
category: 'layout',
|
18 |
+
|
19 |
attributes: {
|
20 |
widgetTitle: {
|
21 |
type: 'string',
|
29 |
type: 'string',
|
30 |
value: '[wppa type="slideonly" album="#last"]',
|
31 |
},
|
32 |
+
filmstrip: {
|
33 |
+
type: 'boolean',
|
34 |
+
checked: false,
|
35 |
+
},
|
36 |
cacheIt: {
|
37 |
type: 'boolean',
|
38 |
checked: false,
|
44 |
widgetTitle: 'Photo of the day',
|
45 |
wppaAlbum: 0,
|
46 |
wppaShortcode: '[wppa type="slideonly" album="#last"]',
|
47 |
+
filmstrip: false,
|
48 |
cacheIt: false,
|
49 |
},
|
50 |
},
|
51 |
|
|
|
52 |
edit: function( props ) {
|
53 |
var blockProps = wp.blockEditor.useBlockProps();
|
54 |
var attributes = props.attributes;
|
73 |
value: attributes.wppaAlbum,
|
74 |
options: wppaSlideshowAlbumList,
|
75 |
onChange: function( val ) {
|
76 |
+
props.setAttributes( { wppaAlbum: parseInt(val) } );
|
77 |
+
props.setAttributes( { wppaShortcode: evaluate(props) } );
|
|
|
|
|
78 |
},
|
79 |
}
|
80 |
+
),
|
81 |
+
el( wp.components.CheckboxControl, {
|
82 |
+
label: __('Add filmstrip', 'wp-photo-album-plus' ),
|
83 |
+
checked: attributes.filmstrip,
|
84 |
+
onChange: function( value ) {
|
85 |
+
props.setAttributes( { filmstrip: value } );
|
86 |
+
},
|
87 |
+
}),
|
88 |
el( wp.components.CheckboxControl, {
|
89 |
+
label: __('Cache this block', 'wp-photo-album-plus'),
|
90 |
help: __('Cache uses WPPA embedded smart cache', 'wp-photo-album-plus'),
|
91 |
checked: attributes.cacheIt,
|
92 |
onChange: function ( value ) {
|
93 |
props.setAttributes( { cacheIt: value } );
|
94 |
},
|
95 |
}),
|
96 |
+
el('small',null,__( 'Corresponding shortcode', 'wp-photo-album-plus' )+': '+evaluate(props)),
|
|
|
|
|
97 |
);
|
98 |
},
|
99 |
|
103 |
'div',
|
104 |
{},
|
105 |
el('h3',{},attributes.widgetTitle),
|
106 |
+
el('div',{},evaluate(props)),
|
107 |
);
|
108 |
},
|
109 |
} );
|
110 |
+
|
111 |
+
function evaluate( props ) {
|
112 |
+
var attributes = props.attributes;
|
113 |
+
var shortcode;
|
114 |
+
|
115 |
+
if ( attributes.filmstrip ) {
|
116 |
+
shortcode = '[wppa type="slideonlyf"';
|
117 |
+
}
|
118 |
+
else {
|
119 |
+
shortcode = '[wppa type="slideonly"';
|
120 |
+
}
|
121 |
+
|
122 |
+
if ( parseInt(attributes.wppaAlbum) > 0 ) {
|
123 |
+
shortcode += ' album="'+attributes.wppaAlbum+'"';
|
124 |
+
}
|
125 |
+
else {
|
126 |
+
shortcode += ' album="#last"';
|
127 |
+
}
|
128 |
+
|
129 |
+
if ( attributes.cacheIt ) {
|
130 |
+
shortcode += ' cache="inf"';
|
131 |
+
}
|
132 |
+
|
133 |
+
if ( wppaOnWidgets() ) {
|
134 |
+
shortcode += ' widget="slide"';
|
135 |
+
}
|
136 |
+
shortcode += ']';
|
137 |
+
|
138 |
+
return shortcode;
|
139 |
+
}
|
140 |
} )(
|
141 |
window.wp.blocks,
|
142 |
window.wp.editor,
|
blocks/slideshow/editor.css
CHANGED
@@ -11,4 +11,7 @@
|
|
11 |
background: #fff;
|
12 |
border: 1px solid #000;
|
13 |
padding: 0 4px;
|
|
|
|
|
|
|
14 |
}
|
11 |
background: #fff;
|
12 |
border: 1px solid #000;
|
13 |
padding: 0 4px;
|
14 |
+
}
|
15 |
+
.wp-block-wp-photo-album-plus-slideshow select {
|
16 |
+
max-width: 50%;
|
17 |
}
|
blocks/upload/block.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
/**
|
2 |
* WPPA Upload block
|
3 |
*
|
|
|
4 |
*/
|
5 |
|
6 |
( function ( blocks, editor, i18n, element, components, _, blockEditor ) {
|
@@ -22,6 +23,14 @@
|
|
22 |
type: 'number',
|
23 |
value: 0,
|
24 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
wppaShortcode: {
|
26 |
type: 'string',
|
27 |
value: '[wppa type="upload"]',
|
@@ -52,15 +61,31 @@
|
|
52 |
value: props.attributes.wppaAlbum,
|
53 |
options: wppaUploadAlbumList,
|
54 |
onChange: function( val ) {
|
55 |
-
props.setAttributes( {
|
56 |
-
|
57 |
-
wppaShortcode: '[wppa type="upload" album="'+parseInt(val)+'"]',
|
58 |
-
} );
|
59 |
},
|
60 |
}
|
61 |
),
|
62 |
-
|
63 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
);
|
65 |
},
|
66 |
|
@@ -71,10 +96,32 @@
|
|
71 |
'div',
|
72 |
{},
|
73 |
el('h3',{},attributes.widgetTitle),
|
74 |
-
el('div',{},
|
75 |
);
|
76 |
}
|
77 |
} );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
} )(
|
79 |
window.wp.blocks,
|
80 |
window.wp.editor,
|
1 |
/**
|
2 |
* WPPA Upload block
|
3 |
*
|
4 |
+
* Version: 8.2.02.003
|
5 |
*/
|
6 |
|
7 |
( function ( blocks, editor, i18n, element, components, _, blockEditor ) {
|
23 |
type: 'number',
|
24 |
value: 0,
|
25 |
},
|
26 |
+
wppaLoginOnly: {
|
27 |
+
type: 'boolean',
|
28 |
+
checked: false,
|
29 |
+
},
|
30 |
+
wppaAdminOnly: {
|
31 |
+
type: 'boolean',
|
32 |
+
checked: false,
|
33 |
+
},
|
34 |
wppaShortcode: {
|
35 |
type: 'string',
|
36 |
value: '[wppa type="upload"]',
|
61 |
value: props.attributes.wppaAlbum,
|
62 |
options: wppaUploadAlbumList,
|
63 |
onChange: function( val ) {
|
64 |
+
props.setAttributes( { wppaAlbum: parseInt(val) } );
|
65 |
+
props.setAttributes( { wppaShortcode: evaluate(props) } );
|
|
|
|
|
66 |
},
|
67 |
}
|
68 |
),
|
69 |
+
( ! attributes.wppaAdminOnly ?
|
70 |
+
el( wp.components.CheckboxControl, {
|
71 |
+
label: __('Show to logged in users only?', 'wp-photo-album-plus'),
|
72 |
+
checked: attributes.wppaLoginOnly,
|
73 |
+
onChange: function ( value ) {
|
74 |
+
props.setAttributes( { wppaLoginOnly: value } );
|
75 |
+
},
|
76 |
+
}) : null
|
77 |
+
),
|
78 |
+
el( wp.components.CheckboxControl, {
|
79 |
+
label: __('Show to admin only?', 'wp-photo-album-plus'),
|
80 |
+
checked: attributes.wppaAdminOnly,
|
81 |
+
onChange: function ( value ) {
|
82 |
+
props.setAttributes( { wppaAdminOnly: value } );
|
83 |
+
if ( value ) {
|
84 |
+
props.setAttributes( { wppaLoginOnly: false } );
|
85 |
+
}
|
86 |
+
},
|
87 |
+
}),
|
88 |
+
el('small',null,__( 'Corresponding shortcode', 'wp-photo-album-plus' )+': '+ evaluate(props)),
|
89 |
);
|
90 |
},
|
91 |
|
96 |
'div',
|
97 |
{},
|
98 |
el('h3',{},attributes.widgetTitle),
|
99 |
+
el('div',{},evaluate(props)),
|
100 |
);
|
101 |
}
|
102 |
} );
|
103 |
+
|
104 |
+
function evaluate( props ) {
|
105 |
+
var attributes = props.attributes;
|
106 |
+
|
107 |
+
var shortcode = '[wppa type="upload"';
|
108 |
+
if ( attributes.wppaAlbum ) {
|
109 |
+
shortcode += ' album="'+attributes.wppaAlbum+'"';
|
110 |
+
}
|
111 |
+
if ( attributes.wppaAdminOnly ) {
|
112 |
+
shortcode += ' login="admin"';
|
113 |
+
}
|
114 |
+
else if ( attributes.wppaLoginOnly ) {
|
115 |
+
shortcode += ' login="yes"';
|
116 |
+
}
|
117 |
+
if ( wppaOnWidgets() ) {
|
118 |
+
shortcode += ' widget="upload"';
|
119 |
+
}
|
120 |
+
shortcode += ']';
|
121 |
+
|
122 |
+
return shortcode;
|
123 |
+
}
|
124 |
+
|
125 |
} )(
|
126 |
window.wp.blocks,
|
127 |
window.wp.editor,
|
wppa-filter.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* get the albums via shortcode handler
|
6 |
-
* Version 8.2.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -165,6 +165,7 @@ global $other_deps;
|
|
165 |
'month' => '',
|
166 |
'cache' => '',
|
167 |
'login' => '',
|
|
|
168 |
], $xatts );
|
169 |
|
170 |
// Login requested?
|
@@ -225,6 +226,11 @@ global $other_deps;
|
|
225 |
$wppa_postid = wppa_get_the_ID(); // Remember the post id
|
226 |
}
|
227 |
|
|
|
|
|
|
|
|
|
|
|
228 |
// If parent given, overwrite album by children
|
229 |
if ( $atts['parent'] !== '' ) {
|
230 |
$temp = explode( ',', $atts['parent'] );
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* get the albums via shortcode handler
|
6 |
+
* Version: 8.2.02.003
|
7 |
*
|
8 |
*/
|
9 |
|
165 |
'month' => '',
|
166 |
'cache' => '',
|
167 |
'login' => '',
|
168 |
+
'widget' => '',
|
169 |
], $xatts );
|
170 |
|
171 |
// Login requested?
|
226 |
$wppa_postid = wppa_get_the_ID(); // Remember the post id
|
227 |
}
|
228 |
|
229 |
+
// Widget?
|
230 |
+
if ( $atts['widget'] ) {
|
231 |
+
wppa( 'in_widget', $atts['widget'] );
|
232 |
+
}
|
233 |
+
|
234 |
// If parent given, overwrite album by children
|
235 |
if ( $atts['parent'] !== '' ) {
|
236 |
$temp = explode( ',', $atts['parent'] );
|
wppa-init.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* This file loads required php files and contains all functions used in init actions.
|
6 |
*
|
7 |
-
* Version 8.2.02.
|
8 |
*/
|
9 |
|
10 |
/* LOAD SIDEBAR WIDGETS */
|
@@ -113,6 +113,7 @@ global $wppa_lang;
|
|
113 |
global $wppa_locale;
|
114 |
global $wp_version;
|
115 |
global $locale;
|
|
|
116 |
|
117 |
// 'Our' usefull language info
|
118 |
if ( wppa_get( 'wppalocale' ) ) {
|
4 |
*
|
5 |
* This file loads required php files and contains all functions used in init actions.
|
6 |
*
|
7 |
+
* Version: 8.2.02.003
|
8 |
*/
|
9 |
|
10 |
/* LOAD SIDEBAR WIDGETS */
|
113 |
global $wppa_locale;
|
114 |
global $wp_version;
|
115 |
global $locale;
|
116 |
+
global $wppa_domain_loaded;
|
117 |
|
118 |
// 'Our' usefull language info
|
119 |
if ( wppa_get( 'wppalocale' ) ) {
|
wppa.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
* Plugin Name: WP Photo Album Plus
|
4 |
* Description: Easily manage and display your photo albums and slideshows within your WordPress site.
|
5 |
-
* Version: 8.2.02.
|
6 |
* Author: J.N. Breetvelt a.k.a. OpaJaap
|
7 |
* Author URI: http://wppa.opajaap.nl/
|
8 |
* Plugin URI: http://wordpress.org/extend/plugins/wp-photo-album-plus/
|
2 |
/*
|
3 |
* Plugin Name: WP Photo Album Plus
|
4 |
* Description: Easily manage and display your photo albums and slideshows within your WordPress site.
|
5 |
+
* Version: 8.2.02.003
|
6 |
* Author: J.N. Breetvelt a.k.a. OpaJaap
|
7 |
* Author URI: http://wppa.opajaap.nl/
|
8 |
* Plugin URI: http://wordpress.org/extend/plugins/wp-photo-album-plus/
|