All-in-One Video Gallery - Version 1.5.7

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 Icon 128x128 All-in-One Video Gallery
Version 1.5.7
Comparing to
See all releases

Code changes from version 1.5.6 to 1.5.7

Files changed (306) hide show
  1. README.txt +52 -25
  2. admin/admin.php +209 -0
  3. admin/assets/css/{aiovg-admin.css → admin.css} +125 -4
  4. admin/assets/js/{aiovg-admin.js → admin.js} +149 -120
  5. admin/{class-aiovg-admin-categories.php → categories.php} +41 -62
  6. admin/class-aiovg-admin-shortcode.php +0 -389
  7. admin/class-aiovg-admin-welcome.php +0 -99
  8. admin/class-aiovg-admin.php +0 -132
  9. admin/{templates → partials}/category-image.php +4 -5
  10. admin/{templates → partials}/index.html +0 -0
  11. admin/{templates → partials}/settings.php +3 -4
  12. admin/partials/shortcode-builder.php +130 -0
  13. admin/{templates → partials}/video-sources.php +3 -4
  14. admin/{templates → partials}/video-submitbox.php +3 -4
  15. admin/{templates → partials}/video-tracks.php +3 -4
  16. admin/{templates → partials}/welcome.php +32 -26
  17. admin/{class-aiovg-admin-settings.php → settings.php} +292 -289
  18. admin/shortcode-builder.php +64 -0
  19. admin/templates/shortcode-builder.php +0 -122
  20. admin/{class-aiovg-admin-videos.php → videos.php} +78 -124
  21. admin/welcome.php +67 -0
  22. all-in-one-video-gallery.php +152 -91
  23. blocks/blocks.php +469 -0
  24. blocks/class-aiovg-blocks.php +0 -438
  25. blocks/dist/blocks.build.js +1 -1
  26. blocks/src/blocks/categories/edit.js +49 -41
  27. blocks/src/blocks/categories/index.js +21 -10
  28. blocks/src/blocks/search/edit.js +14 -20
  29. blocks/src/blocks/search/index.js +8 -5
  30. blocks/src/blocks/video/edit.js +31 -44
  31. blocks/src/blocks/video/index.js +16 -13
  32. blocks/src/blocks/videos/edit.js +154 -171
  33. blocks/src/blocks/videos/index.js +7 -63
  34. blocks/src/utils/helper.js +53 -6
  35. blocks/src/utils/server-side-render.js +129 -0
  36. freemius/LICENSE.txt +674 -0
  37. freemius/assets/css/admin/account.css +1 -0
  38. freemius/assets/css/admin/add-ons.css +2 -0
  39. freemius/assets/css/admin/affiliation.css +1 -0
  40. freemius/assets/css/admin/checkout.css +1 -0
  41. freemius/assets/css/admin/common.css +2 -0
  42. freemius/assets/css/admin/connect.css +1 -0
  43. freemius/assets/css/admin/debug.css +1 -0
  44. freemius/assets/css/admin/dialog-boxes.css +2 -0
  45. freemius/assets/css/admin/gdpr-optin-notice.css +1 -0
  46. freemius/assets/css/admin/index.php +3 -0
  47. freemius/assets/css/customizer.css +1 -0
  48. freemius/assets/css/index.php +3 -0
  49. freemius/assets/img/index.php +3 -0
  50. freemius/assets/img/plugin-icon.png +0 -0
  51. freemius/assets/img/theme-icon.png +0 -0
  52. freemius/assets/index.php +3 -0
  53. freemius/assets/js/index.php +3 -0
  54. freemius/assets/js/nojquery.ba-postmessage.js +140 -0
  55. freemius/assets/js/nojquery.ba-postmessage.min.js +12 -0
  56. freemius/assets/js/postmessage.js +135 -0
  57. freemius/assets/scss/_colors.scss +79 -0
  58. freemius/assets/scss/_functions.scss +0 -0
  59. freemius/assets/scss/_load.scss +4 -0
  60. freemius/assets/scss/_mixins.scss +270 -0
  61. freemius/assets/scss/_start.scss +4 -0
  62. freemius/assets/scss/_vars.scss +6 -0
  63. freemius/assets/scss/admin/_ajax-loader.scss +49 -0
  64. freemius/assets/scss/admin/_auto-install.scss +33 -0
  65. freemius/assets/scss/admin/_buttons.scss +28 -0
  66. freemius/assets/scss/admin/_deactivation-feedback.scss +55 -0
  67. freemius/assets/scss/admin/_gdpr-consent.scss +81 -0
  68. freemius/assets/scss/admin/_license-activation.scss +47 -0
  69. freemius/assets/scss/admin/_license-key-resend.scss +68 -0
  70. freemius/assets/scss/admin/_modal-common.scss +194 -0
  71. freemius/assets/scss/admin/_multisite-options.scss +40 -0
  72. freemius/assets/scss/admin/_plugin-upgrade-notice.scss +8 -0
  73. freemius/assets/scss/admin/_subscription-cancellation.scss +30 -0
  74. freemius/assets/scss/admin/_themes.scss +21 -0
  75. freemius/assets/scss/admin/_tooltip.scss +66 -0
  76. freemius/assets/scss/admin/account.scss +302 -0
  77. freemius/assets/scss/admin/add-ons.scss +449 -0
  78. freemius/assets/scss/admin/affiliation.scss +97 -0
  79. freemius/assets/scss/admin/checkout.scss +5 -0
  80. freemius/assets/scss/admin/common.scss +220 -0
  81. freemius/assets/scss/admin/connect.scss +548 -0
  82. freemius/assets/scss/admin/debug.scss +135 -0
  83. freemius/assets/scss/admin/dialog-boxes.scss +10 -0
  84. freemius/assets/scss/admin/gdpr-optin-notice.scss +17 -0
  85. freemius/assets/scss/admin/index.php +3 -0
  86. freemius/assets/scss/customizer.scss +125 -0
  87. freemius/assets/scss/index.php +3 -0
  88. freemius/config.php +388 -0
  89. freemius/includes/class-freemius-abstract.php +597 -0
  90. freemius/includes/class-freemius.php +21773 -0
  91. freemius/includes/class-fs-admin-notices.php +321 -0
  92. freemius/includes/class-fs-api.php +625 -0
  93. freemius/includes/class-fs-logger.php +691 -0
  94. freemius/includes/class-fs-options.php +431 -0
  95. freemius/includes/class-fs-plugin-updater.php +1360 -0
  96. freemius/includes/class-fs-security.php +85 -0
  97. freemius/includes/class-fs-storage.php +524 -0
  98. freemius/includes/class-fs-user-lock.php +126 -0
  99. freemius/includes/customizer/class-fs-customizer-support-section.php +102 -0
  100. freemius/includes/customizer/class-fs-customizer-upsell-control.php +157 -0
  101. freemius/includes/customizer/index.php +3 -0
  102. freemius/includes/debug/class-fs-debug-bar-panel.php +64 -0
  103. freemius/includes/debug/debug-bar-start.php +52 -0
  104. freemius/includes/debug/index.php +3 -0
  105. freemius/includes/entities/class-fs-affiliate-terms.php +128 -0
  106. freemius/includes/entities/class-fs-affiliate.php +84 -0
  107. freemius/includes/entities/class-fs-billing.php +95 -0
  108. freemius/includes/entities/class-fs-entity.php +149 -0
  109. freemius/includes/entities/class-fs-payment.php +110 -0
  110. freemius/includes/entities/class-fs-plugin-info.php +34 -0
  111. freemius/includes/entities/class-fs-plugin-license.php +269 -0
  112. freemius/includes/entities/class-fs-plugin-plan.php +145 -0
  113. freemius/includes/entities/class-fs-plugin-tag.php +50 -0
  114. freemius/includes/entities/class-fs-plugin.php +142 -0
  115. freemius/includes/entities/class-fs-pricing.php +141 -0
  116. freemius/includes/entities/class-fs-scope-entity.php +29 -0
  117. freemius/includes/entities/class-fs-site.php +230 -0
  118. freemius/includes/entities/class-fs-subscription.php +125 -0
  119. freemius/includes/entities/class-fs-user.php +62 -0
  120. freemius/includes/entities/index.php +3 -0
  121. freemius/includes/fs-core-functions.php +1322 -0
  122. freemius/includes/fs-essential-functions.php +479 -0
  123. freemius/includes/fs-plugin-info-dialog.php +1143 -0
  124. freemius/includes/i18n.php +603 -0
  125. freemius/includes/index.php +3 -0
  126. freemius/includes/l10n.php +48 -0
  127. freemius/includes/managers/class-fs-admin-menu-manager.php +969 -0
  128. freemius/includes/managers/class-fs-admin-notice-manager.php +472 -0
  129. freemius/includes/managers/class-fs-cache-manager.php +326 -0
  130. freemius/includes/managers/class-fs-gdpr-manager.php +202 -0
  131. freemius/includes/managers/class-fs-key-value-storage.php +392 -0
  132. freemius/includes/managers/class-fs-license-manager.php +104 -0
  133. freemius/includes/managers/class-fs-option-manager.php +490 -0
  134. freemius/includes/managers/class-fs-plan-manager.php +162 -0
  135. freemius/includes/managers/class-fs-plugin-manager.php +220 -0
  136. freemius/includes/managers/index.php +3 -0
  137. freemius/includes/sdk/Exceptions/ArgumentNotExistException.php +9 -0
  138. freemius/includes/sdk/Exceptions/EmptyArgumentException.php +9 -0
  139. freemius/includes/sdk/Exceptions/Exception.php +74 -0
  140. freemius/includes/sdk/Exceptions/InvalidArgumentException.php +8 -0
  141. freemius/includes/sdk/Exceptions/OAuthException.php +12 -0
  142. freemius/includes/sdk/Exceptions/index.php +3 -0
  143. freemius/includes/sdk/FreemiusBase.php +215 -0
  144. freemius/includes/sdk/FreemiusWordPress.php +704 -0
  145. freemius/includes/sdk/LICENSE.txt +340 -0
  146. freemius/includes/sdk/index.php +3 -0
  147. freemius/includes/supplements/fs-essential-functions-1.1.7.1.php +43 -0
  148. freemius/includes/supplements/fs-essential-functions-2.2.1.php +45 -0
  149. freemius/includes/supplements/index.php +3 -0
  150. freemius/index.php +3 -0
  151. freemius/languages/freemius-da_DK.mo +0 -0
  152. freemius/languages/freemius-da_DK.po +2434 -0
  153. freemius/languages/freemius-en.mo +0 -0
  154. freemius/languages/freemius-en.po +2320 -0
  155. freemius/languages/freemius-es_ES.mo +0 -0
  156. freemius/languages/freemius-es_ES.po +2433 -0
  157. freemius/languages/freemius-fr_FR.mo +0 -0
  158. freemius/languages/freemius-fr_FR.po +2433 -0
  159. freemius/languages/freemius-he_IL.mo +0 -0
  160. freemius/languages/freemius-he_IL.po +2434 -0
  161. freemius/languages/freemius-hu_HU.mo +0 -0
  162. freemius/languages/freemius-hu_HU.po +2433 -0
  163. freemius/languages/freemius-it_IT.mo +0 -0
  164. freemius/languages/freemius-it_IT.po +2437 -0
  165. freemius/languages/freemius-ja_JP.mo +0 -0
  166. freemius/languages/freemius-ja_JP.po +2436 -0
  167. freemius/languages/freemius-nl_NL.mo +0 -0
  168. freemius/languages/freemius-nl_NL.po +2434 -0
  169. freemius/languages/freemius-ru_RU.mo +0 -0
  170. freemius/languages/freemius-ru_RU.po +2433 -0
  171. freemius/languages/freemius.pot +2317 -0
  172. freemius/languages/index.php +3 -0
  173. freemius/require.php +49 -0
  174. freemius/start.php +522 -0
  175. freemius/templates/account.php +792 -0
  176. freemius/templates/account/billing.php +431 -0
  177. freemius/templates/account/index.php +3 -0
  178. freemius/templates/account/partials/activate-license-button.php +54 -0
  179. freemius/templates/account/partials/addon.php +350 -0
  180. freemius/templates/account/partials/deactivate-license-button.php +36 -0
  181. freemius/templates/account/partials/index.php +3 -0
  182. freemius/templates/account/partials/site.php +336 -0
  183. freemius/templates/account/payments.php +59 -0
  184. freemius/templates/add-ons.php +197 -0
  185. freemius/templates/add-trial-to-pricing.php +31 -0
  186. freemius/templates/admin-notice.php +76 -0
  187. freemius/templates/ajax-loader.php +1 -0
  188. freemius/templates/auto-installation.php +249 -0
  189. freemius/templates/checkout.php +329 -0
  190. freemius/templates/connect.php +932 -0
  191. freemius/templates/contact.php +128 -0
  192. freemius/templates/debug.php +724 -0
  193. freemius/templates/debug/api-calls.php +155 -0
  194. freemius/templates/debug/index.php +3 -0
  195. freemius/templates/debug/logger.php +66 -0
  196. freemius/templates/debug/plugins-themes-sync.php +76 -0
  197. freemius/templates/debug/scheduled-crons.php +136 -0
  198. freemius/templates/email.php +49 -0
  199. freemius/templates/firewall-issues-js.php +59 -0
  200. freemius/templates/forms/affiliation.php +486 -0
  201. freemius/templates/forms/deactivation/contact.php +23 -0
  202. freemius/templates/forms/deactivation/form.php +497 -0
  203. freemius/templates/forms/deactivation/index.php +3 -0
  204. freemius/templates/forms/deactivation/retry-skip.php +24 -0
  205. freemius/templates/forms/index.php +3 -0
  206. freemius/templates/forms/license-activation.php +700 -0
  207. freemius/templates/forms/optout.php +267 -0
  208. freemius/templates/forms/premium-versions-upgrade-handler.php +205 -0
  209. freemius/templates/forms/premium-versions-upgrade-metadata.php +45 -0
  210. freemius/templates/forms/resend-key.php +247 -0
  211. freemius/templates/forms/subscription-cancellation.php +277 -0
  212. freemius/templates/forms/trial-start.php +181 -0
  213. freemius/templates/gdpr-optin-js.php +66 -0
  214. freemius/templates/index.php +3 -0
  215. freemius/templates/js/index.php +3 -0
  216. freemius/templates/js/jquery.content-change.php +58 -0
  217. freemius/templates/js/open-license-activation.php +37 -0
  218. freemius/templates/js/style-premium-theme.php +45 -0
  219. freemius/templates/partials/network-activation.php +81 -0
  220. freemius/templates/plugin-icon.php +20 -0
  221. freemius/templates/plugin-info/description.php +78 -0
  222. freemius/templates/plugin-info/features.php +114 -0
  223. freemius/templates/plugin-info/index.php +3 -0
  224. freemius/templates/plugin-info/screenshots.php +34 -0
  225. freemius/templates/powered-by.php +58 -0
  226. freemius/templates/pricing.php +171 -0
  227. freemius/templates/secure-https-header.php +39 -0
  228. freemius/templates/sticky-admin-notice-js.php +39 -0
  229. freemius/templates/tabs-capture-js.php +63 -0
  230. freemius/templates/tabs.php +190 -0
  231. includes/{class-aiovg-activator.php → activator.php} +6 -12
  232. includes/class-aiovg-loader.php +0 -128
  233. includes/class-aiovg.php +0 -335
  234. includes/{class-aiovg-deactivator.php → deactivator.php} +6 -10
  235. includes/functions.php +794 -351
  236. includes/{class-aiovg-i18n.php → i18n.php} +5 -8
  237. includes/init.php +314 -0
  238. includes/loader.php +144 -0
  239. includes/{class-aiovg-roles.php → roles.php} +23 -37
  240. includes/uninstall.php +103 -0
  241. includes/{class-aiovg-walker-terms-checklist.php → walker-terms-checklist.php} +17 -20
  242. languages/all-in-one-video-gallery.pot +917 -737
  243. public/assets/css/backward-compatibility.css +123 -0
  244. public/assets/css/bootstrap.css +0 -2335
  245. public/assets/css/font-awesome.css +0 -2337
  246. public/assets/css/font-awesome.min.css +0 -4
  247. public/assets/css/magnific-popup.css +223 -128
  248. public/assets/css/{aiovg-public.css → public.css} +252 -62
  249. public/assets/fonts/FontAwesome.otf +0 -0
  250. public/assets/fonts/aiovg-icons.eot +0 -0
  251. public/assets/fonts/aiovg-icons.svg +13 -0
  252. public/assets/fonts/aiovg-icons.ttf +0 -0
  253. public/assets/fonts/aiovg-icons.woff +0 -0
  254. public/assets/fonts/fontawesome-webfont.eot +0 -0
  255. public/assets/fonts/fontawesome-webfont.svg +0 -2671
  256. public/assets/fonts/fontawesome-webfont.ttf +0 -0
  257. public/assets/fonts/fontawesome-webfont.woff +0 -0
  258. public/assets/fonts/fontawesome-webfont.woff2 +0 -0
  259. public/assets/js/magnific-popup.js +0 -1499
  260. public/assets/js/{aiovg-public.js → public.js} +6 -10
  261. public/categories.php +162 -0
  262. public/class-aiovg-public-categories.php +0 -179
  263. public/{class-aiovg-public.php → public.php} +134 -190
  264. public/{class-aiovg-public-search.php → search.php} +12 -17
  265. public/templates/categories-grid.php +0 -60
  266. public/templates/categories-template-grid.php +31 -0
  267. public/templates/categories-template-list.php +35 -0
  268. public/templates/category-thumbnail.php +38 -0
  269. public/templates/player.php +179 -112
  270. public/templates/search-form-horizontal.php +0 -70
  271. public/templates/search-form-template-horizontal.php +47 -0
  272. public/templates/search-form-template-vertical.php +47 -0
  273. public/templates/search-form-vertical.php +0 -52
  274. public/templates/single-video.php +10 -11
  275. public/templates/video-thumbnail-image-left.php +80 -0
  276. public/templates/video-thumbnail.php +74 -0
  277. public/templates/videos-grid.php +0 -118
  278. public/templates/videos-template-classic.php +57 -0
  279. public/{class-aiovg-public-video.php → video.php} +37 -59
  280. public/{class-aiovg-public-videos.php → videos.php} +52 -90
  281. uninstall.php +0 -101
  282. widgets/categories.php +180 -0
  283. widgets/categories/class-aiovg-widget-categories.php +0 -172
  284. widgets/categories/templates/admin.php +0 -85
  285. widgets/categories/templates/categories-list.php +0 -18
  286. widgets/categories/templates/index.html +0 -1
  287. widgets/forms/categories.php +112 -0
  288. widgets/{categories → forms}/index.html +0 -0
  289. widgets/forms/search.php +39 -0
  290. widgets/forms/video.php +101 -0
  291. widgets/forms/videos.php +64 -0
  292. widgets/{search/class-aiovg-widget-search.php → search.php} +28 -39
  293. widgets/search/index.html +0 -1
  294. widgets/search/templates/admin.php +0 -30
  295. widgets/search/templates/index.html +0 -1
  296. widgets/{video/class-aiovg-widget-video.php → video.php} +25 -37
  297. widgets/video/index.html +0 -1
  298. widgets/video/templates/admin.php +0 -100
  299. widgets/video/templates/index.html +0 -1
  300. widgets/videos.php +287 -0
  301. widgets/videos/class-aiovg-widget-videos.php +0 -286
  302. widgets/videos/index.html +0 -1
  303. widgets/videos/templates/admin.php +0 -150
  304. widgets/videos/templates/index.html +0 -1
  305. widgets/videos/templates/videos-grid-image-left.php +0 -113
  306. widgets/videos/templates/videos-grid-image-top.php +0 -107
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: gutenberg, video, player, gallery, logo, watermark, gdpr, mp4, webm, ogv, youtube, vimeo, dailymotion, hls, dash, adaptive, live, stream, popup, carousel, slider
6
Requires at least: 4.4.0
7
- Tested up to: 4.9
8
Requires PHP: 5.3.0
9
- Stable tag: 1.5.6
10
License: GPLv2 or later
11
License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
13
- Built over the WordPress' Native Video Player. Supports any browser & video formats such as MP4, WebM, OGV and embeddable players like YouTube, Vimeo, Dailymotion, Facebook, etc.
14
15
== Description ==
16
17
- Responsive & Lightweight Video gallery plugin. No coding required. Add/Manage videos through a dedicated custom post interface, group them by categories, customize the front-end display using the shortcode builder as you need, provide the option for users to search videos, plus everything you will need to build a YouTube/Vimeo like video sharing website.
18
19
- **Links**
20
21
- * [WordPress Video Gallery Plugin](https://plugins360.com/all-in-one-video-gallery/) - official site.
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: playpause, timer, progressbar, duration, volume, fullscreen
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
- This is a brand new plugin and currently available only in English. But, the plugin is translation ready and you can translate [All-in-One Video Gallery](https://plugins360.com/all-in-one-video-gallery/translate/) to your language on [translate.wordpress.org](https://translate.wordpress.org/projects/wp-plugins/all-in-one-video-gallery).
49
50
**Get Involved**
51
52
- * Wording - I am not a native English speaker, if you find any typo, grammer mistake or etc. please [report](https://plugins360.com/support/) on our website.
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. All Categories [aiovg_categories].
78
- 2. Videos list [aiovg_videos] displayed as a grid (you can select how many columns to display).
79
- 3. Video details page.
80
- 4. Videos list in wp-admin panel.
81
- 5. Video edit page in wp-admin panel.
82
- 6. Category edit page with image select.
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 updated.
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 updated.
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-selector,
270
- #aiovg-shortcode .aiovg-shortcode-field {
271
margin-bottom: 10px;
272
}
273
274
- #aiovg-shortcode .aiovg-shortcode-label {
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 1.0.0
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 1.0.0
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 1.0.0
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: Show or Hide fields basd on the selected video source type
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: Show or Hide WebM fields
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: Show or Hide OGV fields
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: Show or Hide fields basd on the selected shortcode type
268
- $( '#aiovg-shortcode-type' ).on( 'change', function( e ) {
269
-
270
- e.preventDefault();
271
-
272
- var type = $( this ).val();
273
274
- $( '.aiovg-shortcode-field' ).hide();
275
- $( '.aiovg-shortcode-type-' + type ).fadeIn();
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 id = $elem.attr( 'id' );
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
- // Widgets: Initiate color picker
334
- function aiovg_widget_color_picker( widget ) {
335
- widget.find( '.aiovg-color-picker-field' ).wpColorPicker( {
336
- change: _.throttle( function() { // For Customizer
337
- $( this ).trigger( 'change' );
338
- }, 3000 )
339
});
340
- }
341
342
- function on_aiovg_widget_update( event, widget ) {
343
- aiovg_widget_color_picker( widget );
344
- }
345
346
- $( document ).on( 'widget-added widget-updated', on_aiovg_widget_update );
347
348
- $( document ).ready( function() {
349
- $( '#widgets-right .widget:has(.aiovg-color-picker-field)' ).each( function () {
350
- aiovg_widget_color_picker( $( this ) );
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 https://plugins360.com
7
- * @since 1.0.0
8
*
9
- * @package AIOVG
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 1.0.0
22
*/
23
class AIOVG_Admin_Categories {
24
25
/**
26
* Register the custom taxonomy "aiovg_categories".
27
*
28
- * @since 1.0.0
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 1.0.0
80
*/
81
- public function add_image_field() {
82
-
83
$form = 'add';
84
- require_once AIOVG_PLUGIN_DIR . 'admin/templates/category-image.php';
85
-
86
}
87
88
/**
89
* Edit image field.
90
*
91
- * @since 1.0.0
92
- * @param object $term Taxonomy term object.
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/templates/category-image.php';
102
-
103
}
104
105
/**
106
* Save the image field.
107
*
108
- * @since 1.0.0
109
- * @param int $term_id Term ID.
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 1.0.0
133
- * @param array $columns Array of default table columns.
134
- * @return array $columns Updated list of table columns.
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 1.0.0
147
- * @param string $content Content of the column.
148
- * @param string $column Name of the column.
149
- * @param string $term_id Term ID.
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 1.0.0
165
- * @param int $term_id Term ID.
166
- * @param string $taxonomy Taxonomy Name.
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 1.0.0
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
- }
admin/class-aiovg-admin-welcome.php DELETED
@@ -1,99 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Welcome page
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_Welcome class.
20
- *
21
- * @since 1.0.0
22
- */
23
- class AIOVG_Admin_Welcome {
24
-
25
- /**
26
- * Add welcome page sub menus.
27
- *
28
- * @since 1.0.0
29
- */
30
- public function add_welcome_menus() {
31
-
32
- add_dashboard_page(
33
- __( 'About - All-in-One Video Gallery', 'all-in-one-video-gallery' ),
34
- __( 'About - All-in-One Video Gallery', 'all-in-one-video-gallery' ),
35
- 'manage_aiovg_options',
36
- 'aiovg_about',
37
- array( $this, 'display_welcome_content' )
38
- );
39
-
40
- add_dashboard_page(
41
- __( 'Support - All-in-One Video Gallery', 'all-in-one-video-gallery' ),
42
- __( 'Support - All-in-One Video Gallery', 'all-in-one-video-gallery' ),
43
- 'manage_aiovg_options',
44
- 'aiovg_support',
45
- array( $this, 'display_welcome_content' )
46
- );
47
-
48
- // Now remove the menus so plugins that allow customizing the admin menu don't show them
49
- remove_submenu_page( 'index.php', 'aiovg_about' );
50
- remove_submenu_page( 'index.php', 'aiovg_support' );
51
-
52
- }
53
-
54
- /**
55
- * Display welcome page content.
56
- *
57
- * @since 1.0.0
58
- */
59
- public function display_welcome_content() {
60
-
61
- $tabs = array(
62
- 'aiovg_about' => __( 'About', 'all-in-one-video-gallery' ),
63
- 'aiovg_support' => __( 'Support', 'all-in-one-video-gallery' )
64
- );
65