Version Description
- New: Freemius Integration.
- New: PHP 7+ compatibility.
- New: Introduces Template options for both categories and videos gallery.
- Tweak: Code completely revised and rewritten to make the plugin more extensible.
- Tweak: Removed Twitter Bootstrap & Font Awesome libraries and replaced with custom CSS code to keep the plugin lightweight.
- Tweak: Custom Logo & Branding, Custom Context Menu options removed from the FREE version. But, these options will continue to work for our old users.
- Fix: [+] few minor bug fixes.
Download this release
Release Info
Developer | plugins360 |
Plugin | ![]() |
Version | 1.5.7 |
Comparing to | |
See all releases |
Code changes from version 1.5.6 to 1.5.7
- README.txt +52 -25
- admin/admin.php +209 -0
- admin/assets/css/{aiovg-admin.css → admin.css} +125 -4
- admin/assets/js/{aiovg-admin.js → admin.js} +149 -120
- admin/{class-aiovg-admin-categories.php → categories.php} +41 -62
- admin/class-aiovg-admin-shortcode.php +0 -389
- admin/class-aiovg-admin-welcome.php +0 -99
- admin/class-aiovg-admin.php +0 -132
- admin/{templates → partials}/category-image.php +4 -5
- admin/{templates → partials}/index.html +0 -0
- admin/{templates → partials}/settings.php +3 -4
- admin/partials/shortcode-builder.php +130 -0
- admin/{templates → partials}/video-sources.php +3 -4
- admin/{templates → partials}/video-submitbox.php +3 -4
- admin/{templates → partials}/video-tracks.php +3 -4
- admin/{templates → partials}/welcome.php +32 -26
- admin/{class-aiovg-admin-settings.php → settings.php} +292 -289
- admin/shortcode-builder.php +64 -0
- admin/templates/shortcode-builder.php +0 -122
- admin/{class-aiovg-admin-videos.php → videos.php} +78 -124
- admin/welcome.php +67 -0
- all-in-one-video-gallery.php +152 -91
- blocks/blocks.php +469 -0
- blocks/class-aiovg-blocks.php +0 -438
- blocks/dist/blocks.build.js +1 -1
- blocks/src/blocks/categories/edit.js +49 -41
- blocks/src/blocks/categories/index.js +21 -10
- blocks/src/blocks/search/edit.js +14 -20
- blocks/src/blocks/search/index.js +8 -5
- blocks/src/blocks/video/edit.js +31 -44
- blocks/src/blocks/video/index.js +16 -13
- blocks/src/blocks/videos/edit.js +154 -171
- blocks/src/blocks/videos/index.js +7 -63
- blocks/src/utils/helper.js +53 -6
- blocks/src/utils/server-side-render.js +129 -0
- freemius/LICENSE.txt +674 -0
- freemius/assets/css/admin/account.css +1 -0
- freemius/assets/css/admin/add-ons.css +2 -0
- freemius/assets/css/admin/affiliation.css +1 -0
- freemius/assets/css/admin/checkout.css +1 -0
- freemius/assets/css/admin/common.css +2 -0
- freemius/assets/css/admin/connect.css +1 -0
- freemius/assets/css/admin/debug.css +1 -0
- freemius/assets/css/admin/dialog-boxes.css +2 -0
- freemius/assets/css/admin/gdpr-optin-notice.css +1 -0
- freemius/assets/css/admin/index.php +3 -0
- freemius/assets/css/customizer.css +1 -0
- freemius/assets/css/index.php +3 -0
- freemius/assets/img/index.php +3 -0
- freemius/assets/img/plugin-icon.png +0 -0
- freemius/assets/img/theme-icon.png +0 -0
- freemius/assets/index.php +3 -0
- freemius/assets/js/index.php +3 -0
- freemius/assets/js/nojquery.ba-postmessage.js +140 -0
- freemius/assets/js/nojquery.ba-postmessage.min.js +12 -0
- freemius/assets/js/postmessage.js +135 -0
- freemius/assets/scss/_colors.scss +79 -0
- freemius/assets/scss/_functions.scss +0 -0
- freemius/assets/scss/_load.scss +4 -0
- freemius/assets/scss/_mixins.scss +270 -0
- freemius/assets/scss/_start.scss +4 -0
- freemius/assets/scss/_vars.scss +6 -0
- freemius/assets/scss/admin/_ajax-loader.scss +49 -0
- freemius/assets/scss/admin/_auto-install.scss +33 -0
- freemius/assets/scss/admin/_buttons.scss +28 -0
- freemius/assets/scss/admin/_deactivation-feedback.scss +55 -0
- freemius/assets/scss/admin/_gdpr-consent.scss +81 -0
- freemius/assets/scss/admin/_license-activation.scss +47 -0
- freemius/assets/scss/admin/_license-key-resend.scss +68 -0
- freemius/assets/scss/admin/_modal-common.scss +194 -0
- freemius/assets/scss/admin/_multisite-options.scss +40 -0
- freemius/assets/scss/admin/_plugin-upgrade-notice.scss +8 -0
- freemius/assets/scss/admin/_subscription-cancellation.scss +30 -0
- freemius/assets/scss/admin/_themes.scss +21 -0
- freemius/assets/scss/admin/_tooltip.scss +66 -0
- freemius/assets/scss/admin/account.scss +302 -0
- freemius/assets/scss/admin/add-ons.scss +449 -0
- freemius/assets/scss/admin/affiliation.scss +97 -0
- freemius/assets/scss/admin/checkout.scss +5 -0
- freemius/assets/scss/admin/common.scss +220 -0
- freemius/assets/scss/admin/connect.scss +548 -0
- freemius/assets/scss/admin/debug.scss +135 -0
- freemius/assets/scss/admin/dialog-boxes.scss +10 -0
- freemius/assets/scss/admin/gdpr-optin-notice.scss +17 -0
- freemius/assets/scss/admin/index.php +3 -0
- freemius/assets/scss/customizer.scss +125 -0
- freemius/assets/scss/index.php +3 -0
- freemius/config.php +388 -0
- freemius/includes/class-freemius-abstract.php +597 -0
- freemius/includes/class-freemius.php +14628 -0
README.txt
CHANGED
@@ -1,26 +1,24 @@
|
|
1 |
=== All-in-One Video Gallery ===
|
2 |
Plugin URI: https://plugins360.com/all-in-one-video-gallery/
|
3 |
-
Contributors: plugins360
|
4 |
Donate link: https://plugins360.com
|
5 |
-
Tags:
|
6 |
Requires at least: 4.4.0
|
7 |
-
Tested up to:
|
8 |
Requires PHP: 5.3.0
|
9 |
-
Stable tag: 1.5.
|
10 |
License: GPLv2 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
13 |
-
|
14 |
|
15 |
== Description ==
|
16 |
|
17 |
-
|
18 |
|
19 |
-
|
20 |
|
21 |
-
|
22 |
-
* [View Demo](https://demo.plugins360.com/all-in-one-video-gallery/) - see plugin frontend.
|
23 |
-
* [Documentation](https://plugins360.com/all-in-one-video-gallery/documentation/) - mainly for users.
|
24 |
|
25 |
https://www.youtube.com/watch?v=w47PU9ppuF8
|
26 |
|
@@ -32,9 +30,8 @@ https://www.youtube.com/watch?v=w47PU9ppuF8
|
|
32 |
* Thumbnail Gallery (you can select how many rows, columns to display and pagination).
|
33 |
* Beautiful HTML5 Video Player with FLASH fallback.
|
34 |
* Supported Formats: MP4, WebM, OGV and embeddable players like YouTube, Vimeo, Dailymotion & Facebook.
|
35 |
-
* Configure Player controls:
|
36 |
* Configure Player properties: autoplay, loop, preload
|
37 |
-
* Custom Logo & Branding.
|
38 |
* Video Subtitles.
|
39 |
* Comment on videos.
|
40 |
* Sharing of videos through Facebook, Twitter, Google Plus, Linkedin & Pinterest.
|
@@ -43,14 +40,24 @@ https://www.youtube.com/watch?v=w47PU9ppuF8
|
|
43 |
* Show GDPR consent.
|
44 |
* Detailed user and developer documentation.
|
45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
**Translations**
|
47 |
|
48 |
-
|
49 |
|
50 |
**Get Involved**
|
51 |
|
52 |
-
* Wording - I am not a native English speaker, if you find any typo,
|
53 |
-
* Translation - If you have translated the plugin to your language, feel free to submit translation.
|
54 |
* Rate Plugin - If you find this plugin useful, please leave a [positive review](https://wordpress.org/support/plugin/all-in-one-video-gallery/reviews/).
|
55 |
* Submit a Bug - If you find any issue, please [submit a bug](https://plugins360.com/support/) on our website.
|
56 |
|
@@ -67,23 +74,33 @@ For more detailed instructions visit plugin [documentation](https://plugins360.c
|
|
67 |
== Frequently Asked Questions ==
|
68 |
|
69 |
= I have a problem what now? =
|
70 |
-
Please describe your issue and submit a ticket on our plugin support forum, you should receive reply within 24 hours (except Sunday).
|
71 |
|
72 |
= Getting a 404 error? =
|
73 |
-
Most likely rewrite rules were not registered properly for some reason. Go to "WordPress Admin Panel => Settings => Permalinks" and click "Save Changes" button without actually changing anything, this should reset router and fix URLs.
|
74 |
|
75 |
== Screenshots ==
|
76 |
|
77 |
-
1.
|
78 |
-
2.
|
79 |
-
3. Video
|
80 |
-
4. Videos list
|
81 |
-
5. Video
|
82 |
-
6. Category
|
83 |
7. Plugin Settings.
|
84 |
|
85 |
== Changelog ==
|
86 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
= 1.5.6 =
|
88 |
|
89 |
* New: Gutenberg blocks for the plugin.
|
@@ -112,7 +129,7 @@ Most likely rewrite rules were not registered properly for some reason. Go to "W
|
|
112 |
|
113 |
= 1.5.1 =
|
114 |
|
115 |
-
* Tweak: README.txt
|
116 |
|
117 |
= 1.5.0 =
|
118 |
|
@@ -142,6 +159,16 @@ Most likely rewrite rules were not registered properly for some reason. Go to "W
|
|
142 |
|
143 |
== Upgrade Notice ==
|
144 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
= 1.5.6 =
|
146 |
|
147 |
* New: Gutenberg blocks for the plugin.
|
@@ -170,7 +197,7 @@ Most likely rewrite rules were not registered properly for some reason. Go to "W
|
|
170 |
|
171 |
= 1.5.1 =
|
172 |
|
173 |
-
* Tweak: README.txt
|
174 |
|
175 |
= 1.5.0 =
|
176 |
|
1 |
=== All-in-One Video Gallery ===
|
2 |
Plugin URI: https://plugins360.com/all-in-one-video-gallery/
|
3 |
+
Contributors: plugins360, freemius
|
4 |
Donate link: https://plugins360.com
|
5 |
+
Tags: player, youtube, vimeo, live, stream
|
6 |
Requires at least: 4.4.0
|
7 |
+
Tested up to: 5.0
|
8 |
Requires PHP: 5.3.0
|
9 |
+
Stable tag: 1.5.7
|
10 |
License: GPLv2 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
13 |
+
Supports any browser & video formats such as MP4, WebM, OGV and embeddable players like YouTube, Vimeo, Dailymotion, Facebook, etc.
|
14 |
|
15 |
== Description ==
|
16 |
|
17 |
+
No coding required. A Responsive & Lightweight video gallery plugin.
|
18 |
|
19 |
+
HTML5 Video Player, Custom Post Type interface, Categories, Visual Gallery Builder (Gutenberg), forms to Search Videos, Social Sharing and everything you will need to build a YouTube/Vimeo like video sharing website.
|
20 |
|
21 |
+
[Demo](https://demo.plugins360.com/all-in-one-video-gallery/) | [Documentation](https://plugins360.com/all-in-one-video-gallery/documentation/) | [Support](https://plugins360.com/support/) | [Premium Version](https://plugins360.com/all-in-one-video-gallery/#premium)
|
|
|
|
|
22 |
|
23 |
https://www.youtube.com/watch?v=w47PU9ppuF8
|
24 |
|
30 |
* Thumbnail Gallery (you can select how many rows, columns to display and pagination).
|
31 |
* Beautiful HTML5 Video Player with FLASH fallback.
|
32 |
* Supported Formats: MP4, WebM, OGV and embeddable players like YouTube, Vimeo, Dailymotion & Facebook.
|
33 |
+
* Configure Player controls: play pause, timer, progress bar, duration, volume, fullscreen
|
34 |
* Configure Player properties: autoplay, loop, preload
|
|
|
35 |
* Video Subtitles.
|
36 |
* Comment on videos.
|
37 |
* Sharing of videos through Facebook, Twitter, Google Plus, Linkedin & Pinterest.
|
40 |
* Show GDPR consent.
|
41 |
* Detailed user and developer documentation.
|
42 |
|
43 |
+
**Premium Features**
|
44 |
+
|
45 |
+
* Custom Logo & Branding
|
46 |
+
* Custom Context Menu
|
47 |
+
* HLS / M(PEG)-Dash
|
48 |
+
* Live Streaming
|
49 |
+
* Popup Template
|
50 |
+
* Slider Template
|
51 |
+
* VAST / VPAID Ads
|
52 |
+
|
53 |
**Translations**
|
54 |
|
55 |
+
Currently, the plugin is available only in English. But, the plugin is translation ready and you can [translate](https://plugins360.com/all-in-one-video-gallery/translate/) to your language easy.
|
56 |
|
57 |
**Get Involved**
|
58 |
|
59 |
+
* Wording - I am not a native English speaker, if you find any typo, grammar mistake or etc. please [report](https://plugins360.com/support/) on our website.
|
60 |
+
* Translation - If you have translated the plugin to your language, feel free to [submit your translation](https://plugins360.com/support/).
|
61 |
* Rate Plugin - If you find this plugin useful, please leave a [positive review](https://wordpress.org/support/plugin/all-in-one-video-gallery/reviews/).
|
62 |
* Submit a Bug - If you find any issue, please [submit a bug](https://plugins360.com/support/) on our website.
|
63 |
|
74 |
== Frequently Asked Questions ==
|
75 |
|
76 |
= I have a problem what now? =
|
77 |
+
Please describe your issue and submit a ticket on our plugin support forum, you should receive a reply within 24 hours (except Sunday).
|
78 |
|
79 |
= Getting a 404 error? =
|
80 |
+
Most likely rewrite rules were not registered properly for some reason. Go to "WordPress Admin Panel => Settings => Permalinks" and click "Save Changes" button without actually changing anything, this should reset the router and fix URLs.
|
81 |
|
82 |
== Screenshots ==
|
83 |
|
84 |
+
1. Categories Layout.
|
85 |
+
2. Video Gallery ("Classic" Template).
|
86 |
+
3. Single Video page.
|
87 |
+
4. Videos list back-end.
|
88 |
+
5. Video form back-end.
|
89 |
+
6. Category form back-end.
|
90 |
7. Plugin Settings.
|
91 |
|
92 |
== Changelog ==
|
93 |
|
94 |
+
= 1.5.7 =
|
95 |
+
|
96 |
+
* New: Freemius Integration.
|
97 |
+
* New: PHP 7+ compatibility.
|
98 |
+
* New: Introduces Template options for both categories and videos gallery.
|
99 |
+
* Tweak: Code completely revised and rewritten to make the plugin more extensible.
|
100 |
+
* Tweak: Removed Twitter Bootstrap & Font Awesome libraries and replaced with custom CSS code to keep the plugin lightweight.
|
101 |
+
* Tweak: Custom Logo & Branding, Custom Context Menu options removed from the FREE version. But, these options will continue to work for our old users.
|
102 |
+
* Fix: [+] few minor bug fixes.
|
103 |
+
|
104 |
= 1.5.6 =
|
105 |
|
106 |
* New: Gutenberg blocks for the plugin.
|
129 |
|
130 |
= 1.5.1 =
|
131 |
|
132 |
+
* Tweak: README.txt update.
|
133 |
|
134 |
= 1.5.0 =
|
135 |
|
159 |
|
160 |
== Upgrade Notice ==
|
161 |
|
162 |
+
= 1.5.7 =
|
163 |
+
|
164 |
+
* New: Freemius Integration.
|
165 |
+
* New: PHP 7+ compatibility.
|
166 |
+
* New: Introduces Template options for both categories and videos gallery.
|
167 |
+
* Tweak: Code completely revised and rewritten to make the plugin more extensible.
|
168 |
+
* Tweak: Removed Twitter Bootstrap & Font Awesome libraries and replaced with custom CSS code to keep the plugin lightweight.
|
169 |
+
* Tweak: Custom Logo & Branding, Custom Context Menu options removed from the FREE version. But, these options will continue to work for our old users.
|
170 |
+
* Fix: [+] few minor bug fixes.
|
171 |
+
|
172 |
= 1.5.6 =
|
173 |
|
174 |
* New: Gutenberg blocks for the plugin.
|
197 |
|
198 |
= 1.5.1 =
|
199 |
|
200 |
+
* Tweak: README.txt update.
|
201 |
|
202 |
= 1.5.0 =
|
203 |
|
admin/admin.php
ADDED
@@ -0,0 +1,209 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* The admin-specific functionality of the plugin.
|
5 |
+
*
|
6 |
+
* @link https://plugins360.com
|
7 |
+
* @since 1.0.0
|
8 |
+
*
|
9 |
+
* @package All_In_One_Video_Gallery
|
10 |
+
*/
|
11 |
+
|
12 |
+
// Exit if accessed directly
|
13 |
+
if ( ! defined( 'WPINC' ) ) {
|
14 |
+
die;
|
15 |
+
}
|
16 |
+
|
17 |
+
/**
|
18 |
+
* AIOVG_Admin class.
|
19 |
+
*
|
20 |
+
* @since 1.0.0
|
21 |
+
*/
|
22 |
+
class AIOVG_Admin {
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Insert missing plugin options.
|
26 |
+
*
|
27 |
+
* @since 1.5.2
|
28 |
+
*/
|
29 |
+
public function wp_loaded() {
|
30 |
+
$defaults = aiovg_get_default_settings();
|
31 |
+
|
32 |
+
// Insert the missing player settings
|
33 |
+
$player_settings = get_option( 'aiovg_player_settings' );
|
34 |
+
|
35 |
+
$new_player_settings = array();
|
36 |
+
|
37 |
+
if ( ! array_key_exists( 'use_native_controls', $player_settings ) ) {
|
38 |
+
$new_player_settings['use_native_controls'] = $defaults['aiovg_player_settings']['use_native_controls'];
|
39 |
+
}
|
40 |
+
|
41 |
+
if ( count( $new_player_settings ) ) {
|
42 |
+
update_option( 'aiovg_player_settings', array_merge( $player_settings, $new_player_settings ) );
|
43 |
+
}
|
44 |
+
|
45 |
+
// Insert the missing categories settings
|
46 |
+
$categories_settings = get_option( 'aiovg_categories_settings' );
|
47 |
+
|
48 |
+
$new_categories_settings = array();
|
49 |
+
|
50 |
+
if ( ! array_key_exists( 'template', $categories_settings ) ) {
|
51 |
+
$new_categories_settings['template'] = $defaults['aiovg_categories_settings']['template'];
|
52 |
+
}
|
53 |
+
|
54 |
+
if ( ! array_key_exists( 'hierarchical', $categories_settings ) ) {
|
55 |
+
$new_categories_settings['hierarchical'] = $defaults['aiovg_categories_settings']['hierarchical'];
|
56 |
+
}
|
57 |
+
|
58 |
+
if ( count( $new_categories_settings ) ) {
|
59 |
+
update_option( 'aiovg_categories_settings', array_merge( $categories_settings, $new_categories_settings ) );
|
60 |
+
}
|
61 |
+
|
62 |
+
// Insert the missing videos settings
|
63 |
+
$videos_settings = get_option( 'aiovg_videos_settings' );
|
64 |
+
|
65 |
+
$new_videos_settings = array();
|
66 |
+
|
67 |
+
if ( ! array_key_exists( 'template', $videos_settings ) ) {
|
68 |
+
$new_videos_settings['template'] = $defaults['aiovg_videos_settings']['template'];
|
69 |
+
}
|
70 |
+
|
71 |
+
if ( ! array_key_exists( 'thumbnail_style', $videos_settings ) ) {
|
72 |
+
$new_videos_settings['thumbnail_style'] = $defaults['aiovg_videos_settings']['thumbnail_style'];
|
73 |
+
}
|
74 |
+
|
75 |
+
if ( count( $new_videos_settings ) ) {
|
76 |
+
update_option( 'aiovg_videos_settings', array_merge( $videos_settings, $new_videos_settings ) );
|
77 |
+
}
|
78 |
+
|
79 |
+
// Insert the privacy settings
|
80 |
+
if ( false == get_option( 'aiovg_privacy_settings' ) ) {
|
81 |
+
add_option( 'aiovg_privacy_settings', $defaults['aiovg_privacy_settings'] );
|
82 |
+
}
|
83 |
+
|
84 |
+
// Update the plugin version
|
85 |
+
if ( AIOVG_PLUGIN_VERSION !== get_option( 'aiovg_version' ) ) {
|
86 |
+
update_option( 'aiovg_version', AIOVG_PLUGIN_VERSION );
|
87 |
+
}
|
88 |
+
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Register the stylesheets for the admin area.
|
92 |
+
*
|
93 |
+
* @since 1.0.0
|
94 |
+
*/
|
95 |
+
public function enqueue_styles() {
|
96 |
+
wp_enqueue_style( 'wp-color-picker' );
|
97 |
+
|
98 |
+
wp_enqueue_style(
|
99 |
+
AIOVG_PLUGIN_SLUG . '-magnific-popup',
|
100 |
+
AIOVG_PLUGIN_URL . 'public/assets/css/magnific-popup.css',
|
101 |
+
array(),
|
102 |
+
'1.1.0',
|
103 |
+
'all'
|
104 |
+
);
|
105 |
+
|
106 |
+
wp_enqueue_style(
|
107 |
+
AIOVG_PLUGIN_SLUG . '-admin',
|
108 |
+
AIOVG_PLUGIN_URL . 'admin/assets/css/admin.css',
|
109 |
+
array(),
|
110 |
+
AIOVG_PLUGIN_VERSION,
|
111 |
+
'all'
|
112 |
+
);
|
113 |
+
}
|
114 |
+
|
115 |
+
/**
|
116 |
+
* Register the JavaScript for the admin area.
|
117 |
+
*
|
118 |
+
* @since 1.0.0
|
119 |
+
*/
|
120 |
+
public function enqueue_scripts() {
|
121 |
+
wp_enqueue_media();
|
122 |
+
wp_enqueue_script( 'wp-color-picker' );
|
123 |
+
|
124 |
+
wp_enqueue_script(
|
125 |
+
AIOVG_PLUGIN_SLUG . '-magnific-popup',
|
126 |
+
AIOVG_PLUGIN_URL . 'public/assets/js/magnific-popup.min.js',
|
127 |
+
array( 'jquery' ),
|
128 |
+
'1.1.0',
|
129 |
+
false
|
130 |
+
);
|
131 |
+
|
132 |
+
wp_enqueue_script(
|
133 |
+
AIOVG_PLUGIN_SLUG . '-admin',
|
134 |
+
AIOVG_PLUGIN_URL . 'admin/assets/js/admin.js',
|
135 |
+
array( 'jquery' ),
|
136 |
+
AIOVG_PLUGIN_VERSION,
|
137 |
+
false
|
138 |
+
);
|
139 |
+
}
|
140 |
+
|
141 |
+
/**
|
142 |
+
* Add a settings link on the plugin listing page.
|
143 |
+
*
|
144 |
+
* @since 1.0.0
|
145 |
+
* @param array $links An array of plugin action links.
|
146 |
+
* @return string $links Array of filtered plugin action links.
|
147 |
+
*/
|
148 |
+
public function plugin_action_links( $links ) {
|
149 |
+
$settings_link = sprintf( '<a href="%s">%s</a>', admin_url( 'edit.php?post_type=aiovg_videos&page=aiovg_settings' ), __( 'Settings', 'all-in-one-video-gallery' ) );
|
150 |
+
array_unshift( $links, $settings_link );
|
151 |
+
|
152 |
+
return $links;
|
153 |
+
}
|
154 |
+
|
155 |
+
/**
|
156 |
+
* Display admin notice.
|
157 |
+
*
|
158 |
+
* @since 1.0.0
|
159 |
+
*/
|
160 |
+
public function admin_notice() {
|
161 |
+
if ( false == get_option( 'aiovg_admin_notice_dismissed' ) ) : ?>
|
162 |
+
<div id="aiovg-admin-notice" class="notice notice-info is-dismissible" data-security="<?php echo wp_create_nonce( 'aiovg_admin_notice_nonce' ); ?>">
|
163 |
+
<p>
|
164 |
+
<span class="dashicons-before dashicons-playlist-video"></span> <strong><?php _e( 'All-in-One Video Gallery', 'all-in-one-video-gallery' ); ?></strong>
|
165 |
+
<span class="aiovg-admin-notice-separator"> - </span>
|
166 |
+
<a href="https://plugins360.com/all-in-one-video-gallery/documentation/" target="_blank"><?php _e( 'Getting Started', 'all-in-one-video-gallery' ); ?></a>
|
167 |
+
<span class="aiovg-admin-notice-separator"> | </span>
|
168 |
+
<a href="<?php echo admin_url( 'admin.php?page=all-in-one-video-gallery-contact' ); ?>"><?php _e( 'Contact Us', 'all-in-one-video-gallery' ); ?></a>
|
169 |
+
<?php if ( aiovg_fs()->is_not_paying() ) : ?>
|
170 |
+
<span class="aiovg-admin-notice-separator"> | </span>
|
171 |
+
<a href="<?php echo esc_url( aiovg_fs()->get_upgrade_url() ); ?>" class="aiovg-upgrade-link"><?php _e( 'Upgrade Pro', 'all-in-one-video-gallery' ); ?></a>
|
172 |
+
<?php endif; ?>
|
173 |
+
</p>
|
174 |
+
</div>
|
175 |
+
<?php endif;
|
176 |
+
}
|
177 |
+
|
178 |
+
/**
|
179 |
+
* Dismiss admin notice.
|
180 |
+
*
|
181 |
+
* @since 1.0.0
|
182 |
+
*/
|
183 |
+
public function ajax_callback_dismiss_admin_notice() {
|
184 |
+
check_ajax_referer( 'aiovg_admin_notice_nonce', 'security' );
|
185 |
+
|
186 |
+
add_option( 'aiovg_admin_notice_dismissed', 1 );
|
187 |
+
wp_die();
|
188 |
+
}
|
189 |
+
|
190 |
+
/**
|
191 |
+
* Sets the extension and mime type for .vtt files.
|
192 |
+
*
|
193 |
+
* @since 1.5.7
|
194 |
+
* @param array $types File data array containing 'ext', 'type', and 'proper_filename' keys.
|
195 |
+
* @param string $file Full path to the file.
|
196 |
+
* @param string $filename The name of the file (may differ from $file due to $file being in a tmp directory).
|
197 |
+
* @param array $mimes Key is the file extension with value as the mime type.
|
198 |
+
* @return array $types Filtered file data array.
|
199 |
+
*/
|
200 |
+
public function add_filetype_and_ext( $types, $file, $filename, $mimes ) {
|
201 |
+
if ( false !== strpos( $filename, '.vtt' ) ) {
|
202 |
+
$types['ext'] = 'vtt';
|
203 |
+
$types['type'] = 'text/vtt';
|
204 |
+
}
|
205 |
+
|
206 |
+
return $types;
|
207 |
+
}
|
208 |
+
|
209 |
+
}
|
admin/assets/css/{aiovg-admin.css → admin.css}
RENAMED
@@ -43,6 +43,11 @@
|
|
43 |
text-align: center;
|
44 |
}
|
45 |
|
|
|
|
|
|
|
|
|
|
|
46 |
@media (max-width: 767px) {
|
47 |
.aiovg-hidden-xs {
|
48 |
display: none !important;
|
@@ -248,6 +253,15 @@ table.aiovg-table .aiovg-handle {
|
|
248 |
background-color: transparent;
|
249 |
}
|
250 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
251 |
/*----------------------------------------------------------------------------------------------
|
252 |
*
|
253 |
* Shortcode Builder
|
@@ -266,16 +280,123 @@ table.aiovg-table .aiovg-handle {
|
|
266 |
background: #FFF;
|
267 |
}
|
268 |
|
269 |
-
#aiovg-shortcode .aiovg-shortcode-
|
270 |
-
|
271 |
margin-bottom: 10px;
|
|
|
|
|
|
|
|
|
|
|
272 |
}
|
273 |
|
274 |
-
#aiovg-shortcode .aiovg-shortcode-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
275 |
display: block;
|
276 |
margin-bottom: 5px;
|
|
|
277 |
}
|
278 |
|
279 |
-
#aiovg-shortcode label.selectit {
|
280 |
margin-bottom: 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
281 |
}
|
43 |
text-align: center;
|
44 |
}
|
45 |
|
46 |
+
.aiovg-upgrade-link,
|
47 |
+
.aiovg-upgrade-link:hover {
|
48 |
+
color: green;
|
49 |
+
}
|
50 |
+
|
51 |
@media (max-width: 767px) {
|
52 |
.aiovg-hidden-xs {
|
53 |
display: none !important;
|
253 |
background-color: transparent;
|
254 |
}
|
255 |
|
256 |
+
#aiovg-categories-settings.aiovg-template-grid tr.hierarchical {
|
257 |
+
display: none;
|
258 |
+
}
|
259 |
+
|
260 |
+
#aiovg-categories-settings.aiovg-template-list tr.columns,
|
261 |
+
#aiovg-categories-settings.aiovg-template-list tr.show_description {
|
262 |
+
display: none;
|
263 |
+
}
|
264 |
+
|
265 |
/*----------------------------------------------------------------------------------------------
|
266 |
*
|
267 |
* Shortcode Builder
|
280 |
background: #FFF;
|
281 |
}
|
282 |
|
283 |
+
#aiovg-shortcode-form .aiovg-shortcode-section-header {
|
284 |
+
display: block;
|
285 |
margin-bottom: 10px;
|
286 |
+
padding: 7px;
|
287 |
+
background: #666;
|
288 |
+
border: #333;
|
289 |
+
color: #FFF;
|
290 |
+
pointer-events: none;
|
291 |
}
|
292 |
|
293 |
+
#aiovg-shortcode-form .aiovg-shortcode-section-general .aiovg-shortcode-section-header {
|
294 |
+
display: none;
|
295 |
+
}
|
296 |
+
|
297 |
+
#aiovg-shortcode-form .aiovg-shortcode-selector,
|
298 |
+
#aiovg-shortcode-form .aiovg-shortcode-field {
|
299 |
+
margin-bottom: 10px;
|
300 |
+
}
|
301 |
+
|
302 |
+
#aiovg-shortcode-form .aiovg-shortcode-label {
|
303 |
display: block;
|
304 |
margin-bottom: 5px;
|
305 |
+
font-weight: 500;
|
306 |
}
|
307 |
|
308 |
+
#aiovg-shortcode-form label.selectit {
|
309 |
margin-bottom: 0;
|
310 |
+
}
|
311 |
+
|
312 |
+
#aiovg-shortcode-form .aiovg-shortcode-field-description {
|
313 |
+
margin: 7px 0;
|
314 |
+
}
|
315 |
+
|
316 |
+
#aiovg-shortcode-type-categories,
|
317 |
+
#aiovg-shortcode-type-videos,
|
318 |
+
#aiovg-shortcode-type-video,
|
319 |
+
#aiovg-shortcode-type-search_form {
|
320 |
+
display: none;
|
321 |
+
}
|
322 |
+
|
323 |
+
.aiovg-shortcode-type-categories #aiovg-shortcode-type-categories,
|
324 |
+
.aiovg-shortcode-type-videos #aiovg-shortcode-type-videos,
|
325 |
+
.aiovg-shortcode-type-video #aiovg-shortcode-type-video,
|
326 |
+
.aiovg-shortcode-type-search_form #aiovg-shortcode-type-search_form {
|
327 |
+
display: block;
|
328 |
+
}
|
329 |
+
|
330 |
+
#aiovg-shortcode-type-categories .aiovg-shortcode-field-title,
|
331 |
+
#aiovg-shortcode-type-categories .aiovg-shortcode-field-ratio {
|
332 |
+
display: none;
|
333 |
+
}
|
334 |
+
|
335 |
+
#aiovg-shortcode-type-categories.aiovg-template-grid .aiovg-shortcode-field-hierarchical {
|
336 |
+
display: none;
|
337 |
+
}
|
338 |
+
|
339 |
+
#aiovg-shortcode-type-categories.aiovg-template-list .aiovg-shortcode-field-columns,
|
340 |
+
#aiovg-shortcode-type-categories.aiovg-template-list .aiovg-shortcode-field-show_description {
|
341 |
+
display: none;
|
342 |
+
}
|
343 |
+
|
344 |
+
#aiovg-shortcode-type-videos .aiovg-shortcode-field-title,
|
345 |
+
#aiovg-shortcode-type-videos .aiovg-shortcode-field-exclude,
|
346 |
+
#aiovg-shortcode-type-videos .aiovg-shortcode-field-ratio,
|
347 |
+
#aiovg-shortcode-type-videos .aiovg-shortcode-field-show_more,
|
348 |
+
#aiovg-shortcode-type-videos .aiovg-shortcode-field-more_label,
|
349 |
+
#aiovg-shortcode-type-videos .aiovg-shortcode-field-more_link,
|
350 |
+
#aiovg-shortcode-type-videos .aiovg-shortcode-field-excerpt_length {
|
351 |
+
display: none;
|
352 |
+
}
|
353 |
+
|
354 |
+
/*----------------------------------------------------------------------------------------------
|
355 |
+
*
|
356 |
+
* Widgets
|
357 |
+
*
|
358 |
+
*--------------------------------------------------------------------------------------------*/
|
359 |
+
.aiovg-widget-form .aiovg-widget-section-header {
|
360 |
+
display: block;
|
361 |
+
margin-bottom: 10px;
|
362 |
+
padding: 7px;
|
363 |
+
background: #666;
|
364 |
+
border: #333;
|
365 |
+
color: #FFF;
|
366 |
+
pointer-events: none;
|
367 |
+
}
|
368 |
+
|
369 |
+
.aiovg-widget-form .aiovg-widget-section-general .aiovg-widget-section-header {
|
370 |
+
display: none;
|
371 |
+
}
|
372 |
+
|
373 |
+
.aiovg-widget-form .aiovg-widget-field {
|
374 |
+
margin: 10px 0;
|
375 |
+
}
|
376 |
+
|
377 |
+
.aiovg-widget-form .aiovg-widget-label {
|
378 |
+
display: block;
|
379 |
+
margin-bottom: 5px;
|
380 |
+
font-weight: 500;
|
381 |
+
}
|
382 |
+
|
383 |
+
.aiovg-widget-form .aiovg-widget-field-description {
|
384 |
+
margin: 7px 0;
|
385 |
+
}
|
386 |
+
|
387 |
+
.aiovg-widget-form-categories.aiovg-template-grid .aiovg-widget-field-hierarchical {
|
388 |
+
display: none;
|
389 |
+
}
|
390 |
+
|
391 |
+
.aiovg-widget-form-categories.aiovg-template-list .aiovg-widget-field-columns,
|
392 |
+
.aiovg-widget-form-categories.aiovg-template-list .aiovg-widget-field-show_description {
|
393 |
+
display: none;
|
394 |
+
}
|
395 |
+
|
396 |
+
.aiovg-widget-form-videos .aiovg-widget-field-exclude,
|
397 |
+
.aiovg-widget-form-videos .aiovg-widget-field-ratio,
|
398 |
+
.aiovg-widget-form-videos .aiovg-widget-field-show_count,
|
399 |
+
.aiovg-widget-form-videos .aiovg-widget-field-excerpt_length,
|
400 |
+
.aiovg-widget-form-videos .aiovg-widget-field-show_pagination {
|
401 |
+
display: none;
|
402 |
}
|
admin/assets/js/{aiovg-admin.js → admin.js}
RENAMED
@@ -4,10 +4,9 @@
|
|
4 |
/**
|
5 |
* Display the media uploader.
|
6 |
*
|
7 |
-
* @since
|
8 |
*/
|
9 |
-
function aiovg_render_media_uploader( $elem, form ) {
|
10 |
-
|
11 |
var file_frame, attachment;
|
12 |
|
13 |
// If an instance of file_frame already exists, then we can open it rather than creating a new instance
|
@@ -24,8 +23,7 @@
|
|
24 |
});
|
25 |
|
26 |
// Setup an event handler for what to do when a media has been selected
|
27 |
-
file_frame.on( 'insert', function() {
|
28 |
-
|
29 |
// Read the JSON data returned from the media uploader
|
30 |
attachment = file_frame.state().get( 'selection' ).first().toJSON();
|
31 |
|
@@ -54,22 +52,19 @@
|
|
54 |
case 'settings':
|
55 |
$elem.prev( '.aiovg-url' ).val( attachment.url );
|
56 |
break;
|
57 |
-
};
|
58 |
-
|
59 |
});
|
60 |
|
61 |
// Now display the actual file_frame
|
62 |
-
file_frame.open();
|
63 |
-
|
64 |
};
|
65 |
|
66 |
/**
|
67 |
* Make tracks inside the video form sortable.
|
68 |
*
|
69 |
-
* @since
|
70 |
*/
|
71 |
-
function aiovg_sort_tracks() {
|
72 |
-
|
73 |
var $sortable_element = $( '#aiovg-tracks tbody' );
|
74 |
|
75 |
if ( $sortable_element.hasClass( 'ui-sortable' ) ) {
|
@@ -78,20 +73,35 @@
|
|
78 |
|
79 |
$sortable_element.sortable({
|
80 |
handle: '.aiovg-handle'
|
81 |
-
});
|
82 |
-
|
83 |
};
|
84 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
/**
|
86 |
* Called when the page has loaded.
|
87 |
*
|
88 |
-
* @since
|
89 |
*/
|
90 |
$(function() {
|
91 |
|
92 |
// Admin: Dismiss admin notice
|
93 |
-
$( '#aiovg-admin-notice' ).on( 'click', '.notice-dismiss', function( e ) {
|
94 |
-
|
95 |
e.preventDefault();
|
96 |
|
97 |
var data = {
|
@@ -99,13 +109,40 @@
|
|
99 |
'security': $( '#aiovg-admin-notice' ).data( 'security' )
|
100 |
};
|
101 |
|
102 |
-
$.post( ajaxurl, data );
|
103 |
-
|
104 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
|
106 |
-
// Videos:
|
107 |
-
$( '#aiovg-video-type' ).on( 'change', function( e ) {
|
108 |
-
|
109 |
e.preventDefault();
|
110 |
|
111 |
var type = $( this ).val();
|
@@ -116,46 +153,38 @@
|
|
116 |
if ( 'default' == type ) {
|
117 |
$( '#aiovg-has-webm, #aiovg-has-ogv' ).trigger( 'change' );
|
118 |
}
|
119 |
-
|
120 |
}).trigger( 'change' );
|
121 |
|
122 |
-
// Videos:
|
123 |
-
$( '#aiovg-has-webm' ).on( 'change', function( e ) {
|
124 |
-
|
125 |
e.preventDefault();
|
126 |
|
127 |
if ( $( this ).is( ':checked' ) ) {
|
128 |
$( '#aiovg-field-webm' ).show( 300 );
|
129 |
} else {
|
130 |
$( '#aiovg-field-webm' ).hide( 300 );
|
131 |
-
}
|
132 |
-
|
133 |
}).trigger( 'change' );
|
134 |
|
135 |
-
// Videos:
|
136 |
-
$( '#aiovg-has-ogv' ).on( 'change', function( e ) {
|
137 |
-
|
138 |
e.preventDefault();
|
139 |
|
140 |
if ( $( this ).is( ':checked' ) ) {
|
141 |
$( '#aiovg-field-ogv' ).show( 300 );
|
142 |
} else {
|
143 |
$( '#aiovg-field-ogv' ).hide( 300 );
|
144 |
-
}
|
145 |
-
|
146 |
}).trigger( 'change' );
|
147 |
|
148 |
// Videos: Display the media uploader when "Upload Media" button clicked
|
149 |
-
$( '.aiovg-upload-media' ).on( 'click', function( e ) {
|
150 |
-
|
151 |
e.preventDefault();
|
152 |
-
aiovg_render_media_uploader( $( this ), 'videos' );
|
153 |
-
|
154 |
});
|
155 |
|
156 |
// Videos: Add new subtitle fields when "Add New File" button clicked
|
157 |
-
$( '#aiovg-add-new-track' ).on( 'click', function( e ) {
|
158 |
-
|
159 |
e.preventDefault();
|
160 |
|
161 |
var id = $( '.aiovg-tracks-row', '#aiovg-tracks' ).length;
|
@@ -163,50 +192,41 @@
|
|
163 |
var $row = $( '#aiovg-tracks-clone' ).find( 'tr' ).clone();
|
164 |
$row.find( '.aiovg-track-src' ).attr( 'id', 'aiovg-track-'+id );
|
165 |
|
166 |
-
$( '#aiovg-tracks' ).append( $row );
|
167 |
-
|
168 |
});
|
169 |
|
170 |
-
if( ! $( '.aiovg-tracks-row', '#aiovg-tracks' ).length ) {
|
171 |
$( '#aiovg-add-new-track' ).trigger( 'click' );
|
172 |
}
|
173 |
|
174 |
// Videos: Display the media uploader for adding subtitles when "Upload File" button clicked
|
175 |
-
$( 'body' ).on( 'click', '.aiovg-upload-track', function( e ) {
|
176 |
-
|
177 |
e.preventDefault();
|
178 |
-
aiovg_render_media_uploader( $( this ), 'tracks' );
|
179 |
-
|
180 |
});
|
181 |
|
182 |
// Videos: Delete a subtitles fields set when "Delete" button clicked
|
183 |
-
$( 'body' ).on( 'click', '.aiovg-delete-track', function( e ) {
|
184 |
-
|
185 |
e.preventDefault();
|
186 |
-
$( this ).closest( 'tr' ).remove();
|
187 |
-
|
188 |
});
|
189 |
|
190 |
// Videos: Make the subtitles fields sortable
|
191 |
aiovg_sort_tracks();
|
192 |
|
193 |
// Categories: Display the media uploader when "Add Image" button clicked
|
194 |
-
$( '#aiovg-categories-upload-image' ).on( 'click', function( e ) {
|
195 |
-
|
196 |
e.preventDefault();
|
197 |
-
aiovg_render_media_uploader( $( this ), 'categories' );
|
198 |
-
|
199 |
});
|
200 |
|
201 |
// Categories: Delete the image when "Remove Image" button clicked
|
202 |
-
$( '#aiovg-categories-remove-image' ).on( 'click', function( e ) {
|
203 |
-
|
204 |
e.preventDefault();
|
205 |
|
206 |
var id = parseInt( $( '#aiovg-categories-image-id' ).val() );
|
207 |
|
208 |
-
if ( id > 0 ) {
|
209 |
-
|
210 |
var data = {
|
211 |
'action': 'aiovg_delete_category_image',
|
212 |
'attachment_id': id,
|
@@ -219,17 +239,13 @@
|
|
219 |
|
220 |
$( '#aiovg-categories-remove-image' ).hide();
|
221 |
$( '#aiovg-categories-upload-image' ).show();
|
222 |
-
});
|
223 |
-
|
224 |
-
};
|
225 |
-
|
226 |
});
|
227 |
|
228 |
// Categories: Clear the image field after a category was created
|
229 |
-
$( document ).ajaxComplete(function( e, xhr, settings ) {
|
230 |
-
|
231 |
-
if ( $( "#aiovg-categories-image-id" ).length ) {
|
232 |
-
|
233 |
var queryStringArr = settings.data.split( '&' );
|
234 |
|
235 |
if ( -1 !== $.inArray( 'action=add-tag', queryStringArr ) ) {
|
@@ -242,61 +258,72 @@
|
|
242 |
$( '#aiovg-categories-remove-image' ).hide();
|
243 |
$( '#aiovg-categories-upload-image' ).show();
|
244 |
};
|
245 |
-
};
|
246 |
-
|
247 |
-
};
|
248 |
-
|
249 |
});
|
250 |
|
251 |
// Settings: Initiate color picker
|
252 |
$( '.aiovg-color-picker-field', '#aiovg-settings' ).wpColorPicker();
|
253 |
|
254 |
// Settings: Browse button
|
255 |
-
$( '.aiovg-browse', '#aiovg-settings' ).on( 'click', function( e ) {
|
256 |
-
|
257 |
e.preventDefault();
|
258 |
-
aiovg_render_media_uploader( $( this ), 'settings' );
|
259 |
-
|
260 |
});
|
261 |
|
262 |
-
// Shortcode: Initialize popup
|
263 |
$( '#aiovg-media-button' ).magnificPopup({
|
264 |
type: 'inline'
|
265 |
});
|
266 |
|
267 |
-
// Shortcode:
|
268 |
-
$( '#aiovg-shortcode-type' ).on( 'change', function( e ) {
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
273 |
|
274 |
-
$( '
|
275 |
-
|
|
|
|
|
|
|
276 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
277 |
}).trigger( 'change' );
|
278 |
|
279 |
-
// Shortcode: Initiate color picker
|
280 |
-
$( '.aiovg-color-picker-field', '#aiovg-shortcode' ).wpColorPicker();
|
281 |
|
282 |
-
// Shortcode: Insert shortcode
|
283 |
-
$( '#aiovg-insert-shortcode' ).on( 'click', function( e ) {
|
284 |
-
|
285 |
e.preventDefault();
|
286 |
|
287 |
var shortcode = $( '#aiovg-shortcode-type' ).val();
|
288 |
var attrs = '';
|
289 |
|
290 |
-
$( '.aiovg-shortcode-type-' + shortcode ).each(function() {
|
291 |
-
|
292 |
var $elem = $( this ).find( '.aiovg-shortcode-input' );
|
293 |
|
294 |
if ( $elem.length ) {
|
295 |
var type = $elem.attr( 'type' );
|
296 |
-
var
|
297 |
-
var name = id.replace( 'aiovg-shortcode-' + shortcode + '-', '' );
|
298 |
-
var def = $elem.data( 'default' );
|
299 |
var value = $elem.val();
|
|
|
300 |
|
301 |
if ( 'category' == name ) {
|
302 |
value = $( 'input[type="checkbox"]:checked', $elem ).map(function() {
|
@@ -311,44 +338,46 @@
|
|
311 |
if ( value != def ) {
|
312 |
attrs += ( ' ' + name + '="' + value + '"' );
|
313 |
}
|
314 |
-
}
|
315 |
-
|
316 |
});
|
317 |
|
318 |
window.send_to_editor( '[aiovg_' + shortcode + attrs + ']' );
|
319 |
$.magnificPopup.close();
|
320 |
-
|
321 |
}).trigger( 'change' );
|
322 |
|
323 |
-
// Shortcode: Close shortcode builder
|
324 |
-
$( '#aiovg-cancel-shortcode-insert' ).on( 'click', function( e ) {
|
325 |
-
|
326 |
e.preventDefault();
|
327 |
-
$.magnificPopup.close();
|
328 |
-
|
329 |
});
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
}
|
339 |
});
|
340 |
-
}
|
341 |
|
342 |
-
|
343 |
-
|
344 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
345 |
|
346 |
-
|
|
|
|
|
|
|
347 |
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
} );
|
352 |
-
} );
|
353 |
|
354 |
})( jQuery );
|
4 |
/**
|
5 |
* Display the media uploader.
|
6 |
*
|
7 |
+
* @since 1.0.0
|
8 |
*/
|
9 |
+
function aiovg_render_media_uploader( $elem, form ) {
|
|
|
10 |
var file_frame, attachment;
|
11 |
|
12 |
// If an instance of file_frame already exists, then we can open it rather than creating a new instance
|
23 |
});
|
24 |
|
25 |
// Setup an event handler for what to do when a media has been selected
|
26 |
+
file_frame.on( 'insert', function() {
|
|
|
27 |
// Read the JSON data returned from the media uploader
|
28 |
attachment = file_frame.state().get( 'selection' ).first().toJSON();
|
29 |
|
52 |
case 'settings':
|
53 |
$elem.prev( '.aiovg-url' ).val( attachment.url );
|
54 |
break;
|
55 |
+
};
|
|
|
56 |
});
|
57 |
|
58 |
// Now display the actual file_frame
|
59 |
+
file_frame.open();
|
|
|
60 |
};
|
61 |
|
62 |
/**
|
63 |
* Make tracks inside the video form sortable.
|
64 |
*
|
65 |
+
* @since 1.0.0
|
66 |
*/
|
67 |
+
function aiovg_sort_tracks() {
|
|
|
68 |
var $sortable_element = $( '#aiovg-tracks tbody' );
|
69 |
|
70 |
if ( $sortable_element.hasClass( 'ui-sortable' ) ) {
|
73 |
|
74 |
$sortable_element.sortable({
|
75 |
handle: '.aiovg-handle'
|
76 |
+
});
|
|
|
77 |
};
|
78 |
|
79 |
+
/**
|
80 |
+
* Widget: Initiate color picker
|
81 |
+
*
|
82 |
+
* @since 1.0.0
|
83 |
+
*/
|
84 |
+
function aiovg_widget_color_picker( widget ) {
|
85 |
+
widget.find( '.aiovg-color-picker-field' ).wpColorPicker( {
|
86 |
+
change: _.throttle( function() { // For Customizer
|
87 |
+
$( this ).trigger( 'change' );
|
88 |
+
}, 3000 )
|
89 |
+
});
|
90 |
+
}
|
91 |
+
|
92 |
+
function on_aiovg_widget_update( event, widget ) {
|
93 |
+
aiovg_widget_color_picker( widget );
|
94 |
+
}
|
95 |
+
|
96 |
/**
|
97 |
* Called when the page has loaded.
|
98 |
*
|
99 |
+
* @since 1.0.0
|
100 |
*/
|
101 |
$(function() {
|
102 |
|
103 |
// Admin: Dismiss admin notice
|
104 |
+
$( '#aiovg-admin-notice' ).on( 'click', '.notice-dismiss', function( e ) {
|
|
|
105 |
e.preventDefault();
|
106 |
|
107 |
var data = {
|
109 |
'security': $( '#aiovg-admin-notice' ).data( 'security' )
|
110 |
};
|
111 |
|
112 |
+
$.post( ajaxurl, data );
|
|
|
113 |
});
|
114 |
+
|
115 |
+
// Settings: Set Section ID
|
116 |
+
$( '.form-table', '#aiovg-settings' ).each(function() {
|
117 |
+
var str = $( this ).find( 'tr:first th label' ).attr( 'for' );
|
118 |
+
var id = str.split( '[' );
|
119 |
+
id = id[0].replace( /_/g, '-' );
|
120 |
+
|
121 |
+
$( this ).attr( 'id', id );
|
122 |
+
});
|
123 |
+
|
124 |
+
// Settings: Toggle fields based on the selected categories template
|
125 |
+
$( 'tr.template', '#aiovg-categories-settings' ).find( 'select' ).on( 'change', function() {
|
126 |
+
var template = $( this ).val();
|
127 |
+
|
128 |
+
$( '#aiovg-categories-settings' ).removeClass(function( index, classes ) {
|
129 |
+
var matches = classes.match( /\aiovg-template-\S+/ig );
|
130 |
+
return ( matches ) ? matches.join(' ') : '';
|
131 |
+
}).addClass( 'aiovg-template-' + template );
|
132 |
+
}).trigger( 'change' );
|
133 |
+
|
134 |
+
// Settings: Toggle fields based on the selected videos template
|
135 |
+
$( 'tr.template', '#aiovg-videos-settings' ).find( 'select' ).on( 'change', function() {
|
136 |
+
var template = $( this ).val();
|
137 |
+
|
138 |
+
$( '#aiovg-videos-settings' ).removeClass(function( index, classes ) {
|
139 |
+
var matches = classes.match( /\aiovg-template-\S+/ig );
|
140 |
+
return ( matches ) ? matches.join(' ') : '';
|
141 |
+
}).addClass( 'aiovg-template-' + template );
|
142 |
+
}).trigger( 'change' );
|
143 |
|
144 |
+
// Videos: Toggle fields based on the selected video source type
|
145 |
+
$( '#aiovg-video-type' ).on( 'change', function( e ) {
|
|
|
146 |
e.preventDefault();
|
147 |
|
148 |
var type = $( this ).val();
|
153 |
if ( 'default' == type ) {
|
154 |
$( '#aiovg-has-webm, #aiovg-has-ogv' ).trigger( 'change' );
|
155 |
}
|
|
|
156 |
}).trigger( 'change' );
|
157 |
|
158 |
+
// Videos: Toggle WebM fields
|
159 |
+
$( '#aiovg-has-webm' ).on( 'change', function( e ) {
|
|
|
160 |
e.preventDefault();
|
161 |
|
162 |
if ( $( this ).is( ':checked' ) ) {
|
163 |
$( '#aiovg-field-webm' ).show( 300 );
|
164 |
} else {
|
165 |
$( '#aiovg-field-webm' ).hide( 300 );
|
166 |
+
}
|
|
|
167 |
}).trigger( 'change' );
|
168 |
|
169 |
+
// Videos: Toggle OGV fields
|
170 |
+
$( '#aiovg-has-ogv' ).on( 'change', function( e ) {
|
|
|
171 |
e.preventDefault();
|
172 |
|
173 |
if ( $( this ).is( ':checked' ) ) {
|
174 |
$( '#aiovg-field-ogv' ).show( 300 );
|
175 |
} else {
|
176 |
$( '#aiovg-field-ogv' ).hide( 300 );
|
177 |
+
}
|
|
|
178 |
}).trigger( 'change' );
|
179 |
|
180 |
// Videos: Display the media uploader when "Upload Media" button clicked
|
181 |
+
$( '.aiovg-upload-media' ).on( 'click', function( e ) {
|
|
|
182 |
e.preventDefault();
|
183 |
+
aiovg_render_media_uploader( $( this ), 'videos' );
|
|
|
184 |
});
|
185 |
|
186 |
// Videos: Add new subtitle fields when "Add New File" button clicked
|
187 |
+
$( '#aiovg-add-new-track' ).on( 'click', function( e ) {
|
|
|
188 |
e.preventDefault();
|
189 |
|
190 |
var id = $( '.aiovg-tracks-row', '#aiovg-tracks' ).length;
|
192 |
var $row = $( '#aiovg-tracks-clone' ).find( 'tr' ).clone();
|
193 |
$row.find( '.aiovg-track-src' ).attr( 'id', 'aiovg-track-'+id );
|
194 |
|
195 |
+
$( '#aiovg-tracks' ).append( $row );
|
|
|
196 |
});
|
197 |
|
198 |
+
if ( ! $( '.aiovg-tracks-row', '#aiovg-tracks' ).length ) {
|
199 |
$( '#aiovg-add-new-track' ).trigger( 'click' );
|
200 |
}
|
201 |
|
202 |
// Videos: Display the media uploader for adding subtitles when "Upload File" button clicked
|
203 |
+
$( 'body' ).on( 'click', '.aiovg-upload-track', function( e ) {
|
|
|
204 |
e.preventDefault();
|
205 |
+
aiovg_render_media_uploader( $( this ), 'tracks' );
|
|
|
206 |
});
|
207 |
|
208 |
// Videos: Delete a subtitles fields set when "Delete" button clicked
|
209 |
+
$( 'body' ).on( 'click', '.aiovg-delete-track', function( e ) {
|
|
|
210 |
e.preventDefault();
|
211 |
+
$( this ).closest( 'tr' ).remove();
|
|
|
212 |
});
|
213 |
|
214 |
// Videos: Make the subtitles fields sortable
|
215 |
aiovg_sort_tracks();
|
216 |
|
217 |
// Categories: Display the media uploader when "Add Image" button clicked
|
218 |
+
$( '#aiovg-categories-upload-image' ).on( 'click', function( e ) {
|
|
|
219 |
e.preventDefault();
|
220 |
+
aiovg_render_media_uploader( $( this ), 'categories' );
|
|
|
221 |
});
|
222 |
|
223 |
// Categories: Delete the image when "Remove Image" button clicked
|
224 |
+
$( '#aiovg-categories-remove-image' ).on( 'click', function( e ) {
|
|
|
225 |
e.preventDefault();
|
226 |
|
227 |
var id = parseInt( $( '#aiovg-categories-image-id' ).val() );
|
228 |
|
229 |
+
if ( id > 0 ) {
|
|
|
230 |
var data = {
|
231 |
'action': 'aiovg_delete_category_image',
|
232 |
'attachment_id': id,
|
239 |
|
240 |
$( '#aiovg-categories-remove-image' ).hide();
|
241 |
$( '#aiovg-categories-upload-image' ).show();
|
242 |
+
});
|
243 |
+
};
|
|
|
|
|
244 |
});
|
245 |
|
246 |
// Categories: Clear the image field after a category was created
|
247 |
+
$( document ).ajaxComplete(function( e, xhr, settings ) {
|
248 |
+
if ( $( "#aiovg-categories-image-id" ).length ) {
|
|
|
|
|
249 |
var queryStringArr = settings.data.split( '&' );
|
250 |
|
251 |
if ( -1 !== $.inArray( 'action=add-tag', queryStringArr ) ) {
|
258 |
$( '#aiovg-categories-remove-image' ).hide();
|
259 |
$( '#aiovg-categories-upload-image' ).show();
|
260 |
};
|
261 |
+
};
|
262 |
+
};
|
|
|
|
|
263 |
});
|
264 |
|
265 |
// Settings: Initiate color picker
|
266 |
$( '.aiovg-color-picker-field', '#aiovg-settings' ).wpColorPicker();
|
267 |
|
268 |
// Settings: Browse button
|
269 |
+
$( '.aiovg-browse', '#aiovg-settings' ).on( 'click', function( e ) {
|
|
|
270 |
e.preventDefault();
|
271 |
+
aiovg_render_media_uploader( $( this ), 'settings' );
|
|
|
272 |
});
|
273 |
|
274 |
+
// Shortcode Builder: Initialize popup
|
275 |
$( '#aiovg-media-button' ).magnificPopup({
|
276 |
type: 'inline'
|
277 |
});
|
278 |
|
279 |
+
// Shortcode Builder: Toggle fields based on the selected shortcode type
|
280 |
+
$( '#aiovg-shortcode-type' ).on( 'change', function( e ) {
|
281 |
+
var type = $( this ).val();
|
282 |
+
|
283 |
+
$( '#aiovg-shortcode-form' ).removeClass(function( index, classes ) {
|
284 |
+
var matches = classes.match( /\aiovg-shortcode-type-\S+/ig );
|
285 |
+
return ( matches ) ? matches.join(' ') : '';
|
286 |
+
}).addClass( 'aiovg-shortcode-type-' + type );
|
287 |
+
}).trigger( 'change' );
|
288 |
+
|
289 |
+
// Shortcode Builder: Toggle fields based on the selected categories template
|
290 |
+
$( '.aiovg-shortcode-field-template', '#aiovg-shortcode-type-categories' ).find( 'select' ).on( 'change', function() {
|
291 |
+
var template = $( this ).val();
|
292 |
|
293 |
+
$( '#aiovg-shortcode-type-categories' ).removeClass(function( index, classes ) {
|
294 |
+
var matches = classes.match( /\aiovg-template-\S+/ig );
|
295 |
+
return ( matches ) ? matches.join(' ') : '';
|
296 |
+
}).addClass( 'aiovg-template-' + template );
|
297 |
+
}).trigger( 'change' );
|
298 |
|
299 |
+
// Shortcode Builder: Toggle fields based on the selected videos template
|
300 |
+
$( '.aiovg-shortcode-field-template', '#aiovg-shortcode-type-videos' ).find( 'select' ).on( 'change', function() {
|
301 |
+
var template = $( this ).val();
|
302 |
+
|
303 |
+
$( '#aiovg-shortcode-type-videos' ).removeClass(function( index, classes ) {
|
304 |
+
var matches = classes.match( /\aiovg-template-\S+/ig );
|
305 |
+
return ( matches ) ? matches.join(' ') : '';
|
306 |
+
}).addClass( 'aiovg-template-' + template );
|
307 |
}).trigger( 'change' );
|
308 |
|
309 |
+
// Shortcode Builder: Initiate color picker
|
310 |
+
$( '.aiovg-color-picker-field', '#aiovg-shortcode-form' ).wpColorPicker();
|
311 |
|
312 |
+
// Shortcode Builder: Insert shortcode
|
313 |
+
$( '#aiovg-insert-shortcode' ).on( 'click', function( e ) {
|
|
|
314 |
e.preventDefault();
|
315 |
|
316 |
var shortcode = $( '#aiovg-shortcode-type' ).val();
|
317 |
var attrs = '';
|
318 |
|
319 |
+
$( '.aiovg-shortcode-field', '#aiovg-shortcode-type-' + shortcode ).each(function() {
|
|
|
320 |
var $elem = $( this ).find( '.aiovg-shortcode-input' );
|
321 |
|
322 |
if ( $elem.length ) {
|
323 |
var type = $elem.attr( 'type' );
|
324 |
+
var name = $elem.attr( 'name' );
|
|
|
|
|
325 |
var value = $elem.val();
|
326 |
+
var def = $elem.data( 'default' );
|
327 |
|
328 |
if ( 'category' == name ) {
|
329 |
value = $( 'input[type="checkbox"]:checked', $elem ).map(function() {
|
338 |
if ( value != def ) {
|
339 |
attrs += ( ' ' + name + '="' + value + '"' );
|
340 |
}
|
341 |
+
}
|
|
|
342 |
});
|
343 |
|
344 |
window.send_to_editor( '[aiovg_' + shortcode + attrs + ']' );
|
345 |
$.magnificPopup.close();
|
|
|
346 |
}).trigger( 'change' );
|
347 |
|
348 |
+
// Shortcode Builder: Close shortcode builder
|
349 |
+
$( '#aiovg-cancel-shortcode-insert' ).on( 'click', function( e ) {
|
|
|
350 |
e.preventDefault();
|
351 |
+
$.magnificPopup.close();
|
|
|
352 |
});
|
353 |
+
|
354 |
+
// Categories Widget: Toggle fields based on the selected categories template
|
355 |
+
$( document ).on( 'change', '.aiovg-widget-form-categories .aiovg-widget-input-template', function() {
|
356 |
+
var template = $( this ).val();
|
357 |
+
|
358 |
+
$( this ).closest( '.aiovg-widget-form-categories' ).removeClass(function( index, classes ) {
|
359 |
+
var matches = classes.match( /\aiovg-template-\S+/ig );
|
360 |
+
return ( matches ) ? matches.join(' ') : '';
|
361 |
+
}).addClass( 'aiovg-template-' + template );
|
362 |
});
|
|
|
363 |
|
364 |
+
// Videos Widget: Toggle fields based on the selected videos template
|
365 |
+
$( document ).on( 'change', '.aiovg-widget-form-videos .aiovg-widget-input-template', function() {
|
366 |
+
var template = $( this ).val();
|
367 |
+
|
368 |
+
$( this ).closest( '.aiovg-widget-form-videos' ).removeClass(function( index, classes ) {
|
369 |
+
var matches = classes.match( /\aiovg-template-\S+/ig );
|
370 |
+
return ( matches ) ? matches.join(' ') : '';
|
371 |
+
}).addClass( 'aiovg-template-' + template );
|
372 |
+
});
|
373 |
|
374 |
+
// Videos Widget: Initiate color picker
|
375 |
+
$( '#widgets-right .widget:has(.aiovg-color-picker-field)' ).each(function() {
|
376 |
+
aiovg_widget_color_picker( $( this ) );
|
377 |
+
});
|
378 |
|
379 |
+
$( document ).on( 'widget-added widget-updated', on_aiovg_widget_update );
|
380 |
+
|
381 |
+
});
|
|
|
|
|
382 |
|
383 |
})( jQuery );
|
admin/{class-aiovg-admin-categories.php → categories.php}
RENAMED
@@ -3,11 +3,10 @@
|
|
3 |
/**
|
4 |
* Categories
|
5 |
*
|
6 |
-
* @link
|
7 |
-
* @since
|
8 |
*
|
9 |
-
* @package
|
10 |
-
* @subpackage AIOVG/admin
|
11 |
*/
|
12 |
|
13 |
// Exit if accessed directly
|
@@ -18,17 +17,16 @@ if ( ! defined( 'WPINC' ) ) {
|
|
18 |
/**
|
19 |
* AIOVG_Admin_Categories class.
|
20 |
*
|
21 |
-
* @since
|
22 |
*/
|
23 |
class AIOVG_Admin_Categories {
|
24 |
|
25 |
/**
|
26 |
* Register the custom taxonomy "aiovg_categories".
|
27 |
*
|
28 |
-
* @since
|
29 |
*/
|
30 |
-
public function register_taxonomy() {
|
31 |
-
|
32 |
$labels = array(
|
33 |
'name' => _x( 'Categories', 'Taxonomy General Name', 'all-in-one-video-gallery' ),
|
34 |
'singular_name' => _x( 'Category', 'Taxonomy Singular Name', 'all-in-one-video-gallery' ),
|
@@ -69,127 +67,108 @@ class AIOVG_Admin_Categories {
|
|
69 |
)
|
70 |
);
|
71 |
|
72 |
-
register_taxonomy( 'aiovg_categories', array( 'aiovg_videos' ), $args );
|
73 |
-
|
74 |
}
|
75 |
|
76 |
/**
|
77 |
* Add image field.
|
78 |
*
|
79 |
-
* @since
|
80 |
*/
|
81 |
-
public function add_image_field() {
|
82 |
-
|
83 |
$form = 'add';
|
84 |
-
require_once AIOVG_PLUGIN_DIR . 'admin/
|
85 |
-
|
86 |
}
|
87 |
|
88 |
/**
|
89 |
* Edit image field.
|
90 |
*
|
91 |
-
* @since
|
92 |
-
* @param
|
93 |
*/
|
94 |
-
public function edit_image_field( $term ) {
|
95 |
-
|
96 |
$form = 'edit';
|
97 |
|
98 |
$image_id = get_term_meta( $term->term_id, 'image_id', true );
|
99 |
$image_url = $image_id ? wp_get_attachment_url( (int) $image_id ) : '';
|
100 |
|
101 |
-
require_once AIOVG_PLUGIN_DIR . 'admin/
|
102 |
-
|
103 |
}
|
104 |
|
105 |
/**
|
106 |
* Save the image field.
|
107 |
*
|
108 |
-
* @since
|
109 |
-
* @param
|
110 |
*/
|
111 |
-
public function save_image_field( $term_id ) {
|
112 |
-
|
113 |
// Check if "aiovg_category_image_nonce" nonce is set
|
114 |
-
if ( isset( $_POST['aiovg_category_image_nonce'] ) ) {
|
115 |
-
|
116 |
// Verify that the nonce is valid
|
117 |
-
if ( wp_verify_nonce( $_POST['aiovg_category_image_nonce'], 'aiovg_process_category_image' ) ) {
|
118 |
-
|
119 |
// OK to save meta data
|
120 |
$image_id = isset( $_POST['image_id'] ) ? (int) $_POST['image_id'] : 0;
|
121 |
-
update_term_meta( $term_id, 'image_id', $image_id );
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
}
|
126 |
-
|
127 |
}
|
128 |
|
129 |
/**
|
130 |
* Retrieve the table columns.
|
131 |
*
|
132 |
-
* @since
|
133 |
-
* @param
|
134 |
-
* @return
|
135 |
*/
|
136 |
-
public function get_columns( $columns ) {
|
137 |
-
|
138 |
$columns['tax_id'] = __( 'ID', 'all-in-one-video-gallery' );
|
139 |
-
return $columns;
|
140 |
-
|
141 |
}
|
142 |
|
143 |
/**
|
144 |
* This function renders the custom columns in the list table.
|
145 |
*
|
146 |
-
* @since
|
147 |
-
* @param
|
148 |
-
* @param
|
149 |
-
* @param
|
150 |
*/
|
151 |
-
public function custom_column_content( $content, $column, $term_id ) {
|
152 |
-
|
153 |
if ( 'tax_id' == $column ) {
|
154 |
$content = $term_id;
|
155 |
}
|
156 |
|
157 |
-
return $content;
|
158 |
-
|
159 |
}
|
160 |
|
161 |
/**
|
162 |
* Delete attachments.
|
163 |
*
|
164 |
-
* @since
|
165 |
-
* @param
|
166 |
-
* @param
|
167 |
*/
|
168 |
-
public function pre_delete_term( $term_id, $taxonomy ) {
|
169 |
-
|
170 |
if ( 'aiovg_categories' != $taxonomy ) {
|
171 |
return;
|
172 |
}
|
173 |
|
174 |
-
aiovg_delete_category_attachments( $term_id );
|
175 |
-
|
176 |
}
|
177 |
|
178 |
/**
|
179 |
* Delete category image.
|
180 |
*
|
181 |
-
* @since
|
182 |
*/
|
183 |
-
public function ajax_callback_delete_category_image() {
|
184 |
-
|
185 |
check_ajax_referer( 'aiovg_process_category_image', 'security' );
|
186 |
|
187 |
if ( isset( $_POST['attachment_id'] ) ) {
|
188 |
wp_delete_attachment( (int) $_POST['attachment_id'], true );
|
189 |
}
|
190 |
|
191 |
-
wp_die();
|
192 |
-
|
193 |
}
|
194 |
|
195 |
}
|
3 |
/**
|
4 |
* Categories
|
5 |
*
|
6 |
+
* @link https://plugins360.com
|
7 |
+
* @since 1.0.0
|
8 |
*
|
9 |
+
* @package All_In_One_Video_Gallery
|
|
|
10 |
*/
|
11 |
|
12 |
// Exit if accessed directly
|
17 |
/**
|
18 |
* AIOVG_Admin_Categories class.
|
19 |
*
|
20 |
+
* @since 1.0.0
|
21 |
*/
|
22 |
class AIOVG_Admin_Categories {
|
23 |
|
24 |
/**
|
25 |
* Register the custom taxonomy "aiovg_categories".
|
26 |
*
|
27 |
+
* @since 1.0.0
|
28 |
*/
|
29 |
+
public function register_taxonomy() {
|
|
|
30 |
$labels = array(
|
31 |
'name' => _x( 'Categories', 'Taxonomy General Name', 'all-in-one-video-gallery' ),
|
32 |
'singular_name' => _x( 'Category', 'Taxonomy Singular Name', 'all-in-one-video-gallery' ),
|
67 |
)
|
68 |
);
|
69 |
|
70 |
+
register_taxonomy( 'aiovg_categories', array( 'aiovg_videos' ), $args );
|
|
|
71 |
}
|
72 |
|
73 |
/**
|
74 |
* Add image field.
|
75 |
*
|
76 |
+
* @since 1.0.0
|
77 |
*/
|
78 |
+
public function add_image_field() {
|
|
|
79 |
$form = 'add';
|
80 |
+
require_once AIOVG_PLUGIN_DIR . 'admin/partials/category-image.php';
|
|
|
81 |
}
|
82 |
|
83 |
/**
|
84 |
* Edit image field.
|
85 |
*
|
86 |
+
* @since 1.0.0
|
87 |
+
* @param object $term Taxonomy term object.
|
88 |
*/
|
89 |
+
public function edit_image_field( $term ) {
|
|
|
90 |
$form = 'edit';
|
91 |
|
92 |
$image_id = get_term_meta( $term->term_id, 'image_id', true );
|
93 |
$image_url = $image_id ? wp_get_attachment_url( (int) $image_id ) : '';
|
94 |
|
95 |
+
require_once AIOVG_PLUGIN_DIR . 'admin/partials/category-image.php';
|
|
|
96 |
}
|
97 |
|
98 |
/**
|
99 |
* Save the image field.
|
100 |
*
|
101 |
+
* @since 1.0.0
|
102 |
+
* @param int $term_id Term ID.
|
103 |
*/
|
104 |
+
public function save_image_field( $term_id ) {
|
|
|
105 |
// Check if "aiovg_category_image_nonce" nonce is set
|
106 |
+
if ( isset( $_POST['aiovg_category_image_nonce'] ) ) {
|
|
|
107 |
// Verify that the nonce is valid
|
108 |
+
if ( wp_verify_nonce( $_POST['aiovg_category_image_nonce'], 'aiovg_process_category_image' ) ) {
|
|
|
109 |
// OK to save meta data
|
110 |
$image_id = isset( $_POST['image_id'] ) ? (int) $_POST['image_id'] : 0;
|
111 |
+
update_term_meta( $term_id, 'image_id', $image_id );
|
112 |
+
}
|
113 |
+
}
|
|
|
|
|
|
|
114 |
}
|
115 |
|
116 |
/**
|
117 |
* Retrieve the table columns.
|
118 |
*
|
119 |
+
* @since 1.0.0
|
120 |
+
* @param array $columns Array of default table columns.
|
121 |
+
* @return array $columns Updated list of table columns.
|
122 |
*/
|
123 |
+
public function get_columns( $columns ) {
|
|
|
124 |
$columns['tax_id'] = __( 'ID', 'all-in-one-video-gallery' );
|
125 |
+
return $columns;
|
|
|
126 |
}
|
127 |
|
128 |
/**
|
129 |
* This function renders the custom columns in the list table.
|
130 |
*
|
131 |
+
* @since 1.0.0
|
132 |
+
* @param string $content Content of the column.
|
133 |
+
* @param string $column Name of the column.
|
134 |
+
* @param string $term_id Term ID.
|
135 |
*/
|
136 |
+
public function custom_column_content( $content, $column, $term_id ) {
|
|
|
137 |
if ( 'tax_id' == $column ) {
|
138 |
$content = $term_id;
|
139 |
}
|
140 |
|
141 |
+
return $content;
|
|
|
142 |
}
|
143 |
|
144 |
/**
|
145 |
* Delete attachments.
|
146 |
*
|
147 |
+
* @since 1.0.0
|
148 |
+
* @param int $term_id Term ID.
|
149 |
+
* @param string $taxonomy Taxonomy Name.
|
150 |
*/
|
151 |
+
public function pre_delete_term( $term_id, $taxonomy ) {
|
|
|
152 |
if ( 'aiovg_categories' != $taxonomy ) {
|
153 |
return;
|
154 |
}
|
155 |
|
156 |
+
aiovg_delete_category_attachments( $term_id );
|
|
|
157 |
}
|
158 |
|
159 |
/**
|
160 |
* Delete category image.
|
161 |
*
|
162 |
+
* @since 1.0.0
|
163 |
*/
|
164 |
+
public function ajax_callback_delete_category_image() {
|
|
|
165 |
check_ajax_referer( 'aiovg_process_category_image', 'security' );
|
166 |
|
167 |
if ( isset( $_POST['attachment_id'] ) ) {
|
168 |
wp_delete_attachment( (int) $_POST['attachment_id'], true );
|
169 |
}
|
170 |
|
171 |
+
wp_die();
|
|
|
172 |
}
|
173 |
|
174 |
}
|
admin/class-aiovg-admin-shortcode.php
DELETED
@@ -1,389 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Shortcode Builder.
|
5 |
-
*
|
6 |
-
* @link https://plugins360.com
|
7 |
-
* @since 1.0.0
|
8 |
-
*
|
9 |
-
* @package AIOVG
|
10 |
-
* @subpackage AIOVG/admin
|
11 |
-
*/
|
12 |
-
|
13 |
-
// Exit if accessed directly
|
14 |
-
if ( ! defined( 'WPINC' ) ) {
|
15 |
-
die;
|
16 |
-
}
|
17 |
-
|
18 |
-
/**
|
19 |
-
* AIOVG_Admin_Shortcode class.
|
20 |
-
*
|
21 |
-
* @since 1.0.0
|
22 |
-
*/
|
23 |
-
class AIOVG_Admin_Shortcode {
|
24 |
-
|
25 |
-
/**
|
26 |
-
* Adds an "Video Player & Gallery" button above the TinyMCE Editor on add/edit screens.
|
27 |
-
*
|
28 |
-
* @since 1.0.0
|
29 |
-
*/
|
30 |
-
public function media_buttons() {
|
31 |
-
|
32 |
-
global $pagenow, $typenow;
|
33 |
-
|
34 |
-
// Only run in post/page creation and edit screens
|
35 |
-
if ( in_array( $pagenow, array( 'post.php', 'page.php', 'post-new.php', 'post-edit.php' ) ) && 'aiovg_videos' != $typenow ) {
|
36 |
-
printf( '<a href="#aiovg-shortcode-builder" class="button button-primary aiovg-media-button" id="aiovg-media-button"><span class="wp-media-buttons-icon dashicons dashicons-playlist-video"></span> %s</a>', __( 'Video Player & Gallery', 'all-in-one-video-gallery' ) );
|
37 |
-
}
|
38 |
-
|
39 |
-
}
|
40 |
-
|
41 |
-
/**
|
42 |
-
* Prints the footer code needed for the "AIO Video Gallery" TinyMCE button.
|
43 |
-
*
|
44 |
-
* @since 1.0.0
|
45 |
-
*/
|
46 |
-
public function admin_footer() {
|
47 |
-
|
48 |
-
global $pagenow, $typenow;
|
49 |
-
|
50 |
-
// Only run in post/page creation and edit screens
|
51 |
-
if ( in_array( $pagenow, array( 'post.php', 'page.php', 'post-new.php', 'post-edit.php' ) ) && 'aiovg_videos' != $typenow ) {
|
52 |
-
|
53 |
-
$categories_settings = get_option( 'aiovg_categories_settings' );
|
54 |
-
$videos_settings = get_option( 'aiovg_videos_settings' );
|
55 |
-
$player_settings = get_option( 'aiovg_player_settings' );
|
56 |
-
|
57 |
-
// Videos
|
58 |
-
$items = get_posts( array(
|
59 |
-
'post_type' => 'aiovg_videos',
|
60 |
-
'post_status' => 'publish',
|
61 |
-
'numberposts' => -1
|
62 |
-
) );
|
63 |
-
|
64 |
-
$videos = array(
|
65 |
-
0 => '-- ' . __( 'Latest Video', 'all-in-one-video-gallery' ) . ' --'
|
66 |
-
);
|
67 |
-
|
68 |
-
foreach ( $items as $item ) {
|
69 |
-
$videos[ $item->ID ] = $item->post_title;
|
70 |
-
}
|
71 |
-
|
72 |
-
// Shortcodes
|
73 |
-
$shortcodes = array(
|
74 |
-
'categories' => __( 'Video Categories', 'all-in-one-video-gallery' ) . ' - [aiovg_categories]',
|
75 |
-
'videos' => __( 'Video Gallery', 'all-in-one-video-gallery' ) . ' - [aiovg_videos]',
|
76 |
-
'video' => __( 'Single Video', 'all-in-one-video-gallery' ) . ' - [aiovg_video]',
|
77 |
-
'search_form' => __( 'Search Form', 'all-in-one-video-gallery' ) . ' - [aiovg_search_form]'
|
78 |
-
);
|
79 |
-
$shortcodes = apply_filters( 'aiovg_shortcode_types', $shortcodes );
|
80 |
-
|
81 |
-
// Fields
|
82 |
-
$fields = array(
|
83 |
-
'categories' => array(
|
84 |
-
array(
|
85 |
-
'name' => 'id',
|
86 |
-
'label' => __( 'Select Parent', 'all-in-one-video-gallery' ),
|
87 |
-
'type' => 'category',
|
88 |
-
'options' => array(),
|
89 |
-
'value' => 0,
|
90 |
-
'default' => 0
|
91 |
-
),
|
92 |
-
array(
|
93 |
-
'name' => 'columns',
|
94 |
-
'label' => __( 'Number of Columns', 'all-in-one-video-gallery' ),
|
95 |
-
'type' => 'text',
|
96 |
-
'value' => $categories_settings['columns'],
|
97 |
-
'default' => $categories_settings['columns']
|
98 |
-
),
|
99 |
-
array(
|
100 |
-
'name' => 'orderby',
|
101 |
-
'label' => __( 'Sort Categories by', 'all-in-one-video-gallery' ),
|
102 |
-
'type' => 'select',
|
103 |
-
'options' => array(
|
104 |
-
'id' => __( 'ID', 'all-in-one-video-gallery' ),
|
105 |
-
'count' => __( 'Count', 'all-in-one-video-gallery' ),
|
106 |
-
'name' => __( 'Name', 'all-in-one-video-gallery' ),
|
107 |
-
'slug' => __( 'Slug', 'all-in-one-video-gallery' )
|
108 |
-
),
|
109 |
-
'value' => $categories_settings['orderby'],
|
110 |
-
'default' => $categories_settings['orderby']
|
111 |
-
),
|
112 |
-
array(
|
113 |
-
'name' => 'order',
|
114 |
-
'label' => __( 'Order Categories by', 'all-in-one-video-gallery' ),
|
115 |
-
'type' => 'select',
|
116 |
-
'options' => array(
|
117 |
-
'asc' => __( 'ASC', 'all-in-one-video-gallery' ),
|
118 |
-
'desc' => __( 'DESC', 'all-in-one-video-gallery' )
|
119 |
-
),
|
120 |
-
'value' => $categories_settings['order'],
|
121 |
-
'default' => $categories_settings['order']
|
122 |
-
),
|
123 |
-
array(
|
124 |
-
'name' => 'show_description',
|
125 |
-
'label' => __( 'Show Description?', 'all-in-one-video-gallery' ),
|
126 |
-
'type' => 'checkbox',
|
127 |
-
'value' => $categories_settings['show_description'],
|
128 |
-
'default' => $categories_settings['show_description']
|
129 |
-
),
|
130 |
-
array(
|
131 |
-
'name' => 'show_count',
|
132 |
-
'label' => __( 'Show Videos Count?', 'all-in-one-video-gallery' ),
|
133 |
-
'type' => 'checkbox',
|
134 |
-
'value' => $categories_settings['show_count'],
|
135 |
-
'default' => $categories_settings['show_count']
|
136 |
-
),
|
137 |
-
array(
|
138 |
-
'name' => 'hide_empty',
|
139 |
-
'label' => __( 'Hide Empty Categories?', 'all-in-one-video-gallery' ),
|
140 |
-
'type' => 'checkbox',
|
141 |
-
'value' => $categories_settings['hide_empty'],
|
142 |
-
'default' => $categories_settings['hide_empty']
|
143 |
-
)
|
144 |
-
),
|
145 |
-
'videos' => array(
|
146 |
-
array(
|
147 |
-
'name' => 'category',
|
148 |
-
'label' => __( 'Select Categories', 'all-in-one-video-gallery' ),
|
149 |
-
'type' => 'categories',
|
150 |
-
'options' => array(),
|
151 |
-
'value' => 0,
|
152 |
-
'default' => 0
|
153 |
-
),
|
154 |
-
array(
|
155 |
-
'name' => 'columns',
|
156 |
-
'label' => __( 'Number of Columns', 'all-in-one-video-gallery' ),
|
157 |
-
'type' => 'text',
|
158 |
-
'value' => $videos_settings['columns'],
|
159 |
-
'default' => $videos_settings['columns']
|
160 |
-
),
|
161 |
-
array(
|
162 |
-
'name' => 'limit',
|
163 |
-
'label' => __( 'Limit', 'all-in-one-video-gallery' ),
|
164 |
-
'type' => 'text',
|
165 |
-
'value' => $videos_settings['limit'],
|
166 |
-
'default' => $videos_settings['limit']
|
167 |
-
),
|
168 |
-
array(
|
169 |
-
'name' => 'orderby',
|
170 |
-
'label' => __( 'Order By', 'all-in-one-video-gallery' ),
|
171 |
-
'type' => 'select',
|
172 |
-
'options' => array(
|
173 |
-
'title' => __( 'Title', 'all-in-one-video-gallery' ),
|
174 |
-
'date' => __( 'Date Posted', 'all-in-one-video-gallery' ),
|
175 |
-
'views' => __( 'Views Count', 'all-in-one-video-gallery' ),
|
176 |
-
'rand' => __( 'Random', 'all-in-one-video-gallery' )
|
177 |
-
),
|
178 |
-
'value' => $videos_settings['orderby'],
|
179 |
-
'default' => $videos_settings['orderby']
|
180 |
-
),
|
181 |
-
array(
|
182 |
-
'name' => 'order',
|
183 |
-
'label' => __( 'Order', 'all-in-one-video-gallery' ),
|
184 |
-
'type' => 'select',
|
185 |
-
'options' => array(
|
186 |
-
'asc' => __( 'ASC', 'all-in-one-video-gallery' ),
|
187 |
-
'desc' => __( 'DESC', 'all-in-one-video-gallery' )
|
188 |
-
),
|
189 |
-
'value' => $videos_settings['order'],
|
190 |
-
'default' => $videos_settings['order']
|
191 |
-
),
|
192 |
-
array(
|
193 |
-
'name' => 'featured',
|
194 |
-
'label' => __( 'Featured Only', 'all-in-one-video-gallery' ),
|
195 |
-
'type' => 'checkbox',
|
196 |
-
'value' => 0,
|
197 |
-
'default' => 0
|
198 |
-
),
|
199 |
-
array(
|
200 |
-
'name' => 'related',
|
201 |
-
'label' => sprintf( "%s ( %s )", __( 'Follow URL?', 'all-in-one-video-gallery' ), __( 'Related Videos', 'all-in-one-video-gallery' ) ),
|
202 |
-
'type' => 'checkbox',
|
203 |
-
'value' => 0,
|
204 |
-
'default' => 0
|
205 |
-
),
|
206 |
-
array(
|
207 |
-
'name' => 'html',
|
208 |
-
'label' => __( 'Show / Hide', 'all-in-one-video-gallery' ),
|
209 |
-
'type' => 'html'
|
210 |
-
),
|
211 |
-
array(
|
212 |
-
'name' => 'show_count',
|
213 |
-
'label' => __( 'Videos Count', 'all-in-one-video-gallery' ),
|
214 |
-
'type' => 'checkbox',
|
215 |
-
'value' => 0,
|
216 |
-
'default' => isset( $videos_settings['display']['count'] )
|
217 |
-
),
|
218 |
-
array(
|
219 |
-
'name' => 'show_category',
|
220 |
-
'label' => __( 'Category Name', 'all-in-one-video-gallery' ),
|
221 |
-
'type' => 'checkbox',
|
222 |
-
'value' => isset( $videos_settings['display']['category'] ),
|
223 |
-
'default' => isset( $videos_settings['display']['category'] )
|
224 |
-
),
|
225 |
-
array(
|
226 |
-
'name' => 'show_date',
|
227 |
-
'label' => __( 'Date Added', 'all-in-one-video-gallery' ),
|
228 |
-
'type' => 'checkbox',
|
229 |
-
'value' => isset( $videos_settings['display']['date'] ),
|
230 |
-
'default' => isset( $videos_settings['display']['date'] )
|
231 |
-
),
|
232 |
-
array(
|
233 |
-
'name' => 'show_user',
|
234 |
-
'label' => __( 'Author Name', 'all-in-one-video-gallery' ),
|
235 |
-
'type' => 'checkbox',
|
236 |
-
'value' => isset( $videos_settings['display']['user'] ),
|
237 |
-
'default' => isset( $videos_settings['display']['user'] )
|
238 |
-
),
|
239 |
-
array(
|
240 |
-
'name' => 'show_views',
|
241 |
-
'label' => __( 'Views Count', 'all-in-one-video-gallery' ),
|
242 |
-
'type' => 'checkbox',
|
243 |
-
'value' => isset( $videos_settings['display']['views'] ),
|
244 |
-
'default' => isset( $videos_settings['display']['views'] )
|
245 |
-
),
|
246 |
-
array(
|
247 |
-
'name' => 'show_duration',
|
248 |
-
'label' => __( 'Video Duration', 'all-in-one-video-gallery' ),
|
249 |
-
'type' => 'checkbox',
|
250 |
-
'value' => isset( $videos_settings['display']['duration'] ),
|
251 |
-
'default' => isset( $videos_settings['display']['duration'] )
|
252 |
-
),
|
253 |
-
array(
|
254 |
-
'name' => 'show_excerpt',
|
255 |
-
'label' => __( 'Excerpt ( Short Description )', 'all-in-one-video-gallery' ),
|
256 |
-
'type' => 'checkbox',
|
257 |
-
'value' => isset( $videos_settings['display']['excerpt'] ),
|
258 |
-
'default' => isset( $videos_settings['display']['excerpt'] )
|
259 |
-
),
|
260 |
-
array(
|
261 |
-
'name' => 'show_pagination',
|
262 |
-
'label' => __( 'Show Pagination', 'all-in-one-video-gallery' ),
|
263 |
-
'type' => 'checkbox',
|
264 |
-
'value' => 1,
|
265 |
-
'default' => 1
|
266 |
-
)
|
267 |
-
),
|
268 |
-
'video' => array(
|
269 |
-
array(
|
270 |
-
'name' => 'id',
|
271 |
-
'label' => __( 'Select a Video', 'all-in-one-video-gallery' ),
|
272 |
-
'type' => 'select',
|
273 |
-
'options' => $videos,
|
274 |
-
'value' => 0,
|
275 |
-
'default' => 0
|
276 |
-
),
|
277 |
-
array(
|
278 |
-
'name' => 'width',
|
279 |
-
'label' => __( 'Width', 'all-in-one-video-gallery' ),
|
280 |
-
'type' => 'text',
|
281 |
-
'value' => '',
|
282 |
-
'default' => ''
|
283 |
-
),
|
284 |
-
array(
|
285 |
-
'name' => 'ratio',
|
286 |
-
'label' => __( 'Ratio', 'all-in-one-video-gallery' ),
|
287 |
-
'type' => 'text',
|
288 |
-
'value' => $player_settings['ratio'],
|
289 |
-
'default' => $player_settings['ratio']
|
290 |
-
),
|
291 |
-
array(
|
292 |
-
'name' => 'autoplay',
|
293 |
-
'label' => __( 'Autoplay', 'all-in-one-video-gallery' ),
|
294 |
-
'type' => 'checkbox',
|
295 |
-
'value' => $player_settings['autoplay'],
|
296 |
-
'default' => $player_settings['autoplay']
|
297 |
-
),
|
298 |
-
array(
|
299 |
-
'name' => 'loop',
|
300 |
-
'label' => __( 'Loop', 'all-in-one-video-gallery' ),
|
301 |
-
'type' => 'checkbox',
|
302 |
-
'value' => $player_settings['loop'],
|
303 |
-
'default' => $player_settings['loop']
|
304 |
-
),
|
305 |
-
array(
|
306 |
-
'name' => 'html',
|
307 |
-
'label' => __( 'Show / Hide Player Controls', 'all-in-one-video-gallery' ),
|
308 |
-
'type' => 'html'
|
309 |
-
),
|
310 |
-
array(
|
311 |
-
'name' => 'playpause',
|
312 |
-
'label' => __( 'Play / Pause', 'all-in-one-video-gallery' ),
|
313 |
-
'type' => 'checkbox',
|
314 |
-
'value' => isset( $player_settings['controls']['playpause'] ),
|
315 |
-
'default' => isset( $player_settings['controls']['playpause'] )
|
316 |
-
),
|
317 |
-
array(
|
318 |
-
'name' => 'current',
|
319 |
-
'label' => __( 'Current Time', 'all-in-one-video-gallery' ),
|
320 |
-
'type' => 'checkbox',
|
321 |
-
'value' => isset( $player_settings['controls']['current'] ),
|
322 |
-
'default' => isset( $player_settings['controls']['current'] )
|
323 |
-
),
|
324 |
-
array(
|
325 |
-
'name' => 'progress',
|
326 |
-
'label' => __( 'Progressbar', 'all-in-one-video-gallery' ),
|
327 |
-
'type' => 'checkbox',
|
328 |
-
'value' => isset( $player_settings['controls']['progress'] ),
|
329 |
-
'default' => isset( $player_settings['controls']['progress'] )
|
330 |
-
),
|
331 |
-
array(
|
332 |
-
'name' => 'duration',
|
333 |
-
'label' => __( 'Duration', 'all-in-one-video-gallery' ),
|
334 |
-
'type' => 'checkbox',
|
335 |
-
'value' => isset( $player_settings['controls']['duration'] ),
|
336 |
-
'default' => isset( $player_settings['controls']['duration'] )
|
337 |
-
),
|
338 |
-
array(
|
339 |
-
'name' => 'tracks',
|
340 |
-
'label' => __( 'Subtitles', 'all-in-one-video-gallery' ),
|
341 |
-
'type' => 'checkbox',
|
342 |
-
'value' => isset( $player_settings['controls']['tracks'] ),
|
343 |
-
'default' => isset( $player_settings['controls']['tracks'] )
|
344 |
-
),
|
345 |
-
array(
|
346 |
-
'name' => 'volume',
|
347 |
-
'label' => __( 'Volume', 'all-in-one-video-gallery' ),
|
348 |
-
'type' => 'checkbox',
|
349 |
-
'value' => isset( $player_settings['controls']['volume'] ),
|
350 |
-
'default' => isset( $player_settings['controls']['volume'] )
|
351 |
-
),
|
352 |
-
array(
|
353 |
-
'name' => 'fullscreen',
|
354 |
-
'label' => __( 'Fullscreen', 'all-in-one-video-gallery' ),
|
355 |
-
'type' => 'checkbox',
|
356 |
-
'value' => isset( $player_settings['controls']['fullscreen'] ),
|
357 |
-
'default' => isset( $player_settings['controls']['fullscreen'] )
|
358 |
-
)
|
359 |
-
),
|
360 |
-
'search_form' => array(
|
361 |
-
array(
|
362 |
-
'name' => 'template',
|
363 |
-
'label' => __( 'Select a Template', 'all-in-one-video-gallery' ),
|
364 |
-
'type' => 'select',
|
365 |
-
'options' => array(
|
366 |
-
'vertical' => __( 'Vertical', 'all-in-one-video-gallery' ),
|
367 |
-
'horizontal' => __( 'Horizontal', 'all-in-one-video-gallery' )
|
368 |
-
),
|
369 |
-
'value' => 'horizontal',
|
370 |
-
'default' => 'horizontal'
|
371 |
-
),
|
372 |
-
array(
|
373 |
-
'name' => 'category',
|
374 |
-
'label' => __( 'Search by Categories', 'all-in-one-video-gallery' ),
|
375 |
-
'type' => 'checkbox',
|
376 |
-
'value' => 0,
|
377 |
-
'default' => 0
|
378 |
-
)
|
379 |
-
)
|
380 |
-
);
|
381 |
-
$fields = apply_filters( 'aiovg_shortcode_fields', $fields );
|
382 |
-
|
383 |
-
// ...
|
384 |
-
require_once AIOVG_PLUGIN_DIR . 'admin/templates/shortcode-builder.php';
|
385 |
-
}
|
386 |
-
|
387 |
-
}
|
388 |
-
|
389 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|