Version Description
Added the ability to delete taxonomy terms and lot of new features.
Download this release
Release Info
Developer | sudar |
Plugin | Bulk Delete |
Version | 6.0.0 |
Comparing to | |
See all releases |
Code changes from version 5.6.1 to 6.0.0
- assets/css/bulk-delete.css +11 -2
- assets/css/bulk-delete.css.map +1 -1
- assets/css/bulk-delete.min.css +2 -2
- assets/css/jquery-ui-smoothness.min.css +7 -0
- assets/css/jquery-ui-timepicker-addon.min.css +3 -3
- assets/css/select2.min.css +1 -1
- assets/js/bulk-delete.js +304 -40
- assets/js/bulk-delete.js.map +1 -1
- assets/js/bulk-delete.min.js +4 -3
- assets/js/jquery-ui-timepicker-addon.min.js +4 -4
- assets/js/select2.min.js +1 -2
- bulk-delete.php +33 -623
- include/BulkDeleteAutoloader.php +224 -0
- include/Core/Addon/AddonInfo.php +74 -0
- include/Core/Addon/AddonUpsellInfo.php +108 -0
- include/Core/Addon/BaseAddon.php +90 -0
- include/Core/Addon/FeatureAddon.php +106 -0
- include/Core/Addon/SchedulerAddon.php +29 -0
- include/Core/Addon/UpsellModule.php +80 -0
- include/Core/Addon/Upseller.php +208 -0
- include/Core/Base/BaseAddonPage.php +28 -0
- include/Core/Base/BaseDeletePage.php +227 -0
- include/Core/Base/BaseModule.php +442 -0
- include/Core/Base/BasePage.php +349 -0
- include/Core/Base/BaseScheduler.php +124 -0
- include/Core/Base/Mixin/Fetcher.php +200 -0
- include/Core/Base/Mixin/Renderer.php +636 -0
- include/Core/BulkDelete.php +692 -0
- include/Core/Controller.php +272 -0
- include/Core/Cron/CronListPage.php +141 -0
- include/Core/Cron/CronListTable.php +172 -0
- include/Core/Metas/DeleteMetasPage.php +54 -0
- include/Core/Metas/MetasModule.php +40 -0
- include/Core/Metas/Modules/DeleteCommentMetaModule.php +277 -0
- include/Core/Metas/Modules/DeletePostMetaModule.php +196 -0
- include/Core/Metas/Modules/DeleteUserMetaModule.php +161 -0
- include/Core/Pages/DeletePagesPage.php +54 -0
- include/Core/Pages/Modules/DeletePagesByStatusModule.php +88 -0
- include/Core/Pages/PagesModule.php +18 -0
- include/Core/Posts/DeletePostsPage.php +91 -0
- include/Core/Posts/Modules/DeletePostsByCategoryModule.php +125 -0
- include/Core/Posts/Modules/DeletePostsByCommentsModule.php +126 -0
- include/Core/Posts/Modules/DeletePostsByPostTypeModule.php +119 -0
- include/Core/Posts/Modules/DeletePostsByRevisionModule.php +78 -0
- include/Core/Posts/Modules/DeletePostsByStatusModule.php +79 -0
- include/Core/Posts/Modules/DeletePostsByStickyPostModule.php +151 -0
- include/Core/Posts/Modules/DeletePostsByTagModule.php +117 -0
- include/Core/Posts/Modules/DeletePostsByTaxonomyModule.php +161 -0
- include/Core/Posts/Modules/DeletePostsByURLModule.php +93 -0
- include/Core/Posts/PostsModule.php +179 -0
- include/Core/SystemInfo/BulkDeleteSystemInfo.php +92 -0
- include/Core/SystemInfo/SystemInfoPage.php +113 -0
- include/Core/Terms/DeleteTermsPage.php +53 -0
- include/Core/Terms/Modules/DeleteTermsByNameModule.php +222 -0
- include/Core/Terms/Modules/DeleteTermsByPostCountModule.php +102 -0
- include/Core/Terms/TermsModule.php +142 -0
- include/Core/Users/DeleteUsersPage.php +61 -0
- include/Core/Users/Modules/DeleteUsersByUserMetaModule.php +160 -0
- include/Core/Users/Modules/DeleteUsersByUserRoleModule.php +201 -0
- include/Core/Users/UsersModule.php +398 -0
- include/Deprecated/Addons/DeleteFromTrashModule.php +68 -0
- include/Deprecated/Addons/DeletePostsByAttachmentModule.php +38 -0
- include/Deprecated/Addons/DeletePostsByContentModule.php +39 -0
- include/Deprecated/Addons/DeletePostsByCustomFieldModule.php +38 -0
- include/Deprecated/Addons/DeletePostsByDuplicateTitleModule.php +38 -0
- include/Deprecated/Addons/DeletePostsByTitleModule.php +38 -0
- include/Deprecated/Addons/DeletePostsByUserModule.php +39 -0
- include/Deprecated/Addons/DeletePostsByUserRoleModule.php +38 -0
- include/Deprecated/Addons/DeprecatedModule.php +106 -0
- include/Deprecated/Bulk_Delete_Users_By_User_Meta.php +22 -0
- include/Deprecated/class-bd-addon.php +145 -0
- include/Deprecated/class-bd-base-addon.php +63 -0
- include/Deprecated/class-bd-scheduler-addon.php +192 -0
- include/Deprecated/class-bulk-delete-pages.php +32 -0
- include/Deprecated/class-bulk-delete-post-meta.php +41 -0
- include/Deprecated/class-bulk-delete-posts.php +104 -0
- include/Deprecated/class-bulk-delete-user-meta.php +41 -0
- include/Deprecated/class-bulk-delete-users.php +32 -0
- include/Deprecated/deprecated.php +303 -0
- include/Deprecated/old-bulk-delete.php +245 -0
- include/Deprecated/support-old-addons.php +150 -0
- include/base/class-bd-meta-box-module.php +1 -1
- include/base/class-bd-page.php +2 -2
- include/deprecated/class-bulk-delete-users.php +0 -25
- include/deprecated/deprecated.php +0 -140
- include/helpers/addon.php +31 -0
- include/helpers/common.php +177 -0
- include/license/class-bd-license-handler.php +9 -2
- include/license/class-bd-license.php +2 -7
- include/misc/class-bulk-delete-jetpack-contact-form-messages.php +39 -41
- include/misc/class-bulk-delete-misc.php +13 -7
- include/settings/class-bd-settings-page.php +0 -7
- include/settings/class-bd-settings.php +0 -3
- include/ui/admin-ui.php +0 -21
- include/ui/class-bulk-delete-help-screen.php +0 -3
- include/ui/form.php +98 -53
- include/util/query.php +23 -19
- languages/bulk-delete.pot +1001 -2005
- load-bulk-delete.php +116 -0
- readme.txt +38 -398
- vendor/sudar/wp-system-info/LICENSE +339 -0
- vendor/sudar/wp-system-info/README.md +2 -0
- vendor/sudar/wp-system-info/composer.json +23 -0
- vendor/sudar/wp-system-info/src/SystemInfo.php +407 -0
assets/css/bulk-delete.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
-
/*! Bulk Delete -
|
2 |
* https://bulkwp.com
|
3 |
-
* Copyright (c)
|
4 |
.visually-hidden {
|
5 |
border: 0;
|
6 |
clip: rect(1px, 1px, 1px, 1px);
|
@@ -13,6 +13,15 @@
|
|
13 |
width: 1px;
|
14 |
}
|
15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
table.filter-items {
|
17 |
margin-left: 21px;
|
18 |
}
|
1 |
+
/*! Bulk Delete - v6.0.0 %>
|
2 |
* https://bulkwp.com
|
3 |
+
* Copyright (c) 2019; * Licensed GPLv2+ */
|
4 |
.visually-hidden {
|
5 |
border: 0;
|
6 |
clip: rect(1px, 1px, 1px, 1px);
|
13 |
width: 1px;
|
14 |
}
|
15 |
|
16 |
+
#smdb_specific_pages_urls {
|
17 |
+
width: 600px;
|
18 |
+
height: 100px;
|
19 |
+
}
|
20 |
+
|
21 |
+
#bd_posts_by_url tr:last-child td:first-child {
|
22 |
+
width: 10px;
|
23 |
+
}
|
24 |
+
|
25 |
table.filter-items {
|
26 |
margin-left: 21px;
|
27 |
}
|
assets/css/bulk-delete.css.map
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"sources":["src/common.css","src/delete-users.css","src/select2-compat.css","src/tooltip.css"],"names":[],"mappings":";;;AAAA,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAClB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACX,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE;AAChC,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC;AACb,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC;AACd,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC;AAClB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AACZ,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC;AACpB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC;AACrB,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC;AACZ,CAAC;;ACVD,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACpB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC;AACnB,CAAC;;ACFD,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AAC1B,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE;AACZ,CAAC;AACD;AACA,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;AACnC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC;AAC1B,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC;AAClB,CAAC;;ACPD,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;AACV,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC;AACd,CAAC","file":"bulk-delete.css","sourcesContent":[".visually-hidden {\n\tborder: 0;\n\tclip: rect(1px, 1px, 1px, 1px);\n\theight: 1px;\n\tmargin: -1px;\n\toverflow: hidden;\n\tpadding: 0;\n\tposition: absolute;\n\twhite-space: nowrap;\n\twidth: 1px;\n}\n","table.filter-items {\n\tmargin-left: 21px;\n}\n","select[multiple].select2 {\n\twidth: 60%;\n}\n\n#post-body .select2-search__field {\n\t-webkit-box-shadow: none;\n\tbox-shadow: none;\n}\n",".bd-help {\n\tcursor: help;\n}\n"]}
|
1 |
+
{"version":3,"sources":["src/common.css","src/delete-post-by-url.css","src/delete-users.css","src/select2-compat.css","src/tooltip.css"],"names":[],"mappings":";;;AAAA,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAClB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACX,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE;AAChC,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC;AACb,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC;AACd,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC;AAClB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AACZ,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC;AACpB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC;AACrB,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC;AACZ,CAAC;;ACVD,CAAC,wBAAwB,CAAC,CAAC;AAC3B,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC;AACd,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC;AACf,CAAC;AACD;AACA,CAAC,eAAe,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAC/C,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;AACb,CAAC;;ACPD,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACpB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC;AACnB,CAAC;;ACFD,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AAC1B,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE;AACZ,CAAC;AACD;AACA,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;AACnC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC;AAC1B,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC;AAClB,CAAC;;ACPD,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;AACV,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC;AACd,CAAC","file":"bulk-delete.css","sourcesContent":[".visually-hidden {\n\tborder: 0;\n\tclip: rect(1px, 1px, 1px, 1px);\n\theight: 1px;\n\tmargin: -1px;\n\toverflow: hidden;\n\tpadding: 0;\n\tposition: absolute;\n\twhite-space: nowrap;\n\twidth: 1px;\n}\n","#smdb_specific_pages_urls {\n\twidth: 600px;\n\theight: 100px;\n}\n\n#bd_posts_by_url tr:last-child td:first-child {\n\twidth: 10px;\n}\n","table.filter-items {\n\tmargin-left: 21px;\n}\n","select[multiple].select2 {\n\twidth: 60%;\n}\n\n#post-body .select2-search__field {\n\t-webkit-box-shadow: none;\n\tbox-shadow: none;\n}\n",".bd-help {\n\tcursor: help;\n}\n"]}
|
assets/css/bulk-delete.min.css
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Bulk Delete -
|
2 |
* https://bulkwp.com
|
3 |
-
* Copyright (c)
|
1 |
+
/*! Bulk Delete - v6.0.0 %>
|
2 |
* https://bulkwp.com
|
3 |
+
* Copyright (c) 2019; * Licensed GPLv2+ */.visually-hidden{border:0;clip:rect(1px,1px,1px,1px);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}#smdb_specific_pages_urls{width:600px;height:100px}#bd_posts_by_url tr:last-child td:first-child{width:10px}table.filter-items{margin-left:21px}select[multiple].select2{width:60%}#post-body .select2-search__field{-webkit-box-shadow:none;box-shadow:none}.bd-help{cursor:help}
|
assets/css/jquery-ui-smoothness.min.css
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*! jQuery UI - v1.12.1 - 2016-09-14
|
2 |
+
* http://jqueryui.com
|
3 |
+
* Includes: core.css, accordion.css, autocomplete.css, menu.css, button.css, controlgroup.css, checkboxradio.css, datepicker.css, dialog.css, draggable.css, resizable.css, progressbar.css, selectable.css, selectmenu.css, slider.css, sortable.css, spinner.css, tabs.css, tooltip.css, theme.css
|
4 |
+
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
|
5 |
+
* Copyright jQuery Foundation and other contributors; Licensed MIT */
|
6 |
+
|
7 |
+
.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important;pointer-events:none}.ui-icon{display:inline-block;vertical-align:middle;margin-top:-.25em;position:relative;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-icon-block{left:50%;margin-left:-8px;display:block}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin:2px 0 0 0;padding:.5em .5em .5em .7em;font-size:100%}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-menu{list-style:none;padding:0;margin:0;display:block;outline:0}.ui-menu .ui-menu{position:absolute}.ui-menu .ui-menu-item{margin:0;cursor:pointer;list-style-image:url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7")}.ui-menu .ui-menu-item-wrapper{position:relative;padding:3px 1em 3px .4em}.ui-menu .ui-menu-divider{margin:5px 0;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-state-focus,.ui-menu .ui-state-active{margin:-1px}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item-wrapper{padding-left:2em}.ui-menu .ui-icon{position:absolute;top:0;bottom:0;left:.2em;margin:auto 0}.ui-menu .ui-menu-icon{left:auto;right:0}.ui-button{padding:.4em 1em;display:inline-block;position:relative;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:visible}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{width:2em;box-sizing:border-box;text-indent:-9999px;white-space:nowrap}input.ui-button.ui-button-icon-only{text-indent:0}.ui-button-icon-only .ui-icon{position:absolute;top:50%;left:50%;margin-top:-8px;margin-left:-8px}.ui-button.ui-icon-notext .ui-icon{padding:0;width:2.1em;height:2.1em;text-indent:-9999px;white-space:nowrap}input.ui-button.ui-icon-notext .ui-icon{width:auto;height:auto;text-indent:0;white-space:normal;padding:.4em 1em}input.ui-button::-moz-focus-inner,button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-controlgroup{vertical-align:middle;display:inline-block}.ui-controlgroup > .ui-controlgroup-item{float:left;margin-left:0;margin-right:0}.ui-controlgroup > .ui-controlgroup-item:focus,.ui-controlgroup > .ui-controlgroup-item.ui-visual-focus{z-index:9999}.ui-controlgroup-vertical > .ui-controlgroup-item{display:block;float:none;width:100%;margin-top:0;margin-bottom:0;text-align:left}.ui-controlgroup-vertical .ui-controlgroup-item{box-sizing:border-box}.ui-controlgroup .ui-controlgroup-label{padding:.4em 1em}.ui-controlgroup .ui-controlgroup-label span{font-size:80%}.ui-controlgroup-horizontal .ui-controlgroup-label + .ui-controlgroup-item{border-left:none}.ui-controlgroup-vertical .ui-controlgroup-label + .ui-controlgroup-item{border-top:none}.ui-controlgroup-horizontal .ui-controlgroup-label.ui-widget-content{border-right:none}.ui-controlgroup-vertical .ui-controlgroup-label.ui-widget-content{border-bottom:none}.ui-controlgroup-vertical .ui-spinner-input{width:75%;width:calc( 100% - 2.4em )}.ui-controlgroup-vertical .ui-spinner .ui-spinner-up{border-top-style:solid}.ui-checkboxradio-label .ui-icon-background{box-shadow:inset 1px 1px 1px #ccc;border-radius:.12em;border:none}.ui-checkboxradio-radio-label .ui-icon-background{width:16px;height:16px;border-radius:1em;overflow:visible;border:none}.ui-checkboxradio-radio-label.ui-checkboxradio-checked .ui-icon,.ui-checkboxradio-radio-label.ui-checkboxradio-checked:hover .ui-icon{background-image:none;width:8px;height:8px;border-width:4px;border-style:solid}.ui-checkboxradio-disabled{pointer-events:none}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:45%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:bold;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-datepicker .ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat;left:.5em;top:.3em}.ui-dialog{position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:20px;margin:-10px 0 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:none;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-n{height:2px;top:0}.ui-dialog .ui-resizable-e{width:2px;right:0}.ui-dialog .ui-resizable-s{height:2px;bottom:0}.ui-dialog .ui-resizable-w{width:2px;left:0}.ui-dialog .ui-resizable-se,.ui-dialog .ui-resizable-sw,.ui-dialog .ui-resizable-ne,.ui-dialog .ui-resizable-nw{width:7px;height:7px}.ui-dialog .ui-resizable-se{right:0;bottom:0}.ui-dialog .ui-resizable-sw{left:0;bottom:0}.ui-dialog .ui-resizable-ne{right:0;top:0}.ui-dialog .ui-resizable-nw{left:0;top:0}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-draggable-handle{-ms-touch-action:none;touch-action:none}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:0.1px;display:block;-ms-touch-action:none;touch-action:none}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-progressbar-overlay{background:url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==");height:100%;filter:alpha(opacity=25);opacity:0.25}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}.ui-selectable{-ms-touch-action:none;touch-action:none}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted black}.ui-selectmenu-menu{padding:0;margin:0;position:absolute;top:0;left:0;display:none}.ui-selectmenu-menu .ui-menu{overflow:auto;overflow-x:hidden;padding-bottom:1px}.ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup{font-size:1em;font-weight:bold;line-height:1.5;padding:2px 0.4em;margin:0.5em 0 0 0;height:auto;border:0}.ui-selectmenu-open{display:block}.ui-selectmenu-text{display:block;margin-right:20px;overflow:hidden;text-overflow:ellipsis}.ui-selectmenu-button.ui-button{text-align:left;white-space:nowrap;width:14em}.ui-selectmenu-icon.ui-icon{float:right;margin-top:0}.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default;-ms-touch-action:none;touch-action:none}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.ui-sortable-handle{-ms-touch-action:none;touch-action:none}.ui-spinner{position:relative;display:inline-block;overflow:hidden;padding:0;vertical-align:middle}.ui-spinner-input{border:none;background:none;color:inherit;padding:.222em 0;margin:.2em 0;vertical-align:middle;margin-left:.4em;margin-right:2em}.ui-spinner-button{width:1.6em;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.ui-spinner a.ui-spinner-button{border-top-style:none;border-bottom-style:none;border-right-style:none}.ui-spinner-up{top:0}.ui-spinner-down{bottom:0}.ui-tabs{position:relative;padding:.2em}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom-width:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav .ui-tabs-anchor{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor{cursor:text}.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:none}.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px}body .ui-tooltip{border-width:2px}.ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget.ui-widget-content{border:1px solid #d3d3d3}.ui-widget-content{border:1px solid #aaa;background:#fff;color:#222}.ui-widget-content a{color:#222}.ui-widget-header{border:1px solid #aaa;background:#ccc url("images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x;color:#222;font-weight:bold}.ui-widget-header a{color:#222}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default,.ui-button,html .ui-button.ui-state-disabled:hover,html .ui-button.ui-state-disabled:active{border:1px solid #d3d3d3;background:#e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#555}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited,a.ui-button,a:link.ui-button,a:visited.ui-button,.ui-button{color:#555;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus,.ui-button:hover,.ui-button:focus{border:1px solid #999;background:#dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited,a.ui-button:hover,a.ui-button:focus{color:#212121;text-decoration:none}.ui-visual-focus{box-shadow:0 0 3px 1px rgb(94,158,214)}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active,a.ui-button:active,.ui-button:active,.ui-button.ui-state-active:hover{border:1px solid #aaa;background:#fff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-icon-background,.ui-state-active .ui-icon-background{border:#aaa;background-color:#212121}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:#fbf9ee url("images/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x;color:#363636}.ui-state-checked{border:1px solid #fcefa1;background:#fbf9ee}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#fef1ec url("images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x;color:#cd0a0a}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd0a0a}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#cd0a0a}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url("images/ui-icons_222222_256x240.png")}.ui-widget-header .ui-icon{background-image:url("images/ui-icons_222222_256x240.png")}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon,.ui-button:hover .ui-icon,.ui-button:focus .ui-icon{background-image:url("images/ui-icons_454545_256x240.png")}.ui-state-active .ui-icon,.ui-button:active .ui-icon{background-image:url("images/ui-icons_454545_256x240.png")}.ui-state-highlight .ui-icon,.ui-button .ui-state-highlight.ui-icon{background-image:url("images/ui-icons_2e83ff_256x240.png")}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url("images/ui-icons_cd0a0a_256x240.png")}.ui-button .ui-icon{background-image:url("images/ui-icons_888888_256x240.png")}.ui-icon-blank{background-position:16px 16px}.ui-icon-caret-1-n{background-position:0 0}.ui-icon-caret-1-ne{background-position:-16px 0}.ui-icon-caret-1-e{background-position:-32px 0}.ui-icon-caret-1-se{background-position:-48px 0}.ui-icon-caret-1-s{background-position:-65px 0}.ui-icon-caret-1-sw{background-position:-80px 0}.ui-icon-caret-1-w{background-position:-96px 0}.ui-icon-caret-1-nw{background-position:-112px 0}.ui-icon-caret-2-n-s{background-position:-128px 0}.ui-icon-caret-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-65px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-65px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:1px -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:4px}.ui-widget-overlay{background:#aaa;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{-webkit-box-shadow:-8px -8px 8px #aaa;box-shadow:-8px -8px 8px #aaa}
|
assets/css/jquery-ui-timepicker-addon.min.css
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
-
/*! jQuery Timepicker Addon - v1.
|
2 |
* http://trentrichardson.com/examples/timepicker
|
3 |
-
* Copyright (c)
|
4 |
|
5 |
-
.ui-timepicker-div .ui-widget-header{margin-bottom:8px}.ui-timepicker-div dl{text-align:left}.ui-timepicker-div dl dt{float:left;clear:left;padding:0 0 0 5px}.ui-timepicker-div dl dd{margin:0 10px 10px 40%}.ui-timepicker-div td{font-size:90%}.ui-tpicker-grid-label{background:0 0;border:0;margin:0;padding:0}.ui-timepicker-div .ui_tpicker_unit_hide{display:none}.ui-timepicker-rtl{direction:rtl}.ui-timepicker-rtl dl{text-align:right;padding:0 5px 0 0}.ui-timepicker-rtl dl dt{float:right;clear:right}.ui-timepicker-rtl dl dd{margin:0 40% 10px 10px}.ui-timepicker-div.ui-timepicker-oneLine{padding-right:2px}.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_time,.ui-timepicker-div.ui-timepicker-oneLine dt{display:none}.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_time_label{display:block;padding-top:2px}.ui-timepicker-div.ui-timepicker-oneLine dl{text-align:right}.ui-timepicker-div.ui-timepicker-oneLine dl dd,.ui-timepicker-div.ui-timepicker-oneLine dl dd>div{display:inline-block;margin:0}.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_minute:before,.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_second:before{content:':';display:inline-block}.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_millisec:before,.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_microsec:before{content:'.';display:inline-block}.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_unit_hide,.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_unit_hide:before{display:none}
|
1 |
+
/*! jQuery Timepicker Addon - v1.6.3 - 2016-04-20
|
2 |
* http://trentrichardson.com/examples/timepicker
|
3 |
+
* Copyright (c) 2016 Trent Richardson; Licensed MIT */
|
4 |
|
5 |
+
.ui-timepicker-div .ui-widget-header{margin-bottom:8px}.ui-timepicker-div dl{text-align:left}.ui-timepicker-div dl dt{float:left;clear:left;padding:0 0 0 5px}.ui-timepicker-div dl dd{margin:0 10px 10px 40%}.ui-timepicker-div td{font-size:90%}.ui-tpicker-grid-label{background:0 0;border:0;margin:0;padding:0}.ui-timepicker-div .ui_tpicker_unit_hide{display:none}.ui-timepicker-div .ui_tpicker_time .ui_tpicker_time_input{background:0 0;color:inherit;border:0;outline:0;border-bottom:solid 1px #555;width:95%}.ui-timepicker-div .ui_tpicker_time .ui_tpicker_time_input:focus{border-bottom-color:#aaa}.ui-timepicker-rtl{direction:rtl}.ui-timepicker-rtl dl{text-align:right;padding:0 5px 0 0}.ui-timepicker-rtl dl dt{float:right;clear:right}.ui-timepicker-rtl dl dd{margin:0 40% 10px 10px}.ui-timepicker-div.ui-timepicker-oneLine{padding-right:2px}.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_time,.ui-timepicker-div.ui-timepicker-oneLine dt{display:none}.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_time_label{display:block;padding-top:2px}.ui-timepicker-div.ui-timepicker-oneLine dl{text-align:right}.ui-timepicker-div.ui-timepicker-oneLine dl dd,.ui-timepicker-div.ui-timepicker-oneLine dl dd>div{display:inline-block;margin:0}.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_minute:before,.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_second:before{content:':';display:inline-block}.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_millisec:before,.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_microsec:before{content:'.';display:inline-block}.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_unit_hide,.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_unit_hide:before{display:none}
|
assets/css/select2.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle;}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none;}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px;}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none;}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap;}.select2-container .select2-search--inline{float:left;}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none;}.select2-dropdown{background-color:white;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051;}.select2-results{display:block;}.select2-results__options{list-style:none;margin:0;padding:0;}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none;}.select2-results__option[aria-selected]{cursor:pointer;}.select2-container--open .select2-dropdown{left:0;}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0;}.select2-search--dropdown{display:block;padding:4px;}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box;}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none;}.select2-search--dropdown.select2-search--hide{display:none;}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0);}.select2-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px;}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px;}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999;}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px;}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0;}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left;}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow{left:1px;right:auto;}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default;}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none;}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px;}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%;}.select2-container--default .select2-selection--multiple .select2-selection__placeholder{color:#999;margin-top:5px;float:left;}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px;}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px;}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px;}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333;}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder{float:right;}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto;}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto;}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid black 1px;outline:0;}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default;}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none;}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0;}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0;}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa;}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:0;}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto;}.select2-container--default .select2-results__option[role=group]{padding:0;}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999;}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd;}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em;}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0;}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em;}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em;}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em;}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em;}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em;}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:white;}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px;}.select2-container--classic .select2-selection--single{background-color:#f6f6f6;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #ffffff 50%, #eeeeee 100%);background-image:-o-linear-gradient(top, #ffffff 50%, #eeeeee 100%);background-image:linear-gradient(to bottom, #ffffff 50%, #eeeeee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#eeeeee', GradientType=0);}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb;}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px;}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px;}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999;}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eeeeee 50%, #cccccc 100%);background-image:-o-linear-gradient(top, #eeeeee 50%, #cccccc 100%);background-image:linear-gradient(to bottom, #eeeeee 50%, #cccccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#cccccc', GradientType=0);}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0;}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left;}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto;}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb;}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none;}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px;}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, #ffffff 0%, #eeeeee 50%);background-image:-o-linear-gradient(top, #ffffff 0%, #eeeeee 50%);background-image:linear-gradient(to bottom, #ffffff 0%, #eeeeee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#eeeeee', GradientType=0);}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eeeeee 50%, #ffffff 100%);background-image:-o-linear-gradient(top, #eeeeee 50%, #ffffff 100%);background-image:linear-gradient(to bottom, #eeeeee 50%, #ffffff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0);}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0;}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb;}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px;}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none;}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px;}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px;}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555;}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right;}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto;}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto;}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb;}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0;}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0;}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;}.select2-container--classic .select2-dropdown{background-color:white;border:1px solid transparent;}.select2-container--classic .select2-dropdown--above{border-bottom:none;}.select2-container--classic .select2-dropdown--below{border-top:none;}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto;}.select2-container--classic .select2-results__option[role=group]{padding:0;}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey;}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:white;}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px;}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb;}
|
1 |
+
.select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:white;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option[aria-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0 !important;clip:rect(0 0 0 0) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__placeholder{color:#999;margin-top:5px;float:left}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline{float:right}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid black 1px;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:white}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #fff 50%, #eee 100%);background-image:-o-linear-gradient(top, #fff 50%, #eee 100%);background-image:linear-gradient(to bottom, #fff 50%, #eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eee 50%, #ccc 100%);background-image:-o-linear-gradient(top, #eee 50%, #ccc 100%);background-image:linear-gradient(to bottom, #eee 50%, #ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, #fff 0%, #eee 50%);background-image:-o-linear-gradient(top, #fff 0%, #eee 50%);background-image:linear-gradient(to bottom, #fff 0%, #eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eee 50%, #fff 100%);background-image:-o-linear-gradient(top, #eee 50%, #fff 100%);background-image:linear-gradient(to bottom, #eee 50%, #fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb}
|
assets/js/bulk-delete.js
CHANGED
@@ -1,18 +1,19 @@
|
|
1 |
-
/*! Bulk Delete -
|
2 |
* https://bulkwp.com
|
3 |
-
* Copyright (c)
|
4 |
-
/*global
|
5 |
-
jQuery(document).ready(function () {
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
BulkWP.enableHelpTooltips( jQuery( '.bd-help' ) );
|
15 |
|
|
|
|
|
16 |
jQuery( '.user_restrict_to_no_posts_filter' ).change( function() {
|
17 |
var $this = jQuery(this),
|
18 |
filterEnabled = $this.is( ':checked' ),
|
@@ -71,8 +72,21 @@ jQuery(document).ready(function () {
|
|
71 |
function toggle_registered_restrict(el) {
|
72 |
if (jQuery("#smbd" + el + "_registered_restrict").is(":checked")) {
|
73 |
jQuery("#smbd" + el + "_registered_days").removeAttr('disabled');
|
|
|
74 |
} else {
|
75 |
jQuery("#smbd" + el + "_registered_days").attr('disabled', 'true');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
}
|
77 |
}
|
78 |
|
@@ -112,6 +126,7 @@ jQuery(document).ready(function () {
|
|
112 |
jQuery.each(BulkWP.dt_iterators, function (index, value) {
|
113 |
// invoke the date time picker
|
114 |
jQuery('#smbd' + value + '_cron_start').datetimepicker({
|
|
|
115 |
timeFormat: 'HH:mm:ss'
|
116 |
});
|
117 |
|
@@ -131,6 +146,10 @@ jQuery(document).ready(function () {
|
|
131 |
toggle_registered_restrict(value);
|
132 |
});
|
133 |
|
|
|
|
|
|
|
|
|
134 |
jQuery( '#smbd' + value + '_no_posts' ).change( function () {
|
135 |
toggle_post_type_dropdown( value );
|
136 |
});
|
@@ -138,14 +157,18 @@ jQuery(document).ready(function () {
|
|
138 |
|
139 |
jQuery.each( BulkWP.pro_iterators, function ( index, value) {
|
140 |
jQuery('.bd-' + value.replace( '_', '-' ) + '-pro').hide();
|
|
|
|
|
|
|
|
|
141 |
jQuery('#smbd_' + value + '_cron_freq, #smbd_' + value + '_cron_start, #smbd_' + value + '_cron').removeAttr('disabled');
|
142 |
} );
|
143 |
|
144 |
-
// Validate user action
|
145 |
jQuery('button[name="bd_action"]').click(function () {
|
146 |
var currentButton = jQuery(this).val(),
|
147 |
-
|
148 |
-
|
149 |
error_key = "selectPostOption";
|
150 |
|
151 |
if (currentButton in BulkWP.validators) {
|
@@ -158,7 +181,11 @@ jQuery(document).ready(function () {
|
|
158 |
|
159 |
if (valid) {
|
160 |
if (currentButton in BulkWP.pre_action_msg) {
|
161 |
-
|
|
|
|
|
|
|
|
|
162 |
}
|
163 |
|
164 |
return confirm(BulkWP.msg[msg_key]);
|
@@ -173,36 +200,19 @@ jQuery(document).ready(function () {
|
|
173 |
return false;
|
174 |
});
|
175 |
|
176 |
-
/**
|
177 |
-
* Validation functions
|
178 |
-
*/
|
179 |
-
BulkWP.noValidation = function() {
|
180 |
-
return true;
|
181 |
-
};
|
182 |
-
|
183 |
BulkWP.validateSelect2 = function(that) {
|
184 |
-
if (null !== jQuery(that).parent().prev().children().find(".select2[multiple]").val()) {
|
185 |
-
return true;
|
186 |
-
} else {
|
187 |
-
return false;
|
188 |
-
}
|
189 |
-
};
|
190 |
-
|
191 |
-
BulkWP.validateUrl = function(that) {
|
192 |
-
if (jQuery(that).parent().prev().children('table').find("textarea").val() !== '') {
|
193 |
return true;
|
194 |
} else {
|
195 |
return false;
|
196 |
}
|
197 |
};
|
|
|
198 |
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
return false;
|
204 |
-
}
|
205 |
-
};
|
206 |
});
|
207 |
|
208 |
BulkWP.jetpack = function() {
|
@@ -235,6 +245,237 @@ BulkWP.jetpack = function() {
|
|
235 |
});
|
236 |
};
|
237 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
238 |
BulkWP.enableHelpTooltips = function ( $selector ) {
|
239 |
$selector.tooltip({
|
240 |
content: function() {
|
@@ -254,4 +495,27 @@ BulkWP.enableHelpTooltips = function ( $selector ) {
|
|
254 |
});
|
255 |
};
|
256 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
257 |
//# sourceMappingURL=bulk-delete.js.map
|
1 |
+
/*! Bulk Delete - v6.0.0 %>
|
2 |
* https://bulkwp.com
|
3 |
+
* Copyright (c) 2019; * Licensed GPLv2+ */
|
4 |
+
/*global jQuery, document*/
|
5 |
+
jQuery( document ).ready( function () {
|
6 |
+
jQuery( 'input[name="smbd_comment_meta_use_value"]' ).change( function () {
|
7 |
+
if ( 'true' === jQuery( this ).val() ) {
|
8 |
+
jQuery( '#smbd_comment_meta_filters' ).show();
|
9 |
+
} else {
|
10 |
+
jQuery( '#smbd_comment_meta_filters' ).hide();
|
11 |
+
}
|
12 |
+
} );
|
13 |
+
} );
|
|
|
14 |
|
15 |
+
/*global BulkWP, postboxes, pagenow */
|
16 |
+
jQuery(document).ready(function () {
|
17 |
jQuery( '.user_restrict_to_no_posts_filter' ).change( function() {
|
18 |
var $this = jQuery(this),
|
19 |
filterEnabled = $this.is( ':checked' ),
|
72 |
function toggle_registered_restrict(el) {
|
73 |
if (jQuery("#smbd" + el + "_registered_restrict").is(":checked")) {
|
74 |
jQuery("#smbd" + el + "_registered_days").removeAttr('disabled');
|
75 |
+
jQuery("#smbd" + el + "_op").removeAttr('disabled');
|
76 |
} else {
|
77 |
jQuery("#smbd" + el + "_registered_days").attr('disabled', 'true');
|
78 |
+
jQuery("#smbd" + el + "_op").attr('disabled', 'true');
|
79 |
+
}
|
80 |
+
}
|
81 |
+
|
82 |
+
/**
|
83 |
+
* Toggle delete attachments
|
84 |
+
*/
|
85 |
+
function toggle_delete_attachments(el) {
|
86 |
+
if ( "true" === jQuery('input[name="smbd' + el + '_force_delete"]:checked').val()) {
|
87 |
+
jQuery("#smbd" + el + "_attachment").removeAttr('disabled');
|
88 |
+
} else {
|
89 |
+
jQuery("#smbd" + el + "_attachment").attr('disabled', 'true');
|
90 |
}
|
91 |
}
|
92 |
|
126 |
jQuery.each(BulkWP.dt_iterators, function (index, value) {
|
127 |
// invoke the date time picker
|
128 |
jQuery('#smbd' + value + '_cron_start').datetimepicker({
|
129 |
+
dateFormat: 'yy-mm-dd',
|
130 |
timeFormat: 'HH:mm:ss'
|
131 |
});
|
132 |
|
146 |
toggle_registered_restrict(value);
|
147 |
});
|
148 |
|
149 |
+
jQuery('input[name="smbd' + value + '_force_delete"]').change(function () {
|
150 |
+
toggle_delete_attachments(value);
|
151 |
+
});
|
152 |
+
|
153 |
jQuery( '#smbd' + value + '_no_posts' ).change( function () {
|
154 |
toggle_post_type_dropdown( value );
|
155 |
});
|
157 |
|
158 |
jQuery.each( BulkWP.pro_iterators, function ( index, value) {
|
159 |
jQuery('.bd-' + value.replace( '_', '-' ) + '-pro').hide();
|
160 |
+
|
161 |
+
// `<tr>` displays the documentation link when the pro add-on is installed.
|
162 |
+
jQuery('tr.bd-' + value.replace( '_', '-' ) + '-pro').show();
|
163 |
+
|
164 |
jQuery('#smbd_' + value + '_cron_freq, #smbd_' + value + '_cron_start, #smbd_' + value + '_cron').removeAttr('disabled');
|
165 |
} );
|
166 |
|
167 |
+
// Validate user action.
|
168 |
jQuery('button[name="bd_action"]').click(function () {
|
169 |
var currentButton = jQuery(this).val(),
|
170 |
+
valid = false,
|
171 |
+
msg_key = "deletePostsWarning",
|
172 |
error_key = "selectPostOption";
|
173 |
|
174 |
if (currentButton in BulkWP.validators) {
|
181 |
|
182 |
if (valid) {
|
183 |
if (currentButton in BulkWP.pre_action_msg) {
|
184 |
+
if ( jQuery.isFunction( BulkWP[ BulkWP.pre_action_msg[ currentButton ] ] ) ) {
|
185 |
+
msg_key = BulkWP[ BulkWP.pre_action_msg[ currentButton ] ]( this );
|
186 |
+
} else {
|
187 |
+
msg_key = BulkWP.pre_action_msg[ currentButton ];
|
188 |
+
}
|
189 |
}
|
190 |
|
191 |
return confirm(BulkWP.msg[msg_key]);
|
200 |
return false;
|
201 |
});
|
202 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
203 |
BulkWP.validateSelect2 = function(that) {
|
204 |
+
if (null !== jQuery(that).parent().prev().children().find(".select2-taxonomy[multiple]").val()) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
205 |
return true;
|
206 |
} else {
|
207 |
return false;
|
208 |
}
|
209 |
};
|
210 |
+
});
|
211 |
|
212 |
+
/*global jQuery, BulkWP*/
|
213 |
+
jQuery(document).ready(function () {
|
214 |
+
// Start Jetpack.
|
215 |
+
BulkWP.jetpack();
|
|
|
|
|
|
|
216 |
});
|
217 |
|
218 |
BulkWP.jetpack = function() {
|
245 |
});
|
246 |
};
|
247 |
|
248 |
+
/*global jQuery, BulkWP*/
|
249 |
+
BulkWP.validateCommentsCount = function(that) {
|
250 |
+
return ("" !== jQuery(that).parent().prev().children().find(":input.comments_count_num").val());
|
251 |
+
};
|
252 |
+
|
253 |
+
/* global BulkWP */
|
254 |
+
|
255 |
+
/**
|
256 |
+
* Validation for Post Type select2.
|
257 |
+
*/
|
258 |
+
BulkWP.validatePostTypeSelect2 = function(that) {
|
259 |
+
if (null !== jQuery(that).parent().prev().children().find(".enhanced-post-types-with-status[multiple]").val()) {
|
260 |
+
return true;
|
261 |
+
} else {
|
262 |
+
return false;
|
263 |
+
}
|
264 |
+
};
|
265 |
+
|
266 |
+
/*global BulkWP */
|
267 |
+
jQuery( document ).ready( function () {
|
268 |
+
var stickyAction = jQuery( "input[name='smbd_sticky_post_sticky_action']" ),
|
269 |
+
deleteAction = stickyAction.parents( 'tr' ).next(),
|
270 |
+
deleteActionRadio = deleteAction.find('[type="radio"]'),
|
271 |
+
deleteAttachmentAction = deleteAction.next(),
|
272 |
+
deleteAttachmentCheckBox = deleteAttachmentAction.find('[type="checkbox"]'),
|
273 |
+
stickyPostCheckbox = jQuery( "input[name='smbd_sticky_post[]']" ),
|
274 |
+
deleteButton = jQuery( "button[value='delete_posts_by_sticky_post']" );
|
275 |
+
|
276 |
+
deleteButton.html( 'Remove Sticky »' );
|
277 |
+
deleteAction.hide();
|
278 |
+
deleteAttachmentAction.hide();
|
279 |
+
|
280 |
+
stickyAction.change( function () {
|
281 |
+
if ( 'delete' === stickyAction.filter( ':checked' ).val() ) {
|
282 |
+
deleteButton.html( 'Bulk Delete »' );
|
283 |
+
deleteAction.show();
|
284 |
+
deleteAttachmentAction.show();
|
285 |
+
} else {
|
286 |
+
deleteButton.html( 'Remove Sticky »' );
|
287 |
+
deleteAction.hide();
|
288 |
+
deleteAttachmentAction.hide();
|
289 |
+
}
|
290 |
+
} );
|
291 |
+
|
292 |
+
deleteActionRadio.change( function () {
|
293 |
+
if( "true" === deleteActionRadio.filter(':checked').val() ){
|
294 |
+
deleteAttachmentCheckBox.removeAttr('disabled');
|
295 |
+
} else {
|
296 |
+
deleteAttachmentCheckBox.attr('disabled', 'true');
|
297 |
+
}
|
298 |
+
});
|
299 |
+
|
300 |
+
jQuery("input[value='all']").change( function () {
|
301 |
+
if( jQuery(this).is(':checked') ) {
|
302 |
+
uncheckAndDisableOtherCheckboxes();
|
303 |
+
} else {
|
304 |
+
enableCheckboxes();
|
305 |
+
}
|
306 |
+
});
|
307 |
+
|
308 |
+
function uncheckAndDisableOtherCheckboxes() {
|
309 |
+
stickyPostCheckbox.each( function() {
|
310 |
+
if ( 'all' !== jQuery(this).val() ){
|
311 |
+
jQuery(this).prop('checked', false);
|
312 |
+
jQuery(this).attr('disabled', 'true');
|
313 |
+
}
|
314 |
+
});
|
315 |
+
}
|
316 |
+
|
317 |
+
function enableCheckboxes() {
|
318 |
+
stickyPostCheckbox.each( function() {
|
319 |
+
jQuery(this).removeAttr('disabled');
|
320 |
+
});
|
321 |
+
}
|
322 |
+
} );
|
323 |
+
|
324 |
+
/**
|
325 |
+
* Validate that at least one post was selected.
|
326 |
+
*
|
327 |
+
* @returns {boolean} True if at least one post was selected, False otherwise.
|
328 |
+
*/
|
329 |
+
BulkWP.validateStickyPost = function () {
|
330 |
+
return jQuery( "input[name='smbd_sticky_post[]']:checked" ).length > 0;
|
331 |
+
};
|
332 |
+
|
333 |
+
BulkWP.DeletePostsByStickyPostPreAction = function () {
|
334 |
+
var stickyAction = jQuery( "input[name='smbd_sticky_post_sticky_action']:checked" ).val();
|
335 |
+
|
336 |
+
if ( 'unsticky' === stickyAction ) {
|
337 |
+
return 'unstickyPostsWarning';
|
338 |
+
} else {
|
339 |
+
return 'deletePostsWarning';
|
340 |
+
}
|
341 |
+
};
|
342 |
+
|
343 |
+
/*global jQuery, BulkWP*/
|
344 |
+
BulkWP.validateUrl = function(that) {
|
345 |
+
if (jQuery(that).parent().prev().children('table').find("textarea").val() !== '') {
|
346 |
+
return true;
|
347 |
+
} else {
|
348 |
+
return false;
|
349 |
+
}
|
350 |
+
};
|
351 |
+
|
352 |
+
jQuery( document ).ready( function () {
|
353 |
+
jQuery( '.enhanced-taxonomy-list' ).select2( {
|
354 |
+
width: '300px'
|
355 |
+
} );
|
356 |
+
} );
|
357 |
+
|
358 |
+
/*global BulkWP */
|
359 |
+
|
360 |
+
/**
|
361 |
+
* Validate that term name is not left blank.
|
362 |
+
*
|
363 |
+
* @returns {boolean} True if term name is not blank, False otherwise.
|
364 |
+
*/
|
365 |
+
BulkWP.validateTermName = function() {
|
366 |
+
return (jQuery('input[name="smbd_terms_by_name_value"]').val() !== '');
|
367 |
+
};
|
368 |
+
|
369 |
+
/**
|
370 |
+
* Validate that post count is not left blank.
|
371 |
+
*
|
372 |
+
* @returns {boolean} True if post count is not blank, False otherwise.
|
373 |
+
*/
|
374 |
+
BulkWP.validatePostCount = function() {
|
375 |
+
return (jQuery('input[name="smbd_terms_by_post_count"]').val() !== '');
|
376 |
+
};
|
377 |
+
|
378 |
+
/*global jQuery, BulkWP*/
|
379 |
+
jQuery( document ).ready( function () {
|
380 |
+
var reassignSelectBoxes = jQuery( ".reassign-user" ),
|
381 |
+
contentDeleteRadios = jQuery( ".post-reassign" );
|
382 |
+
|
383 |
+
reassignSelectBoxes.select2(
|
384 |
+
{
|
385 |
+
width: '200px'
|
386 |
+
}
|
387 |
+
);
|
388 |
+
|
389 |
+
reassignSelectBoxes.each( function () {
|
390 |
+
jQuery( this ).attr( 'disabled', 'true' );
|
391 |
+
} );
|
392 |
+
|
393 |
+
contentDeleteRadios.change( function () {
|
394 |
+
var reassignSelectBox = jQuery( this ).parents( 'tr' ).find( '.reassign-user' );
|
395 |
+
|
396 |
+
if ( "true" === jQuery( this ).val() ) {
|
397 |
+
reassignSelectBox.removeAttr( 'disabled' );
|
398 |
+
} else {
|
399 |
+
reassignSelectBox.attr( 'disabled', 'true' );
|
400 |
+
}
|
401 |
+
} );
|
402 |
+
} );
|
403 |
+
|
404 |
+
BulkWP.validateUserMeta = function () {
|
405 |
+
return (jQuery( '#smbd_u_meta_value' ).val() !== '');
|
406 |
+
};
|
407 |
+
|
408 |
+
BulkWP.validateUserRole = function ( that ) {
|
409 |
+
return (null !== jQuery( that ).parent().prev().find( ".enhanced-role-dropdown" ).val());
|
410 |
+
};
|
411 |
+
|
412 |
+
/*global ajaxurl*/
|
413 |
+
jQuery( document ).ready( function () {
|
414 |
+
/**
|
415 |
+
* Normal select2.
|
416 |
+
*/
|
417 |
+
jQuery( '.select2-taxonomy, .enhanced-dropdown, .enhanced-role-dropdown' ).select2( {
|
418 |
+
width: '300px'
|
419 |
+
} );
|
420 |
+
|
421 |
+
/**
|
422 |
+
* Select 2 for posts types with status.
|
423 |
+
*
|
424 |
+
* The label of the selected item is modified to include the optgroup label.
|
425 |
+
*/
|
426 |
+
jQuery( '.enhanced-post-types-with-status' ).select2( {
|
427 |
+
width: '300px',
|
428 |
+
templateSelection: function (state) {
|
429 |
+
if ( ! state.id ) {
|
430 |
+
return state.text;
|
431 |
+
}
|
432 |
+
|
433 |
+
return jQuery(
|
434 |
+
'<span>' + state.element.parentElement.label + '-' + state.text + '</span>'
|
435 |
+
);
|
436 |
+
}
|
437 |
+
});
|
438 |
+
|
439 |
+
/**
|
440 |
+
* Enable AJAX for Taxonomy Select2.
|
441 |
+
*/
|
442 |
+
jQuery( '.select2-taxonomy-ajax' ).select2( {
|
443 |
+
ajax: {
|
444 |
+
url: ajaxurl,
|
445 |
+
dataType: 'json',
|
446 |
+
delay: 250,
|
447 |
+
data: function ( params ) {
|
448 |
+
return {
|
449 |
+
q: params.term,
|
450 |
+
taxonomy: jQuery( this ).attr( 'data-taxonomy' ),
|
451 |
+
action: 'bd_load_taxonomy_term'
|
452 |
+
};
|
453 |
+
},
|
454 |
+
processResults: function ( data ) {
|
455 |
+
var options = [];
|
456 |
+
|
457 |
+
if ( data ) {
|
458 |
+
jQuery.each( data, function ( index, dataPair ) {
|
459 |
+
options.push( { id: dataPair[ 0 ], text: dataPair[ 1 ] } );
|
460 |
+
} );
|
461 |
+
}
|
462 |
+
|
463 |
+
return {
|
464 |
+
results: options
|
465 |
+
};
|
466 |
+
},
|
467 |
+
cache: true
|
468 |
+
},
|
469 |
+
minimumInputLength: 2, // the minimum of symbols to input before perform a search
|
470 |
+
width: '300px'
|
471 |
+
} );
|
472 |
+
} );
|
473 |
+
|
474 |
+
/*global jQuery, BulkWP*/
|
475 |
+
jQuery(document).ready(function () {
|
476 |
+
BulkWP.enableHelpTooltips( jQuery( '.bd-help' ) );
|
477 |
+
});
|
478 |
+
|
479 |
BulkWP.enableHelpTooltips = function ( $selector ) {
|
480 |
$selector.tooltip({
|
481 |
content: function() {
|
495 |
});
|
496 |
};
|
497 |
|
498 |
+
/*global BulkWP*/
|
499 |
+
|
500 |
+
/**
|
501 |
+
* No need to validate anything.
|
502 |
+
*
|
503 |
+
* @returns {boolean} Returns true always.
|
504 |
+
*/
|
505 |
+
BulkWP.noValidation = function() {
|
506 |
+
return true;
|
507 |
+
};
|
508 |
+
|
509 |
+
/**
|
510 |
+
* Validate enhanced dropdowns.
|
511 |
+
*
|
512 |
+
* @param that Reference to the button.
|
513 |
+
* @returns {boolean} True if validation succeeds, False otherwise.
|
514 |
+
*/
|
515 |
+
BulkWP.validateEnhancedDropdown = function ( that ) {
|
516 |
+
var value = jQuery( that ).parent().prev().children().find( ".enhanced-dropdown" ).val();
|
517 |
+
|
518 |
+
return ( value !== null && value !== '-1' );
|
519 |
+
};
|
520 |
+
|
521 |
//# sourceMappingURL=bulk-delete.js.map
|
assets/js/bulk-delete.js.map
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"sources":["src/bulk-delete.js"],"names":[],"mappings":";;;AAAA,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE;AACrC,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACpC,CAAC,GAAG;AACJ,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO;AAClB,EAAE,EAAE;AACJ,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,OAAO,GAAG;AAChC;AACA,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC;AAClB,CAAC,MAAM,CAAC,OAAO,GAAG;AAClB;AACA,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE;AACnD;AACA,CAAC,MAAM,CAAC,CAAC,EAAE,gCAAgC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;AACnE,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE;AAC3B,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE;AAC1C,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC,CAAC,EAAE,sCAAsC,CAAC,CAAC,EAAE;AAC3G;AACA,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;AACxB,GAAG,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE;AACjD,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AACV,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE;AAC9C,EAAE,CAAC;AACH,CAAC,CAAC,CAAC,EAAE;AACL;AACA,CAAC,GAAG;AACJ,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ;AAC3B,EAAE,EAAE;AACJ,CAAC,SAAS,CAAC,mBAAmB,CAAC,OAAO,EAAE;AACxC;AACA,CAAC,GAAG;AACJ,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM;AACnC,EAAE,EAAE;AACJ,CAAC,QAAQ,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAC,CAAC;AACpC,EAAE,EAAE,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,EAAE,GAAG,OAAO,GAAG,CAAC,CAAC;AAC1D,GAAG,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,UAAU,EAAE,QAAQ,GAAG;AACvD,GAAG,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,UAAU,EAAE,QAAQ,GAAG;AACzD,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AACV,GAAG,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,IAAI,GAAG;AACzD,GAAG,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,IAAI,GAAG;AAC3D,EAAE,CAAC;AACH,CAAC,CAAC;AACF;AACA,CAAC,GAAG;AACJ,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM;AAChC,EAAE,EAAE;AACJ,CAAC,QAAQ,CAAC,qBAAqB,CAAC,EAAE,CAAC,CAAC,CAAC;AACrC,EAAE,EAAE,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,EAAE,GAAG,OAAO,GAAG,CAAC,CAAC;AACvD,GAAG,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,UAAU,EAAE,QAAQ,GAAG;AAC7D,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AACV,GAAG,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,IAAI,GAAG;AAC/D,EAAE,CAAC;AACH,CAAC,CAAC;AACF;AACA,CAAC,GAAG;AACJ,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM;AACrC,EAAE,EAAE;AACJ,CAAC,QAAQ,CAAC,qBAAqB,CAAC,EAAE,CAAC,CAAC,CAAC;AACrC,EAAE,EAAE,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,eAAe,GAAG,EAAE,GAAG,OAAO,GAAG,CAAC,CAAC;AAChE,GAAG,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,GAAG,UAAU,EAAE,QAAQ,GAAG;AAC/D,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AACV,GAAG,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,GAAG,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,IAAI,GAAG;AACjE,EAAE,CAAC;AACH,CAAC,CAAC;AACF;AACA,CAAC,GAAG;AACJ,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,MAAM;AAC1C,EAAE,EAAE;AACJ,CAAC,QAAQ,CAAC,0BAA0B,CAAC,EAAE,CAAC,CAAC,CAAC;AAC1C,EAAE,EAAE,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,oBAAoB,GAAG,EAAE,GAAG,OAAO,GAAG,CAAC,CAAC;AACrE,GAAG,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,gBAAgB,GAAG,UAAU,EAAE,QAAQ,GAAG;AACpE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AACV,GAAG,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,gBAAgB,GAAG,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,IAAI,GAAG;AACtE,EAAE,CAAC;AACH,CAAC,CAAC;AACF;AACA,IAAI,GAAG;AACP,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;AACjC,KAAK,EAAE;AACP,IAAI,QAAQ,CAAC,yBAAyB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAC9C,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC;AAC7F,QAAQ,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACtE,YAAY,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,GAAG;AACpE,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC;AAChB,YAAY,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,GAAG;AACpE,QAAQ,CAAC;AACT,IAAI,CAAC;AACL;AACA,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK;AAClB,CAAC,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC;AAC1B,EAAE,MAAM,EAAE,KAAK,CAAC,KAAK,GAAG,IAAI,GAAG;AAC/B,EAAE,MAAM,EAAE,KAAK,CAAC,KAAK,GAAG,IAAI,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE;AAC/C,CAAC,CAAC;AACF,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI;AAC9B,CAAC,YAAY,GAAG;AAChB;AACA,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ;AAC3B,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AAC3C,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE;AAC3B,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,GAAG;AACrB,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE;AACzC;AACA,EAAE,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,GAAG,OAAO,GAAG,CAAC,CAAC;AAC7B,GAAG,YAAY,GAAG;AAClB,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,GAAG;AACvB,EAAE,CAAC;AACH,CAAC,GAAG;AACJ;AACA,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM;AACpB,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AAC3D,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM;AAChC,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,GAAG,cAAc,EAAE;AAC1D,GAAG,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AACzB,EAAE,GAAG;AACL;AACA,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AAC5D,GAAG,oBAAoB,CAAC,KAAK,EAAE;AAC/B,EAAE,GAAG;AACL;AACA,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACzD,GAAG,qBAAqB,CAAC,KAAK,EAAE;AAChC,EAAE,GAAG;AACL;AACA,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,eAAe,GAAG,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AAClE,GAAG,qBAAqB,CAAC,KAAK,EAAE;AAChC,EAAE,GAAG;AACL;AACA,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,oBAAoB,GAAG,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACvE,GAAG,0BAA0B,CAAC,KAAK,EAAE;AACrC,EAAE,GAAG;AACL;AACA,EAAE,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AAC/D,GAAG,yBAAyB,CAAC,CAAC,KAAK,CAAC,EAAE;AACtC,EAAE,GAAG;AACL,CAAC,GAAG;AACJ;AACA,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AAC9D,EAAE,MAAM,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,IAAI,GAAG;AAC7D,EAAE,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,UAAU,EAAE,QAAQ,GAAG;AAC3H,CAAC,CAAC,CAAC,EAAE;AACL;AACA,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM;AACxB,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,EAAE,SAAS,KAAK,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACvD,EAAE,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,GAAG;AACzC,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;AAChB,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,kBAAkB,EAAE;AACjC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,gBAAgB,EAAE;AAClC;AACA,EAAE,EAAE,CAAC,CAAC,aAAa,CAAC,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;AAC3C,GAAG,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,aAAa,GAAG,IAAI,EAAE;AAC1D,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AACV,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,QAAQ,EAAE,KAAK,GAAG,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,KAAK,GAAG,IAAI,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,QAAQ;AAClI,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;AACjB,GAAG,CAAC;AACJ,EAAE,CAAC;AACH;AACA,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AACd,GAAG,EAAE,CAAC,CAAC,aAAa,CAAC,EAAE,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC;AAChD,IAAI,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,aAAa,EAAE;AACnD,GAAG,CAAC;AACJ;AACA,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,GAAG;AACvC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AACV,GAAG,EAAE,CAAC,CAAC,aAAa,CAAC,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;AAC3C,IAAI,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,aAAa,EAAE;AAChD,GAAG,CAAC;AACJ;AACA,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,GAAG;AAChC,EAAE,CAAC;AACH;AACA,EAAE,MAAM,CAAC,KAAK,CAAC;AACf,CAAC,GAAG;AACJ;AACA,CAAC,GAAG;AACJ,EAAE,CAAC,CAAC,UAAU,CAAC,SAAS;AACxB,EAAE,EAAE;AACJ,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;AACnC,EAAE,MAAM,CAAC,IAAI,CAAC;AACd,CAAC,EAAE;AACH;AACA,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AAC1C,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,QAAQ,GAAG,IAAI,GAAG,OAAO,CAAC,QAAQ,IAAI,GAAG,GAAG,CAAC,CAAC;AAC1F,GAAG,MAAM,CAAC,IAAI,CAAC;AACf,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AACV,GAAG,MAAM,CAAC,KAAK,CAAC;AAChB,EAAE,CAAC;AACH,CAAC,EAAE;AACH;AACA,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AACtC,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,QAAQ,EAAE,KAAK,GAAG,IAAI,EAAE,QAAQ,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACrF,GAAG,MAAM,CAAC,IAAI,CAAC;AACf,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AACV,GAAG,MAAM,CAAC,KAAK,CAAC;AAChB,EAAE,CAAC;AACH,CAAC,EAAE;AACH;AACA,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;AACvC,EAAE,EAAE,CAAC,CAAC,MAAM,GAAG,iBAAiB,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAClD,GAAG,MAAM,CAAC,IAAI,CAAC;AACf,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AACV,GAAG,MAAM,CAAC,KAAK,CAAC;AAChB,EAAE,CAAC;AACH,CAAC,EAAE;AACH,GAAG;AACH;AACA,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;AAC7B,CAAC,MAAM,GAAG,EAAE,CAAC,QAAQ,CAAC,GAAG,GAAG,IAAI,GAAG;AACnC;AACA,CAAC,MAAM,GAAG,uBAAuB,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,kBAAkB,GAAG,UAAU,EAAE,QAAQ,GAAG;AAC3G,CAAC,MAAM,GAAG,wBAAwB,GAAG,UAAU,EAAE,QAAQ,GAAG;AAC5D;AACA,CAAC,EAAE,CAAC,MAAM,CAAC,OAAO;AAClB,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,EAAE,wBAAwB,KAAK,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;AACrE,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,GAAG,CAAC,CAAC;AACrC,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO;AACnB,GAAG,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,GAAG;AACrC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AACV,GAAG,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,GAAG;AACrC,EAAE,CAAC;AACH,CAAC,GAAG;AACJ;AACA,CAAC,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO;AAC7B,CAAC,MAAM,CAAC,IAAI,GAAG,IAAI,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AAC/D,EAAE,MAAM,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;AAC1E,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,GAAG,OAAO,GAAG,CAAC,CAAC;AACpC,IAAI,MAAM,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,UAAU,EAAE,QAAQ,GAAG;AAC5E,IAAI,MAAM,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,UAAU,EAAE,QAAQ,GAAG;AAC/E,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC;AACX,IAAI,MAAM,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,IAAI,GAAG;AAC9E,IAAI,MAAM,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,IAAI,GAAG;AACjF,GAAG,CAAC;AACJ,EAAE,GAAG;AACL,CAAC,GAAG;AACJ,EAAE;AACF;AACA,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC,CAAC,QAAQ,CAAC,OAAO,EAAE;AACpB,EAAE,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;AACvB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,GAAG;AACrC,EAAE,EAAE;AACJ,EAAE,QAAQ,CAAC,CAAC,CAAC;AACb,GAAG,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,EAAE;AACpB,GAAG,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE;AAC1B,GAAG,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC;AACvB,EAAE,EAAE;AACJ,EAAE,IAAI,CAAC,CAAC,CAAC;AACT,GAAG,QAAQ,CAAC,CAAC,GAAG;AAChB,EAAE,EAAE;AACJ,EAAE,IAAI,CAAC,CAAC,CAAC;AACT,GAAG,QAAQ,CAAC,CAAC,GAAG;AAChB,EAAE,CAAC;AACH,CAAC,GAAG;AACJ,EAAE","file":"bulk-delete.js","sourcesContent":["/*global BulkWP, postboxes, pagenow*/\njQuery(document).ready(function () {\n\t/**\n\t * Enable select2\n\t */\n\tjQuery( '.select2' ).select2();\n\n\t// Start Jetpack.\n\tBulkWP.jetpack();\n\n\tBulkWP.enableHelpTooltips( jQuery( '.bd-help' ) );\n\n\tjQuery( '.user_restrict_to_no_posts_filter' ).change( function() {\n\t\tvar $this = jQuery(this),\n\t\t\tfilterEnabled = $this.is( ':checked' ),\n\t\t $filterItems = $this.parents( 'table' ).children().find( '.user_restrict_to_no_posts_filter_items' );\n\n\t\tif ( filterEnabled ) {\n\t\t\t$filterItems.removeClass( 'visually-hidden' );\n\t\t} else {\n\t\t\t$filterItems.addClass( 'visually-hidden' );\n\t\t}\n\t} );\n\n\t/**\n\t * Enable Postbox handling\n\t */\n\tpostboxes.add_postbox_toggles(pagenow);\n\n\t/**\n\t * Toggle the date restrict fields\n\t */\n\tfunction toggle_date_restrict(el) {\n\t\tif (jQuery(\"#smbd\" + el + \"_restrict\").is(\":checked\")) {\n\t\t\tjQuery(\"#smbd\" + el + \"_op\").removeAttr('disabled');\n\t\t\tjQuery(\"#smbd\" + el + \"_days\").removeAttr('disabled');\n\t\t} else {\n\t\t\tjQuery(\"#smbd\" + el + \"_op\").attr('disabled', 'true');\n\t\t\tjQuery(\"#smbd\" + el + \"_days\").attr('disabled', 'true');\n\t\t}\n\t}\n\n\t/**\n\t * Toggle limit restrict fields\n\t */\n\tfunction toggle_limit_restrict(el) {\n\t\tif (jQuery(\"#smbd\" + el + \"_limit\").is(\":checked\")) {\n\t\t\tjQuery(\"#smbd\" + el + \"_limit_to\").removeAttr('disabled');\n\t\t} else {\n\t\t\tjQuery(\"#smbd\" + el + \"_limit_to\").attr('disabled', 'true');\n\t\t}\n\t}\n\n\t/**\n\t * Toggle user login restrict fields\n\t */\n\tfunction toggle_login_restrict(el) {\n\t\tif (jQuery(\"#smbd\" + el + \"_login_restrict\").is(\":checked\")) {\n\t\t\tjQuery(\"#smbd\" + el + \"_login_days\").removeAttr('disabled');\n\t\t} else {\n\t\t\tjQuery(\"#smbd\" + el + \"_login_days\").attr('disabled', 'true');\n\t\t}\n\t}\n\n\t/**\n\t * Toggle user registered restrict fields\n\t */\n\tfunction toggle_registered_restrict(el) {\n\t\tif (jQuery(\"#smbd\" + el + \"_registered_restrict\").is(\":checked\")) {\n\t\t\tjQuery(\"#smbd\" + el + \"_registered_days\").removeAttr('disabled');\n\t\t} else {\n\t\t\tjQuery(\"#smbd\" + el + \"_registered_days\").attr('disabled', 'true');\n\t\t}\n\t}\n\n /**\n * Toggle Post type dropdown.\n */\n function toggle_post_type_dropdown( el ) {\n // TODO: Check why the element is not toggling even when display:none is added by JS.\n if ( jQuery( \"#smbd\" + el + \"_no_posts\" ).is( \":checked\" ) ) {\n jQuery( \"tr#smbd\" + el + \"-post-type-dropdown\" ).show();\n } else {\n jQuery( \"tr#smbd\" + el + \"-post-type-dropdown\" ).hide();\n }\n }\n\n\t// hide all terms\n\tfunction hideAllTerms() {\n\t\tjQuery('table.terms').hide();\n\t\tjQuery('input.terms').attr('checked', false);\n\t}\n\t// call it for the first time\n\thideAllTerms();\n\n\t// taxonomy click handling\n\tjQuery('.custom-tax').change(function () {\n\t\tvar $this = jQuery(this),\n\t\t$tax = $this.val(),\n\t\t$terms = jQuery('table.terms_' + $tax);\n\n\t\tif ($this.is(':checked')) {\n\t\t\thideAllTerms();\n\t\t\t$terms.show('slow');\n\t\t}\n\t});\n\n\t// date time picker\n\tjQuery.each(BulkWP.dt_iterators, function (index, value) {\n\t\t// invoke the date time picker\n\t\tjQuery('#smbd' + value + '_cron_start').datetimepicker({\n\t\t\ttimeFormat: 'HH:mm:ss'\n\t\t});\n\n\t\tjQuery('#smbd' + value + '_restrict').change(function () {\n\t\t\ttoggle_date_restrict(value);\n\t\t});\n\n\t\tjQuery('#smbd' + value + '_limit').change(function () {\n\t\t\ttoggle_limit_restrict(value);\n\t\t});\n\n\t\tjQuery('#smbd' + value + '_login_restrict').change(function () {\n\t\t\ttoggle_login_restrict(value);\n\t\t});\n\n\t\tjQuery('#smbd' + value + '_registered_restrict').change(function () {\n\t\t\ttoggle_registered_restrict(value);\n\t\t});\n\n\t\tjQuery( '#smbd' + value + '_no_posts' ).change( function () {\n\t\t\ttoggle_post_type_dropdown( value );\n\t\t});\n\t});\n\n\tjQuery.each( BulkWP.pro_iterators, function ( index, value) {\n\t\tjQuery('.bd-' + value.replace( '_', '-' ) + '-pro').hide();\n\t\tjQuery('#smbd_' + value + '_cron_freq, #smbd_' + value + '_cron_start, #smbd_' + value + '_cron').removeAttr('disabled');\n\t} );\n\n\t// Validate user action\n\tjQuery('button[name=\"bd_action\"]').click(function () {\n\t\tvar currentButton = jQuery(this).val(),\n\t\tvalid = false,\n\t\tmsg_key = \"deletePostsWarning\",\n\t\t\terror_key = \"selectPostOption\";\n\n\t\tif (currentButton in BulkWP.validators) {\n\t\t\tvalid = BulkWP[BulkWP.validators[currentButton]](this);\n\t\t} else {\n\t\t\tif (jQuery(this).parent().prev().children('table').find(\":checkbox:checked[value!='true']\").size() > 0) { // monstrous selector\n\t\t\t\tvalid = true;\n\t\t\t}\n\t\t}\n\n\t\tif (valid) {\n\t\t\tif (currentButton in BulkWP.pre_action_msg) {\n\t\t\t\tmsg_key = BulkWP.pre_action_msg[currentButton];\n\t\t\t}\n\n\t\t\treturn confirm(BulkWP.msg[msg_key]);\n\t\t} else {\n\t\t\tif (currentButton in BulkWP.error_msg) {\n\t\t\t\terror_key = BulkWP.error_msg[currentButton];\n\t\t\t}\n\n\t\t\talert(BulkWP.msg[error_key]);\n\t\t}\n\n\t\treturn false;\n\t});\n\n\t/**\n\t * Validation functions\n\t */\n\tBulkWP.noValidation = function() {\n\t\treturn true;\n\t};\n\n\tBulkWP.validateSelect2 = function(that) {\n\t\tif (null !== jQuery(that).parent().prev().children().find(\".select2[multiple]\").val()) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t};\n\n\tBulkWP.validateUrl = function(that) {\n\t\tif (jQuery(that).parent().prev().children('table').find(\"textarea\").val() !== '') {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t};\n\n\tBulkWP.validateUserMeta = function() {\n\t\tif (jQuery('#smbd_u_meta_value').val() !== '') {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t};\n});\n\nBulkWP.jetpack = function() {\n\tjQuery('.bd-feedback-pro').hide();\n\n\tjQuery('#smbd_feedback_cron_freq, #smbd_feedback_cron_start, #smbd_feedback_cron').removeAttr('disabled');\n\tjQuery('#smbd_feedback_use_filter').removeAttr('disabled');\n\n\t// enable filters\n\tjQuery('input[name=\"smbd_feedback_use_filter\"]').change(function() {\n\t\tif('true' === jQuery(this).val()) {\n\t\t\t// using filters\n\t\t\tjQuery('#jetpack-filters').show();\n\t\t} else {\n\t\t\tjQuery('#jetpack-filters').hide();\n\t\t}\n\t});\n\n\t// enable individual filters\n\tjQuery.each(['name', 'email', 'ip'], function (index, value) {\n\t\tjQuery('#smbd_feedback_author_' + value + '_filter').change(function() {\n\t\t\tif(jQuery(this).is(':checked')) {\n\t\t\t\tjQuery('#smbd_feedback_author_' + value + '_op').removeAttr('disabled');\n\t\t\t\tjQuery('#smbd_feedback_author_' + value + '_value').removeAttr('disabled');\n\t\t\t} else {\n\t\t\t\tjQuery('#smbd_feedback_author_' + value + '_op').attr('disabled', 'true');\n\t\t\t\tjQuery('#smbd_feedback_author_' + value + '_value').attr('disabled', 'true');\n\t\t\t}\n\t\t});\n\t});\n};\n\nBulkWP.enableHelpTooltips = function ( $selector ) {\n\t$selector.tooltip({\n\t\tcontent: function() {\n\t\t\treturn jQuery(this).prop('title');\n\t\t},\n\t\tposition: {\n\t\t\tmy: 'center top',\n\t\t\tat: 'center bottom+10',\n\t\t\tcollision: 'flipfit'\n\t\t},\n\t\thide: {\n\t\t\tduration: 200\n\t\t},\n\t\tshow: {\n\t\t\tduration: 200\n\t\t}\n\t});\n};\n"]}
|
1 |
+
{"version":3,"sources":["src/bulk-delete-post-meta.js","src/bulk-delete.js","src/delete-jetpack-messages.js","src/delete-posts-by-comments.js","src/delete-posts-by-post-type.js","src/delete-posts-by-sticky-post.js","src/delete-posts-by-url.js","src/delete-terms.js","src/delete-users.js","src/select2.js","src/tooltips.js","src/validation-helpers.js"],"names":[],"mappings":";;;AAAA,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE;AAC3B,MAAM,CAAC,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACvC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,2BAA2B,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AAC5E,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;AAC1C,GAAG,MAAM,CAAC,CAAC,EAAE,yBAAyB,CAAC,CAAC,EAAE,IAAI,GAAG;AACjD,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AACV,GAAG,MAAM,CAAC,CAAC,EAAE,yBAAyB,CAAC,CAAC,EAAE,IAAI,GAAG;AACjD,EAAE,CAAC;AACH,CAAC,CAAC,CAAC,EAAE;AACL,CAAC,CAAC,EAAE;;ACTJ,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,EAAE;AACtC,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACpC,CAAC,MAAM,CAAC,CAAC,EAAE,gCAAgC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;AACnE,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE;AAC3B,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE;AAC1C,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC,CAAC,EAAE,sCAAsC,CAAC,CAAC,EAAE;AAC3G;AACA,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;AACxB,GAAG,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE;AACjD,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AACV,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE;AAC9C,EAAE,CAAC;AACH,CAAC,CAAC,CAAC,EAAE;AACL;AACA,CAAC,GAAG;AACJ,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ;AAC3B,EAAE,EAAE;AACJ,CAAC,SAAS,CAAC,mBAAmB,CAAC,OAAO,EAAE;AACxC;AACA,CAAC,GAAG;AACJ,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM;AACnC,EAAE,EAAE;AACJ,CAAC,QAAQ,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAC,CAAC;AACpC,EAAE,EAAE,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,EAAE,GAAG,OAAO,GAAG,CAAC,CAAC;AAC1D,GAAG,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,UAAU,EAAE,QAAQ,GAAG;AACvD,GAAG,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,UAAU,EAAE,QAAQ,GAAG;AACzD,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AACV,GAAG,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,IAAI,GAAG;AACzD,GAAG,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,IAAI,GAAG;AAC3D,EAAE,CAAC;AACH,CAAC,CAAC;AACF;AACA,CAAC,GAAG;AACJ,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM;AAChC,EAAE,EAAE;AACJ,CAAC,QAAQ,CAAC,qBAAqB,CAAC,EAAE,CAAC,CAAC,CAAC;AACrC,EAAE,EAAE,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,EAAE,GAAG,OAAO,GAAG,CAAC,CAAC;AACvD,GAAG,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,UAAU,EAAE,QAAQ,GAAG;AAC7D,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AACV,GAAG,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,IAAI,GAAG;AAC/D,EAAE,CAAC;AACH,CAAC,CAAC;AACF;AACA,CAAC,GAAG;AACJ,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM;AACrC,EAAE,EAAE;AACJ,CAAC,QAAQ,CAAC,qBAAqB,CAAC,EAAE,CAAC,CAAC,CAAC;AACrC,EAAE,EAAE,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,eAAe,GAAG,EAAE,GAAG,OAAO,GAAG,CAAC,CAAC;AAChE,GAAG,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,GAAG,UAAU,EAAE,QAAQ,GAAG;AAC/D,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AACV,GAAG,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,GAAG,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,IAAI,GAAG;AACjE,EAAE,CAAC;AACH,CAAC,CAAC;AACF;AACA,CAAC,GAAG;AACJ,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,MAAM;AAC1C,EAAE,EAAE;AACJ,CAAC,QAAQ,CAAC,0BAA0B,CAAC,EAAE,CAAC,CAAC,CAAC;AAC1C,EAAE,EAAE,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,oBAAoB,GAAG,EAAE,GAAG,OAAO,GAAG,CAAC,CAAC;AACrE,GAAG,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,gBAAgB,GAAG,UAAU,EAAE,QAAQ,GAAG;AACpE,GAAG,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,UAAU,EAAE,QAAQ,GAAG;AACvD,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AACV,GAAG,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,gBAAgB,GAAG,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,IAAI,GAAG;AACtE,GAAG,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,IAAI,GAAG;AACzD,EAAE,CAAC;AACH,CAAC,CAAC;AACF;AACA,CAAC,GAAG;AACJ,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW;AAC7B,EAAE,EAAE;AACJ,CAAC,QAAQ,CAAC,yBAAyB,CAAC,EAAE,CAAC,CAAC,CAAC;AACzC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,aAAa,GAAG,OAAO,GAAG,GAAG,GAAG,CAAC,CAAC;AACtF,GAAG,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,GAAG,UAAU,EAAE,QAAQ,GAAG;AAC/D,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AACV,GAAG,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,GAAG,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,IAAI,GAAG;AACjE,EAAE,CAAC;AACH,CAAC,CAAC;AACF;AACA,IAAI,GAAG;AACP,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;AACjC,KAAK,EAAE;AACP,IAAI,QAAQ,CAAC,yBAAyB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAC9C,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC;AAC7F,QAAQ,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACtE,YAAY,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,GAAG;AACpE,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC;AAChB,YAAY,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,GAAG;AACpE,QAAQ,CAAC;AACT,IAAI,CAAC;AACL;AACA,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK;AAClB,CAAC,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC;AAC1B,EAAE,MAAM,EAAE,KAAK,CAAC,KAAK,GAAG,IAAI,GAAG;AAC/B,EAAE,MAAM,EAAE,KAAK,CAAC,KAAK,GAAG,IAAI,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE;AAC/C,CAAC,CAAC;AACF,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI;AAC9B,CAAC,YAAY,GAAG;AAChB;AACA,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ;AAC3B,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AAC3C,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE;AAC3B,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,GAAG;AACrB,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE;AACzC;AACA,EAAE,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,GAAG,OAAO,GAAG,CAAC,CAAC;AAC7B,GAAG,YAAY,GAAG;AAClB,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,GAAG;AACvB,EAAE,CAAC;AACH,CAAC,GAAG;AACJ;AACA,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM;AACpB,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AAC3D,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM;AAChC,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,GAAG,cAAc,EAAE;AAC1D,GAAG,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE;AAC1B,GAAG,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AACzB,EAAE,GAAG;AACL;AACA,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AAC5D,GAAG,oBAAoB,CAAC,KAAK,EAAE;AAC/B,EAAE,GAAG;AACL;AACA,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACzD,GAAG,qBAAqB,CAAC,KAAK,EAAE;AAChC,EAAE,GAAG;AACL;AACA,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,eAAe,GAAG,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AAClE,GAAG,qBAAqB,CAAC,KAAK,EAAE;AAChC,EAAE,GAAG;AACL;AACA,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,oBAAoB,GAAG,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACvE,GAAG,0BAA0B,CAAC,KAAK,EAAE;AACrC,EAAE,GAAG;AACL;AACA,EAAE,MAAM,EAAE,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,aAAa,KAAK,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AAC7E,GAAG,yBAAyB,CAAC,KAAK,EAAE;AACpC,EAAE,GAAG;AACL;AACA,EAAE,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AAC/D,GAAG,yBAAyB,CAAC,CAAC,KAAK,CAAC,EAAE;AACtC,EAAE,GAAG;AACL,CAAC,GAAG;AACJ;AACA,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AAC9D,EAAE,MAAM,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,IAAI,GAAG;AAC7D;AACA,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC;AAC7E,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,IAAI,GAAG;AAC/D;AACA,EAAE,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,UAAU,EAAE,QAAQ,GAAG;AAC3H,CAAC,CAAC,CAAC,EAAE;AACL;AACA,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC;AACzB,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,EAAE,SAAS,KAAK,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACvD,EAAE,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,GAAG;AACzC,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;AACjB,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,kBAAkB,EAAE;AAClC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,gBAAgB,EAAE;AAClC;AACA,EAAE,EAAE,CAAC,CAAC,aAAa,CAAC,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;AAC3C,GAAG,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,aAAa,GAAG,IAAI,EAAE;AAC1D,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AACV,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,QAAQ,EAAE,KAAK,GAAG,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,KAAK,GAAG,IAAI,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,QAAQ;AAClI,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;AACjB,GAAG,CAAC;AACJ,EAAE,CAAC;AACH;AACA,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AACd,GAAG,EAAE,CAAC,CAAC,aAAa,CAAC,EAAE,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC;AAChD,IAAI,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClF,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE;AACxE,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;AACZ,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,aAAa,CAAC,EAAE;AACtD,IAAI,CAAC;AACL,GAAG,CAAC;AACJ;AACA,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,GAAG;AACvC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AACV,GAAG,EAAE,CAAC,CAAC,aAAa,CAAC,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;AAC3C,IAAI,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,aAAa,EAAE;AAChD,GAAG,CAAC;AACJ;AACA,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,GAAG;AAChC,EAAE,CAAC;AACH;AACA,EAAE,MAAM,CAAC,KAAK,CAAC;AACf,CAAC,GAAG;AACJ;AACA,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AAC1C,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,QAAQ,GAAG,IAAI,GAAG,OAAO,CAAC,QAAQ,CAAC,QAAQ,IAAI,GAAG,GAAG,CAAC,CAAC;AACnG,GAAG,MAAM,CAAC,IAAI,CAAC;AACf,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AACV,GAAG,MAAM,CAAC,KAAK,CAAC;AAChB,EAAE,CAAC;AACH,CAAC,EAAE;AACH,GAAG;;ACnMH,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE;AACzB,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACpC,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC;AAClB,CAAC,MAAM,CAAC,OAAO,GAAG;AAClB,GAAG;AACH;AACA,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;AAC7B,CAAC,MAAM,GAAG,EAAE,CAAC,QAAQ,CAAC,GAAG,GAAG,IAAI,GAAG;AACnC;AACA,CAAC,MAAM,GAAG,uBAAuB,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,kBAAkB,GAAG,UAAU,EAAE,QAAQ,GAAG;AAC3G,CAAC,MAAM,GAAG,wBAAwB,GAAG,UAAU,EAAE,QAAQ,GAAG;AAC5D;AACA,CAAC,EAAE,CAAC,MAAM,CAAC,OAAO;AAClB,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,EAAE,wBAAwB,KAAK,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;AACrE,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,GAAG,CAAC,CAAC;AACrC,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO;AACnB,GAAG,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,GAAG;AACrC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AACV,GAAG,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,GAAG;AACrC,EAAE,CAAC;AACH,CAAC,GAAG;AACJ;AACA,CAAC,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO;AAC7B,CAAC,MAAM,CAAC,IAAI,GAAG,IAAI,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AAC/D,EAAE,MAAM,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;AAC1E,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,GAAG,OAAO,GAAG,CAAC,CAAC;AACpC,IAAI,MAAM,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,UAAU,EAAE,QAAQ,GAAG;AAC5E,IAAI,MAAM,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,UAAU,EAAE,QAAQ,GAAG;AAC/E,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC;AACX,IAAI,MAAM,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,IAAI,GAAG;AAC9E,IAAI,MAAM,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,IAAI,GAAG;AACjF,GAAG,CAAC;AACJ,EAAE,GAAG;AACL,CAAC,GAAG;AACJ,EAAE;;AClCF,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE;AACzB,MAAM,CAAC,qBAAqB,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AAC/C,IAAI,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,QAAQ,GAAG,IAAI,GAAG,KAAK,CAAC,kBAAkB,GAAG,GAAG,IAAI;AACpG,EAAE;;ACHF,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE;AACnB;AACA,GAAG;AACH,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;AACpC,CAAC,EAAE;AACH,MAAM,CAAC,uBAAuB,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AACjD,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,QAAQ,GAAG,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,GAAG,GAAG,CAAC,CAAC;AACjH,EAAE,MAAM,CAAC,IAAI,CAAC;AACd,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AACT,EAAE,MAAM,CAAC,KAAK,CAAC;AACf,CAAC,CAAC;AACF,EAAE;;ACXF,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE;AAClB,MAAM,CAAC,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACvC,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,8BAA8B,GAAG,CAAC,EAAE;AAC7E,EAAE,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,GAAG;AACrD,EAAE,iBAAiB,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,GAAG,IAAI,EAAE,KAAK,KAAK;AAC1D,EAAE,sBAAsB,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,GAAG;AAC/C,EAAE,wBAAwB,CAAC,CAAC,CAAC,sBAAsB,CAAC,IAAI,GAAG,IAAI,EAAE,QAAQ,KAAK;AAC9E,EAAE,kBAAkB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,gBAAgB,KAAK,CAAC,EAAE;AACpE,EAAE,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,2BAA2B,GAAG,CAAC,EAAE;AACzE;AACA,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE;AAC9C,CAAC,YAAY,CAAC,IAAI,GAAG;AACrB,CAAC,sBAAsB,CAAC,IAAI,GAAG;AAC/B;AACA,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACnC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;AAC/D,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE;AAC9C,GAAG,YAAY,CAAC,IAAI,GAAG;AACvB,GAAG,sBAAsB,CAAC,IAAI,GAAG;AACjC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AACV,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE;AAChD,GAAG,YAAY,CAAC,IAAI,GAAG;AACvB,GAAG,sBAAsB,CAAC,IAAI,GAAG;AACjC,EAAE,CAAC;AACH,CAAC,CAAC,CAAC,EAAE;AACL;AACA,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACxC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,iBAAiB,CAAC,MAAM,GAAG,OAAO,GAAG,GAAG,EAAE,CAAC,EAAE;AAC9D,GAAG,wBAAwB,CAAC,UAAU,EAAE,QAAQ,GAAG;AACnD,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AACV,GAAG,wBAAwB,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,IAAI,GAAG;AACrD,EAAE,CAAC;AACH,CAAC,GAAG;AACJ;AACA,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,EAAE,GAAG,KAAK,MAAM,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACnD,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;AACrC,GAAG,gCAAgC,GAAG;AACtC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AACV,GAAG,gBAAgB,GAAG;AACtB,EAAE,CAAC;AACH,CAAC,GAAG;AACJ;AACA,CAAC,QAAQ,CAAC,gCAAgC,EAAE,CAAC,CAAC;AAC9C,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;AACvC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE;AACvC,IAAI,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE;AACxC,IAAI,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,IAAI,GAAG;AAC1C,GAAG,CAAC;AACJ,EAAE,GAAG;AACL,CAAC,CAAC;AACF;AACA,CAAC,QAAQ,CAAC,gBAAgB,EAAE,CAAC,CAAC;AAC9B,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;AACvC,GAAG,MAAM,CAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,GAAG;AACvC,EAAE,GAAG;AACL,CAAC,CAAC;AACF,CAAC,CAAC,EAAE;AACJ;AACA,GAAG;AACH,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC;AAChD,CAAC,CAAC;AACF,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC;AAC9E,CAAC,EAAE;AACH,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACzC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,gBAAgB,KAAK,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACxE,EAAE;AACF;AACA,MAAM,CAAC,gCAAgC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACvD,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,8BAA8B,GAAG,OAAO,CAAC,CAAC,EAAE,GAAG,GAAG;AAC3F;AACA,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;AACrC,EAAE,MAAM,CAAC,CAAC,oBAAoB,EAAE;AAChC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AACT,EAAE,MAAM,CAAC,CAAC,kBAAkB,EAAE;AAC9B,CAAC,CAAC;AACF,EAAE;;AC3EF,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE;AACzB,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AACrC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,QAAQ,EAAE,KAAK,GAAG,IAAI,EAAE,QAAQ,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACvF,QAAQ,MAAM,CAAC,IAAI,CAAC;AACpB,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;AACZ,QAAQ,MAAM,CAAC,KAAK,CAAC;AACrB,IAAI,CAAC;AACL,EAAE;;ACPF,MAAM,CAAC,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACvC,CAAC,MAAM,CAAC,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;AAC/C,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;AAChB,CAAC,CAAC,CAAC,EAAE;AACL,CAAC,CAAC,EAAE;AACJ;AACA,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE;AAClB;AACA,GAAG;AACH,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC;AAC7C,CAAC,CAAC;AACF,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC;AACtE,CAAC,EAAE;AACH,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;AACtC,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,EAAE,wBAAwB,KAAK,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI;AACxE,EAAE;AACF;AACA,GAAG;AACH,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC;AAC9C,CAAC,CAAC;AACF,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC;AACvE,CAAC,EAAE;AACH,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;AACvC,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,EAAE,wBAAwB,KAAK,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI;AACxE,EAAE;;ACxBF,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE;AACzB,MAAM,CAAC,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACvC,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE;AACtD,EAAE,mBAAmB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE;AACnD;AACA,CAAC,mBAAmB,CAAC,OAAO,CAAC;AAC7B,EAAE,CAAC;AACH,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;AACjB,EAAE,CAAC;AACH,CAAC,EAAE;AACH;AACA,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACxC,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE;AAC5C,CAAC,CAAC,CAAC,EAAE;AACL;AACA,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AAC1C,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE;AAClF;AACA,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;AAC1C,GAAG,iBAAiB,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE;AAC9C,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AACV,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE;AAChD,EAAE,CAAC;AACH,CAAC,CAAC,CAAC,EAAE;AACL,CAAC,CAAC,EAAE;AACJ;AACA,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACvC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,iBAAiB,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI;AACtD,EAAE;AACF;AACA,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAC7C,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,IAAI;AAC1F,EAAE;;AChCF,EAAE,MAAM,CAAC,OAAO,EAAE;AAClB,MAAM,CAAC,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACvC,CAAC,GAAG;AACJ,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC;AACnB,EAAE,EAAE;AACJ,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;AACtF,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;AAChB,CAAC,CAAC,CAAC,EAAE;AACL;AACA,CAAC,GAAG;AACJ,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC;AACzC,EAAE,CAAC;AACH,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC;AAC7E,EAAE,EAAE;AACJ,CAAC,MAAM,CAAC,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;AACxD,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE;AACjB,EAAE,iBAAiB,CAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AACvC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AACtB,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC;AACtB,GAAG,CAAC;AACJ;AACA,GAAG,MAAM,CAAC,MAAM,CAAC;AACjB,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE;AAC/E,GAAG,EAAE;AACL,EAAE,CAAC;AACH,CAAC,GAAG;AACJ;AACA,CAAC,GAAG;AACJ,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC;AACrC,EAAE,EAAE;AACJ,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;AAC9C,EAAE,IAAI,CAAC,CAAC,CAAC;AACT,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC;AAChB,GAAG,QAAQ,CAAC,CAAC,CAAC,IAAI,EAAE;AACpB,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC;AACd,GAAG,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAC9B,IAAI,MAAM,CAAC,CAAC;AACZ,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC;AACpB,KAAK,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE;AACtD,KAAK,MAAM,CAAC,CAAC,CAAC,qBAAqB,CAAC;AACpC,IAAI,EAAE;AACN,GAAG,EAAE;AACL,GAAG,cAAc,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACtC,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG;AACrB;AACA,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjB,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AACtD,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;AACjE,KAAK,CAAC,CAAC,EAAE;AACT,IAAI,CAAC;AACL;AACA,IAAI,MAAM,CAAC,CAAC;AACZ,KAAK,OAAO,CAAC,CAAC,OAAO;AACrB,IAAI,EAAE;AACN,GAAG,EAAE;AACL,GAAG,KAAK,CAAC,CAAC,IAAI;AACd,EAAE,EAAE;AACJ,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM;AACnF,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;AAChB,CAAC,CAAC,CAAC,EAAE;AACL,CAAC,CAAC,EAAE;;AC5DJ,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE;AACzB,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACpC,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE;AACnD,GAAG;AACH;AACA,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC,CAAC,QAAQ,CAAC,OAAO,EAAE;AACpB,EAAE,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;AACvB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,GAAG;AACrC,EAAE,EAAE;AACJ,EAAE,QAAQ,CAAC,CAAC,CAAC;AACb,GAAG,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,EAAE;AACpB,GAAG,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE;AAC1B,GAAG,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC;AACvB,EAAE,EAAE;AACJ,EAAE,IAAI,CAAC,CAAC,CAAC;AACT,GAAG,QAAQ,CAAC,CAAC,GAAG;AAChB,EAAE,EAAE;AACJ,EAAE,IAAI,CAAC,CAAC,CAAC;AACT,GAAG,QAAQ,CAAC,CAAC,GAAG;AAChB,EAAE,CAAC;AACH,CAAC,GAAG;AACJ,EAAE;;ACtBF,EAAE,MAAM,CAAC,MAAM,EAAE;AACjB;AACA,GAAG;AACH,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC;AAChC,CAAC,CAAC;AACF,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC;AAC1C,CAAC,EAAE;AACH,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;AAClC,CAAC,MAAM,CAAC,IAAI,CAAC;AACb,EAAE;AACF;AACA,GAAG;AACH,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,SAAS,CAAC;AAC/B,CAAC,CAAC;AACF,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC;AACvC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC;AACnE,CAAC,EAAE;AACH,MAAM,CAAC,wBAAwB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACrD,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,QAAQ,GAAG,IAAI,CAAC,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,GAAG;AAC1F;AACA,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;AAC7C,EAAE","file":"bulk-delete.js","sourcesContent":["/*global jQuery, document*/\njQuery( document ).ready( function () {\n\tjQuery( 'input[name=\"smbd_comment_meta_use_value\"]' ).change( function () {\n\t\tif ( 'true' === jQuery( this ).val() ) {\n\t\t\tjQuery( '#smbd_comment_meta_filters' ).show();\n\t\t} else {\n\t\t\tjQuery( '#smbd_comment_meta_filters' ).hide();\n\t\t}\n\t} );\n} );\n","/*global BulkWP, postboxes, pagenow */\njQuery(document).ready(function () {\n\tjQuery( '.user_restrict_to_no_posts_filter' ).change( function() {\n\t\tvar $this = jQuery(this),\n\t\t\tfilterEnabled = $this.is( ':checked' ),\n\t\t $filterItems = $this.parents( 'table' ).children().find( '.user_restrict_to_no_posts_filter_items' );\n\n\t\tif ( filterEnabled ) {\n\t\t\t$filterItems.removeClass( 'visually-hidden' );\n\t\t} else {\n\t\t\t$filterItems.addClass( 'visually-hidden' );\n\t\t}\n\t} );\n\n\t/**\n\t * Enable Postbox handling\n\t */\n\tpostboxes.add_postbox_toggles(pagenow);\n\n\t/**\n\t * Toggle the date restrict fields\n\t */\n\tfunction toggle_date_restrict(el) {\n\t\tif (jQuery(\"#smbd\" + el + \"_restrict\").is(\":checked\")) {\n\t\t\tjQuery(\"#smbd\" + el + \"_op\").removeAttr('disabled');\n\t\t\tjQuery(\"#smbd\" + el + \"_days\").removeAttr('disabled');\n\t\t} else {\n\t\t\tjQuery(\"#smbd\" + el + \"_op\").attr('disabled', 'true');\n\t\t\tjQuery(\"#smbd\" + el + \"_days\").attr('disabled', 'true');\n\t\t}\n\t}\n\n\t/**\n\t * Toggle limit restrict fields\n\t */\n\tfunction toggle_limit_restrict(el) {\n\t\tif (jQuery(\"#smbd\" + el + \"_limit\").is(\":checked\")) {\n\t\t\tjQuery(\"#smbd\" + el + \"_limit_to\").removeAttr('disabled');\n\t\t} else {\n\t\t\tjQuery(\"#smbd\" + el + \"_limit_to\").attr('disabled', 'true');\n\t\t}\n\t}\n\n\t/**\n\t * Toggle user login restrict fields\n\t */\n\tfunction toggle_login_restrict(el) {\n\t\tif (jQuery(\"#smbd\" + el + \"_login_restrict\").is(\":checked\")) {\n\t\t\tjQuery(\"#smbd\" + el + \"_login_days\").removeAttr('disabled');\n\t\t} else {\n\t\t\tjQuery(\"#smbd\" + el + \"_login_days\").attr('disabled', 'true');\n\t\t}\n\t}\n\n\t/**\n\t * Toggle user registered restrict fields\n\t */\n\tfunction toggle_registered_restrict(el) {\n\t\tif (jQuery(\"#smbd\" + el + \"_registered_restrict\").is(\":checked\")) {\n\t\t\tjQuery(\"#smbd\" + el + \"_registered_days\").removeAttr('disabled');\n\t\t\tjQuery(\"#smbd\" + el + \"_op\").removeAttr('disabled');\n\t\t} else {\n\t\t\tjQuery(\"#smbd\" + el + \"_registered_days\").attr('disabled', 'true');\n\t\t\tjQuery(\"#smbd\" + el + \"_op\").attr('disabled', 'true');\n\t\t}\n\t}\n\n\t/**\n\t * Toggle delete attachments\n\t */\n\tfunction toggle_delete_attachments(el) {\n\t\tif ( \"true\" === jQuery('input[name=\"smbd' + el + '_force_delete\"]:checked').val()) {\n\t\t\tjQuery(\"#smbd\" + el + \"_attachment\").removeAttr('disabled');\n\t\t} else {\n\t\t\tjQuery(\"#smbd\" + el + \"_attachment\").attr('disabled', 'true');\n\t\t}\n\t}\n\n /**\n * Toggle Post type dropdown.\n */\n function toggle_post_type_dropdown( el ) {\n // TODO: Check why the element is not toggling even when display:none is added by JS.\n if ( jQuery( \"#smbd\" + el + \"_no_posts\" ).is( \":checked\" ) ) {\n jQuery( \"tr#smbd\" + el + \"-post-type-dropdown\" ).show();\n } else {\n jQuery( \"tr#smbd\" + el + \"-post-type-dropdown\" ).hide();\n }\n }\n\n\t// hide all terms\n\tfunction hideAllTerms() {\n\t\tjQuery('table.terms').hide();\n\t\tjQuery('input.terms').attr('checked', false);\n\t}\n\t// call it for the first time\n\thideAllTerms();\n\n\t// taxonomy click handling\n\tjQuery('.custom-tax').change(function () {\n\t\tvar $this = jQuery(this),\n\t\t$tax = $this.val(),\n\t\t$terms = jQuery('table.terms_' + $tax);\n\n\t\tif ($this.is(':checked')) {\n\t\t\thideAllTerms();\n\t\t\t$terms.show('slow');\n\t\t}\n\t});\n\n\t// date time picker\n\tjQuery.each(BulkWP.dt_iterators, function (index, value) {\n\t\t// invoke the date time picker\n\t\tjQuery('#smbd' + value + '_cron_start').datetimepicker({\n\t\t\tdateFormat: 'yy-mm-dd',\n\t\t\ttimeFormat: 'HH:mm:ss'\n\t\t});\n\n\t\tjQuery('#smbd' + value + '_restrict').change(function () {\n\t\t\ttoggle_date_restrict(value);\n\t\t});\n\n\t\tjQuery('#smbd' + value + '_limit').change(function () {\n\t\t\ttoggle_limit_restrict(value);\n\t\t});\n\n\t\tjQuery('#smbd' + value + '_login_restrict').change(function () {\n\t\t\ttoggle_login_restrict(value);\n\t\t});\n\n\t\tjQuery('#smbd' + value + '_registered_restrict').change(function () {\n\t\t\ttoggle_registered_restrict(value);\n\t\t});\n\n\t\tjQuery('input[name=\"smbd' + value + '_force_delete\"]').change(function () {\n\t\t\ttoggle_delete_attachments(value);\n\t\t});\n\n\t\tjQuery( '#smbd' + value + '_no_posts' ).change( function () {\n\t\t\ttoggle_post_type_dropdown( value );\n\t\t});\n\t});\n\n\tjQuery.each( BulkWP.pro_iterators, function ( index, value) {\n\t\tjQuery('.bd-' + value.replace( '_', '-' ) + '-pro').hide();\n\n\t\t// `<tr>` displays the documentation link when the pro add-on is installed.\n\t\tjQuery('tr.bd-' + value.replace( '_', '-' ) + '-pro').show();\n\n\t\tjQuery('#smbd_' + value + '_cron_freq, #smbd_' + value + '_cron_start, #smbd_' + value + '_cron').removeAttr('disabled');\n\t} );\n\n\t// Validate user action.\n\tjQuery('button[name=\"bd_action\"]').click(function () {\n\t\tvar currentButton = jQuery(this).val(),\n\t\t\tvalid = false,\n\t\t\tmsg_key = \"deletePostsWarning\",\n\t\t\terror_key = \"selectPostOption\";\n\n\t\tif (currentButton in BulkWP.validators) {\n\t\t\tvalid = BulkWP[BulkWP.validators[currentButton]](this);\n\t\t} else {\n\t\t\tif (jQuery(this).parent().prev().children('table').find(\":checkbox:checked[value!='true']\").size() > 0) { // monstrous selector\n\t\t\t\tvalid = true;\n\t\t\t}\n\t\t}\n\n\t\tif (valid) {\n\t\t\tif (currentButton in BulkWP.pre_action_msg) {\n\t\t\t\tif ( jQuery.isFunction( BulkWP[ BulkWP.pre_action_msg[ currentButton ] ] ) ) {\n\t\t\t\t\tmsg_key = BulkWP[ BulkWP.pre_action_msg[ currentButton ] ]( this );\n\t\t\t\t} else {\n\t\t\t\t\tmsg_key = BulkWP.pre_action_msg[ currentButton ];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn confirm(BulkWP.msg[msg_key]);\n\t\t} else {\n\t\t\tif (currentButton in BulkWP.error_msg) {\n\t\t\t\terror_key = BulkWP.error_msg[currentButton];\n\t\t\t}\n\n\t\t\talert(BulkWP.msg[error_key]);\n\t\t}\n\n\t\treturn false;\n\t});\n\n\tBulkWP.validateSelect2 = function(that) {\n\t\tif (null !== jQuery(that).parent().prev().children().find(\".select2-taxonomy[multiple]\").val()) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t};\n});\n","/*global jQuery, BulkWP*/\njQuery(document).ready(function () {\n\t// Start Jetpack.\n\tBulkWP.jetpack();\n});\n\nBulkWP.jetpack = function() {\n\tjQuery('.bd-feedback-pro').hide();\n\n\tjQuery('#smbd_feedback_cron_freq, #smbd_feedback_cron_start, #smbd_feedback_cron').removeAttr('disabled');\n\tjQuery('#smbd_feedback_use_filter').removeAttr('disabled');\n\n\t// enable filters\n\tjQuery('input[name=\"smbd_feedback_use_filter\"]').change(function() {\n\t\tif('true' === jQuery(this).val()) {\n\t\t\t// using filters\n\t\t\tjQuery('#jetpack-filters').show();\n\t\t} else {\n\t\t\tjQuery('#jetpack-filters').hide();\n\t\t}\n\t});\n\n\t// enable individual filters\n\tjQuery.each(['name', 'email', 'ip'], function (index, value) {\n\t\tjQuery('#smbd_feedback_author_' + value + '_filter').change(function() {\n\t\t\tif(jQuery(this).is(':checked')) {\n\t\t\t\tjQuery('#smbd_feedback_author_' + value + '_op').removeAttr('disabled');\n\t\t\t\tjQuery('#smbd_feedback_author_' + value + '_value').removeAttr('disabled');\n\t\t\t} else {\n\t\t\t\tjQuery('#smbd_feedback_author_' + value + '_op').attr('disabled', 'true');\n\t\t\t\tjQuery('#smbd_feedback_author_' + value + '_value').attr('disabled', 'true');\n\t\t\t}\n\t\t});\n\t});\n};\n","/*global jQuery, BulkWP*/\nBulkWP.validateCommentsCount = function(that) {\n return (\"\" !== jQuery(that).parent().prev().children().find(\":input.comments_count_num\").val());\n};\n","/* global BulkWP */\n\n/**\n * Validation for Post Type select2.\n */\nBulkWP.validatePostTypeSelect2 = function(that) {\n\tif (null !== jQuery(that).parent().prev().children().find(\".enhanced-post-types-with-status[multiple]\").val()) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n};\n","/*global BulkWP */\njQuery( document ).ready( function () {\n\tvar stickyAction = jQuery( \"input[name='smbd_sticky_post_sticky_action']\" ),\n\t\tdeleteAction = stickyAction.parents( 'tr' ).next(),\n\t\tdeleteActionRadio = deleteAction.find('[type=\"radio\"]'),\n\t\tdeleteAttachmentAction = deleteAction.next(),\n\t\tdeleteAttachmentCheckBox = deleteAttachmentAction.find('[type=\"checkbox\"]'),\n\t\tstickyPostCheckbox = jQuery( \"input[name='smbd_sticky_post[]']\" ),\n\t\tdeleteButton = jQuery( \"button[value='delete_posts_by_sticky_post']\" );\n\n\tdeleteButton.html( 'Remove Sticky »' );\n\tdeleteAction.hide();\n\tdeleteAttachmentAction.hide();\n\n\tstickyAction.change( function () {\n\t\tif ( 'delete' === stickyAction.filter( ':checked' ).val() ) {\n\t\t\tdeleteButton.html( 'Bulk Delete »' );\n\t\t\tdeleteAction.show();\n\t\t\tdeleteAttachmentAction.show();\n\t\t} else {\n\t\t\tdeleteButton.html( 'Remove Sticky »' );\n\t\t\tdeleteAction.hide();\n\t\t\tdeleteAttachmentAction.hide();\n\t\t}\n\t} );\n\n\tdeleteActionRadio.change( function () {\n\t\tif( \"true\" === deleteActionRadio.filter(':checked').val() ){\n\t\t\tdeleteAttachmentCheckBox.removeAttr('disabled');\n\t\t} else {\n\t\t\tdeleteAttachmentCheckBox.attr('disabled', 'true');\n\t\t}\n\t});\n\n\tjQuery(\"input[value='all']\").change( function () {\n\t\tif( jQuery(this).is(':checked') ) {\n\t\t\tuncheckAndDisableOtherCheckboxes();\n\t\t} else {\n\t\t\tenableCheckboxes();\n\t\t}\n\t});\n\n\tfunction uncheckAndDisableOtherCheckboxes() {\n\t\tstickyPostCheckbox.each( function() {\n\t\t\tif ( 'all' !== jQuery(this).val() ){\n\t\t\t\tjQuery(this).prop('checked', false);\n\t\t\t\tjQuery(this).attr('disabled', 'true');\n\t\t\t}\n\t\t});\n\t}\n\n\tfunction enableCheckboxes() {\n\t\tstickyPostCheckbox.each( function() {\n\t\t\tjQuery(this).removeAttr('disabled');\n\t\t});\n\t}\n} );\n\n/**\n * Validate that at least one post was selected.\n *\n * @returns {boolean} True if at least one post was selected, False otherwise.\n */\nBulkWP.validateStickyPost = function () {\n\treturn jQuery( \"input[name='smbd_sticky_post[]']:checked\" ).length > 0;\n};\n\nBulkWP.DeletePostsByStickyPostPreAction = function () {\n\tvar stickyAction = jQuery( \"input[name='smbd_sticky_post_sticky_action']:checked\" ).val();\n\n\tif ( 'unsticky' === stickyAction ) {\n\t\treturn 'unstickyPostsWarning';\n\t} else {\n\t\treturn 'deletePostsWarning';\n\t}\n};\n","/*global jQuery, BulkWP*/\nBulkWP.validateUrl = function(that) {\n if (jQuery(that).parent().prev().children('table').find(\"textarea\").val() !== '') {\n return true;\n } else {\n return false;\n }\n};\n","jQuery( document ).ready( function () {\n\tjQuery( '.enhanced-taxonomy-list' ).select2( {\n\t\twidth: '300px'\n\t} );\n} );\n\n/*global BulkWP */\n\n/**\n * Validate that term name is not left blank.\n *\n * @returns {boolean} True if term name is not blank, False otherwise.\n */\nBulkWP.validateTermName = function() {\n\treturn (jQuery('input[name=\"smbd_terms_by_name_value\"]').val() !== '');\n};\n\n/**\n * Validate that post count is not left blank.\n *\n * @returns {boolean} True if post count is not blank, False otherwise.\n */\nBulkWP.validatePostCount = function() {\n\treturn (jQuery('input[name=\"smbd_terms_by_post_count\"]').val() !== '');\n};\n","/*global jQuery, BulkWP*/\njQuery( document ).ready( function () {\n\tvar reassignSelectBoxes = jQuery( \".reassign-user\" ),\n\t\tcontentDeleteRadios = jQuery( \".post-reassign\" );\n\n\treassignSelectBoxes.select2(\n\t\t{\n\t\t\twidth: '200px'\n\t\t}\n\t);\n\n\treassignSelectBoxes.each( function () {\n\t\tjQuery( this ).attr( 'disabled', 'true' );\n\t} );\n\n\tcontentDeleteRadios.change( function () {\n\t\tvar reassignSelectBox = jQuery( this ).parents( 'tr' ).find( '.reassign-user' );\n\n\t\tif ( \"true\" === jQuery( this ).val() ) {\n\t\t\treassignSelectBox.removeAttr( 'disabled' );\n\t\t} else {\n\t\t\treassignSelectBox.attr( 'disabled', 'true' );\n\t\t}\n\t} );\n} );\n\nBulkWP.validateUserMeta = function () {\n\treturn (jQuery( '#smbd_u_meta_value' ).val() !== '');\n};\n\nBulkWP.validateUserRole = function ( that ) {\n\treturn (null !== jQuery( that ).parent().prev().find( \".enhanced-role-dropdown\" ).val());\n};\n","/*global ajaxurl*/\njQuery( document ).ready( function () {\n\t/**\n\t * Normal select2.\n\t */\n\tjQuery( '.select2-taxonomy, .enhanced-dropdown, .enhanced-role-dropdown' ).select2( {\n\t\twidth: '300px'\n\t} );\n\n\t/**\n\t * Select 2 for posts types with status.\n\t *\n\t * The label of the selected item is modified to include the optgroup label.\n\t */\n\tjQuery( '.enhanced-post-types-with-status' ).select2( {\n\t\twidth: '300px',\n\t\ttemplateSelection: function (state) {\n\t\t\tif ( ! state.id ) {\n\t\t\t\treturn state.text;\n\t\t\t}\n\n\t\t\treturn jQuery(\n\t\t\t\t'<span>' + state.element.parentElement.label + '-' + state.text + '</span>'\n\t\t\t);\n\t\t}\n\t});\n\n\t/**\n\t * Enable AJAX for Taxonomy Select2.\n\t */\n\tjQuery( '.select2-taxonomy-ajax' ).select2( {\n\t\tajax: {\n\t\t\turl: ajaxurl,\n\t\t\tdataType: 'json',\n\t\t\tdelay: 250,\n\t\t\tdata: function ( params ) {\n\t\t\t\treturn {\n\t\t\t\t\tq: params.term,\n\t\t\t\t\ttaxonomy: jQuery( this ).attr( 'data-taxonomy' ),\n\t\t\t\t\taction: 'bd_load_taxonomy_term'\n\t\t\t\t};\n\t\t\t},\n\t\t\tprocessResults: function ( data ) {\n\t\t\t\tvar options = [];\n\n\t\t\t\tif ( data ) {\n\t\t\t\t\tjQuery.each( data, function ( index, dataPair ) {\n\t\t\t\t\t\toptions.push( { id: dataPair[ 0 ], text: dataPair[ 1 ] } );\n\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\tresults: options\n\t\t\t\t};\n\t\t\t},\n\t\t\tcache: true\n\t\t},\n\t\tminimumInputLength: 2, // the minimum of symbols to input before perform a search\n\t\twidth: '300px'\n\t} );\n} );\n","/*global jQuery, BulkWP*/\njQuery(document).ready(function () {\n\tBulkWP.enableHelpTooltips( jQuery( '.bd-help' ) );\n});\n\nBulkWP.enableHelpTooltips = function ( $selector ) {\n\t$selector.tooltip({\n\t\tcontent: function() {\n\t\t\treturn jQuery(this).prop('title');\n\t\t},\n\t\tposition: {\n\t\t\tmy: 'center top',\n\t\t\tat: 'center bottom+10',\n\t\t\tcollision: 'flipfit'\n\t\t},\n\t\thide: {\n\t\t\tduration: 200\n\t\t},\n\t\tshow: {\n\t\t\tduration: 200\n\t\t}\n\t});\n};\n","/*global BulkWP*/\n\n/**\n * No need to validate anything.\n *\n * @returns {boolean} Returns true always.\n */\nBulkWP.noValidation = function() {\n\treturn true;\n};\n\n/**\n * Validate enhanced dropdowns.\n *\n * @param that Reference to the button.\n * @returns {boolean} True if validation succeeds, False otherwise.\n */\nBulkWP.validateEnhancedDropdown = function ( that ) {\n\tvar value = jQuery( that ).parent().prev().children().find( \".enhanced-dropdown\" ).val();\n\n\treturn ( value !== null && value !== '-1' );\n};\n"]}
|
assets/js/bulk-delete.min.js
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
-
/*! Bulk Delete -
|
2 |
* https://bulkwp.com
|
3 |
-
* Copyright (c)
|
4 |
-
|
|
1 |
+
/*! Bulk Delete - v6.0.0
|
2 |
* https://bulkwp.com
|
3 |
+
* Copyright (c) 2019; * Licensed GPLv2+ */
|
4 |
+
|
5 |
+
jQuery(document).ready(function(){jQuery('input[name="smbd_comment_meta_use_value"]').change(function(){"true"===jQuery(this).val()?jQuery("#smbd_comment_meta_filters").show():jQuery("#smbd_comment_meta_filters").hide()})}),jQuery(document).ready(function(){function n(){jQuery("table.terms").hide(),jQuery("input.terms").attr("checked",!1)}jQuery(".user_restrict_to_no_posts_filter").change(function(){var e=jQuery(this),t=e.is(":checked"),r=e.parents("table").children().find(".user_restrict_to_no_posts_filter_items");t?r.removeClass("visually-hidden"):r.addClass("visually-hidden")}),postboxes.add_postbox_toggles(pagenow),n(),jQuery(".custom-tax").change(function(){var e=jQuery(this),t=e.val(),r=jQuery("table.terms_"+t);e.is(":checked")&&(n(),r.show("slow"))}),jQuery.each(BulkWP.dt_iterators,function(e,t){jQuery("#smbd"+t+"_cron_start").datetimepicker({dateFormat:"yy-mm-dd",timeFormat:"HH:mm:ss"}),jQuery("#smbd"+t+"_restrict").change(function(){var e;e=t,jQuery("#smbd"+e+"_restrict").is(":checked")?(jQuery("#smbd"+e+"_op").removeAttr("disabled"),jQuery("#smbd"+e+"_days").removeAttr("disabled")):(jQuery("#smbd"+e+"_op").attr("disabled","true"),jQuery("#smbd"+e+"_days").attr("disabled","true"))}),jQuery("#smbd"+t+"_limit").change(function(){var e;e=t,jQuery("#smbd"+e+"_limit").is(":checked")?jQuery("#smbd"+e+"_limit_to").removeAttr("disabled"):jQuery("#smbd"+e+"_limit_to").attr("disabled","true")}),jQuery("#smbd"+t+"_login_restrict").change(function(){var e;e=t,jQuery("#smbd"+e+"_login_restrict").is(":checked")?jQuery("#smbd"+e+"_login_days").removeAttr("disabled"):jQuery("#smbd"+e+"_login_days").attr("disabled","true")}),jQuery("#smbd"+t+"_registered_restrict").change(function(){var e;e=t,jQuery("#smbd"+e+"_registered_restrict").is(":checked")?(jQuery("#smbd"+e+"_registered_days").removeAttr("disabled"),jQuery("#smbd"+e+"_op").removeAttr("disabled")):(jQuery("#smbd"+e+"_registered_days").attr("disabled","true"),jQuery("#smbd"+e+"_op").attr("disabled","true"))}),jQuery('input[name="smbd'+t+'_force_delete"]').change(function(){var e;e=t,"true"===jQuery('input[name="smbd'+e+'_force_delete"]:checked').val()?jQuery("#smbd"+e+"_attachment").removeAttr("disabled"):jQuery("#smbd"+e+"_attachment").attr("disabled","true")}),jQuery("#smbd"+t+"_no_posts").change(function(){var e;e=t,jQuery("#smbd"+e+"_no_posts").is(":checked")?jQuery("tr#smbd"+e+"-post-type-dropdown").show():jQuery("tr#smbd"+e+"-post-type-dropdown").hide()})}),jQuery.each(BulkWP.pro_iterators,function(e,t){jQuery(".bd-"+t.replace("_","-")+"-pro").hide(),jQuery("tr.bd-"+t.replace("_","-")+"-pro").show(),jQuery("#smbd_"+t+"_cron_freq, #smbd_"+t+"_cron_start, #smbd_"+t+"_cron").removeAttr("disabled")}),jQuery('button[name="bd_action"]').click(function(){var e=jQuery(this).val(),t=!1,r="deletePostsWarning",n="selectPostOption";return e in BulkWP.validators?t=BulkWP[BulkWP.validators[e]](this):0<jQuery(this).parent().prev().children("table").find(":checkbox:checked[value!='true']").size()&&(t=!0),t?(e in BulkWP.pre_action_msg&&(r=jQuery.isFunction(BulkWP[BulkWP.pre_action_msg[e]])?BulkWP[BulkWP.pre_action_msg[e]](this):BulkWP.pre_action_msg[e]),confirm(BulkWP.msg[r])):(e in BulkWP.error_msg&&(n=BulkWP.error_msg[e]),alert(BulkWP.msg[n]),!1)}),BulkWP.validateSelect2=function(e){return null!==jQuery(e).parent().prev().children().find(".select2-taxonomy[multiple]").val()}}),jQuery(document).ready(function(){BulkWP.jetpack()}),BulkWP.jetpack=function(){jQuery(".bd-feedback-pro").hide(),jQuery("#smbd_feedback_cron_freq, #smbd_feedback_cron_start, #smbd_feedback_cron").removeAttr("disabled"),jQuery("#smbd_feedback_use_filter").removeAttr("disabled"),jQuery('input[name="smbd_feedback_use_filter"]').change(function(){"true"===jQuery(this).val()?jQuery("#jetpack-filters").show():jQuery("#jetpack-filters").hide()}),jQuery.each(["name","email","ip"],function(e,t){jQuery("#smbd_feedback_author_"+t+"_filter").change(function(){jQuery(this).is(":checked")?(jQuery("#smbd_feedback_author_"+t+"_op").removeAttr("disabled"),jQuery("#smbd_feedback_author_"+t+"_value").removeAttr("disabled")):(jQuery("#smbd_feedback_author_"+t+"_op").attr("disabled","true"),jQuery("#smbd_feedback_author_"+t+"_value").attr("disabled","true"))})})},BulkWP.validateCommentsCount=function(e){return""!==jQuery(e).parent().prev().children().find(":input.comments_count_num").val()},BulkWP.validatePostTypeSelect2=function(e){return null!==jQuery(e).parent().prev().children().find(".enhanced-post-types-with-status[multiple]").val()},jQuery(document).ready(function(){var e=jQuery("input[name='smbd_sticky_post_sticky_action']"),t=e.parents("tr").next(),r=t.find('[type="radio"]'),n=t.next(),u=n.find('[type="checkbox"]'),a=jQuery("input[name='smbd_sticky_post[]']"),i=jQuery("button[value='delete_posts_by_sticky_post']");i.html("Remove Sticky »"),t.hide(),n.hide(),e.change(function(){"delete"===e.filter(":checked").val()?(i.html("Bulk Delete »"),t.show(),n.show()):(i.html("Remove Sticky »"),t.hide(),n.hide())}),r.change(function(){"true"===r.filter(":checked").val()?u.removeAttr("disabled"):u.attr("disabled","true")}),jQuery("input[value='all']").change(function(){jQuery(this).is(":checked")?a.each(function(){"all"!==jQuery(this).val()&&(jQuery(this).prop("checked",!1),jQuery(this).attr("disabled","true"))}):a.each(function(){jQuery(this).removeAttr("disabled")})})}),BulkWP.validateStickyPost=function(){return 0<jQuery("input[name='smbd_sticky_post[]']:checked").length},BulkWP.DeletePostsByStickyPostPreAction=function(){return"unsticky"===jQuery("input[name='smbd_sticky_post_sticky_action']:checked").val()?"unstickyPostsWarning":"deletePostsWarning"},BulkWP.validateUrl=function(e){return""!==jQuery(e).parent().prev().children("table").find("textarea").val()},jQuery(document).ready(function(){jQuery(".enhanced-taxonomy-list").select2({width:"300px"})}),BulkWP.validateTermName=function(){return""!==jQuery('input[name="smbd_terms_by_name_value"]').val()},BulkWP.validatePostCount=function(){return""!==jQuery('input[name="smbd_terms_by_post_count"]').val()},jQuery(document).ready(function(){var e=jQuery(".reassign-user"),t=jQuery(".post-reassign");e.select2({width:"200px"}),e.each(function(){jQuery(this).attr("disabled","true")}),t.change(function(){var e=jQuery(this).parents("tr").find(".reassign-user");"true"===jQuery(this).val()?e.removeAttr("disabled"):e.attr("disabled","true")})}),BulkWP.validateUserMeta=function(){return""!==jQuery("#smbd_u_meta_value").val()},BulkWP.validateUserRole=function(e){return null!==jQuery(e).parent().prev().find(".enhanced-role-dropdown").val()},jQuery(document).ready(function(){jQuery(".select2-taxonomy, .enhanced-dropdown, .enhanced-role-dropdown").select2({width:"300px"}),jQuery(".enhanced-post-types-with-status").select2({width:"300px",templateSelection:function(e){return e.id?jQuery("<span>"+e.element.parentElement.label+"-"+e.text+"</span>"):e.text}}),jQuery(".select2-taxonomy-ajax").select2({ajax:{url:ajaxurl,dataType:"json",delay:250,data:function(e){return{q:e.term,taxonomy:jQuery(this).attr("data-taxonomy"),action:"bd_load_taxonomy_term"}},processResults:function(e){var r=[];return e&&jQuery.each(e,function(e,t){r.push({id:t[0],text:t[1]})}),{results:r}},cache:!0},minimumInputLength:2,width:"300px"})}),jQuery(document).ready(function(){BulkWP.enableHelpTooltips(jQuery(".bd-help"))}),BulkWP.enableHelpTooltips=function(e){e.tooltip({content:function(){return jQuery(this).prop("title")},position:{my:"center top",at:"center bottom+10",collision:"flipfit"},hide:{duration:200},show:{duration:200}})},BulkWP.noValidation=function(){return!0},BulkWP.validateEnhancedDropdown=function(e){var t=jQuery(e).parent().prev().children().find(".enhanced-dropdown").val();return null!==t&&"-1"!==t};
|
assets/js/jquery-ui-timepicker-addon.min.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
-
/*! jQuery Timepicker Addon - v1.
|
2 |
* http://trentrichardson.com/examples/timepicker
|
3 |
-
* Copyright (c)
|
4 |
-
!function(a){"function"==typeof define&&define.amd?define(["jquery","jquery.ui"],a):a(jQuery)}(function($){if($.ui.timepicker=$.ui.timepicker||{},!$.ui.timepicker.version){$.extend($.ui,{timepicker:{version:"1.5.4"}});var Timepicker=function(){this.regional=[],this.regional[""]={currentText:"Now",closeText:"Done",amNames:["AM","A"],pmNames:["PM","P"],timeFormat:"HH:mm",timeSuffix:"",timeOnlyTitle:"Choose Time",timeText:"Time",hourText:"Hour",minuteText:"Minute",secondText:"Second",millisecText:"Millisecond",microsecText:"Microsecond",timezoneText:"Time Zone",isRTL:!1},this._defaults={showButtonPanel:!0,timeOnly:!1,timeOnlyShowDate:!1,showHour:null,showMinute:null,showSecond:null,showMillisec:null,showMicrosec:null,showTimezone:null,showTime:!0,stepHour:1,stepMinute:1,stepSecond:1,stepMillisec:1,stepMicrosec:1,hour:0,minute:0,second:0,millisec:0,microsec:0,timezone:null,hourMin:0,minuteMin:0,secondMin:0,millisecMin:0,microsecMin:0,hourMax:23,minuteMax:59,secondMax:59,millisecMax:999,microsecMax:999,minDateTime:null,maxDateTime:null,maxTime:null,minTime:null,onSelect:null,hourGrid:0,minuteGrid:0,secondGrid:0,millisecGrid:0,microsecGrid:0,alwaysSetTime:!0,separator:" ",altFieldTimeOnly:!0,altTimeFormat:null,altSeparator:null,altTimeSuffix:null,altRedirectFocus:!0,pickerTimeFormat:null,pickerTimeSuffix:null,showTimepicker:!0,timezoneList:null,addSliderAccess:!1,sliderAccessArgs:null,controlType:"slider",oneLine:!1,defaultValue:null,parse:"strict",afterInject:null},$.extend(this._defaults,this.regional[""])};$.extend(Timepicker.prototype,{$input:null,$altInput:null,$timeObj:null,inst:null,hour_slider:null,minute_slider:null,second_slider:null,millisec_slider:null,microsec_slider:null,timezone_select:null,maxTime:null,minTime:null,hour:0,minute:0,second:0,millisec:0,microsec:0,timezone:null,hourMinOriginal:null,minuteMinOriginal:null,secondMinOriginal:null,millisecMinOriginal:null,microsecMinOriginal:null,hourMaxOriginal:null,minuteMaxOriginal:null,secondMaxOriginal:null,millisecMaxOriginal:null,microsecMaxOriginal:null,ampm:"",formattedDate:"",formattedTime:"",formattedDateTime:"",timezoneList:null,units:["hour","minute","second","millisec","microsec"],support:{},control:null,setDefaults:function(a){return extendRemove(this._defaults,a||{}),this},_newInst:function($input,opts){var tp_inst=new Timepicker,inlineSettings={},fns={},overrides,i;for(var attrName in this._defaults)if(this._defaults.hasOwnProperty(attrName)){var attrValue=$input.attr("time:"+attrName);if(attrValue)try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}overrides={beforeShow:function(a,b){return $.isFunction(tp_inst._defaults.evnts.beforeShow)?tp_inst._defaults.evnts.beforeShow.call($input[0],a,b,tp_inst):void 0},onChangeMonthYear:function(a,b,c){$.isFunction(tp_inst._defaults.evnts.onChangeMonthYear)&&tp_inst._defaults.evnts.onChangeMonthYear.call($input[0],a,b,c,tp_inst)},onClose:function(a,b){tp_inst.timeDefined===!0&&""!==$input.val()&&tp_inst._updateDateTime(b),$.isFunction(tp_inst._defaults.evnts.onClose)&&tp_inst._defaults.evnts.onClose.call($input[0],a,b,tp_inst)}};for(i in overrides)overrides.hasOwnProperty(i)&&(fns[i]=opts[i]||this._defaults[i]||null);tp_inst._defaults=$.extend({},this._defaults,inlineSettings,opts,overrides,{evnts:fns,timepicker:tp_inst}),tp_inst.amNames=$.map(tp_inst._defaults.amNames,function(a){return a.toUpperCase()}),tp_inst.pmNames=$.map(tp_inst._defaults.pmNames,function(a){return a.toUpperCase()}),tp_inst.support=detectSupport(tp_inst._defaults.timeFormat+(tp_inst._defaults.pickerTimeFormat?tp_inst._defaults.pickerTimeFormat:"")+(tp_inst._defaults.altTimeFormat?tp_inst._defaults.altTimeFormat:"")),"string"==typeof tp_inst._defaults.controlType?("slider"===tp_inst._defaults.controlType&&"undefined"==typeof $.ui.slider&&(tp_inst._defaults.controlType="select"),tp_inst.control=tp_inst._controls[tp_inst._defaults.controlType]):tp_inst.control=tp_inst._defaults.controlType;var timezoneList=[-720,-660,-600,-570,-540,-480,-420,-360,-300,-270,-240,-210,-180,-120,-60,0,60,120,180,210,240,270,300,330,345,360,390,420,480,525,540,570,600,630,660,690,720,765,780,840];null!==tp_inst._defaults.timezoneList&&(timezoneList=tp_inst._defaults.timezoneList);var tzl=timezoneList.length,tzi=0,tzv=null;if(tzl>0&&"object"!=typeof timezoneList[0])for(;tzl>tzi;tzi++)tzv=timezoneList[tzi],timezoneList[tzi]={value:tzv,label:$.timepicker.timezoneOffsetString(tzv,tp_inst.support.iso8601)};return tp_inst._defaults.timezoneList=timezoneList,tp_inst.timezone=null!==tp_inst._defaults.timezone?$.timepicker.timezoneOffsetNumber(tp_inst._defaults.timezone):-1*(new Date).getTimezoneOffset(),tp_inst.hour=tp_inst._defaults.hour<tp_inst._defaults.hourMin?tp_inst._defaults.hourMin:tp_inst._defaults.hour>tp_inst._defaults.hourMax?tp_inst._defaults.hourMax:tp_inst._defaults.hour,tp_inst.minute=tp_inst._defaults.minute<tp_inst._defaults.minuteMin?tp_inst._defaults.minuteMin:tp_inst._defaults.minute>tp_inst._defaults.minuteMax?tp_inst._defaults.minuteMax:tp_inst._defaults.minute,tp_inst.second=tp_inst._defaults.second<tp_inst._defaults.secondMin?tp_inst._defaults.secondMin:tp_inst._defaults.second>tp_inst._defaults.secondMax?tp_inst._defaults.secondMax:tp_inst._defaults.second,tp_inst.millisec=tp_inst._defaults.millisec<tp_inst._defaults.millisecMin?tp_inst._defaults.millisecMin:tp_inst._defaults.millisec>tp_inst._defaults.millisecMax?tp_inst._defaults.millisecMax:tp_inst._defaults.millisec,tp_inst.microsec=tp_inst._defaults.microsec<tp_inst._defaults.microsecMin?tp_inst._defaults.microsecMin:tp_inst._defaults.microsec>tp_inst._defaults.microsecMax?tp_inst._defaults.microsecMax:tp_inst._defaults.microsec,tp_inst.ampm="",tp_inst.$input=$input,tp_inst._defaults.altField&&(tp_inst.$altInput=$(tp_inst._defaults.altField),tp_inst._defaults.altRedirectFocus===!0&&tp_inst.$altInput.css({cursor:"pointer"}).focus(function(){$input.trigger("focus")})),(0===tp_inst._defaults.minDate||0===tp_inst._defaults.minDateTime)&&(tp_inst._defaults.minDate=new Date),(0===tp_inst._defaults.maxDate||0===tp_inst._defaults.maxDateTime)&&(tp_inst._defaults.maxDate=new Date),void 0!==tp_inst._defaults.minDate&&tp_inst._defaults.minDate instanceof Date&&(tp_inst._defaults.minDateTime=new Date(tp_inst._defaults.minDate.getTime())),void 0!==tp_inst._defaults.minDateTime&&tp_inst._defaults.minDateTime instanceof Date&&(tp_inst._defaults.minDate=new Date(tp_inst._defaults.minDateTime.getTime())),void 0!==tp_inst._defaults.maxDate&&tp_inst._defaults.maxDate instanceof Date&&(tp_inst._defaults.maxDateTime=new Date(tp_inst._defaults.maxDate.getTime())),void 0!==tp_inst._defaults.maxDateTime&&tp_inst._defaults.maxDateTime instanceof Date&&(tp_inst._defaults.maxDate=new Date(tp_inst._defaults.maxDateTime.getTime())),tp_inst.$input.bind("focus",function(){tp_inst._onFocus()}),tp_inst},_addTimePicker:function(a){var b=$.trim(this.$altInput&&this._defaults.altFieldTimeOnly?this.$input.val()+" "+this.$altInput.val():this.$input.val());this.timeDefined=this._parseTime(b),this._limitMinMaxDateTime(a,!1),this._injectTimePicker(),this._afterInject()},_parseTime:function(a,b){if(this.inst||(this.inst=$.datepicker._getInst(this.$input[0])),b||!this._defaults.timeOnly){var c=$.datepicker._get(this.inst,"dateFormat");try{var d=parseDateTimeInternal(c,this._defaults.timeFormat,a,$.datepicker._getFormatConfig(this.inst),this._defaults);if(!d.timeObj)return!1;$.extend(this,d.timeObj)}catch(e){return $.timepicker.log("Error parsing the date/time string: "+e+"\ndate/time string = "+a+"\ntimeFormat = "+this._defaults.timeFormat+"\ndateFormat = "+c),!1}return!0}var f=$.datepicker.parseTime(this._defaults.timeFormat,a,this._defaults);return f?($.extend(this,f),!0):!1},_afterInject:function(){var a=this.inst.settings;$.isFunction(a.afterInject)&&a.afterInject.call(this)},_injectTimePicker:function(){var a=this.inst.dpDiv,b=this.inst.settings,c=this,d="",e="",f=null,g={},h={},i=null,j=0,k=0;if(0===a.find("div.ui-timepicker-div").length&&b.showTimepicker){var l=" ui_tpicker_unit_hide",m='<div class="ui-timepicker-div'+(b.isRTL?" ui-timepicker-rtl":"")+(b.oneLine&&"select"===b.controlType?" ui-timepicker-oneLine":"")+'"><dl><dt class="ui_tpicker_time_label'+(b.showTime?"":l)+'">'+b.timeText+'</dt><dd class="ui_tpicker_time '+(b.showTime?"":l)+'"></dd>';for(j=0,k=this.units.length;k>j;j++){if(d=this.units[j],e=d.substr(0,1).toUpperCase()+d.substr(1),f=null!==b["show"+e]?b["show"+e]:this.support[d],g[d]=parseInt(b[d+"Max"]-(b[d+"Max"]-b[d+"Min"])%b["step"+e],10),h[d]=0,m+='<dt class="ui_tpicker_'+d+"_label"+(f?"":l)+'">'+b[d+"Text"]+'</dt><dd class="ui_tpicker_'+d+(f?"":l)+'"><div class="ui_tpicker_'+d+"_slider"+(f?"":l)+'"></div>',f&&b[d+"Grid"]>0){if(m+='<div style="padding-left: 1px"><table class="ui-tpicker-grid-label"><tr>',"hour"===d)for(var n=b[d+"Min"];n<=g[d];n+=parseInt(b[d+"Grid"],10)){h[d]++;var o=$.datepicker.formatTime(this.support.ampm?"hht":"HH",{hour:n},b);m+='<td data-for="'+d+'">'+o+"</td>"}else for(var p=b[d+"Min"];p<=g[d];p+=parseInt(b[d+"Grid"],10))h[d]++,m+='<td data-for="'+d+'">'+(10>p?"0":"")+p+"</td>";m+="</tr></table></div>"}m+="</dd>"}var q=null!==b.showTimezone?b.showTimezone:this.support.timezone;m+='<dt class="ui_tpicker_timezone_label'+(q?"":l)+'">'+b.timezoneText+"</dt>",m+='<dd class="ui_tpicker_timezone'+(q?"":l)+'"></dd>',m+="</dl></div>";var r=$(m);for(b.timeOnly===!0&&(r.prepend('<div class="ui-widget-header ui-helper-clearfix ui-corner-all"><div class="ui-datepicker-title">'+b.timeOnlyTitle+"</div></div>"),a.find(".ui-datepicker-header, .ui-datepicker-calendar").hide()),j=0,k=c.units.length;k>j;j++)d=c.units[j],e=d.substr(0,1).toUpperCase()+d.substr(1),f=null!==b["show"+e]?b["show"+e]:this.support[d],c[d+"_slider"]=c.control.create(c,r.find(".ui_tpicker_"+d+"_slider"),d,c[d],b[d+"Min"],g[d],b["step"+e]),f&&b[d+"Grid"]>0&&(i=100*h[d]*b[d+"Grid"]/(g[d]-b[d+"Min"]),r.find(".ui_tpicker_"+d+" table").css({width:i+"%",marginLeft:b.isRTL?"0":i/(-2*h[d])+"%",marginRight:b.isRTL?i/(-2*h[d])+"%":"0",borderCollapse:"collapse"}).find("td").click(function(a){var b=$(this),e=b.html(),f=parseInt(e.replace(/[^0-9]/g),10),g=e.replace(/[^apm]/gi),h=b.data("for");"hour"===h&&(-1!==g.indexOf("p")&&12>f?f+=12:-1!==g.indexOf("a")&&12===f&&(f=0)),c.control.value(c,c[h+"_slider"],d,f),c._onTimeChange(),c._onSelectHandler()}).css({cursor:"pointer",width:100/h[d]+"%",textAlign:"center",overflow:"hidden"}));if(this.timezone_select=r.find(".ui_tpicker_timezone").append("<select></select>").find("select"),$.fn.append.apply(this.timezone_select,$.map(b.timezoneList,function(a,b){return $("<option />").val("object"==typeof a?a.value:a).text("object"==typeof a?a.label:a)})),"undefined"!=typeof this.timezone&&null!==this.timezone&&""!==this.timezone){var s=-1*new Date(this.inst.selectedYear,this.inst.selectedMonth,this.inst.selectedDay,12).getTimezoneOffset();s===this.timezone?selectLocalTimezone(c):this.timezone_select.val(this.timezone)}else"undefined"!=typeof this.hour&&null!==this.hour&&""!==this.hour?this.timezone_select.val(b.timezone):selectLocalTimezone(c);this.timezone_select.change(function(){c._onTimeChange(),c._onSelectHandler(),c._afterInject()});var t=a.find(".ui-datepicker-buttonpane");if(t.length?t.before(r):a.append(r),this.$timeObj=r.find(".ui_tpicker_time"),null!==this.inst){var u=this.timeDefined;this._onTimeChange(),this.timeDefined=u}if(this._defaults.addSliderAccess){var v=this._defaults.sliderAccessArgs,w=this._defaults.isRTL;v.isRTL=w,setTimeout(function(){if(0===r.find(".ui-slider-access").length){r.find(".ui-slider:visible").sliderAccess(v);var a=r.find(".ui-slider-access:eq(0)").outerWidth(!0);a&&r.find("table:visible").each(function(){var b=$(this),c=b.outerWidth(),d=b.css(w?"marginRight":"marginLeft").toString().replace("%",""),e=c-a,f=d*e/c+"%",g={width:e,marginRight:0,marginLeft:0};g[w?"marginRight":"marginLeft"]=f,b.css(g)})}},10)}c._limitMinMaxDateTime(this.inst,!0)}},_limitMinMaxDateTime:function(a,b){var c=this._defaults,d=new Date(a.selectedYear,a.selectedMonth,a.selectedDay);if(this._defaults.showTimepicker){if(null!==$.datepicker._get(a,"minDateTime")&&void 0!==$.datepicker._get(a,"minDateTime")&&d){var e=$.datepicker._get(a,"minDateTime"),f=new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0,0);(null===this.hourMinOriginal||null===this.minuteMinOriginal||null===this.secondMinOriginal||null===this.millisecMinOriginal||null===this.microsecMinOriginal)&&(this.hourMinOriginal=c.hourMin,this.minuteMinOriginal=c.minuteMin,this.secondMinOriginal=c.secondMin,this.millisecMinOriginal=c.millisecMin,this.microsecMinOriginal=c.microsecMin),a.settings.timeOnly||f.getTime()===d.getTime()?(this._defaults.hourMin=e.getHours(),this.hour<=this._defaults.hourMin?(this.hour=this._defaults.hourMin,this._defaults.minuteMin=e.getMinutes(),this.minute<=this._defaults.minuteMin?(this.minute=this._defaults.minuteMin,this._defaults.secondMin=e.getSeconds(),this.second<=this._defaults.secondMin?(this.second=this._defaults.secondMin,this._defaults.millisecMin=e.getMilliseconds(),this.millisec<=this._defaults.millisecMin?(this.millisec=this._defaults.millisecMin,this._defaults.microsecMin=e.getMicroseconds()):(this.microsec<this._defaults.microsecMin&&(this.microsec=this._defaults.microsecMin),this._defaults.microsecMin=this.microsecMinOriginal)):(this._defaults.millisecMin=this.millisecMinOriginal,this._defaults.microsecMin=this.microsecMinOriginal)):(this._defaults.secondMin=this.secondMinOriginal,this._defaults.millisecMin=this.millisecMinOriginal,this._defaults.microsecMin=this.microsecMinOriginal)):(this._defaults.minuteMin=this.minuteMinOriginal,this._defaults.secondMin=this.secondMinOriginal,this._defaults.millisecMin=this.millisecMinOriginal,this._defaults.microsecMin=this.microsecMinOriginal)):(this._defaults.hourMin=this.hourMinOriginal,this._defaults.minuteMin=this.minuteMinOriginal,this._defaults.secondMin=this.secondMinOriginal,this._defaults.millisecMin=this.millisecMinOriginal,this._defaults.microsecMin=this.microsecMinOriginal)}if(null!==$.datepicker._get(a,"maxDateTime")&&void 0!==$.datepicker._get(a,"maxDateTime")&&d){var g=$.datepicker._get(a,"maxDateTime"),h=new Date(g.getFullYear(),g.getMonth(),g.getDate(),0,0,0,0);(null===this.hourMaxOriginal||null===this.minuteMaxOriginal||null===this.secondMaxOriginal||null===this.millisecMaxOriginal)&&(this.hourMaxOriginal=c.hourMax,this.minuteMaxOriginal=c.minuteMax,this.secondMaxOriginal=c.secondMax,this.millisecMaxOriginal=c.millisecMax,this.microsecMaxOriginal=c.microsecMax),a.settings.timeOnly||h.getTime()===d.getTime()?(this._defaults.hourMax=g.getHours(),this.hour>=this._defaults.hourMax?(this.hour=this._defaults.hourMax,this._defaults.minuteMax=g.getMinutes(),this.minute>=this._defaults.minuteMax?(this.minute=this._defaults.minuteMax,this._defaults.secondMax=g.getSeconds(),this.second>=this._defaults.secondMax?(this.second=this._defaults.secondMax,this._defaults.millisecMax=g.getMilliseconds(),this.millisec>=this._defaults.millisecMax?(this.millisec=this._defaults.millisecMax,this._defaults.microsecMax=g.getMicroseconds()):(this.microsec>this._defaults.microsecMax&&(this.microsec=this._defaults.microsecMax),this._defaults.microsecMax=this.microsecMaxOriginal)):(this._defaults.millisecMax=this.millisecMaxOriginal,this._defaults.microsecMax=this.microsecMaxOriginal)):(this._defaults.secondMax=this.secondMaxOriginal,this._defaults.millisecMax=this.millisecMaxOriginal,this._defaults.microsecMax=this.microsecMaxOriginal)):(this._defaults.minuteMax=this.minuteMaxOriginal,this._defaults.secondMax=this.secondMaxOriginal,this._defaults.millisecMax=this.millisecMaxOriginal,this._defaults.microsecMax=this.microsecMaxOriginal)):(this._defaults.hourMax=this.hourMaxOriginal,this._defaults.minuteMax=this.minuteMaxOriginal,this._defaults.secondMax=this.secondMaxOriginal,this._defaults.millisecMax=this.millisecMaxOriginal,this._defaults.microsecMax=this.microsecMaxOriginal)}if(null!==a.settings.minTime){var i=new Date("01/01/1970 "+a.settings.minTime);this.hour<i.getHours()?(this.hour=this._defaults.hourMin=i.getHours(),this.minute=this._defaults.minuteMin=i.getMinutes()):this.hour===i.getHours()&&this.minute<i.getMinutes()?this.minute=this._defaults.minuteMin=i.getMinutes():this._defaults.hourMin<i.getHours()?(this._defaults.hourMin=i.getHours(),this._defaults.minuteMin=i.getMinutes()):this._defaults.hourMin===i.getHours()===this.hour&&this._defaults.minuteMin<i.getMinutes()?this._defaults.minuteMin=i.getMinutes():this._defaults.minuteMin=0}if(null!==a.settings.maxTime){var j=new Date("01/01/1970 "+a.settings.maxTime);this.hour>j.getHours()?(this.hour=this._defaults.hourMax=j.getHours(),this.minute=this._defaults.minuteMax=j.getMinutes()):this.hour===j.getHours()&&this.minute>j.getMinutes()?this.minute=this._defaults.minuteMax=j.getMinutes():this._defaults.hourMax>j.getHours()?(this._defaults.hourMax=j.getHours(),this._defaults.minuteMax=j.getMinutes()):this._defaults.hourMax===j.getHours()===this.hour&&this._defaults.minuteMax>j.getMinutes()?this._defaults.minuteMax=j.getMinutes():this._defaults.minuteMax=59}if(void 0!==b&&b===!0){var k=parseInt(this._defaults.hourMax-(this._defaults.hourMax-this._defaults.hourMin)%this._defaults.stepHour,10),l=parseInt(this._defaults.minuteMax-(this._defaults.minuteMax-this._defaults.minuteMin)%this._defaults.stepMinute,10),m=parseInt(this._defaults.secondMax-(this._defaults.secondMax-this._defaults.secondMin)%this._defaults.stepSecond,10),n=parseInt(this._defaults.millisecMax-(this._defaults.millisecMax-this._defaults.millisecMin)%this._defaults.stepMillisec,10),o=parseInt(this._defaults.microsecMax-(this._defaults.microsecMax-this._defaults.microsecMin)%this._defaults.stepMicrosec,10);this.hour_slider&&(this.control.options(this,this.hour_slider,"hour",{min:this._defaults.hourMin,max:k,step:this._defaults.stepHour}),this.control.value(this,this.hour_slider,"hour",this.hour-this.hour%this._defaults.stepHour)),this.minute_slider&&(this.control.options(this,this.minute_slider,"minute",{min:this._defaults.minuteMin,max:l,step:this._defaults.stepMinute}),this.control.value(this,this.minute_slider,"minute",this.minute-this.minute%this._defaults.stepMinute)),this.second_slider&&(this.control.options(this,this.second_slider,"second",{min:this._defaults.secondMin,max:m,step:this._defaults.stepSecond}),this.control.value(this,this.second_slider,"second",this.second-this.second%this._defaults.stepSecond)),this.millisec_slider&&(this.control.options(this,this.millisec_slider,"millisec",{min:this._defaults.millisecMin,max:n,step:this._defaults.stepMillisec}),this.control.value(this,this.millisec_slider,"millisec",this.millisec-this.millisec%this._defaults.stepMillisec)),this.microsec_slider&&(this.control.options(this,this.microsec_slider,"microsec",{min:this._defaults.microsecMin,max:o,step:this._defaults.stepMicrosec}),this.control.value(this,this.microsec_slider,"microsec",this.microsec-this.microsec%this._defaults.stepMicrosec))}}},_onTimeChange:function(){if(this._defaults.showTimepicker){var a=this.hour_slider?this.control.value(this,this.hour_slider,"hour"):!1,b=this.minute_slider?this.control.value(this,this.minute_slider,"minute"):!1,c=this.second_slider?this.control.value(this,this.second_slider,"second"):!1,d=this.millisec_slider?this.control.value(this,this.millisec_slider,"millisec"):!1,e=this.microsec_slider?this.control.value(this,this.microsec_slider,"microsec"):!1,f=this.timezone_select?this.timezone_select.val():!1,g=this._defaults,h=g.pickerTimeFormat||g.timeFormat,i=g.pickerTimeSuffix||g.timeSuffix;"object"==typeof a&&(a=!1),"object"==typeof b&&(b=!1),"object"==typeof c&&(c=!1),"object"==typeof d&&(d=!1),"object"==typeof e&&(e=!1),"object"==typeof f&&(f=!1),a!==!1&&(a=parseInt(a,10)),b!==!1&&(b=parseInt(b,10)),c!==!1&&(c=parseInt(c,10)),d!==!1&&(d=parseInt(d,10)),e!==!1&&(e=parseInt(e,10)),f!==!1&&(f=f.toString());var j=g[12>a?"amNames":"pmNames"][0],k=a!==parseInt(this.hour,10)||b!==parseInt(this.minute,10)||c!==parseInt(this.second,10)||d!==parseInt(this.millisec,10)||e!==parseInt(this.microsec,10)||this.ampm.length>0&&12>a!=(-1!==$.inArray(this.ampm.toUpperCase(),this.amNames))||null!==this.timezone&&f!==this.timezone.toString();k&&(a!==!1&&(this.hour=a),b!==!1&&(this.minute=b),c!==!1&&(this.second=c),d!==!1&&(this.millisec=d),e!==!1&&(this.microsec=e),f!==!1&&(this.timezone=f),this.inst||(this.inst=$.datepicker._getInst(this.$input[0])),this._limitMinMaxDateTime(this.inst,!0)),this.support.ampm&&(this.ampm=j),this.formattedTime=$.datepicker.formatTime(g.timeFormat,this,g),this.$timeObj&&this.$timeObj.text(h===g.timeFormat?this.formattedTime+i:$.datepicker.formatTime(h,this,g)+i),this.timeDefined=!0,k&&this._updateDateTime()}},_onSelectHandler:function(){var a=this._defaults.onSelect||this.inst.settings.onSelect,b=this.$input?this.$input[0]:null;a&&b&&a.apply(b,[this.formattedDateTime,this])},_updateDateTime:function(a){a=this.inst||a;var b=a.currentYear>0?new Date(a.currentYear,a.currentMonth,a.currentDay):new Date(a.selectedYear,a.selectedMonth,a.selectedDay),c=$.datepicker._daylightSavingAdjust(b),d=$.datepicker._get(a,"dateFormat"),e=$.datepicker._getFormatConfig(a),f=null!==c&&this.timeDefined;this.formattedDate=$.datepicker.formatDate(d,null===c?new Date:c,e);var g=this.formattedDate;if(""===a.lastVal&&(a.currentYear=a.selectedYear,a.currentMonth=a.selectedMonth,a.currentDay=a.selectedDay),this._defaults.timeOnly===!0&&this._defaults.timeOnlyShowDate===!1?g=this.formattedTime:(this._defaults.timeOnly!==!0&&(this._defaults.alwaysSetTime||f)||this._defaults.timeOnly===!0&&this._defaults.timeOnlyShowDate===!0)&&(g+=this._defaults.separator+this.formattedTime+this._defaults.timeSuffix),this.formattedDateTime=g,this._defaults.showTimepicker)if(this.$altInput&&this._defaults.timeOnly===!1&&this._defaults.altFieldTimeOnly===!0)this.$altInput.val(this.formattedTime),this.$input.val(this.formattedDate);else if(this.$altInput){this.$input.val(g);var h="",i=null!==this._defaults.altSeparator?this._defaults.altSeparator:this._defaults.separator,j=null!==this._defaults.altTimeSuffix?this._defaults.altTimeSuffix:this._defaults.timeSuffix;this._defaults.timeOnly||(h=this._defaults.altFormat?$.datepicker.formatDate(this._defaults.altFormat,null===c?new Date:c,e):this.formattedDate,h&&(h+=i)),h+=null!==this._defaults.altTimeFormat?$.datepicker.formatTime(this._defaults.altTimeFormat,this,this._defaults)+j:this.formattedTime+j,this.$altInput.val(h)}else this.$input.val(g);else this.$input.val(this.formattedDate);this.$input.trigger("change")},_onFocus:function(){if(!this.$input.val()&&this._defaults.defaultValue){this.$input.val(this._defaults.defaultValue);var a=$.datepicker._getInst(this.$input.get(0)),b=$.datepicker._get(a,"timepicker");if(b&&b._defaults.timeOnly&&a.input.val()!==a.lastVal)try{$.datepicker._updateDatepicker(a)}catch(c){$.timepicker.log(c)}}},_controls:{slider:{create:function(a,b,c,d,e,f,g){var h=a._defaults.isRTL;return b.prop("slide",null).slider({orientation:"horizontal",value:h?-1*d:d,min:h?-1*f:e,max:h?-1*e:f,step:g,slide:function(b,d){a.control.value(a,$(this),c,h?-1*d.value:d.value),a._onTimeChange()},stop:function(b,c){a._onSelectHandler()}})},options:function(a,b,c,d,e){if(a._defaults.isRTL){if("string"==typeof d)return"min"===d||"max"===d?void 0!==e?b.slider(d,-1*e):Math.abs(b.slider(d)):b.slider(d);var f=d.min,g=d.max;return d.min=d.max=null,void 0!==f&&(d.max=-1*f),void 0!==g&&(d.min=-1*g),b.slider(d)}return"string"==typeof d&&void 0!==e?b.slider(d,e):b.slider(d)},value:function(a,b,c,d){return a._defaults.isRTL?void 0!==d?b.slider("value",-1*d):Math.abs(b.slider("value")):void 0!==d?b.slider("value",d):b.slider("value")}},select:{create:function(a,b,c,d,e,f,g){for(var h='<select class="ui-timepicker-select ui-state-default ui-corner-all" data-unit="'+c+'" data-min="'+e+'" data-max="'+f+'" data-step="'+g+'">',i=a._defaults.pickerTimeFormat||a._defaults.timeFormat,j=e;f>=j;j+=g)h+='<option value="'+j+'"'+(j===d?" selected":"")+">",h+="hour"===c?$.datepicker.formatTime($.trim(i.replace(/[^ht ]/gi,"")),{hour:j},a._defaults):"millisec"===c||"microsec"===c||j>=10?j:"0"+j.toString(),h+="</option>";return h+="</select>",b.children("select").remove(),$(h).appendTo(b).change(function(b){a._onTimeChange(),a._onSelectHandler(),a._afterInject()}),b},options:function(a,b,c,d,e){var f={},g=b.children("select");if("string"==typeof d){if(void 0===e)return g.data(d);f[d]=e}else f=d;return a.control.create(a,b,g.data("unit"),g.val(),f.min>=0?f.min:g.data("min"),f.max||g.data("max"),f.step||g.data("step"))},value:function(a,b,c,d){var e=b.children("select");return void 0!==d?e.val(d):e.val()}}}}),$.fn.extend({timepicker:function(a){a=a||{};var b=Array.prototype.slice.call(arguments);return"object"==typeof a&&(b[0]=$.extend(a,{timeOnly:!0})),$(this).each(function(){$.fn.datetimepicker.apply($(this),b)})},datetimepicker:function(a){a=a||{};var b=arguments;return"string"==typeof a?"getDate"===a||"option"===a&&2===b.length&&"string"==typeof b[1]?$.fn.datepicker.apply($(this[0]),b):this.each(function(){var a=$(this);a.datepicker.apply(a,b)}):this.each(function(){var b=$(this);b.datepicker($.timepicker._newInst(b,a)._defaults)})}}),$.datepicker.parseDateTime=function(a,b,c,d,e){var f=parseDateTimeInternal(a,b,c,d,e);if(f.timeObj){var g=f.timeObj;f.date.setHours(g.hour,g.minute,g.second,g.millisec),f.date.setMicroseconds(g.microsec)}return f.date},$.datepicker.parseTime=function(a,b,c){var d=extendRemove(extendRemove({},$.timepicker._defaults),c||{}),e=(-1!==a.replace(/\'.*?\'/g,"").indexOf("Z"),function(a,b,c){var d,e=function(a,b){var c=[];return a&&$.merge(c,a),b&&$.merge(c,b),c=$.map(c,function(a){return a.replace(/[.*+?|()\[\]{}\\]/g,"\\$&")}),"("+c.join("|")+")?"},f=function(a){var b=a.toLowerCase().match(/(h{1,2}|m{1,2}|s{1,2}|l{1}|c{1}|t{1,2}|z|'.*?')/g),c={h:-1,m:-1,s:-1,l:-1,c:-1,t:-1,z:-1};if(b)for(var d=0;d<b.length;d++)-1===c[b[d].toString().charAt(0)]&&(c[b[d].toString().charAt(0)]=d+1);return c},g="^"+a.toString().replace(/([hH]{1,2}|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g,function(a){var b=a.length;switch(a.charAt(0).toLowerCase()){case"h":return 1===b?"(\\d?\\d)":"(\\d{"+b+"})";case"m":return 1===b?"(\\d?\\d)":"(\\d{"+b+"})";case"s":return 1===b?"(\\d?\\d)":"(\\d{"+b+"})";case"l":return"(\\d?\\d?\\d)";case"c":return"(\\d?\\d?\\d)";case"z":return"(z|[-+]\\d\\d:?\\d\\d|\\S+)?";case"t":return e(c.amNames,c.pmNames);default:return"("+a.replace(/\'/g,"").replace(/(\.|\$|\^|\\|\/|\(|\)|\[|\]|\?|\+|\*)/g,function(a){return"\\"+a})+")?"}}).replace(/\s/g,"\\s?")+c.timeSuffix+"$",h=f(a),i="";d=b.match(new RegExp(g,"i"));var j={hour:0,minute:0,second:0,millisec:0,microsec:0};return d?(-1!==h.t&&(void 0===d[h.t]||0===d[h.t].length?(i="",j.ampm=""):(i=-1!==$.inArray(d[h.t].toUpperCase(),$.map(c.amNames,function(a,b){return a.toUpperCase()}))?"AM":"PM",j.ampm=c["AM"===i?"amNames":"pmNames"][0])),-1!==h.h&&("AM"===i&&"12"===d[h.h]?j.hour=0:"PM"===i&&"12"!==d[h.h]?j.hour=parseInt(d[h.h],10)+12:j.hour=Number(d[h.h])),-1!==h.m&&(j.minute=Number(d[h.m])),-1!==h.s&&(j.second=Number(d[h.s])),-1!==h.l&&(j.millisec=Number(d[h.l])),-1!==h.c&&(j.microsec=Number(d[h.c])),-1!==h.z&&void 0!==d[h.z]&&(j.timezone=$.timepicker.timezoneOffsetNumber(d[h.z])),j):!1}),f=function(a,b,c){try{var d=new Date("2012-01-01 "+b);if(isNaN(d.getTime())&&(d=new Date("2012-01-01T"+b),isNaN(d.getTime())&&(d=new Date("01/01/2012 "+b),isNaN(d.getTime()))))throw"Unable to parse time with native Date: "+b;return{hour:d.getHours(),minute:d.getMinutes(),second:d.getSeconds(),millisec:d.getMilliseconds(),microsec:d.getMicroseconds(),timezone:-1*d.getTimezoneOffset()}}catch(f){try{return e(a,b,c)}catch(g){$.timepicker.log("Unable to parse \ntimeString: "+b+"\ntimeFormat: "+a)}}return!1};return"function"==typeof d.parse?d.parse(a,b,d):"loose"===d.parse?f(a,b,d):e(a,b,d)},$.datepicker.formatTime=function(a,b,c){c=c||{},c=$.extend({},$.timepicker._defaults,c),b=$.extend({hour:0,minute:0,second:0,millisec:0,microsec:0,timezone:null},b);var d=a,e=c.amNames[0],f=parseInt(b.hour,10);return f>11&&(e=c.pmNames[0]),d=d.replace(/(?:HH?|hh?|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g,function(a){switch(a){case"HH":return("0"+f).slice(-2);case"H":return f;case"hh":return("0"+convert24to12(f)).slice(-2);case"h":return convert24to12(f);case"mm":return("0"+b.minute).slice(-2);case"m":return b.minute;case"ss":return("0"+b.second).slice(-2);case"s":return b.second;case"l":return("00"+b.millisec).slice(-3);case"c":return("00"+b.microsec).slice(-3);case"z":return $.timepicker.timezoneOffsetString(null===b.timezone?c.timezone:b.timezone,!1);case"Z":return $.timepicker.timezoneOffsetString(null===b.timezone?c.timezone:b.timezone,!0);case"T":return e.charAt(0).toUpperCase();case"TT":return e.toUpperCase();case"t":return e.charAt(0).toLowerCase();case"tt":return e.toLowerCase();default:return a.replace(/'/g,"")}})},$.datepicker._base_selectDate=$.datepicker._selectDate,$.datepicker._selectDate=function(a,b){var c,d=this._getInst($(a)[0]),e=this._get(d,"timepicker");e&&d.settings.showTimepicker?(e._limitMinMaxDateTime(d,!0),c=d.inline,d.inline=d.stay_open=!0,this._base_selectDate(a,b),d.inline=c,d.stay_open=!1,this._notifyChange(d),this._updateDatepicker(d)):this._base_selectDate(a,b)},$.datepicker._base_updateDatepicker=$.datepicker._updateDatepicker,$.datepicker._updateDatepicker=function(a){var b=a.input[0];if(!($.datepicker._curInst&&$.datepicker._curInst!==a&&$.datepicker._datepickerShowing&&$.datepicker._lastInput!==b||"boolean"==typeof a.stay_open&&a.stay_open!==!1)){this._base_updateDatepicker(a);var c=this._get(a,"timepicker");c&&c._addTimePicker(a)}},$.datepicker._base_doKeyPress=$.datepicker._doKeyPress,$.datepicker._doKeyPress=function(a){var b=$.datepicker._getInst(a.target),c=$.datepicker._get(b,"timepicker");if(c&&$.datepicker._get(b,"constrainInput")){var d=c.support.ampm,e=null!==c._defaults.showTimezone?c._defaults.showTimezone:c.support.timezone,f=$.datepicker._possibleChars($.datepicker._get(b,"dateFormat")),g=c._defaults.timeFormat.toString().replace(/[hms]/g,"").replace(/TT/g,d?"APM":"").replace(/Tt/g,d?"AaPpMm":"").replace(/tT/g,d?"AaPpMm":"").replace(/T/g,d?"AP":"").replace(/tt/g,d?"apm":"").replace(/t/g,d?"ap":"")+" "+c._defaults.separator+c._defaults.timeSuffix+(e?c._defaults.timezoneList.join(""):"")+c._defaults.amNames.join("")+c._defaults.pmNames.join("")+f,h=String.fromCharCode(void 0===a.charCode?a.keyCode:a.charCode);return a.ctrlKey||" ">h||!f||g.indexOf(h)>-1}return $.datepicker._base_doKeyPress(a)},$.datepicker._base_updateAlternate=$.datepicker._updateAlternate,$.datepicker._updateAlternate=function(a){var b=this._get(a,"timepicker");if(b){var c=b._defaults.altField;if(c){var d=(b._defaults.altFormat||b._defaults.dateFormat,this._getDate(a)),e=$.datepicker._getFormatConfig(a),f="",g=b._defaults.altSeparator?b._defaults.altSeparator:b._defaults.separator,h=b._defaults.altTimeSuffix?b._defaults.altTimeSuffix:b._defaults.timeSuffix,i=null!==b._defaults.altTimeFormat?b._defaults.altTimeFormat:b._defaults.timeFormat;f+=$.datepicker.formatTime(i,b,b._defaults)+h,b._defaults.timeOnly||b._defaults.altFieldTimeOnly||null===d||(f=b._defaults.altFormat?$.datepicker.formatDate(b._defaults.altFormat,d,e)+g+f:b.formattedDate+g+f),$(c).val(a.input.val()?f:"")}}else $.datepicker._base_updateAlternate(a)},$.datepicker._base_doKeyUp=$.datepicker._doKeyUp,$.datepicker._doKeyUp=function(a){var b=$.datepicker._getInst(a.target),c=$.datepicker._get(b,"timepicker");if(c&&c._defaults.timeOnly&&b.input.val()!==b.lastVal)try{$.datepicker._updateDatepicker(b)}catch(d){$.timepicker.log(d)}return $.datepicker._base_doKeyUp(a)},$.datepicker._base_gotoToday=$.datepicker._gotoToday,$.datepicker._gotoToday=function(a){var b=this._getInst($(a)[0]),c=(b.dpDiv,this._get(b,"timepicker"));selectLocalTimezone(c);var d=new Date;this._setTime(b,d),this._setDate(b,d),this._base_gotoToday(a)},$.datepicker._disableTimepickerDatepicker=function(a){
|
5 |
-
var b=this._getInst(a);if(b){var c=this._get(b,"timepicker");$(a).datepicker("getDate"),c&&(b.settings.showTimepicker=!1,c._defaults.showTimepicker=!1,c._updateDateTime(b))}},$.datepicker._enableTimepickerDatepicker=function(a){var b=this._getInst(a);if(b){var c=this._get(b,"timepicker");$(a).datepicker("getDate"),c&&(b.settings.showTimepicker=!0,c._defaults.showTimepicker=!0,c._addTimePicker(b),c._updateDateTime(b))}},$.datepicker._setTime=function(a,b){var c=this._get(a,"timepicker");if(c){var d=c._defaults;c.hour=b?b.getHours():d.hour,c.minute=b?b.getMinutes():d.minute,c.second=b?b.getSeconds():d.second,c.millisec=b?b.getMilliseconds():d.millisec,c.microsec=b?b.getMicroseconds():d.microsec,c._limitMinMaxDateTime(a,!0),c._onTimeChange(),c._updateDateTime(a)}},$.datepicker._setTimeDatepicker=function(a,b,c){var d=this._getInst(a);if(d){var e=this._get(d,"timepicker");if(e){this._setDateFromField(d);var f;b&&("string"==typeof b?(e._parseTime(b,c),f=new Date,f.setHours(e.hour,e.minute,e.second,e.millisec),f.setMicroseconds(e.microsec)):(f=new Date(b.getTime()),f.setMicroseconds(b.getMicroseconds())),"Invalid Date"===f.toString()&&(f=void 0),this._setTime(d,f))}}},$.datepicker._base_setDateDatepicker=$.datepicker._setDateDatepicker,$.datepicker._setDateDatepicker=function(a,b){var c=this._getInst(a),d=b;if(c){"string"==typeof b&&(d=new Date(b),d.getTime()||(this._base_setDateDatepicker.apply(this,arguments),d=$(a).datepicker("getDate")));var e,f=this._get(c,"timepicker");d instanceof Date?(e=new Date(d.getTime()),e.setMicroseconds(d.getMicroseconds())):e=d,f&&e&&(f.support.timezone||null!==f._defaults.timezone||(f.timezone=-1*e.getTimezoneOffset()),d=$.timepicker.timezoneAdjust(d,f.timezone),e=$.timepicker.timezoneAdjust(e,f.timezone)),this._updateDatepicker(c),this._base_setDateDatepicker.apply(this,arguments),this._setTimeDatepicker(a,e,!0)}},$.datepicker._base_getDateDatepicker=$.datepicker._getDateDatepicker,$.datepicker._getDateDatepicker=function(a,b){var c=this._getInst(a);if(c){var d=this._get(c,"timepicker");if(d){void 0===c.lastVal&&this._setDateFromField(c,b);var e=this._getDate(c),f
|
1 |
+
/*! jQuery Timepicker Addon - v1.6.3 - 2016-04-20
|
2 |
* http://trentrichardson.com/examples/timepicker
|
3 |
+
* Copyright (c) 2016 Trent Richardson; Licensed MIT */
|
4 |
+
!function(a){"function"==typeof define&&define.amd?define(["jquery","jquery-ui"],a):a(jQuery)}(function($){if($.ui.timepicker=$.ui.timepicker||{},!$.ui.timepicker.version){$.extend($.ui,{timepicker:{version:"1.6.3"}});var Timepicker=function(){this.regional=[],this.regional[""]={currentText:"Now",closeText:"Done",amNames:["AM","A"],pmNames:["PM","P"],timeFormat:"HH:mm",timeSuffix:"",timeOnlyTitle:"Choose Time",timeText:"Time",hourText:"Hour",minuteText:"Minute",secondText:"Second",millisecText:"Millisecond",microsecText:"Microsecond",timezoneText:"Time Zone",isRTL:!1},this._defaults={showButtonPanel:!0,timeOnly:!1,timeOnlyShowDate:!1,showHour:null,showMinute:null,showSecond:null,showMillisec:null,showMicrosec:null,showTimezone:null,showTime:!0,stepHour:1,stepMinute:1,stepSecond:1,stepMillisec:1,stepMicrosec:1,hour:0,minute:0,second:0,millisec:0,microsec:0,timezone:null,hourMin:0,minuteMin:0,secondMin:0,millisecMin:0,microsecMin:0,hourMax:23,minuteMax:59,secondMax:59,millisecMax:999,microsecMax:999,minDateTime:null,maxDateTime:null,maxTime:null,minTime:null,onSelect:null,hourGrid:0,minuteGrid:0,secondGrid:0,millisecGrid:0,microsecGrid:0,alwaysSetTime:!0,separator:" ",altFieldTimeOnly:!0,altTimeFormat:null,altSeparator:null,altTimeSuffix:null,altRedirectFocus:!0,pickerTimeFormat:null,pickerTimeSuffix:null,showTimepicker:!0,timezoneList:null,addSliderAccess:!1,sliderAccessArgs:null,controlType:"slider",oneLine:!1,defaultValue:null,parse:"strict",afterInject:null},$.extend(this._defaults,this.regional[""])};$.extend(Timepicker.prototype,{$input:null,$altInput:null,$timeObj:null,inst:null,hour_slider:null,minute_slider:null,second_slider:null,millisec_slider:null,microsec_slider:null,timezone_select:null,maxTime:null,minTime:null,hour:0,minute:0,second:0,millisec:0,microsec:0,timezone:null,hourMinOriginal:null,minuteMinOriginal:null,secondMinOriginal:null,millisecMinOriginal:null,microsecMinOriginal:null,hourMaxOriginal:null,minuteMaxOriginal:null,secondMaxOriginal:null,millisecMaxOriginal:null,microsecMaxOriginal:null,ampm:"",formattedDate:"",formattedTime:"",formattedDateTime:"",timezoneList:null,units:["hour","minute","second","millisec","microsec"],support:{},control:null,setDefaults:function(a){return extendRemove(this._defaults,a||{}),this},_newInst:function($input,opts){var tp_inst=new Timepicker,inlineSettings={},fns={},overrides,i;for(var attrName in this._defaults)if(this._defaults.hasOwnProperty(attrName)){var attrValue=$input.attr("time:"+attrName);if(attrValue)try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}overrides={beforeShow:function(a,b){return $.isFunction(tp_inst._defaults.evnts.beforeShow)?tp_inst._defaults.evnts.beforeShow.call($input[0],a,b,tp_inst):void 0},onChangeMonthYear:function(a,b,c){$.isFunction(tp_inst._defaults.evnts.onChangeMonthYear)&&tp_inst._defaults.evnts.onChangeMonthYear.call($input[0],a,b,c,tp_inst)},onClose:function(a,b){tp_inst.timeDefined===!0&&""!==$input.val()&&tp_inst._updateDateTime(b),$.isFunction(tp_inst._defaults.evnts.onClose)&&tp_inst._defaults.evnts.onClose.call($input[0],a,b,tp_inst)}};for(i in overrides)overrides.hasOwnProperty(i)&&(fns[i]=opts[i]||this._defaults[i]||null);tp_inst._defaults=$.extend({},this._defaults,inlineSettings,opts,overrides,{evnts:fns,timepicker:tp_inst}),tp_inst.amNames=$.map(tp_inst._defaults.amNames,function(a){return a.toUpperCase()}),tp_inst.pmNames=$.map(tp_inst._defaults.pmNames,function(a){return a.toUpperCase()}),tp_inst.support=detectSupport(tp_inst._defaults.timeFormat+(tp_inst._defaults.pickerTimeFormat?tp_inst._defaults.pickerTimeFormat:"")+(tp_inst._defaults.altTimeFormat?tp_inst._defaults.altTimeFormat:"")),"string"==typeof tp_inst._defaults.controlType?("slider"===tp_inst._defaults.controlType&&"undefined"==typeof $.ui.slider&&(tp_inst._defaults.controlType="select"),tp_inst.control=tp_inst._controls[tp_inst._defaults.controlType]):tp_inst.control=tp_inst._defaults.controlType;var timezoneList=[-720,-660,-600,-570,-540,-480,-420,-360,-300,-270,-240,-210,-180,-120,-60,0,60,120,180,210,240,270,300,330,345,360,390,420,480,525,540,570,600,630,660,690,720,765,780,840];null!==tp_inst._defaults.timezoneList&&(timezoneList=tp_inst._defaults.timezoneList);var tzl=timezoneList.length,tzi=0,tzv=null;if(tzl>0&&"object"!=typeof timezoneList[0])for(;tzl>tzi;tzi++)tzv=timezoneList[tzi],timezoneList[tzi]={value:tzv,label:$.timepicker.timezoneOffsetString(tzv,tp_inst.support.iso8601)};return tp_inst._defaults.timezoneList=timezoneList,tp_inst.timezone=null!==tp_inst._defaults.timezone?$.timepicker.timezoneOffsetNumber(tp_inst._defaults.timezone):-1*(new Date).getTimezoneOffset(),tp_inst.hour=tp_inst._defaults.hour<tp_inst._defaults.hourMin?tp_inst._defaults.hourMin:tp_inst._defaults.hour>tp_inst._defaults.hourMax?tp_inst._defaults.hourMax:tp_inst._defaults.hour,tp_inst.minute=tp_inst._defaults.minute<tp_inst._defaults.minuteMin?tp_inst._defaults.minuteMin:tp_inst._defaults.minute>tp_inst._defaults.minuteMax?tp_inst._defaults.minuteMax:tp_inst._defaults.minute,tp_inst.second=tp_inst._defaults.second<tp_inst._defaults.secondMin?tp_inst._defaults.secondMin:tp_inst._defaults.second>tp_inst._defaults.secondMax?tp_inst._defaults.secondMax:tp_inst._defaults.second,tp_inst.millisec=tp_inst._defaults.millisec<tp_inst._defaults.millisecMin?tp_inst._defaults.millisecMin:tp_inst._defaults.millisec>tp_inst._defaults.millisecMax?tp_inst._defaults.millisecMax:tp_inst._defaults.millisec,tp_inst.microsec=tp_inst._defaults.microsec<tp_inst._defaults.microsecMin?tp_inst._defaults.microsecMin:tp_inst._defaults.microsec>tp_inst._defaults.microsecMax?tp_inst._defaults.microsecMax:tp_inst._defaults.microsec,tp_inst.ampm="",tp_inst.$input=$input,tp_inst._defaults.altField&&(tp_inst.$altInput=$(tp_inst._defaults.altField),tp_inst._defaults.altRedirectFocus===!0&&tp_inst.$altInput.css({cursor:"pointer"}).focus(function(){$input.trigger("focus")})),(0===tp_inst._defaults.minDate||0===tp_inst._defaults.minDateTime)&&(tp_inst._defaults.minDate=new Date),(0===tp_inst._defaults.maxDate||0===tp_inst._defaults.maxDateTime)&&(tp_inst._defaults.maxDate=new Date),void 0!==tp_inst._defaults.minDate&&tp_inst._defaults.minDate instanceof Date&&(tp_inst._defaults.minDateTime=new Date(tp_inst._defaults.minDate.getTime())),void 0!==tp_inst._defaults.minDateTime&&tp_inst._defaults.minDateTime instanceof Date&&(tp_inst._defaults.minDate=new Date(tp_inst._defaults.minDateTime.getTime())),void 0!==tp_inst._defaults.maxDate&&tp_inst._defaults.maxDate instanceof Date&&(tp_inst._defaults.maxDateTime=new Date(tp_inst._defaults.maxDate.getTime())),void 0!==tp_inst._defaults.maxDateTime&&tp_inst._defaults.maxDateTime instanceof Date&&(tp_inst._defaults.maxDate=new Date(tp_inst._defaults.maxDateTime.getTime())),tp_inst.$input.bind("focus",function(){tp_inst._onFocus()}),tp_inst},_addTimePicker:function(a){var b=$.trim(this.$altInput&&this._defaults.altFieldTimeOnly?this.$input.val()+" "+this.$altInput.val():this.$input.val());this.timeDefined=this._parseTime(b),this._limitMinMaxDateTime(a,!1),this._injectTimePicker(),this._afterInject()},_parseTime:function(a,b){if(this.inst||(this.inst=$.datepicker._getInst(this.$input[0])),b||!this._defaults.timeOnly){var c=$.datepicker._get(this.inst,"dateFormat");try{var d=parseDateTimeInternal(c,this._defaults.timeFormat,a,$.datepicker._getFormatConfig(this.inst),this._defaults);if(!d.timeObj)return!1;$.extend(this,d.timeObj)}catch(e){return $.timepicker.log("Error parsing the date/time string: "+e+"\ndate/time string = "+a+"\ntimeFormat = "+this._defaults.timeFormat+"\ndateFormat = "+c),!1}return!0}var f=$.datepicker.parseTime(this._defaults.timeFormat,a,this._defaults);return f?($.extend(this,f),!0):!1},_afterInject:function(){var a=this.inst.settings;$.isFunction(a.afterInject)&&a.afterInject.call(this)},_injectTimePicker:function(){var a=this.inst.dpDiv,b=this.inst.settings,c=this,d="",e="",f=null,g={},h={},i=null,j=0,k=0;if(0===a.find("div.ui-timepicker-div").length&&b.showTimepicker){var l=" ui_tpicker_unit_hide",m='<div class="ui-timepicker-div'+(b.isRTL?" ui-timepicker-rtl":"")+(b.oneLine&&"select"===b.controlType?" ui-timepicker-oneLine":"")+'"><dl><dt class="ui_tpicker_time_label'+(b.showTime?"":l)+'">'+b.timeText+'</dt><dd class="ui_tpicker_time '+(b.showTime?"":l)+'"><input class="ui_tpicker_time_input" '+(b.timeInput?"":"disabled")+"/></dd>";for(j=0,k=this.units.length;k>j;j++){if(d=this.units[j],e=d.substr(0,1).toUpperCase()+d.substr(1),f=null!==b["show"+e]?b["show"+e]:this.support[d],g[d]=parseInt(b[d+"Max"]-(b[d+"Max"]-b[d+"Min"])%b["step"+e],10),h[d]=0,m+='<dt class="ui_tpicker_'+d+"_label"+(f?"":l)+'">'+b[d+"Text"]+'</dt><dd class="ui_tpicker_'+d+(f?"":l)+'"><div class="ui_tpicker_'+d+"_slider"+(f?"":l)+'"></div>',f&&b[d+"Grid"]>0){if(m+='<div style="padding-left: 1px"><table class="ui-tpicker-grid-label"><tr>',"hour"===d)for(var n=b[d+"Min"];n<=g[d];n+=parseInt(b[d+"Grid"],10)){h[d]++;var o=$.datepicker.formatTime(this.support.ampm?"hht":"HH",{hour:n},b);m+='<td data-for="'+d+'">'+o+"</td>"}else for(var p=b[d+"Min"];p<=g[d];p+=parseInt(b[d+"Grid"],10))h[d]++,m+='<td data-for="'+d+'">'+(10>p?"0":"")+p+"</td>";m+="</tr></table></div>"}m+="</dd>"}var q=null!==b.showTimezone?b.showTimezone:this.support.timezone;m+='<dt class="ui_tpicker_timezone_label'+(q?"":l)+'">'+b.timezoneText+"</dt>",m+='<dd class="ui_tpicker_timezone'+(q?"":l)+'"></dd>',m+="</dl></div>";var r=$(m);for(b.timeOnly===!0&&(r.prepend('<div class="ui-widget-header ui-helper-clearfix ui-corner-all"><div class="ui-datepicker-title">'+b.timeOnlyTitle+"</div></div>"),a.find(".ui-datepicker-header, .ui-datepicker-calendar").hide()),j=0,k=c.units.length;k>j;j++)d=c.units[j],e=d.substr(0,1).toUpperCase()+d.substr(1),f=null!==b["show"+e]?b["show"+e]:this.support[d],c[d+"_slider"]=c.control.create(c,r.find(".ui_tpicker_"+d+"_slider"),d,c[d],b[d+"Min"],g[d],b["step"+e]),f&&b[d+"Grid"]>0&&(i=100*h[d]*b[d+"Grid"]/(g[d]-b[d+"Min"]),r.find(".ui_tpicker_"+d+" table").css({width:i+"%",marginLeft:b.isRTL?"0":i/(-2*h[d])+"%",marginRight:b.isRTL?i/(-2*h[d])+"%":"0",borderCollapse:"collapse"}).find("td").click(function(a){var b=$(this),e=b.html(),f=parseInt(e.replace(/[^0-9]/g),10),g=e.replace(/[^apm]/gi),h=b.data("for");"hour"===h&&(-1!==g.indexOf("p")&&12>f?f+=12:-1!==g.indexOf("a")&&12===f&&(f=0)),c.control.value(c,c[h+"_slider"],d,f),c._onTimeChange(),c._onSelectHandler()}).css({cursor:"pointer",width:100/h[d]+"%",textAlign:"center",overflow:"hidden"}));if(this.timezone_select=r.find(".ui_tpicker_timezone").append("<select></select>").find("select"),$.fn.append.apply(this.timezone_select,$.map(b.timezoneList,function(a,b){return $("<option />").val("object"==typeof a?a.value:a).text("object"==typeof a?a.label:a)})),"undefined"!=typeof this.timezone&&null!==this.timezone&&""!==this.timezone){var s=-1*new Date(this.inst.selectedYear,this.inst.selectedMonth,this.inst.selectedDay,12).getTimezoneOffset();s===this.timezone?selectLocalTimezone(c):this.timezone_select.val(this.timezone)}else"undefined"!=typeof this.hour&&null!==this.hour&&""!==this.hour?this.timezone_select.val(b.timezone):selectLocalTimezone(c);this.timezone_select.change(function(){c._onTimeChange(),c._onSelectHandler(),c._afterInject()});var t=a.find(".ui-datepicker-buttonpane");if(t.length?t.before(r):a.append(r),this.$timeObj=r.find(".ui_tpicker_time_input"),this.$timeObj.change(function(){var a=c.inst.settings.timeFormat,b=$.datepicker.parseTime(a,this.value),d=new Date;b?(d.setHours(b.hour),d.setMinutes(b.minute),d.setSeconds(b.second),$.datepicker._setTime(c.inst,d)):(this.value=c.formattedTime,this.blur())}),null!==this.inst){var u=this.timeDefined;this._onTimeChange(),this.timeDefined=u}if(this._defaults.addSliderAccess){var v=this._defaults.sliderAccessArgs,w=this._defaults.isRTL;v.isRTL=w,setTimeout(function(){if(0===r.find(".ui-slider-access").length){r.find(".ui-slider:visible").sliderAccess(v);var a=r.find(".ui-slider-access:eq(0)").outerWidth(!0);a&&r.find("table:visible").each(function(){var b=$(this),c=b.outerWidth(),d=b.css(w?"marginRight":"marginLeft").toString().replace("%",""),e=c-a,f=d*e/c+"%",g={width:e,marginRight:0,marginLeft:0};g[w?"marginRight":"marginLeft"]=f,b.css(g)})}},10)}c._limitMinMaxDateTime(this.inst,!0)}},_limitMinMaxDateTime:function(a,b){var c=this._defaults,d=new Date(a.selectedYear,a.selectedMonth,a.selectedDay);if(this._defaults.showTimepicker){if(null!==$.datepicker._get(a,"minDateTime")&&void 0!==$.datepicker._get(a,"minDateTime")&&d){var e=$.datepicker._get(a,"minDateTime"),f=new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0,0);(null===this.hourMinOriginal||null===this.minuteMinOriginal||null===this.secondMinOriginal||null===this.millisecMinOriginal||null===this.microsecMinOriginal)&&(this.hourMinOriginal=c.hourMin,this.minuteMinOriginal=c.minuteMin,this.secondMinOriginal=c.secondMin,this.millisecMinOriginal=c.millisecMin,this.microsecMinOriginal=c.microsecMin),a.settings.timeOnly||f.getTime()===d.getTime()?(this._defaults.hourMin=e.getHours(),this.hour<=this._defaults.hourMin?(this.hour=this._defaults.hourMin,this._defaults.minuteMin=e.getMinutes(),this.minute<=this._defaults.minuteMin?(this.minute=this._defaults.minuteMin,this._defaults.secondMin=e.getSeconds(),this.second<=this._defaults.secondMin?(this.second=this._defaults.secondMin,this._defaults.millisecMin=e.getMilliseconds(),this.millisec<=this._defaults.millisecMin?(this.millisec=this._defaults.millisecMin,this._defaults.microsecMin=e.getMicroseconds()):(this.microsec<this._defaults.microsecMin&&(this.microsec=this._defaults.microsecMin),this._defaults.microsecMin=this.microsecMinOriginal)):(this._defaults.millisecMin=this.millisecMinOriginal,this._defaults.microsecMin=this.microsecMinOriginal)):(this._defaults.secondMin=this.secondMinOriginal,this._defaults.millisecMin=this.millisecMinOriginal,this._defaults.microsecMin=this.microsecMinOriginal)):(this._defaults.minuteMin=this.minuteMinOriginal,this._defaults.secondMin=this.secondMinOriginal,this._defaults.millisecMin=this.millisecMinOriginal,this._defaults.microsecMin=this.microsecMinOriginal)):(this._defaults.hourMin=this.hourMinOriginal,this._defaults.minuteMin=this.minuteMinOriginal,this._defaults.secondMin=this.secondMinOriginal,this._defaults.millisecMin=this.millisecMinOriginal,this._defaults.microsecMin=this.microsecMinOriginal)}if(null!==$.datepicker._get(a,"maxDateTime")&&void 0!==$.datepicker._get(a,"maxDateTime")&&d){var g=$.datepicker._get(a,"maxDateTime"),h=new Date(g.getFullYear(),g.getMonth(),g.getDate(),0,0,0,0);(null===this.hourMaxOriginal||null===this.minuteMaxOriginal||null===this.secondMaxOriginal||null===this.millisecMaxOriginal)&&(this.hourMaxOriginal=c.hourMax,this.minuteMaxOriginal=c.minuteMax,this.secondMaxOriginal=c.secondMax,this.millisecMaxOriginal=c.millisecMax,this.microsecMaxOriginal=c.microsecMax),a.settings.timeOnly||h.getTime()===d.getTime()?(this._defaults.hourMax=g.getHours(),this.hour>=this._defaults.hourMax?(this.hour=this._defaults.hourMax,this._defaults.minuteMax=g.getMinutes(),this.minute>=this._defaults.minuteMax?(this.minute=this._defaults.minuteMax,this._defaults.secondMax=g.getSeconds(),this.second>=this._defaults.secondMax?(this.second=this._defaults.secondMax,this._defaults.millisecMax=g.getMilliseconds(),this.millisec>=this._defaults.millisecMax?(this.millisec=this._defaults.millisecMax,this._defaults.microsecMax=g.getMicroseconds()):(this.microsec>this._defaults.microsecMax&&(this.microsec=this._defaults.microsecMax),this._defaults.microsecMax=this.microsecMaxOriginal)):(this._defaults.millisecMax=this.millisecMaxOriginal,this._defaults.microsecMax=this.microsecMaxOriginal)):(this._defaults.secondMax=this.secondMaxOriginal,this._defaults.millisecMax=this.millisecMaxOriginal,this._defaults.microsecMax=this.microsecMaxOriginal)):(this._defaults.minuteMax=this.minuteMaxOriginal,this._defaults.secondMax=this.secondMaxOriginal,this._defaults.millisecMax=this.millisecMaxOriginal,this._defaults.microsecMax=this.microsecMaxOriginal)):(this._defaults.hourMax=this.hourMaxOriginal,this._defaults.minuteMax=this.minuteMaxOriginal,this._defaults.secondMax=this.secondMaxOriginal,this._defaults.millisecMax=this.millisecMaxOriginal,this._defaults.microsecMax=this.microsecMaxOriginal)}if(null!==a.settings.minTime){var i=new Date("01/01/1970 "+a.settings.minTime);this.hour<i.getHours()?(this.hour=this._defaults.hourMin=i.getHours(),this.minute=this._defaults.minuteMin=i.getMinutes()):this.hour===i.getHours()&&this.minute<i.getMinutes()?this.minute=this._defaults.minuteMin=i.getMinutes():this._defaults.hourMin<i.getHours()?(this._defaults.hourMin=i.getHours(),this._defaults.minuteMin=i.getMinutes()):this._defaults.hourMin===i.getHours()===this.hour&&this._defaults.minuteMin<i.getMinutes()?this._defaults.minuteMin=i.getMinutes():this._defaults.minuteMin=0}if(null!==a.settings.maxTime){var j=new Date("01/01/1970 "+a.settings.maxTime);this.hour>j.getHours()?(this.hour=this._defaults.hourMax=j.getHours(),this.minute=this._defaults.minuteMax=j.getMinutes()):this.hour===j.getHours()&&this.minute>j.getMinutes()?this.minute=this._defaults.minuteMax=j.getMinutes():this._defaults.hourMax>j.getHours()?(this._defaults.hourMax=j.getHours(),this._defaults.minuteMax=j.getMinutes()):this._defaults.hourMax===j.getHours()===this.hour&&this._defaults.minuteMax>j.getMinutes()?this._defaults.minuteMax=j.getMinutes():this._defaults.minuteMax=59}if(void 0!==b&&b===!0){var k=parseInt(this._defaults.hourMax-(this._defaults.hourMax-this._defaults.hourMin)%this._defaults.stepHour,10),l=parseInt(this._defaults.minuteMax-(this._defaults.minuteMax-this._defaults.minuteMin)%this._defaults.stepMinute,10),m=parseInt(this._defaults.secondMax-(this._defaults.secondMax-this._defaults.secondMin)%this._defaults.stepSecond,10),n=parseInt(this._defaults.millisecMax-(this._defaults.millisecMax-this._defaults.millisecMin)%this._defaults.stepMillisec,10),o=parseInt(this._defaults.microsecMax-(this._defaults.microsecMax-this._defaults.microsecMin)%this._defaults.stepMicrosec,10);this.hour_slider&&(this.control.options(this,this.hour_slider,"hour",{min:this._defaults.hourMin,max:k,step:this._defaults.stepHour}),this.control.value(this,this.hour_slider,"hour",this.hour-this.hour%this._defaults.stepHour)),this.minute_slider&&(this.control.options(this,this.minute_slider,"minute",{min:this._defaults.minuteMin,max:l,step:this._defaults.stepMinute}),this.control.value(this,this.minute_slider,"minute",this.minute-this.minute%this._defaults.stepMinute)),this.second_slider&&(this.control.options(this,this.second_slider,"second",{min:this._defaults.secondMin,max:m,step:this._defaults.stepSecond}),this.control.value(this,this.second_slider,"second",this.second-this.second%this._defaults.stepSecond)),this.millisec_slider&&(this.control.options(this,this.millisec_slider,"millisec",{min:this._defaults.millisecMin,max:n,step:this._defaults.stepMillisec}),this.control.value(this,this.millisec_slider,"millisec",this.millisec-this.millisec%this._defaults.stepMillisec)),this.microsec_slider&&(this.control.options(this,this.microsec_slider,"microsec",{min:this._defaults.microsecMin,max:o,step:this._defaults.stepMicrosec}),this.control.value(this,this.microsec_slider,"microsec",this.microsec-this.microsec%this._defaults.stepMicrosec))}}},_onTimeChange:function(){if(this._defaults.showTimepicker){var a=this.hour_slider?this.control.value(this,this.hour_slider,"hour"):!1,b=this.minute_slider?this.control.value(this,this.minute_slider,"minute"):!1,c=this.second_slider?this.control.value(this,this.second_slider,"second"):!1,d=this.millisec_slider?this.control.value(this,this.millisec_slider,"millisec"):!1,e=this.microsec_slider?this.control.value(this,this.microsec_slider,"microsec"):!1,f=this.timezone_select?this.timezone_select.val():!1,g=this._defaults,h=g.pickerTimeFormat||g.timeFormat,i=g.pickerTimeSuffix||g.timeSuffix;"object"==typeof a&&(a=!1),"object"==typeof b&&(b=!1),"object"==typeof c&&(c=!1),"object"==typeof d&&(d=!1),"object"==typeof e&&(e=!1),"object"==typeof f&&(f=!1),a!==!1&&(a=parseInt(a,10)),b!==!1&&(b=parseInt(b,10)),c!==!1&&(c=parseInt(c,10)),d!==!1&&(d=parseInt(d,10)),e!==!1&&(e=parseInt(e,10)),f!==!1&&(f=f.toString());var j=g[12>a?"amNames":"pmNames"][0],k=a!==parseInt(this.hour,10)||b!==parseInt(this.minute,10)||c!==parseInt(this.second,10)||d!==parseInt(this.millisec,10)||e!==parseInt(this.microsec,10)||this.ampm.length>0&&12>a!=(-1!==$.inArray(this.ampm.toUpperCase(),this.amNames))||null!==this.timezone&&f!==this.timezone.toString();if(k&&(a!==!1&&(this.hour=a),b!==!1&&(this.minute=b),c!==!1&&(this.second=c),d!==!1&&(this.millisec=d),e!==!1&&(this.microsec=e),f!==!1&&(this.timezone=f),this.inst||(this.inst=$.datepicker._getInst(this.$input[0])),this._limitMinMaxDateTime(this.inst,!0)),this.support.ampm&&(this.ampm=j),this.formattedTime=$.datepicker.formatTime(g.timeFormat,this,g),this.$timeObj&&(this.$timeObj.val(h===g.timeFormat?this.formattedTime+i:$.datepicker.formatTime(h,this,g)+i),this.$timeObj[0].setSelectionRange)){var l=this.$timeObj[0].selectionStart,m=this.$timeObj[0].selectionEnd;this.$timeObj[0].setSelectionRange(l,m)}this.timeDefined=!0,k&&this._updateDateTime()}},_onSelectHandler:function(){var a=this._defaults.onSelect||this.inst.settings.onSelect,b=this.$input?this.$input[0]:null;a&&b&&a.apply(b,[this.formattedDateTime,this])},_updateDateTime:function(a){a=this.inst||a;var b=a.currentYear>0?new Date(a.currentYear,a.currentMonth,a.currentDay):new Date(a.selectedYear,a.selectedMonth,a.selectedDay),c=$.datepicker._daylightSavingAdjust(b),d=$.datepicker._get(a,"dateFormat"),e=$.datepicker._getFormatConfig(a),f=null!==c&&this.timeDefined;this.formattedDate=$.datepicker.formatDate(d,null===c?new Date:c,e);var g=this.formattedDate;if(""===a.lastVal&&(a.currentYear=a.selectedYear,a.currentMonth=a.selectedMonth,a.currentDay=a.selectedDay),this._defaults.timeOnly===!0&&this._defaults.timeOnlyShowDate===!1?g=this.formattedTime:(this._defaults.timeOnly!==!0&&(this._defaults.alwaysSetTime||f)||this._defaults.timeOnly===!0&&this._defaults.timeOnlyShowDate===!0)&&(g+=this._defaults.separator+this.formattedTime+this._defaults.timeSuffix),this.formattedDateTime=g,this._defaults.showTimepicker)if(this.$altInput&&this._defaults.timeOnly===!1&&this._defaults.altFieldTimeOnly===!0)this.$altInput.val(this.formattedTime),this.$input.val(this.formattedDate);else if(this.$altInput){this.$input.val(g);var h="",i=null!==this._defaults.altSeparator?this._defaults.altSeparator:this._defaults.separator,j=null!==this._defaults.altTimeSuffix?this._defaults.altTimeSuffix:this._defaults.timeSuffix;this._defaults.timeOnly||(h=this._defaults.altFormat?$.datepicker.formatDate(this._defaults.altFormat,null===c?new Date:c,e):this.formattedDate,h&&(h+=i)),h+=null!==this._defaults.altTimeFormat?$.datepicker.formatTime(this._defaults.altTimeFormat,this,this._defaults)+j:this.formattedTime+j,this.$altInput.val(h)}else this.$input.val(g);else this.$input.val(this.formattedDate);this.$input.trigger("change")},_onFocus:function(){if(!this.$input.val()&&this._defaults.defaultValue){this.$input.val(this._defaults.defaultValue);var a=$.datepicker._getInst(this.$input.get(0)),b=$.datepicker._get(a,"timepicker");if(b&&b._defaults.timeOnly&&a.input.val()!==a.lastVal)try{$.datepicker._updateDatepicker(a)}catch(c){$.timepicker.log(c)}}},_controls:{slider:{create:function(a,b,c,d,e,f,g){var h=a._defaults.isRTL;return b.prop("slide",null).slider({orientation:"horizontal",value:h?-1*d:d,min:h?-1*f:e,max:h?-1*e:f,step:g,slide:function(b,d){a.control.value(a,$(this),c,h?-1*d.value:d.value),a._onTimeChange()},stop:function(b,c){a._onSelectHandler()}})},options:function(a,b,c,d,e){if(a._defaults.isRTL){if("string"==typeof d)return"min"===d||"max"===d?void 0!==e?b.slider(d,-1*e):Math.abs(b.slider(d)):b.slider(d);var f=d.min,g=d.max;return d.min=d.max=null,void 0!==f&&(d.max=-1*f),void 0!==g&&(d.min=-1*g),b.slider(d)}return"string"==typeof d&&void 0!==e?b.slider(d,e):b.slider(d)},value:function(a,b,c,d){return a._defaults.isRTL?void 0!==d?b.slider("value",-1*d):Math.abs(b.slider("value")):void 0!==d?b.slider("value",d):b.slider("value")}},select:{create:function(a,b,c,d,e,f,g){for(var h='<select class="ui-timepicker-select ui-state-default ui-corner-all" data-unit="'+c+'" data-min="'+e+'" data-max="'+f+'" data-step="'+g+'">',i=a._defaults.pickerTimeFormat||a._defaults.timeFormat,j=e;f>=j;j+=g)h+='<option value="'+j+'"'+(j===d?" selected":"")+">",h+="hour"===c?$.datepicker.formatTime($.trim(i.replace(/[^ht ]/gi,"")),{hour:j},a._defaults):"millisec"===c||"microsec"===c||j>=10?j:"0"+j.toString(),h+="</option>";return h+="</select>",b.children("select").remove(),$(h).appendTo(b).change(function(b){a._onTimeChange(),a._onSelectHandler(),a._afterInject()}),b},options:function(a,b,c,d,e){var f={},g=b.children("select");if("string"==typeof d){if(void 0===e)return g.data(d);f[d]=e}else f=d;return a.control.create(a,b,g.data("unit"),g.val(),f.min>=0?f.min:g.data("min"),f.max||g.data("max"),f.step||g.data("step"))},value:function(a,b,c,d){var e=b.children("select");return void 0!==d?e.val(d):e.val()}}}}),$.fn.extend({timepicker:function(a){a=a||{};var b=Array.prototype.slice.call(arguments);return"object"==typeof a&&(b[0]=$.extend(a,{timeOnly:!0})),$(this).each(function(){$.fn.datetimepicker.apply($(this),b)})},datetimepicker:function(a){a=a||{};var b=arguments;return"string"==typeof a?"getDate"===a||"option"===a&&2===b.length&&"string"==typeof b[1]?$.fn.datepicker.apply($(this[0]),b):this.each(function(){var a=$(this);a.datepicker.apply(a,b)}):this.each(function(){var b=$(this);b.datepicker($.timepicker._newInst(b,a)._defaults)})}}),$.datepicker.parseDateTime=function(a,b,c,d,e){var f=parseDateTimeInternal(a,b,c,d,e);if(f.timeObj){var g=f.timeObj;f.date.setHours(g.hour,g.minute,g.second,g.millisec),f.date.setMicroseconds(g.microsec)}return f.date},$.datepicker.parseTime=function(a,b,c){var d=extendRemove(extendRemove({},$.timepicker._defaults),c||{}),e=(-1!==a.replace(/\'.*?\'/g,"").indexOf("Z"),function(a,b,c){var d,e=function(a,b){var c=[];return a&&$.merge(c,a),b&&$.merge(c,b),c=$.map(c,function(a){return a.replace(/[.*+?|()\[\]{}\\]/g,"\\$&")}),"("+c.join("|")+")?"},f=function(a){var b=a.toLowerCase().match(/(h{1,2}|m{1,2}|s{1,2}|l{1}|c{1}|t{1,2}|z|'.*?')/g),c={h:-1,m:-1,s:-1,l:-1,c:-1,t:-1,z:-1};if(b)for(var d=0;d<b.length;d++)-1===c[b[d].toString().charAt(0)]&&(c[b[d].toString().charAt(0)]=d+1);return c},g="^"+a.toString().replace(/([hH]{1,2}|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g,function(a){var b=a.length;switch(a.charAt(0).toLowerCase()){case"h":return 1===b?"(\\d?\\d)":"(\\d{"+b+"})";case"m":return 1===b?"(\\d?\\d)":"(\\d{"+b+"})";case"s":return 1===b?"(\\d?\\d)":"(\\d{"+b+"})";case"l":return"(\\d?\\d?\\d)";case"c":return"(\\d?\\d?\\d)";case"z":return"(z|[-+]\\d\\d:?\\d\\d|\\S+)?";case"t":return e(c.amNames,c.pmNames);default:return"("+a.replace(/\'/g,"").replace(/(\.|\$|\^|\\|\/|\(|\)|\[|\]|\?|\+|\*)/g,function(a){return"\\"+a})+")?"}}).replace(/\s/g,"\\s?")+c.timeSuffix+"$",h=f(a),i="";d=b.match(new RegExp(g,"i"));var j={hour:0,minute:0,second:0,millisec:0,microsec:0};return d?(-1!==h.t&&(void 0===d[h.t]||0===d[h.t].length?(i="",j.ampm=""):(i=-1!==$.inArray(d[h.t].toUpperCase(),$.map(c.amNames,function(a,b){return a.toUpperCase()}))?"AM":"PM",j.ampm=c["AM"===i?"amNames":"pmNames"][0])),-1!==h.h&&("AM"===i&&"12"===d[h.h]?j.hour=0:"PM"===i&&"12"!==d[h.h]?j.hour=parseInt(d[h.h],10)+12:j.hour=Number(d[h.h])),-1!==h.m&&(j.minute=Number(d[h.m])),-1!==h.s&&(j.second=Number(d[h.s])),-1!==h.l&&(j.millisec=Number(d[h.l])),-1!==h.c&&(j.microsec=Number(d[h.c])),-1!==h.z&&void 0!==d[h.z]&&(j.timezone=$.timepicker.timezoneOffsetNumber(d[h.z])),j):!1}),f=function(a,b,c){try{var d=new Date("2012-01-01 "+b);if(isNaN(d.getTime())&&(d=new Date("2012-01-01T"+b),isNaN(d.getTime())&&(d=new Date("01/01/2012 "+b),isNaN(d.getTime()))))throw"Unable to parse time with native Date: "+b;return{hour:d.getHours(),minute:d.getMinutes(),second:d.getSeconds(),millisec:d.getMilliseconds(),microsec:d.getMicroseconds(),timezone:-1*d.getTimezoneOffset()}}catch(f){try{return e(a,b,c)}catch(g){$.timepicker.log("Unable to parse \ntimeString: "+b+"\ntimeFormat: "+a)}}return!1};return"function"==typeof d.parse?d.parse(a,b,d):"loose"===d.parse?f(a,b,d):e(a,b,d)},$.datepicker.formatTime=function(a,b,c){c=c||{},c=$.extend({},$.timepicker._defaults,c),b=$.extend({hour:0,minute:0,second:0,millisec:0,microsec:0,timezone:null},b);var d=a,e=c.amNames[0],f=parseInt(b.hour,10);return f>11&&(e=c.pmNames[0]),d=d.replace(/(?:HH?|hh?|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g,function(a){switch(a){case"HH":return("0"+f).slice(-2);case"H":return f;case"hh":return("0"+convert24to12(f)).slice(-2);case"h":return convert24to12(f);case"mm":return("0"+b.minute).slice(-2);case"m":return b.minute;case"ss":return("0"+b.second).slice(-2);case"s":return b.second;case"l":return("00"+b.millisec).slice(-3);case"c":return("00"+b.microsec).slice(-3);case"z":return $.timepicker.timezoneOffsetString(null===b.timezone?c.timezone:b.timezone,!1);case"Z":return $.timepicker.timezoneOffsetString(null===b.timezone?c.timezone:b.timezone,!0);case"T":return e.charAt(0).toUpperCase();case"TT":return e.toUpperCase();case"t":return e.charAt(0).toLowerCase();case"tt":return e.toLowerCase();default:return a.replace(/'/g,"")}})},$.datepicker._base_selectDate=$.datepicker._selectDate,$.datepicker._selectDate=function(a,b){var c,d=this._getInst($(a)[0]),e=this._get(d,"timepicker");e&&d.settings.showTimepicker?(e._limitMinMaxDateTime(d,!0),c=d.inline,d.inline=d.stay_open=!0,this._base_selectDate(a,b),d.inline=c,d.stay_open=!1,this._notifyChange(d),this._updateDatepicker(d)):this._base_selectDate(a,b)},$.datepicker._base_updateDatepicker=$.datepicker._updateDatepicker,$.datepicker._updateDatepicker=function(a){var b=a.input[0];if(!($.datepicker._curInst&&$.datepicker._curInst!==a&&$.datepicker._datepickerShowing&&$.datepicker._lastInput!==b||"boolean"==typeof a.stay_open&&a.stay_open!==!1)){this._base_updateDatepicker(a);var c=this._get(a,"timepicker");c&&c._addTimePicker(a)}},$.datepicker._base_doKeyPress=$.datepicker._doKeyPress,$.datepicker._doKeyPress=function(a){var b=$.datepicker._getInst(a.target),c=$.datepicker._get(b,"timepicker");if(c&&$.datepicker._get(b,"constrainInput")){var d=c.support.ampm,e=null!==c._defaults.showTimezone?c._defaults.showTimezone:c.support.timezone,f=$.datepicker._possibleChars($.datepicker._get(b,"dateFormat")),g=c._defaults.timeFormat.toString().replace(/[hms]/g,"").replace(/TT/g,d?"APM":"").replace(/Tt/g,d?"AaPpMm":"").replace(/tT/g,d?"AaPpMm":"").replace(/T/g,d?"AP":"").replace(/tt/g,d?"apm":"").replace(/t/g,d?"ap":"")+" "+c._defaults.separator+c._defaults.timeSuffix+(e?c._defaults.timezoneList.join(""):"")+c._defaults.amNames.join("")+c._defaults.pmNames.join("")+f,h=String.fromCharCode(void 0===a.charCode?a.keyCode:a.charCode);return a.ctrlKey||" ">h||!f||g.indexOf(h)>-1}return $.datepicker._base_doKeyPress(a)},$.datepicker._base_updateAlternate=$.datepicker._updateAlternate,$.datepicker._updateAlternate=function(a){var b=this._get(a,"timepicker");if(b){var c=b._defaults.altField;if(c){var d=(b._defaults.altFormat||b._defaults.dateFormat,this._getDate(a)),e=$.datepicker._getFormatConfig(a),f="",g=b._defaults.altSeparator?b._defaults.altSeparator:b._defaults.separator,h=b._defaults.altTimeSuffix?b._defaults.altTimeSuffix:b._defaults.timeSuffix,i=null!==b._defaults.altTimeFormat?b._defaults.altTimeFormat:b._defaults.timeFormat;f+=$.datepicker.formatTime(i,b,b._defaults)+h,b._defaults.timeOnly||b._defaults.altFieldTimeOnly||null===d||(f=b._defaults.altFormat?$.datepicker.formatDate(b._defaults.altFormat,d,e)+g+f:b.formattedDate+g+f),$(c).val(a.input.val()?f:"")}}else $.datepicker._base_updateAlternate(a)},$.datepicker._base_doKeyUp=$.datepicker._doKeyUp,$.datepicker._doKeyUp=function(a){var b=$.datepicker._getInst(a.target),c=$.datepicker._get(b,"timepicker");
|
5 |
+
if(c&&c._defaults.timeOnly&&b.input.val()!==b.lastVal)try{$.datepicker._updateDatepicker(b)}catch(d){$.timepicker.log(d)}return $.datepicker._base_doKeyUp(a)},$.datepicker._base_gotoToday=$.datepicker._gotoToday,$.datepicker._gotoToday=function(a){var b=this._getInst($(a)[0]);this._base_gotoToday(a);var c=this._get(b,"timepicker");if(c){var d=$.timepicker.timezoneOffsetNumber(c.timezone),e=new Date;e.setMinutes(e.getMinutes()+e.getTimezoneOffset()+parseInt(d,10)),this._setTime(b,e),this._setDate(b,e),c._onSelectHandler()}},$.datepicker._disableTimepickerDatepicker=function(a){var b=this._getInst(a);if(b){var c=this._get(b,"timepicker");$(a).datepicker("getDate"),c&&(b.settings.showTimepicker=!1,c._defaults.showTimepicker=!1,c._updateDateTime(b))}},$.datepicker._enableTimepickerDatepicker=function(a){var b=this._getInst(a);if(b){var c=this._get(b,"timepicker");$(a).datepicker("getDate"),c&&(b.settings.showTimepicker=!0,c._defaults.showTimepicker=!0,c._addTimePicker(b),c._updateDateTime(b))}},$.datepicker._setTime=function(a,b){var c=this._get(a,"timepicker");if(c){var d=c._defaults;c.hour=b?b.getHours():d.hour,c.minute=b?b.getMinutes():d.minute,c.second=b?b.getSeconds():d.second,c.millisec=b?b.getMilliseconds():d.millisec,c.microsec=b?b.getMicroseconds():d.microsec,c._limitMinMaxDateTime(a,!0),c._onTimeChange(),c._updateDateTime(a)}},$.datepicker._setTimeDatepicker=function(a,b,c){var d=this._getInst(a);if(d){var e=this._get(d,"timepicker");if(e){this._setDateFromField(d);var f;b&&("string"==typeof b?(e._parseTime(b,c),f=new Date,f.setHours(e.hour,e.minute,e.second,e.millisec),f.setMicroseconds(e.microsec)):(f=new Date(b.getTime()),f.setMicroseconds(b.getMicroseconds())),"Invalid Date"===f.toString()&&(f=void 0),this._setTime(d,f))}}},$.datepicker._base_setDateDatepicker=$.datepicker._setDateDatepicker,$.datepicker._setDateDatepicker=function(a,b){var c=this._getInst(a),d=b;if(c){"string"==typeof b&&(d=new Date(b),d.getTime()||(this._base_setDateDatepicker.apply(this,arguments),d=$(a).datepicker("getDate")));var e,f=this._get(c,"timepicker");d instanceof Date?(e=new Date(d.getTime()),e.setMicroseconds(d.getMicroseconds())):e=d,f&&e&&(f.support.timezone||null!==f._defaults.timezone||(f.timezone=-1*e.getTimezoneOffset()),d=$.timepicker.timezoneAdjust(d,$.timepicker.timezoneOffsetString(-d.getTimezoneOffset()),f.timezone),e=$.timepicker.timezoneAdjust(e,$.timepicker.timezoneOffsetString(-e.getTimezoneOffset()),f.timezone)),this._updateDatepicker(c),this._base_setDateDatepicker.apply(this,arguments),this._setTimeDatepicker(a,e,!0)}},$.datepicker._base_getDateDatepicker=$.datepicker._getDateDatepicker,$.datepicker._getDateDatepicker=function(a,b){var c=this._getInst(a);if(c){var d=this._get(c,"timepicker");if(d){void 0===c.lastVal&&this._setDateFromField(c,b);var e=this._getDate(c),f=null;return f=d.$altInput&&d._defaults.altFieldTimeOnly?d.$input.val()+" "+d.$altInput.val():"INPUT"!==d.$input.get(0).tagName&&d.$altInput?d.$altInput.val():d.$input.val(),e&&d._parseTime(f,!c.settings.timeOnly)&&(e.setHours(d.hour,d.minute,d.second,d.millisec),e.setMicroseconds(d.microsec),null!=d.timezone&&(d.support.timezone||null!==d._defaults.timezone||(d.timezone=-1*e.getTimezoneOffset()),e=$.timepicker.timezoneAdjust(e,d.timezone,$.timepicker.timezoneOffsetString(-e.getTimezoneOffset())))),e}return this._base_getDateDatepicker(a,b)}},$.datepicker._base_parseDate=$.datepicker.parseDate,$.datepicker.parseDate=function(a,b,c){var d;try{d=this._base_parseDate(a,b,c)}catch(e){if(!(e.indexOf(":")>=0))throw e;d=this._base_parseDate(a,b.substring(0,b.length-(e.length-e.indexOf(":")-2)),c),$.timepicker.log("Error parsing the date string: "+e+"\ndate string = "+b+"\ndate format = "+a)}return d},$.datepicker._base_formatDate=$.datepicker._formatDate,$.datepicker._formatDate=function(a,b,c,d){var e=this._get(a,"timepicker");return e?(e._updateDateTime(a),e.$input.val()):this._base_formatDate(a)},$.datepicker._base_optionDatepicker=$.datepicker._optionDatepicker,$.datepicker._optionDatepicker=function(a,b,c){var d,e=this._getInst(a);if(!e)return null;var f=this._get(e,"timepicker");if(f){var g,h,i,j,k=null,l=null,m=null,n=f._defaults.evnts,o={};if("string"==typeof b){if("minDate"===b||"minDateTime"===b)k=c;else if("maxDate"===b||"maxDateTime"===b)l=c;else if("onSelect"===b)m=c;else if(n.hasOwnProperty(b)){if("undefined"==typeof c)return n[b];o[b]=c,d={}}}else if("object"==typeof b){b.minDate?k=b.minDate:b.minDateTime?k=b.minDateTime:b.maxDate?l=b.maxDate:b.maxDateTime&&(l=b.maxDateTime);for(g in n)n.hasOwnProperty(g)&&b[g]&&(o[g]=b[g])}for(g in o)o.hasOwnProperty(g)&&(n[g]=o[g],d||(d=$.extend({},b)),delete d[g]);if(d&&isEmptyObject(d))return;if(k?(k=0===k?new Date:new Date(k),f._defaults.minDate=k,f._defaults.minDateTime=k):l?(l=0===l?new Date:new Date(l),f._defaults.maxDate=l,f._defaults.maxDateTime=l):m&&(f._defaults.onSelect=m),k||l)return j=$(a),i=j.datetimepicker("getDate"),h=this._base_optionDatepicker.call($.datepicker,a,d||b,c),j.datetimepicker("setDate",i),h}return void 0===c?this._base_optionDatepicker.call($.datepicker,a,b):this._base_optionDatepicker.call($.datepicker,a,d||b,c)};var isEmptyObject=function(a){var b;for(b in a)if(a.hasOwnProperty(b))return!1;return!0},extendRemove=function(a,b){$.extend(a,b);for(var c in b)(null===b[c]||void 0===b[c])&&(a[c]=b[c]);return a},detectSupport=function(a){var b=a.replace(/'.*?'/g,"").toLowerCase(),c=function(a,b){return-1!==a.indexOf(b)?!0:!1};return{hour:c(b,"h"),minute:c(b,"m"),second:c(b,"s"),millisec:c(b,"l"),microsec:c(b,"c"),timezone:c(b,"z"),ampm:c(b,"t")&&c(a,"h"),iso8601:c(a,"Z")}},convert24to12=function(a){return a%=12,0===a&&(a=12),String(a)},computeEffectiveSetting=function(a,b){return a&&a[b]?a[b]:$.timepicker._defaults[b]},splitDateTime=function(a,b){var c=computeEffectiveSetting(b,"separator"),d=computeEffectiveSetting(b,"timeFormat"),e=d.split(c),f=e.length,g=a.split(c),h=g.length;return h>1?{dateString:g.splice(0,h-f).join(c),timeString:g.splice(0,f).join(c)}:{dateString:a,timeString:""}},parseDateTimeInternal=function(a,b,c,d,e){var f,g,h;if(g=splitDateTime(c,e),f=$.datepicker._base_parseDate(a,g.dateString,d),""===g.timeString)return{date:f};if(h=$.datepicker.parseTime(b,g.timeString,e),!h)throw"Wrong time format";return{date:f,timeObj:h}},selectLocalTimezone=function(a,b){if(a&&a.timezone_select){var c=b||new Date;a.timezone_select.val(-c.getTimezoneOffset())}};$.timepicker=new Timepicker,$.timepicker.timezoneOffsetString=function(a,b){if(isNaN(a)||a>840||-720>a)return a;var c=a,d=c%60,e=(c-d)/60,f=b?":":"",g=(c>=0?"+":"-")+("0"+Math.abs(e)).slice(-2)+f+("0"+Math.abs(d)).slice(-2);return"+00:00"===g?"Z":g},$.timepicker.timezoneOffsetNumber=function(a){var b=a.toString().replace(":","");return"Z"===b.toUpperCase()?0:/^(\-|\+)\d{4}$/.test(b)?("-"===b.substr(0,1)?-1:1)*(60*parseInt(b.substr(1,2),10)+parseInt(b.substr(3,2),10)):parseInt(a,10)},$.timepicker.timezoneAdjust=function(a,b,c){var d=$.timepicker.timezoneOffsetNumber(b),e=$.timepicker.timezoneOffsetNumber(c);return isNaN(e)||a.setMinutes(a.getMinutes()+-d- -e),a},$.timepicker.timeRange=function(a,b,c){return $.timepicker.handleRange("timepicker",a,b,c)},$.timepicker.datetimeRange=function(a,b,c){$.timepicker.handleRange("datetimepicker",a,b,c)},$.timepicker.dateRange=function(a,b,c){$.timepicker.handleRange("datepicker",a,b,c)},$.timepicker.handleRange=function(a,b,c,d){function e(e,f){var g=b[a]("getDate"),h=c[a]("getDate"),i=e[a]("getDate");if(null!==g){var j=new Date(g.getTime()),k=new Date(g.getTime());j.setMilliseconds(j.getMilliseconds()+d.minInterval),k.setMilliseconds(k.getMilliseconds()+d.maxInterval),d.minInterval>0&&j>h?c[a]("setDate",j):d.maxInterval>0&&h>k?c[a]("setDate",k):g>h&&f[a]("setDate",i)}}function f(b,c,e){if(b.val()){var f=b[a].call(b,"getDate");null!==f&&d.minInterval>0&&("minDate"===e&&f.setMilliseconds(f.getMilliseconds()+d.minInterval),"maxDate"===e&&f.setMilliseconds(f.getMilliseconds()-d.minInterval)),f.getTime&&c[a].call(c,"option",e,f)}}d=$.extend({},{minInterval:0,maxInterval:0,start:{},end:{}},d);var g=!1;return"timepicker"===a&&(g=!0,a="datetimepicker"),$.fn[a].call(b,$.extend({timeOnly:g,onClose:function(a,b){e($(this),c)},onSelect:function(a){f($(this),c,"minDate")}},d,d.start)),$.fn[a].call(c,$.extend({timeOnly:g,onClose:function(a,c){e($(this),b)},onSelect:function(a){f($(this),b,"maxDate")}},d,d.end)),e(b,c),f(b,c,"minDate"),f(c,b,"maxDate"),$([b.get(0),c.get(0)])},$.timepicker.log=function(){window.console&&window.console.log&&window.console.log.apply&&window.console.log.apply(window.console,Array.prototype.slice.call(arguments))},$.timepicker._util={_extendRemove:extendRemove,_isEmptyObject:isEmptyObject,_convert24to12:convert24to12,_detectSupport:detectSupport,_selectLocalTimezone:selectLocalTimezone,_computeEffectiveSetting:computeEffectiveSetting,_splitDateTime:splitDateTime,_parseDateTimeInternal:parseDateTimeInternal},Date.prototype.getMicroseconds||(Date.prototype.microseconds=0,Date.prototype.getMicroseconds=function(){return this.microseconds},Date.prototype.setMicroseconds=function(a){return this.setMilliseconds(this.getMilliseconds()+Math.floor(a/1e3)),this.microseconds=a%1e3,this}),$.timepicker.version="1.6.3"}});
|
assets/js/select2.min.js
CHANGED
@@ -1,2 +1 @@
|
|
1 |
-
/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=s.map,p=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(n=n.slice(0,n.length-1),a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.concat(a),k=0;k<a.length;k+=1)if(m=a[k],"."===m)a.splice(k,1),k-=1;else if(".."===m){if(1===k&&(".."===a[2]||".."===a[0]))break;k>0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||p)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&p&&p[d]&&(i=p[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){return n.apply(b,v.call(arguments,0).concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){q[a]=b}}function j(a){if(e(r,a)){var c=r[a];delete r[a],t[a]=!0,m.apply(b,c)}if(!e(q,a)&&!e(t,a))throw new Error("No "+a);return q[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice,w=/\.js$/;o=function(a,b){var c,d=k(a),e=d[0];return a=d[1],e&&(e=f(e,b),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(b)):f(a,b):(a=f(a,b),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},p={require:function(a){return g(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(a,c,d,f){var h,k,l,m,n,s,u=[],v=typeof d;if(f=f||a,"undefined"===v||"function"===v){for(c=!c.length&&d.length?["require","exports","module"]:c,n=0;n<c.length;n+=1)if(m=o(c[n],f),k=m.f,"require"===k)u[n]=p.require(a);else if("exports"===k)u[n]=p.exports(a),s=!0;else if("module"===k)h=u[n]=p.module(a);else if(e(q,k)||e(r,k)||e(t,k))u[n]=j(k);else{if(!m.p)throw new Error(a+" missing "+k);m.p.load(m.n,g(f,!0),i(k),{}),u[n]=q[k]}l=d?d.apply(q[a],u):void 0,a&&(h&&h.exports!==b&&h.exports!==q[a]?q[a]=h.exports:l===b&&s||(q[a]=l))}else a&&(q[a]=d)},a=c=n=function(a,c,d,e,f){if("string"==typeof a)return p[a]?p[a](c):j(o(a,c).f);if(!a.splice){if(s=a,s.deps&&n(s.deps,s.callback),!c)return;c.splice?(a=c,c=d,d=null):a=b}return c=c||function(){},"function"==typeof d&&(d=e,e=f),e?m(b,a,c,d):setTimeout(function(){m(b,a,c,d)},4),n},n.config=function(a){return n(a)},a._defined=q,d=function(a,b,c){b.splice||(c=b,b=[]),e(q,a)||e(r,a)||(r[a]=[a,b,c])},d.amd={jQuery:!0}}(),b.requirejs=a,b.require=c,b.define=d}}(),b.define("almond",function(){}),b.define("jquery",[],function(){var b=a||$;return null==b&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),b}),b.define("select2/utils",["jquery"],function(a){function b(a){var b=a.prototype,c=[];for(var d in b){var e=b[d];"function"==typeof e&&"constructor"!==d&&c.push(d)}return c}var c={};c.Extend=function(a,b){function c(){this.constructor=a}var d={}.hasOwnProperty;for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},c.Decorate=function(a,c){function d(){var b=Array.prototype.unshift,d=c.prototype.constructor.length,e=a.prototype.constructor;d>0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h<g.length;h++){var i=g[h];d.prototype[i]=a.prototype[i]}for(var j=(function(a){var b=function(){};a in d.prototype&&(b=d.prototype[a]);var e=c.prototype[a];return function(){var a=Array.prototype.unshift;return a.call(arguments,b),e.apply(this,arguments)}}),k=0;k<f.length;k++){var l=f[k];d.prototype[l]=j(l)}return d};var d=function(){this.listeners={}};return d.prototype.on=function(a,b){this.listeners=this.listeners||{},a in this.listeners?this.listeners[a].push(b):this.listeners[a]=[b]},d.prototype.trigger=function(a){var b=Array.prototype.slice;this.listeners=this.listeners||{},a in this.listeners&&this.invoke(this.listeners[a],b.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},d.prototype.invoke=function(a,b){for(var c=0,d=a.length;d>c;c++)a[c].apply(this,b)},c.Observable=d,c.generateChars=function(a){for(var b="",c=0;a>c;c++){var d=Math.floor(36*Math.random());b+=d.toString(36)}return b},c.bind=function(a,b){return function(){a.apply(b,arguments)}},c._convertData=function(a){for(var b in a){var c=b.split("-"),d=a;if(1!==c.length){for(var e=0;e<c.length;e++){var f=c[e];f=f.substring(0,1).toLowerCase()+f.substring(1),f in d||(d[f]={}),e==c.length-1&&(d[f]=a[b]),d=d[f]}delete a[b]}}return a},c.hasScroll=function(b,c){var d=a(c),e=c.style.overflowX,f=c.style.overflowY;return e!==f||"hidden"!==f&&"visible"!==f?"scroll"===e||"scroll"===f?!0:d.innerHeight()<c.scrollHeight||d.innerWidth()<c.scrollWidth:!1},c.escapeMarkup=function(a){var b={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<ul class="select2-results__options" role="tree"></ul>');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a('<li role="treeitem" class="select2-results__option"></li>'),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),this.$results.append(d)},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c<a.results.length;c++){var d=a.results[c],e=this.option(d);b.push(e)}this.$results.append(b)},c.prototype.position=function(a,b){var c=b.find(".select2-results");c.append(a)},c.prototype.sort=function(a){var b=this.options.get("sorter");return b(a)},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()}),e=b.$results.find(".select2-results__option[aria-selected]");e.each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("aria-selected","true"):b.attr("aria-selected","false")});var f=e.filter("[aria-selected=true]");f.length>0?f.first().trigger("mouseenter"):e.first().trigger("mouseenter")})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"treeitem","aria-selected":"false"};b.disabled&&(delete d["aria-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["aria-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d.role="group",d["aria-label"]=b.text,delete d["aria-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";{a(h)}this.template(b,h);for(var i=[],j=0;j<b.children.length;j++){var k=b.children[j],l=this.option(k);i.push(l)}var m=a("<ul></ul>",{"class":"select2-results__options select2-results__options--nested"});m.append(i),g.append(h),g.append(m)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b){var c=this,d=b.id+"-results";this.$results.attr("id",d),b.on("results:all",function(a){c.clear(),c.append(a.data),b.isOpen()&&c.setClasses()}),b.on("results:append",function(a){c.append(a.data),b.isOpen()&&c.setClasses()}),b.on("query",function(a){c.showLoading(a)}),b.on("select",function(){b.isOpen()&&c.setClasses()}),b.on("unselect",function(){b.isOpen()&&c.setClasses()}),b.on("open",function(){c.$results.attr("aria-expanded","true"),c.$results.attr("aria-hidden","false"),c.setClasses(),c.ensureHighlightVisible()}),b.on("close",function(){c.$results.attr("aria-expanded","false"),c.$results.attr("aria-hidden","true"),c.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=c.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=c.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("aria-selected")?c.trigger("close"):c.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=c.getHighlightedResults(),b=c.$results.find("[aria-selected]"),d=b.index(a);if(0!==d){var e=d-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=c.$results.offset().top,h=f.offset().top,i=c.$results.scrollTop()+(h-g);0===e?c.$results.scrollTop(0):0>h-g&&c.$results.scrollTop(i)}}),b.on("results:next",function(){var a=c.getHighlightedResults(),b=c.$results.find("[aria-selected]"),d=b.index(a),e=d+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=c.$results.offset().top+c.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=c.$results.scrollTop()+h-g;0===e?c.$results.scrollTop(0):h>g&&c.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted")}),b.on("results:message",function(a){c.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=c.$results.scrollTop(),d=c.$results.get(0).scrollHeight-c.$results.scrollTop()+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&d<=c.$results.height();e?(c.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(c.$results.scrollTop(c.$results.get(0).scrollHeight-c.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(b){var d=a(this),e=d.data("data");return"true"===d.attr("aria-selected")?void(c.options.get("multiple")?c.trigger("unselect",{originalEvent:b,data:e}):c.trigger("close")):void c.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(){var b=a(this).data("data");c.getHighlightedResults().removeClass("select2-results__option--highlighted"),c.trigger("results:focus",{data:b,element:a(this)})})},c.prototype.getHighlightedResults=function(){var a=this.$results.find(".select2-results__option--highlighted");return a},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),2>=c?this.$results.scrollTop(0):(g>this.$results.outerHeight()||0>g)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){var a={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46};return a}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a('<span class="select2-selection" role="combobox" aria-autocomplete="list" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a){var b=this,d=(a.id+"-container",a.id+"-results");this.container=a,this.$selection.on("focus",function(a){b.trigger("focus",a)}),this.$selection.on("blur",function(a){b.trigger("blur",a)}),this.$selection.on("keydown",function(a){b.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){b.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){b.update(a.data)}),a.on("open",function(){b.$selection.attr("aria-expanded","true"),b.$selection.attr("aria-owns",d),b._attachCloseHandler(a)}),a.on("close",function(){b.$selection.attr("aria-expanded","false"),b.$selection.removeAttr("aria-activedescendant"),b.$selection.removeAttr("aria-owns"),b.$selection.focus(),b._detachCloseHandler(a)}),a.on("enable",function(){b.$selection.attr("tabindex",b._tabindex)}),a.on("disable",function(){b.$selection.attr("tabindex","-1")})},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2"),e=a(".select2.select2-container--open");e.each(function(){var b=a(this);if(this!=d[0]){var c=b.data("element");c.select2("close")}})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){var c=b.find(".selection");c.append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c){function d(){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),a},d.prototype.bind=function(a){var b=this;d.__super__.bind.apply(this,arguments);var c=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",c),this.$selection.attr("aria-labelledby",c),this.$selection.on("mousedown",function(a){1===a.which&&b.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(){}),this.$selection.on("blur",function(){}),a.on("selection:update",function(a){b.update(a.data)})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a){var b=this.options.get("templateSelection"),c=this.options.get("escapeMarkup");return c(b(a))},d.prototype.selectionContainer=function(){return a("<span></span>")},d.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.display(b),d=this.$selection.find(".select2-selection__rendered");d.empty().append(c),d.prop("title",b.title||b.text)},d}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('<ul class="select2-selection__rendered"></ul>'),a},d.prototype.bind=function(){var b=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){b.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(c){var d=a(this),e=d.parent(),f=e.data("data");b.trigger("unselect",{originalEvent:c,data:f})})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a){var b=this.options.get("templateSelection"),c=this.options.get("escapeMarkup");return c(b(a))},d.prototype.selectionContainer=function(){var b=a('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">×</span></li>');return b},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d<a.length;d++){var e=a[d],f=this.display(e),g=this.selectionContainer();g.append(f),g.prop("title",e.title||e.text),g.data("data",e),b.push(g)}var h=this.$selection.find(".select2-selection__rendered");c.appendMany(h,b)}},d}),b.define("select2/selection/placeholder",["../utils"],function(){function a(a,b,c){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c)}return a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.createPlaceholder=function(a,b){var c=this.selectionContainer();return c.html(this.display(b)),c.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),c},a.prototype.update=function(a,b){var c=1==b.length&&b[0].id!=this.placeholder.id,d=b.length>1;if(d||c)return a.call(this,b);this.clear();var e=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(e)},a}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e<d.length;e++){var f={data:d[e]};if(this.trigger("unselect",f),f.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle")}}},c.prototype._handleKeyboardClear=function(a,c,d){d.isOpen()||(c.which==b.DELETE||c.which==b.BACKSPACE)&&this._handleClear(c)},c.prototype.update=function(b,c){if(b.call(this,c),!(this.$selection.find(".select2-selection__placeholder").length>0||0===c.length)){var d=a('<span class="select2-selection__clear">×</span>');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" /></li>');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return d},d.prototype.bind=function(a,b,d){var e=this;a.call(this,b,d),b.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus()}),b.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val(""),e.$search.focus()}),b.on("enable",function(){e.$search.prop("disabled",!1)}),b.on("disable",function(){e.$search.prop("disabled",!0)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e.trigger("blur",a)}),this.$selection.on("keydown",".select2-search--inline",function(a){a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented();var b=a.which;if(b===c.BACKSPACE&&""===e.$search.val()){var d=e.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var f=d.data("data");e.searchRemoveChoice(f),a.preventDefault()}}}),this.$selection.on("input",".select2-search--inline",function(){e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input",".select2-search--inline",function(a){e.handleSearch(a)})},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.trigger("open"),this.$search.val(b.text+" ")},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{var b=this.$search.val().length+1;a=.75*b+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){var a={"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"};return a}),b.define("select2/data/base",["../utils"],function(a){function b(){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),d+=null!=c.id?"-"+c.id.toString():"-"+a.generateChars(4)},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f<a.length;f++){var g=a[f].id;-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")});else{var d=a.id;this.$element.val(d),this.$element.trigger("change")}},d.prototype.unselect=function(a){var b=this;if(this.$element.prop("multiple"))return a.selected=!1,c(a.element).is("option")?(a.element.selected=!1,void this.$element.trigger("change")):void this.current(function(d){for(var e=[],f=0;f<d.length;f++){var g=d[f].id;g!==a.id&&-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")})},d.prototype.bind=function(a){var b=this;this.container=a,a.on("select",function(a){b.select(a.data)}),a.on("unselect",function(a){b.unselect(a.data)})},d.prototype.destroy=function(){this.$element.find("*").each(function(){c.removeData(this,"data")})},d.prototype.query=function(a,b){var d=[],e=this,f=this.$element.children();f.each(function(){var b=c(this);if(b.is("option")||b.is("optgroup")){var f=e.item(b),g=e.matches(a,f);null!==g&&d.push(g)}}),b({results:d})},d.prototype.addOptions=function(a){b.appendMany(this.$element,a)},d.prototype.option=function(a){var b;a.children?(b=document.createElement("optgroup"),b.label=a.text):(b=document.createElement("option"),void 0!==b.textContent?b.textContent=a.text:b.innerText=a.text),a.id&&(b.value=a.id),a.disabled&&(b.disabled=!0),a.selected&&(b.selected=!0),a.title&&(b.title=a.title);var d=c(b),e=this._normalizeItem(a);return e.element=b,c.data(b,"data",e),d},d.prototype.item=function(a){var b={};
|
2 |
-
if(b=c.data(a[0],"data"),null!=b)return b;if(a.is("option"))b={id:a.val(),text:a.text(),disabled:a.prop("disabled"),selected:a.prop("selected"),title:a.prop("title")};else if(a.is("optgroup")){b={text:a.prop("label"),children:[],title:a.prop("title")};for(var d=a.children("option"),e=[],f=0;f<d.length;f++){var g=c(d[f]),h=this.item(g);e.push(h)}b.children=e}return b=this._normalizeItem(b),b.element=a[0],c.data(a[0],"data",b),b},d.prototype._normalizeItem=function(a){c.isPlainObject(a)||(a={id:a,text:a}),a=c.extend({},{text:""},a);var b={selected:!1,disabled:!1};return null!=a.id&&(a.id=a.id.toString()),null!=a.text&&(a.text=a.text.toString()),null==a._resultId&&a.id&&null!=this.container&&(a._resultId=this.generateResultId(this.container,a)),c.extend({},b,a)},d.prototype.matches=function(a,b){var c=this.options.get("matcher");return c(a,b)},d}),b.define("select2/data/array",["./select","../utils","jquery"],function(a,b,c){function d(a,b){var c=b.get("data")||[];d.__super__.constructor.call(this,a,b),this.addOptions(this.convertToOptions(c))}return b.Extend(d,a),d.prototype.select=function(a){var b=this.$element.find("option").filter(function(b,c){return c.value==a.id.toString()});0===b.length&&(b=this.option(a),this.addOptions(b)),d.__super__.select.call(this,a)},d.prototype.convertToOptions=function(a){function d(a){return function(){return c(this).val()==a.id}}for(var e=this,f=this.$element.find("option"),g=f.map(function(){return e.item(c(this)).id}).get(),h=[],i=0;i<a.length;i++){var j=this._normalizeItem(a[i]);if(c.inArray(j.id,g)>=0){var k=f.filter(d(j)),l=this.item(k),m=(c.extend(!0,{},l,j),this.option(l));k.replaceWith(m)}else{var n=this.option(j);if(j.children){var o=this.convertToOptions(j.children);b.appendMany(n,o)}h.push(n)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(b,c){this.ajaxOptions=this._applyDefaults(c.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),a.__super__.constructor.call(this,b,c)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return{q:a.term}},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)},function(){});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url(a)),"function"==typeof f.data&&(f.data=f.data(a)),this.ajaxOptions.delay&&""!==a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");if(void 0!==f&&(this.createTag=f),b.call(this,c,d),a.isArray(e))for(var g=0;g<e.length;g++){var h=e[g],i=this._normalizeItem(h),j=this.option(i);this.$element.append(j)}}return b.prototype.query=function(a,b,c){function d(a,f){for(var g=a.results,h=0;h<g.length;h++){var i=g[h],j=null!=i.children&&!d({results:i.children},!0),k=i.text===b.term;if(k||j)return f?!1:(a.data=g,void c(a))}if(f)return!0;var l=e.createTag(b);if(null!=l){var m=e.option(l);m.attr("data-select2-tag",!0),e.addOptions([m]),e.insertTag(g,l)}a.results=g,c(a)}var e=this;return this._removeOldTags(),null==b.term||null!=b.page?void a.call(this,b,c):void a.call(this,b,d)},b.prototype.createTag=function(b,c){var d=a.trim(c.term);return""===d?null:{id:d,text:d}},b.prototype.insertTag=function(a,b,c){b.unshift(c)},b.prototype._removeOldTags=function(){var b=(this._lastTag,this.$element.find("option[data-select2-tag]"));b.each(function(){this.selected||a(this).remove()})},b}),b.define("select2/data/tokenizer",["jquery"],function(a){function b(a,b,c){var d=c.get("tokenizer");void 0!==d&&(this.tokenizer=d),a.call(this,b,c)}return b.prototype.bind=function(a,b,c){a.call(this,b,c),this.$search=b.dropdown.$search||b.selection.$search||c.find(".select2-search__field")},b.prototype.query=function(a,b,c){function d(a){e.select(a)}var e=this;b.term=b.term||"";var f=this.tokenizer(b,this.options,d);f.term!==b.term&&(this.$search.length&&(this.$search.val(f.term),this.$search.focus()),b.term=f.term),a.call(this,b,c)},b.prototype.tokenizer=function(b,c,d,e){for(var f=d.get("tokenSeparators")||[],g=c.term,h=0,i=this.createTag||function(a){return{id:a.term,text:a.term}};h<g.length;){var j=g[h];if(-1!==a.inArray(j,f)){var k=g.substr(0,h),l=a.extend({},c,{term:k}),m=i(l);e(m),g=g.substr(h+1)||"",h=0}else h++}return{term:g}},b}),b.define("select2/data/minimumInputLength",[],function(){function a(a,b,c){this.minimumInputLength=c.get("minimumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){return b.term=b.term||"",b.term.length<this.minimumInputLength?void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:b.term,params:b}}):void a.call(this,b,c)},a}),b.define("select2/data/maximumInputLength",[],function(){function a(a,b,c){this.maximumInputLength=c.get("maximumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){return b.term=b.term||"",this.maximumInputLength>0&&b.term.length>this.maximumInputLength?void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}}):void a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;return d.maximumSelectionLength>0&&f>=d.maximumSelectionLength?void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}}):void a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<span class="select2-dropdown"><span class="select2-results"></span></span>');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.position=function(){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a){function b(){}return b.prototype.render=function(b){var c=b.call(this),d=a('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" /></span>');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val("")}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){var b=e.showSearch(a);b?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}})},b.prototype.handleSearch=function(){if(!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},b.prototype.showSearch=function(){return!0},b}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){var c=e.$results.offset().top+e.$results.outerHeight(!1),d=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1);c+50>=d&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('<li class="option load-more" role="treeitem"></li>'),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(a,b,c){this.$dropdownParent=c.get("dropdownParent")||document.body,a.call(this,b,c)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a("<span></span>"),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c){var d=this,e="scroll.select2."+c.id,f="resize.select2."+c.id,g="orientationchange.select2."+c.id,h=this.$container.parents().filter(b.hasScroll);h.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),h.on(e,function(){var b=a(this).data("select2-scroll-position");a(this).scrollTop(b.y)}),a(window).on(e+" "+f+" "+g,function(){d._positionDropdown(),d._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c){var d="scroll.select2."+c.id,e="resize.select2."+c.id,f="orientationchange.select2."+c.id,g=this.$container.parents().filter(b.hasScroll);g.off(d),a(window).off(d+" "+e+" "+f)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=(this.$container.position(),this.$container.offset());f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.top<f.top-h.height,k=i.bottom>f.bottom+h.height,l={left:f.left,top:g.bottom};c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){this.$dropdownContainer.width();var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d<b.length;d++){var e=b[d];e.children?c+=a(e.children):c++}return c}function b(a,b,c,d){this.minimumResultsForSearch=c.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),a.call(this,b,c,d)}return b.prototype.showSearch=function(b,c){return a(c.data.results)<this.minimumResultsForSearch?!1:b.call(this,c)},b}),b.define("select2/dropdown/selectOnClose",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("close",function(){d._handleSelectOnClose()})},a.prototype._handleSelectOnClose=function(){var a=this.getHighlightedResults();a.length<1||this.trigger("select",{data:a.data("data")})},a}),b.define("select2/dropdown/closeOnSelect",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("select",function(a){d._selectTriggered(a)}),b.on("unselect",function(a){d._selectTriggered(a)})},a.prototype._selectTriggered=function(a,b){var c=b.originalEvent;c&&c.ctrlKey||this.trigger("close")},a}),b.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(a){var b=a.input.length-a.maximum,c="Please delete "+b+" character";return 1!=b&&(c+="s"),c},inputTooShort:function(a){var b=a.minimum-a.input.length,c="Please enter "+b+" or more characters";return c},loadingMore:function(){return"Loading more results…"},maximumSelected:function(a){var b="You can only select "+a.maximum+" item";return 1!=a.maximum&&(b+="s"),b},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),b.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C){function D(){this.reset()}D.prototype.apply=function(l){if(l=a.extend({},this.defaults,l),null==l.dataAdapter){if(l.dataAdapter=null!=l.ajax?o:null!=l.data?n:m,l.minimumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),(null!=l.tokenSeparators||null!=l.tokenizer)&&(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.selectionAdapter=l.multiple?e:d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L<K.length;L++){var M=K[L],N={};try{N=k.loadPath(M)}catch(O){try{M=this.defaults.amdLanguageBase+M,N=k.loadPath(M)}catch(P){l.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+M+'" could not be automatically loaded. A fallback will be used instead.');continue}}J.extend(N)}l.translations=J}else{var Q=k.loadPath(this.defaults.amdLanguageBase+"en"),R=new k(l.language);R.extend(Q),l.translations=R}return l},D.prototype.reset=function(){function b(a){function b(a){return l[a]||a}return a.replace(/[^\u0000-\u007E]/g,b)}function c(d,e){if(""===a.trim(d.term))return e;if(e.children&&e.children.length>0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){var h=e.children[g],i=c(d,h);null==i&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var j=b(e.text).toUpperCase(),k=b(d.term).toUpperCase();return j.indexOf(k)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)};var E=new D;return E}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(this.options.dir=a.prop("dir")?a.prop("dir"):a.closest("[dir]").prop("dir")?a.closest("[dir]").prop("dir"):"ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return 0>=e?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;i>h;h+=1){var j=g[h].replace(/\s/g,""),k=j.match(c);if(null!==k&&k.length>=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this._sync=c.bind(this._syncAttributes,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._sync);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._sync)}),this._observer.observe(this.$element[0],{attributes:!0,subtree:!1})):this.$element[0].addEventListener&&this.$element[0].addEventListener("DOMAttrModified",b._sync,!1)},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("focus",function(){a.$container.addClass("select2-container--focus")}),this.on("blur",function(){a.$container.removeClass("select2-container--focus")}),this.on("query",function(b){a.isOpen()||a.trigger("open"),this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ENTER?(a.trigger("results:select"),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle"),b.preventDefault()):c===d.UP?(a.trigger("results:previous"),b.preventDefault()):c===d.DOWN?(a.trigger("results:next"),b.preventDefault()):(c===d.ESC||c===d.TAB)&&(a.close(),b.preventDefault()):(c===d.ENTER||c===d.SPACE||(c===d.DOWN||c===d.UP)&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable")):this.trigger("enable")},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||(this.trigger("query",{}),this.trigger("open"))},e.prototype.close=function(){this.isOpen()&&this.trigger("close")},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),(null==a||0===a.length)&&(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._sync),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&this.$element[0].removeEventListener("DOMAttrModified",this._sync,!1),this._sync=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("jquery.select2",["jquery","require","./select2/core","./select2/defaults"],function(a,b,c,d){if(b("jquery.mousewheel"),null==a.fn.select2){var e=["open","close","destroy"];a.fn.select2=function(b){if(b=b||{},"object"==typeof b)return this.each(function(){{var d=a.extend({},b,!0);new c(a(this),d)}}),this;if("string"==typeof b){var d=this.data("select2");null==d&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2.");var f=Array.prototype.slice.call(arguments,1),g=d[b](f);return a.inArray(b,e)>-1?this:g}throw new Error("Invalid arguments for Select2: "+b)}}return null==a.fn.select2.defaults&&(a.fn.select2.defaults=d),c}),b.define("jquery.mousewheel",["jquery"],function(a){return a}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,c});
|
1 |
+
/*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return v.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o=b&&b.split("/"),p=t.map,q=p&&p["*"]||{};if(a){for(a=a.split("/"),g=a.length-1,t.nodeIdCompat&&x.test(a[g])&&(a[g]=a[g].replace(x,"")),"."===a[0].charAt(0)&&o&&(n=o.slice(0,o.length-1),a=n.concat(a)),k=0;k<a.length;k++)if("."===(m=a[k]))a.splice(k,1),k-=1;else if(".."===m){if(0===k||1===k&&".."===a[2]||".."===a[k-1])continue;k>0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}if((o||q)&&p){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),o)for(l=o.length;l>0;l-=1)if((e=p[o.slice(0,l).join("/")])&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&q&&q[d]&&(i=q[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=w.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),o.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){r[a]=b}}function j(a){if(e(s,a)){var c=s[a];delete s[a],u[a]=!0,n.apply(b,c)}if(!e(r,a)&&!e(u,a))throw new Error("No "+a);return r[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return a?k(a):[]}function m(a){return function(){return t&&t.config&&t.config[a]||{}}}var n,o,p,q,r={},s={},t={},u={},v=Object.prototype.hasOwnProperty,w=[].slice,x=/\.js$/;p=function(a,b){var c,d=k(a),e=d[0],g=b[1];return a=d[1],e&&(e=f(e,g),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(g)):f(a,g):(a=f(a,g),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},q={require:function(a){return g(a)},exports:function(a){var b=r[a];return void 0!==b?b:r[a]={}},module:function(a){return{id:a,uri:"",exports:r[a],config:m(a)}}},n=function(a,c,d,f){var h,k,m,n,o,t,v,w=[],x=typeof d;if(f=f||a,t=l(f),"undefined"===x||"function"===x){for(c=!c.length&&d.length?["require","exports","module"]:c,o=0;o<c.length;o+=1)if(n=p(c[o],t),"require"===(k=n.f))w[o]=q.require(a);else if("exports"===k)w[o]=q.exports(a),v=!0;else if("module"===k)h=w[o]=q.module(a);else if(e(r,k)||e(s,k)||e(u,k))w[o]=j(k);else{if(!n.p)throw new Error(a+" missing "+k);n.p.load(n.n,g(f,!0),i(k),{}),w[o]=r[k]}m=d?d.apply(r[a],w):void 0,a&&(h&&h.exports!==b&&h.exports!==r[a]?r[a]=h.exports:m===b&&v||(r[a]=m))}else a&&(r[a]=d)},a=c=o=function(a,c,d,e,f){if("string"==typeof a)return q[a]?q[a](c):j(p(a,l(c)).f);if(!a.splice){if(t=a,t.deps&&o(t.deps,t.callback),!c)return;c.splice?(a=c,c=d,d=null):a=b}return c=c||function(){},"function"==typeof d&&(d=e,e=f),e?n(b,a,c,d):setTimeout(function(){n(b,a,c,d)},4),o},o.config=function(a){return o(a)},a._defined=r,d=function(a,b,c){if("string"!=typeof a)throw new Error("See almond README: incorrect module build, no module name");b.splice||(c=b,b=[]),e(r,a)||e(s,a)||(s[a]=[a,b,c])},d.amd={jQuery:!0}}(),b.requirejs=a,b.require=c,b.define=d}}(),b.define("almond",function(){}),b.define("jquery",[],function(){var b=a||$;return null==b&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),b}),b.define("select2/utils",["jquery"],function(a){function b(a){var b=a.prototype,c=[];for(var d in b){"function"==typeof b[d]&&("constructor"!==d&&c.push(d))}return c}var c={};c.Extend=function(a,b){function c(){this.constructor=a}var d={}.hasOwnProperty;for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},c.Decorate=function(a,c){function d(){var b=Array.prototype.unshift,d=c.prototype.constructor.length,e=a.prototype.constructor;d>0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h<g.length;h++){var i=g[h];d.prototype[i]=a.prototype[i]}for(var j=(function(a){var b=function(){};a in d.prototype&&(b=d.prototype[a]);var e=c.prototype[a];return function(){return Array.prototype.unshift.call(arguments,b),e.apply(this,arguments)}}),k=0;k<f.length;k++){var l=f[k];d.prototype[l]=j(l)}return d};var d=function(){this.listeners={}};return d.prototype.on=function(a,b){this.listeners=this.listeners||{},a in this.listeners?this.listeners[a].push(b):this.listeners[a]=[b]},d.prototype.trigger=function(a){var b=Array.prototype.slice,c=b.call(arguments,1);this.listeners=this.listeners||{},null==c&&(c=[]),0===c.length&&c.push({}),c[0]._type=a,a in this.listeners&&this.invoke(this.listeners[a],b.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},d.prototype.invoke=function(a,b){for(var c=0,d=a.length;c<d;c++)a[c].apply(this,b)},c.Observable=d,c.generateChars=function(a){for(var b="",c=0;c<a;c++){b+=Math.floor(36*Math.random()).toString(36)}return b},c.bind=function(a,b){return function(){a.apply(b,arguments)}},c._convertData=function(a){for(var b in a){var c=b.split("-"),d=a;if(1!==c.length){for(var e=0;e<c.length;e++){var f=c[e];f=f.substring(0,1).toLowerCase()+f.substring(1),f in d||(d[f]={}),e==c.length-1&&(d[f]=a[b]),d=d[f]}delete a[b]}}return a},c.hasScroll=function(b,c){var d=a(c),e=c.style.overflowX,f=c.style.overflowY;return(e!==f||"hidden"!==f&&"visible"!==f)&&("scroll"===e||"scroll"===f||(d.innerHeight()<c.scrollHeight||d.innerWidth()<c.scrollWidth))},c.escapeMarkup=function(a){var b={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<ul class="select2-results__options" role="tree"></ul>');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a('<li role="treeitem" aria-live="assertive" class="select2-results__option"></li>'),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c<a.results.length;c++){var d=a.results[c],e=this.option(d);b.push(e)}this.$results.append(b)},c.prototype.position=function(a,b){b.find(".select2-results").append(a)},c.prototype.sort=function(a){return this.options.get("sorter")(a)},c.prototype.highlightFirstItem=function(){var a=this.$results.find(".select2-results__option[aria-selected]"),b=a.filter("[aria-selected=true]");b.length>0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()});b.$results.find(".select2-results__option[aria-selected]").each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("aria-selected","true"):b.attr("aria-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"treeitem","aria-selected":"false"};b.disabled&&(delete d["aria-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["aria-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d.role="group",d["aria-label"]=b.text,delete d["aria-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";a(h);this.template(b,h);for(var i=[],j=0;j<b.children.length;j++){var k=b.children[j],l=this.option(k);i.push(l)}var m=a("<ul></ul>",{class:"select2-results__options select2-results__options--nested"});m.append(i),g.append(h),g.append(m)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("unselect",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("aria-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):h-g<0&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted")}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(b){var c=a(this),e=c.data("data");if("true"===c.attr("aria-selected"))return void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{}));d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),c<=2?this.$results.scrollTop(0):(g>this.$results.outerHeight()||g<0)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a('<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id,a.id+"-results");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),d.$selection.focus(),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2");a(".select2.select2-container--open").each(function(){var b=a(this);this!=d[0]&&b.data("element").select2("close")})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){b.find(".selection").append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d),this.$selection.attr("aria-labelledby",d),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},e.prototype.selectionContainer=function(){return a("<span></span>")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('<ul class="select2-selection__rendered"></ul>'),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},d.prototype.selectionContainer=function(){return a('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">×</span></li>')},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d<a.length;d++){var e=a[d],f=this.selectionContainer(),g=this.display(e,f);f.append(g),f.prop("title",e.title||e.text),f.data("data",e),b.push(f)}var h=this.$selection.find(".select2-selection__rendered");c.appendMany(h,b)}},d}),b.define("select2/selection/placeholder",["../utils"],function(a){function b(a,b,c){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c)}return b.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},b.prototype.createPlaceholder=function(a,b){var c=this.selectionContainer();return c.html(this.display(b)),c.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),c},b.prototype.update=function(a,b){var c=1==b.length&&b[0].id!=this.placeholder.id;if(b.length>1||c)return a.call(this,b);this.clear();var d=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(d)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e<d.length;e++){var f={data:d[e]};if(this.trigger("unselect",f),f.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle",{})}}},c.prototype._handleKeyboardClear=function(a,c,d){d.isOpen()||c.which!=b.DELETE&&c.which!=b.BACKSPACE||this._handleClear(c)},c.prototype.update=function(b,c){if(b.call(this,c),!(this.$selection.find(".select2-selection__placeholder").length>0||0===c.length)){var d=a('<span class="select2-selection__clear">×</span>');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this;a.call(this,b,d),b.on("open",function(){e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.id)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){if(a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented(),a.which===c.BACKSPACE&&""===e.$search.val()){var b=e.$searchContainer.prev(".select2-selection__choice");if(b.length>0){var d=b.data("data");e.searchRemoveChoice(d),a.preventDefault()}}});var f=document.documentMode,g=f&&f<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){if(g)return void e.$selection.off("input.search input.searchcheck");e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(g&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{a=.75*(this.$search.val().length+1)+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),null!=c.id?d+="-"+c.id.toString():d+="-"+a.generateChars(4),d},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f<a.length;f++){var g=a[f].id;-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")});else{var d=a.id;this.$element.val(d),this.$element.trigger("change")}},d.prototype.unselect=function(a){var b=this;if(this.$element.prop("multiple")){if(a.selected=!1,c(a.element).is("option"))return a.element.selected=!1,void this.$element.trigger("change");this.current(function(d){for(var e=[],f=0;f<d.length;f++){var g=d[f].id;g!==a.id&&-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")})}},d.prototype.bind=function(a,b){var c=this;this.container=a,a.on("select",function(a){c.select(a.data)}),a.on("unselect",function(a){c.unselect(a.data)})},d.prototype.destroy=function(){this.$element.find("*").each(function(){c.removeData(this,"data")})},d.prototype.query=function(a,b){var d=[],e=this;this.$element.children().each(function(){var b=c(this);if(b.is("option")||b.is("optgroup")){var f=e.item(b),g=e.matches(a,f);null!==g&&d.push(g)}}),b({results:d})},d.prototype.addOptions=function(a){b.appendMany(this.$element,a)},d.prototype.option=function(a){var b;a.children?(b=document.createElement("optgroup"),b.label=a.text):(b=document.createElement("option"),void 0!==b.textContent?b.textContent=a.text:b.innerText=a.text),void 0!==a.id&&(b.value=a.id),a.disabled&&(b.disabled=!0),a.selected&&(b.selected=!0),a.title&&(b.title=a.title);var d=c(b),e=this._normalizeItem(a);return e.element=b,c.data(b,"data",e),d},d.prototype.item=function(a){var b={};if(null!=(b=c.data(a[0],"data")))return b;if(a.is("option"))b={id:a.val(),text:a.text(),disabled:a.prop("disabled"),selected:a.prop("selected"),title:a.prop("title")};else if(a.is("optgroup")){b={text:a.prop("label"),children:[],title:a.prop("title")};for(var d=a.children("option"),e=[],f=0;f<d.length;f++){var g=c(d[f]),h=this.item(g);e.push(h)}b.children=e}return b=this._normalizeItem(b),b.element=a[0],c.data(a[0],"data",b),b},d.prototype._normalizeItem=function(a){c.isPlainObject(a)||(a={id:a,text:a}),a=c.extend({},{text:""},a);var b={selected:!1,disabled:!1};return null!=a.id&&(a.id=a.id.toString()),null!=a.text&&(a.text=a.text.toString()),null==a._resultId&&a.id&&null!=this.container&&(a._resultId=this.generateResultId(this.container,a)),c.extend({},b,a)},d.prototype.matches=function(a,b){return this.options.get("matcher")(a,b)},d}),b.define("select2/data/array",["./select","../utils","jquery"],function(a,b,c){function d(a,b){var c=b.get("data")||[];d.__super__.constructor.call(this,a,b),this.addOptions(this.convertToOptions(c))}return b.Extend(d,a),d.prototype.select=function(a){var b=this.$element.find("option").filter(function(b,c){return c.value==a.id.toString()});0===b.length&&(b=this.option(a),this.addOptions(b)),d.__super__.select.call(this,a)},d.prototype.convertToOptions=function(a){function d(a){return function(){return c(this).val()==a.id}}for(var e=this,f=this.$element.find("option"),g=f.map(function(){return e.item(c(this)).id}).get(),h=[],i=0;i<a.length;i++){var j=this._normalizeItem(a[i]);if(c.inArray(j.id,g)>=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)},function(){d.status&&"0"===d.status||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h<e.length;h++){var i=e[h],j=this._normalizeItem(i),k=this.option(j);this.$element.append(k)}}return b.prototype.query=function(a,b,c){function d(a,f){for(var g=a.results,h=0;h<g.length;h++){var i=g[h],j=null!=i.children&&!d({results:i.children},!0);if((i.text||"").toUpperCase()===(b.term||"").toUpperCase()||j)return!f&&(a.data=g,void c(a))}if(f)return!0;var k=e.createTag(b);if(null!=k){var l=e.option(k);l.attr("data-select2-tag",!0),e.addOptions([l]),e.insertTag(g,k)}a.results=g,c(a)}var e=this;if(this._removeOldTags(),null==b.term||null!=b.page)return void a.call(this,b,c);a.call(this,b,d)},b.prototype.createTag=function(b,c){var d=a.trim(c.term);return""===d?null:{id:d,text:d}},b.prototype.insertTag=function(a,b,c){b.unshift(c)},b.prototype._removeOldTags=function(b){this._lastTag;this.$element.find("option[data-select2-tag]").each(function(){this.selected||a(this).remove()})},b}),b.define("select2/data/tokenizer",["jquery"],function(a){function b(a,b,c){var d=c.get("tokenizer");void 0!==d&&(this.tokenizer=d),a.call(this,b,c)}return b.prototype.bind=function(a,b,c){a.call(this,b,c),this.$search=b.dropdown.$search||b.selection.$search||c.find(".select2-search__field")},b.prototype.query=function(b,c,d){function e(b){var c=g._normalizeItem(b);if(!g.$element.find("option").filter(function(){return a(this).val()===c.id}).length){var d=g.option(c);d.attr("data-select2-tag",!0),g._removeOldTags(),g.addOptions([d])}f(c)}function f(a){g.trigger("select",{data:a})}var g=this;c.term=c.term||"";var h=this.tokenizer(c,this.options,e);h.term!==c.term&&(this.$search.length&&(this.$search.val(h.term),this.$search.focus()),c.term=h.term),b.call(this,c,d)},b.prototype.tokenizer=function(b,c,d,e){for(var f=d.get("tokenSeparators")||[],g=c.term,h=0,i=this.createTag||function(a){return{id:a.term,text:a.term}};h<g.length;){var j=g[h];if(-1!==a.inArray(j,f)){var k=g.substr(0,h),l=a.extend({},c,{term:k}),m=i(l);null!=m?(e(m),g=g.substr(h+1)||"",h=0):h++}else h++}return{term:g}},b}),b.define("select2/data/minimumInputLength",[],function(){function a(a,b,c){this.minimumInputLength=c.get("minimumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){if(b.term=b.term||"",b.term.length<this.minimumInputLength)return void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumInputLength",[],function(){function a(a,b,c){this.maximumInputLength=c.get("maximumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){if(b.term=b.term||"",this.maximumInputLength>0&&b.term.length>this.maximumInputLength)return void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;if(d.maximumSelectionLength>0&&f>=d.maximumSelectionLength)return void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}});a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<span class="select2-dropdown"><span class="select2-results"></span></span>');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="textbox" /></span>');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val("")}),c.on("focus",function(){c.isOpen()||e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){e.showSearch(a)?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){e.$results.offset().top+e.$results.outerHeight(!1)+50>=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1)&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('<li class="select2-results__option select2-results__option--load-more"role="treeitem" aria-disabled="true"></li>'),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a("<span></span>"),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id;this.$container.parents().filter(b.hasScroll).off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.top<f.top-h.height,k=i.bottom>f.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d<b.length;d++){var e=b[d];e.children?c+=a(e.children):c++}return c}function b(a,b,c,d){this.minimumResultsForSearch=c.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),a.call(this,b,c,d)}return b.prototype.showSearch=function(b,c){return!(a(c.data.results)<this.minimumResultsForSearch)&&b.call(this,c)},b}),b.define("select2/dropdown/selectOnClose",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("close",function(a){d._handleSelectOnClose(a)})},a.prototype._handleSelectOnClose=function(a,b){if(b&&null!=b.originalSelect2Event){var c=b.originalSelect2Event;if("select"===c._type||"unselect"===c._type)return}var d=this.getHighlightedResults();if(!(d.length<1)){var e=d.data("data");null!=e.element&&e.element.selected||null==e.element&&e.selected||this.trigger("select",{data:e})}},a}),b.define("select2/dropdown/closeOnSelect",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("select",function(a){d._selectTriggered(a)}),b.on("unselect",function(a){d._selectTriggered(a)})},a.prototype._selectTriggered=function(a,b){var c=b.originalEvent;c&&c.ctrlKey||this.trigger("close",{originalEvent:c,originalSelect2Event:b})},a}),b.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(a){var b=a.input.length-a.maximum,c="Please delete "+b+" character";return 1!=b&&(c+="s"),c},inputTooShort:function(a){return"Please enter "+(a.minimum-a.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(a){var b="You can only select "+a.maximum+" item";return 1!=a.maximum&&(b+="s"),b},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),b.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C){function D(){this.reset()}return D.prototype.apply=function(l){if(l=a.extend(!0,{},this.defaults,l),null==l.dataAdapter){if(null!=l.ajax?l.dataAdapter=o:null!=l.data?l.dataAdapter=n:l.dataAdapter=m,l.minimumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),null==l.tokenSeparators&&null==l.tokenizer||(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L<K.length;L++){var M=K[L],N={};try{N=k.loadPath(M)}catch(a){try{M=this.defaults.amdLanguageBase+M,N=k.loadPath(M)}catch(a){l.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+M+'" could not be automatically loaded. A fallback will be used instead.');continue}}J.extend(N)}l.translations=J}else{var O=k.loadPath(this.defaults.amdLanguageBase+"en"),P=new k(l.language);P.extend(O),l.translations=P}return l},D.prototype.reset=function(){function b(a){function b(a){return l[a]||a}return a.replace(/[^\u0000-\u007E]/g,b)}function c(d,e){if(""===a.trim(d.term))return e;if(e.children&&e.children.length>0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){null==c(d,e.children[g])&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var h=b(e.text).toUpperCase(),i=b(d.term).toUpperCase();return h.indexOf(i)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)},new D}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return e<=0?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;h<i;h+=1){var j=g[h].replace(/\s/g,""),k=j.match(c);if(null!==k&&k.length>=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("blur",function(){a.$container.removeClass("select2-container--focus")}),this.on("query",function(b){a.isOpen()||a.trigger("open",{}),this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ESC||c===d.TAB||c===d.UP&&b.altKey?(a.close(),b.preventDefault()):c===d.ENTER?(a.trigger("results:select",{}),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle",{}),b.preventDefault()):c===d.UP?(a.trigger("results:previous",{}),b.preventDefault()):c===d.DOWN&&(a.trigger("results:next",{}),b.preventDefault()):(c===d.ENTER||c===d.SPACE||c===d.DOWN&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e<b.addedNodes.length;e++){var f=b.addedNodes[e];f.selected&&(c=!0)}else b.removedNodes&&b.removedNodes.length>0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=a&&0!==a.length||(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("jquery-mousewheel",["jquery"],function(a){return a}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(a,b,c,d){if(null==a.fn.select2){var e=["open","close","destroy"];a.fn.select2=function(b){if("object"==typeof(b=b||{}))return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d,f=Array.prototype.slice.call(arguments,1);return this.each(function(){var c=a(this).data("select2");null==c&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2."),d=c[b].apply(c,f)}),a.inArray(b,e)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null==a.fn.select2.defaults&&(a.fn.select2.defaults=d),c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,c});
|
|
bulk-delete.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin Script: bulk-delete.php
|
5 |
* Plugin URI: https://bulkwp.com
|
6 |
* Description: Bulk delete users and posts from selected categories, tags, post types, custom taxonomies or by post status like drafts, scheduled posts, revisions etc.
|
7 |
-
* Version:
|
8 |
* License: GPLv2 or later
|
9 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
* Author: Sudar
|
@@ -30,639 +30,49 @@
|
|
30 |
* along with this program; if not, write to the Free Software
|
31 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
32 |
*/
|
33 |
-
defined( 'ABSPATH' ) || exit; // Exit if accessed directly
|
34 |
|
35 |
-
|
36 |
-
|
37 |
-
*
|
38 |
-
* Singleton @since 5.0
|
39 |
-
*/
|
40 |
-
final class Bulk_Delete {
|
41 |
-
/**
|
42 |
-
* @var Bulk_Delete The one true Bulk_Delete
|
43 |
-
*
|
44 |
-
* @since 5.0
|
45 |
-
*/
|
46 |
-
private static $instance;
|
47 |
-
|
48 |
-
private $controller;
|
49 |
-
|
50 |
-
// version
|
51 |
-
const VERSION = '5.6.1';
|
52 |
-
|
53 |
-
// Numeric constants
|
54 |
-
const MENU_ORDER = '26';
|
55 |
-
|
56 |
-
// page slugs
|
57 |
-
const POSTS_PAGE_SLUG = 'bulk-delete-posts';
|
58 |
-
const PAGES_PAGE_SLUG = 'bulk-delete-pages';
|
59 |
-
const CRON_PAGE_SLUG = 'bulk-delete-cron';
|
60 |
-
const ADDON_PAGE_SLUG = 'bulk-delete-addon';
|
61 |
-
|
62 |
-
// JS constants
|
63 |
-
const JS_HANDLE = 'bulk-delete';
|
64 |
-
const JS_VARIABLE = 'BulkWP';
|
65 |
-
|
66 |
-
const CSS_HANDLE = 'bulk-delete';
|
67 |
-
|
68 |
-
// Cron hooks
|
69 |
-
const CRON_HOOK_CATEGORY = 'do-bulk-delete-cat';
|
70 |
-
const CRON_HOOK_POST_STATUS = 'do-bulk-delete-post-status';
|
71 |
-
const CRON_HOOK_TAG = 'do-bulk-delete-tag';
|
72 |
-
const CRON_HOOK_TAXONOMY = 'do-bulk-delete-taxonomy';
|
73 |
-
const CRON_HOOK_POST_TYPE = 'do-bulk-delete-post-type';
|
74 |
-
const CRON_HOOK_CUSTOM_FIELD = 'do-bulk-delete-custom-field';
|
75 |
-
const CRON_HOOK_TITLE = 'do-bulk-delete-by-title';
|
76 |
-
const CRON_HOOK_DUPLICATE_TITLE = 'do-bulk-delete-by-duplicate-title';
|
77 |
-
const CRON_HOOK_POST_BY_ROLE = 'do-bulk-delete-posts-by-role';
|
78 |
-
|
79 |
-
const CRON_HOOK_PAGES_STATUS = 'do-bulk-delete-pages-by-status';
|
80 |
-
|
81 |
-
// meta boxes for delete posts
|
82 |
-
const BOX_POST_STATUS = 'bd_by_post_status';
|
83 |
-
const BOX_CATEGORY = 'bd_by_category';
|
84 |
-
const BOX_TAG = 'bd_by_tag';
|
85 |
-
const BOX_TAX = 'bd_by_tax';
|
86 |
-
const BOX_POST_TYPE = 'bd_by_post_type';
|
87 |
-
const BOX_URL = 'bd_by_url';
|
88 |
-
const BOX_POST_REVISION = 'bd_by_post_revision';
|
89 |
-
const BOX_CUSTOM_FIELD = 'bd_by_custom_field';
|
90 |
-
const BOX_TITLE = 'bd_by_title';
|
91 |
-
const BOX_DUPLICATE_TITLE = 'bd_by_duplicate_title';
|
92 |
-
const BOX_POST_FROM_TRASH = 'bd_posts_from_trash';
|
93 |
-
const BOX_POST_BY_ROLE = 'bd_post_by_user_role';
|
94 |
-
|
95 |
-
// meta boxes for delete pages
|
96 |
-
const BOX_PAGE_STATUS = 'bd_by_page_status';
|
97 |
-
const BOX_PAGE_FROM_TRASH = 'bd_pages_from_trash';
|
98 |
-
|
99 |
-
// Settings constants
|
100 |
-
const SETTING_OPTION_GROUP = 'bd_settings';
|
101 |
-
const SETTING_OPTION_NAME = 'bd_licenses';
|
102 |
-
const SETTING_SECTION_ID = 'bd_license_section';
|
103 |
-
|
104 |
-
// Transient keys
|
105 |
-
const LICENSE_CACHE_KEY_PREFIX = 'bd-license_';
|
106 |
-
|
107 |
-
// path variables
|
108 |
-
// Ideally these should be constants, but because of PHP's limitations, these are static variables
|
109 |
-
public static $PLUGIN_DIR;
|
110 |
-
public static $PLUGIN_URL;
|
111 |
-
public static $PLUGIN_FILE;
|
112 |
-
|
113 |
-
// Instance variables
|
114 |
-
public $translations;
|
115 |
-
public $posts_page;
|
116 |
-
public $pages_page;
|
117 |
-
public $cron_page;
|
118 |
-
public $addon_page;
|
119 |
-
public $settings_page;
|
120 |
-
public $meta_page;
|
121 |
-
public $misc_page;
|
122 |
-
public $display_activate_license_form = false;
|
123 |
-
|
124 |
-
// Deprecated.
|
125 |
-
// Will be removed in v6.0
|
126 |
-
const CRON_HOOK_USER_ROLE = 'do-bulk-delete-users-by-role';
|
127 |
-
public $users_page;
|
128 |
-
|
129 |
-
/**
|
130 |
-
* Main Bulk_Delete Instance.
|
131 |
-
*
|
132 |
-
* Insures that only one instance of Bulk_Delete exists in memory at any one
|
133 |
-
* time. Also prevents needing to define globals all over the place.
|
134 |
-
*
|
135 |
-
* @since 5.0
|
136 |
-
* @static
|
137 |
-
* @staticvar array $instance
|
138 |
-
*
|
139 |
-
* @see BULK_DELETE()
|
140 |
-
*
|
141 |
-
* @uses Bulk_Delete::setup_paths() Setup the plugin paths
|
142 |
-
* @uses Bulk_Delete::includes() Include the required files
|
143 |
-
* @uses Bulk_Delete::load_textdomain() Load text domain for translation
|
144 |
-
* @uses Bulk_Delete::setup_actions() Setup the hooks and actions
|
145 |
-
*
|
146 |
-
* @return Bulk_Delete The one true instance of Bulk_Delete
|
147 |
-
*/
|
148 |
-
public static function instance() {
|
149 |
-
if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Bulk_Delete ) ) {
|
150 |
-
self::$instance = new Bulk_Delete;
|
151 |
-
self::$instance->setup_paths();
|
152 |
-
self::$instance->includes();
|
153 |
-
self::$instance->load_textdomain();
|
154 |
-
self::$instance->setup_actions();
|
155 |
-
}
|
156 |
-
|
157 |
-
return self::$instance;
|
158 |
-
}
|
159 |
-
|
160 |
-
/**
|
161 |
-
* Throw error on object clone.
|
162 |
-
*
|
163 |
-
* The whole idea of the singleton design pattern is that there is a single
|
164 |
-
* object therefore, we don't want the object to be cloned.
|
165 |
-
*
|
166 |
-
* @since 5.0
|
167 |
-
* @access protected
|
168 |
-
*
|
169 |
-
* @return void
|
170 |
-
*/
|
171 |
-
public function __clone() {
|
172 |
-
// Cloning instances of the class is forbidden
|
173 |
-
_doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'bulk-delete' ), '5.0' );
|
174 |
-
}
|
175 |
-
|
176 |
-
/**
|
177 |
-
* Disable unserializing of the class.
|
178 |
-
*
|
179 |
-
* @since 5.0
|
180 |
-
* @access protected
|
181 |
-
*
|
182 |
-
* @return void
|
183 |
-
*/
|
184 |
-
public function __wakeup() {
|
185 |
-
// Unserializing instances of the class is forbidden
|
186 |
-
_doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'bulk-delete' ), '5.0' );
|
187 |
-
}
|
188 |
-
|
189 |
-
/**
|
190 |
-
* Setup plugin constants.
|
191 |
-
*
|
192 |
-
* @access private
|
193 |
-
*
|
194 |
-
* @since 5.0
|
195 |
-
*
|
196 |
-
* @return void
|
197 |
-
*/
|
198 |
-
private function setup_paths() {
|
199 |
-
// Plugin Folder Path
|
200 |
-
self::$PLUGIN_DIR = plugin_dir_path( __FILE__ );
|
201 |
-
|
202 |
-
// Plugin Folder URL
|
203 |
-
self::$PLUGIN_URL = plugin_dir_url( __FILE__ );
|
204 |
-
|
205 |
-
// Plugin Root File
|
206 |
-
self::$PLUGIN_FILE = __FILE__;
|
207 |
-
}
|
208 |
-
|
209 |
-
/**
|
210 |
-
* Include required files.
|
211 |
-
*
|
212 |
-
* @access private
|
213 |
-
*
|
214 |
-
* @since 5.0
|
215 |
-
*
|
216 |
-
* @return void
|
217 |
-
*/
|
218 |
-
private function includes() {
|
219 |
-
require_once self::$PLUGIN_DIR . '/include/base/class-bd-meta-box-module.php';
|
220 |
-
require_once self::$PLUGIN_DIR . '/include/base/users/class-bd-user-meta-box-module.php';
|
221 |
-
require_once self::$PLUGIN_DIR . '/include/base/class-bd-base-page.php';
|
222 |
-
require_once self::$PLUGIN_DIR . '/include/base/class-bd-page.php';
|
223 |
-
|
224 |
-
require_once self::$PLUGIN_DIR . '/include/controller/class-bd-controller.php';
|
225 |
-
|
226 |
-
require_once self::$PLUGIN_DIR . '/include/ui/form.php';
|
227 |
-
|
228 |
-
require_once self::$PLUGIN_DIR . '/include/posts/class-bulk-delete-posts.php';
|
229 |
-
require_once self::$PLUGIN_DIR . '/include/pages/class-bulk-delete-pages.php';
|
230 |
-
|
231 |
-
require_once self::$PLUGIN_DIR . '/include/users/class-bd-users-page.php';
|
232 |
-
require_once self::$PLUGIN_DIR . '/include/users/modules/class-bulk-delete-users-by-user-role.php';
|
233 |
-
require_once self::$PLUGIN_DIR . '/include/users/modules/class-bulk-delete-users-by-user-meta.php';
|
234 |
-
|
235 |
-
require_once self::$PLUGIN_DIR . '/include/meta/class-bulk-delete-meta.php';
|
236 |
-
require_once self::$PLUGIN_DIR . '/include/meta/class-bulk-delete-post-meta.php';
|
237 |
-
require_once self::$PLUGIN_DIR . '/include/meta/class-bulk-delete-comment-meta.php';
|
238 |
-
require_once self::$PLUGIN_DIR . '/include/meta/class-bulk-delete-user-meta.php';
|
239 |
-
|
240 |
-
require_once self::$PLUGIN_DIR . '/include/misc/class-bulk-delete-misc.php';
|
241 |
-
require_once self::$PLUGIN_DIR . '/include/misc/class-bulk-delete-jetpack-contact-form-messages.php';
|
242 |
-
|
243 |
-
require_once self::$PLUGIN_DIR . '/include/settings/class-bd-settings-page.php';
|
244 |
-
require_once self::$PLUGIN_DIR . '/include/settings/setting-helpers.php';
|
245 |
-
require_once self::$PLUGIN_DIR . '/include/settings/class-bd-settings.php';
|
246 |
-
|
247 |
-
require_once self::$PLUGIN_DIR . '/include/system-info/class-bd-system-info-page.php';
|
248 |
-
|
249 |
-
require_once self::$PLUGIN_DIR . '/include/util/class-bd-util.php';
|
250 |
-
require_once self::$PLUGIN_DIR . '/include/util/query.php';
|
251 |
-
|
252 |
-
require_once self::$PLUGIN_DIR . '/include/compatibility/simple-login-log.php';
|
253 |
-
require_once self::$PLUGIN_DIR . '/include/compatibility/the-event-calendar.php';
|
254 |
-
require_once self::$PLUGIN_DIR . '/include/compatibility/woocommerce.php';
|
255 |
-
require_once self::$PLUGIN_DIR . '/include/compatibility/advanced-custom-fields-pro.php';
|
256 |
-
|
257 |
-
require_once self::$PLUGIN_DIR . '/include/deprecated/class-bulk-delete-users.php';
|
258 |
-
require_once self::$PLUGIN_DIR . '/include/deprecated/deprecated.php';
|
259 |
-
|
260 |
-
require_once self::$PLUGIN_DIR . '/include/addons/base/class-bd-addon.php';
|
261 |
-
require_once self::$PLUGIN_DIR . '/include/addons/base/class-bd-base-addon.php';
|
262 |
-
require_once self::$PLUGIN_DIR . '/include/addons/base/class-bd-scheduler-addon.php';
|
263 |
-
|
264 |
-
require_once self::$PLUGIN_DIR . '/include/addons/addon-list.php';
|
265 |
-
require_once self::$PLUGIN_DIR . '/include/addons/posts.php';
|
266 |
-
require_once self::$PLUGIN_DIR . '/include/addons/pages.php';
|
267 |
-
require_once self::$PLUGIN_DIR . '/include/addons/util.php';
|
268 |
-
|
269 |
-
require_once self::$PLUGIN_DIR . '/include/license/class-bd-license.php';
|
270 |
-
require_once self::$PLUGIN_DIR . '/include/license/class-bd-license-handler.php';
|
271 |
-
require_once self::$PLUGIN_DIR . '/include/license/class-bd-edd-api-wrapper.php';
|
272 |
-
|
273 |
-
require_once self::$PLUGIN_DIR . '/include/ui/admin-ui.php';
|
274 |
-
require_once self::$PLUGIN_DIR . '/include/ui/class-bulk-delete-help-screen.php';
|
275 |
-
}
|
276 |
-
|
277 |
-
/**
|
278 |
-
* Loads the plugin language files.
|
279 |
-
*
|
280 |
-
* @since 5.0
|
281 |
-
*/
|
282 |
-
public function load_textdomain() {
|
283 |
-
// Load localization domain
|
284 |
-
$this->translations = dirname( plugin_basename( self::$PLUGIN_FILE ) ) . '/languages/';
|
285 |
-
load_plugin_textdomain( 'bulk-delete', false, $this->translations );
|
286 |
-
}
|
287 |
-
|
288 |
-
/**
|
289 |
-
* Loads the plugin's actions and hooks.
|
290 |
-
*
|
291 |
-
* @access private
|
292 |
-
*
|
293 |
-
* @since 5.0
|
294 |
-
*
|
295 |
-
* @return void
|
296 |
-
*/
|
297 |
-
private function setup_actions() {
|
298 |
-
$this->controller = new BD_Controller();
|
299 |
-
|
300 |
-
add_action( 'admin_menu', array( $this, 'add_menu' ) );
|
301 |
-
|
302 |
-
add_filter( 'bd_help_tooltip', 'bd_generate_help_tooltip', 10, 2 );
|
303 |
-
|
304 |
-
if ( defined( 'BD_DEBUG' ) && BD_DEBUG ) {
|
305 |
-
add_action( 'bd_after_query', array( $this, 'log_sql_query' ) );
|
306 |
-
}
|
307 |
-
}
|
308 |
|
|
|
309 |
/**
|
310 |
-
*
|
311 |
-
*
|
312 |
-
*
|
313 |
-
*
|
314 |
-
* @since 5.6
|
315 |
*
|
316 |
-
* @
|
317 |
-
|
318 |
-
public function log_sql_query( $wp_query ) {
|
319 |
-
$query = $wp_query->request;
|
320 |
-
|
321 |
-
/**
|
322 |
-
* Bulk Delete query is getting logged.
|
323 |
-
*
|
324 |
-
* @since 5.6
|
325 |
-
*
|
326 |
-
* @param string $query Bulk Delete SQL Query.
|
327 |
-
*/
|
328 |
-
do_action( 'bd_log_sql_query', $query );
|
329 |
-
|
330 |
-
error_log( 'Bulk Delete Query: ' . $query );
|
331 |
-
}
|
332 |
-
|
333 |
-
/**
|
334 |
-
* Add navigation menu.
|
335 |
*/
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
do_action( 'bd_after_primary_menus' );
|
350 |
-
|
351 |
-
/**
|
352 |
-
* Runs just before adding non-action menu items to Bulk WP main menu.
|
353 |
-
*
|
354 |
-
* This action is primarily for adding extra menu items before non-action menu items to the Bulk WP main menu.
|
355 |
-
*
|
356 |
-
* @since 5.3
|
357 |
-
*/
|
358 |
-
do_action( 'bd_before_secondary_menus' );
|
359 |
-
|
360 |
-
$this->cron_page = add_submenu_page( self::POSTS_PAGE_SLUG, __( 'Bulk Delete Schedules', 'bulk-delete' ), __( 'Scheduled Jobs', 'bulk-delete' ), 'delete_posts' , self::CRON_PAGE_SLUG , array( $this, 'display_cron_page' ) );
|
361 |
-
$this->addon_page = add_submenu_page( self::POSTS_PAGE_SLUG, __( 'Addon Licenses' , 'bulk-delete' ), __( 'Addon Licenses', 'bulk-delete' ), 'activate_plugins', self::ADDON_PAGE_SLUG, array( 'BD_License', 'display_addon_page' ) );
|
362 |
-
|
363 |
-
/**
|
364 |
-
* Runs just after adding all menu items to Bulk WP main menu.
|
365 |
-
*
|
366 |
-
* This action is primarily for adding extra menu items to the Bulk WP main menu.
|
367 |
-
*
|
368 |
-
* @since 5.3
|
369 |
-
*/
|
370 |
-
do_action( 'bd_after_all_menus' );
|
371 |
-
|
372 |
-
// enqueue JavaScript
|
373 |
-
add_action( 'admin_print_scripts-' . $this->posts_page, array( $this, 'add_script' ) );
|
374 |
-
add_action( 'admin_print_scripts-' . $this->pages_page, array( $this, 'add_script' ) );
|
375 |
-
|
376 |
-
// delete posts page
|
377 |
-
add_action( "load-{$this->posts_page}", array( $this, 'add_delete_posts_settings_panel' ) );
|
378 |
-
add_action( "add_meta_boxes_{$this->posts_page}", array( $this, 'add_delete_posts_meta_boxes' ) );
|
379 |
-
|
380 |
-
// delete pages page
|
381 |
-
add_action( "load-{$this->pages_page}", array( $this, 'add_delete_pages_settings_panel' ) );
|
382 |
-
add_action( "add_meta_boxes_{$this->pages_page}", array( $this, 'add_delete_pages_meta_boxes' ) );
|
383 |
-
}
|
384 |
-
|
385 |
-
/**
|
386 |
-
* Add settings Panel for delete posts page.
|
387 |
-
*/
|
388 |
-
public function add_delete_posts_settings_panel() {
|
389 |
-
/**
|
390 |
-
* Add contextual help for admin screens.
|
391 |
-
*
|
392 |
-
* @since 5.1
|
393 |
-
*/
|
394 |
-
do_action( 'bd_add_contextual_help', $this->posts_page );
|
395 |
-
|
396 |
-
/* Trigger the add_meta_boxes hooks to allow meta boxes to be added */
|
397 |
-
do_action( 'add_meta_boxes_' . $this->posts_page, null );
|
398 |
-
|
399 |
-
/* Enqueue WordPress' script for handling the meta boxes */
|
400 |
-
wp_enqueue_script( 'postbox' );
|
401 |
}
|
|
|
402 |
|
403 |
/**
|
404 |
-
*
|
405 |
-
*/
|
406 |
-
public function add_delete_posts_meta_boxes() {
|
407 |
-
add_meta_box( self::BOX_POST_STATUS , __( 'By Post Status' , 'bulk-delete' ) , 'Bulk_Delete_Posts::render_delete_posts_by_status_box' , $this->posts_page , 'advanced' );
|
408 |
-
add_meta_box( self::BOX_CATEGORY , __( 'By Category' , 'bulk-delete' ) , 'Bulk_Delete_Posts::render_delete_posts_by_category_box' , $this->posts_page , 'advanced' );
|
409 |
-
add_meta_box( self::BOX_TAG , __( 'By Tag' , 'bulk-delete' ) , 'Bulk_Delete_Posts::render_delete_posts_by_tag_box' , $this->posts_page , 'advanced' );
|
410 |
-
add_meta_box( self::BOX_TAX , __( 'By Custom Taxonomy' , 'bulk-delete' ) , 'Bulk_Delete_Posts::render_delete_posts_by_taxonomy_box' , $this->posts_page , 'advanced' );
|
411 |
-
add_meta_box( self::BOX_POST_TYPE , __( 'By Custom Post Type' , 'bulk-delete' ) , 'Bulk_Delete_Posts::render_delete_posts_by_post_type_box' , $this->posts_page , 'advanced' );
|
412 |
-
add_meta_box( self::BOX_URL , __( 'By URL' , 'bulk-delete' ) , 'Bulk_Delete_Posts::render_delete_posts_by_url_box' , $this->posts_page , 'advanced' );
|
413 |
-
add_meta_box( self::BOX_POST_REVISION , __( 'By Post Revision' , 'bulk-delete' ) , 'Bulk_Delete_Posts::render_posts_by_revision_box' , $this->posts_page , 'advanced' );
|
414 |
-
|
415 |
-
/**
|
416 |
-
* Add meta box in delete posts page
|
417 |
-
* This hook can be used for adding additional meta boxes in delete posts page.
|
418 |
-
*
|
419 |
-
* @since 5.3
|
420 |
-
*/
|
421 |
-
do_action( 'bd_add_meta_box_for_posts' );
|
422 |
-
}
|
423 |
-
|
424 |
-
/**
|
425 |
-
* Setup settings panel for delete pages page.
|
426 |
-
*
|
427 |
-
* @since 5.0
|
428 |
-
*/
|
429 |
-
public function add_delete_pages_settings_panel() {
|
430 |
-
/**
|
431 |
-
* Add contextual help for admin screens.
|
432 |
-
*
|
433 |
-
* @since 5.1
|
434 |
-
*/
|
435 |
-
do_action( 'bd_add_contextual_help', $this->pages_page );
|
436 |
-
|
437 |
-
/* Trigger the add_meta_boxes hooks to allow meta boxes to be added */
|
438 |
-
do_action( 'add_meta_boxes_' . $this->pages_page, null );
|
439 |
-
|
440 |
-
/* Enqueue WordPress' script for handling the meta boxes */
|
441 |
-
wp_enqueue_script( 'postbox' );
|
442 |
-
}
|
443 |
-
|
444 |
-
/**
|
445 |
-
* Register meta boxes for delete pages page.
|
446 |
*
|
447 |
-
* @since
|
448 |
*/
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
/**
|
453 |
-
* Add meta box in delete pages page
|
454 |
-
* This hook can be used for adding additional meta boxes in delete pages page.
|
455 |
-
*
|
456 |
-
* @since 5.3
|
457 |
-
*/
|
458 |
-
do_action( 'bd_add_meta_box_for_pages' );
|
459 |
}
|
|
|
460 |
|
461 |
-
|
462 |
-
* Enqueue Scripts and Styles.
|
463 |
-
*/
|
464 |
-
public function add_script() {
|
465 |
-
global $wp_scripts;
|
466 |
-
|
467 |
-
/**
|
468 |
-
* Runs just before enqueuing scripts and styles in all Bulk WP admin pages.
|
469 |
-
*
|
470 |
-
* This action is primarily for registering or deregistering additional scripts or styles.
|
471 |
-
*
|
472 |
-
* @since 5.5.1
|
473 |
-
*/
|
474 |
-
do_action( 'bd_before_admin_enqueue_scripts' );
|
475 |
-
|
476 |
-
wp_enqueue_script( 'jquery-ui-timepicker', plugins_url( '/assets/js/jquery-ui-timepicker-addon.min.js', __FILE__ ), array( 'jquery-ui-slider', 'jquery-ui-datepicker' ), '1.5.4', true );
|
477 |
-
wp_enqueue_style( 'jquery-ui-timepicker', plugins_url( '/assets/css/jquery-ui-timepicker-addon.min.css', __FILE__ ), array(), '1.5.4' );
|
478 |
-
|
479 |
-
wp_enqueue_script( 'select2', plugins_url( '/assets/js/select2.min.js', __FILE__ ), array( 'jquery' ), '4.0.0', true );
|
480 |
-
wp_enqueue_style( 'select2', plugins_url( '/assets/css/select2.min.css', __FILE__ ), array(), '4.0.0' );
|
481 |
-
|
482 |
-
$postfix = ( defined( 'SCRIPT_DEBUG' ) && true === SCRIPT_DEBUG ) ? '' : '.min';
|
483 |
-
wp_enqueue_script( self::JS_HANDLE, plugins_url( '/assets/js/bulk-delete' . $postfix . '.js', __FILE__ ), array( 'jquery-ui-timepicker', 'jquery-ui-tooltip' ), self::VERSION, true );
|
484 |
-
wp_enqueue_style( self::CSS_HANDLE, plugins_url( '/assets/css/bulk-delete' . $postfix . '.css', __FILE__ ), array( 'select2' ), self::VERSION );
|
485 |
-
|
486 |
-
$ui = $wp_scripts->query( 'jquery-ui-core' );
|
487 |
-
$url = "//ajax.googleapis.com/ajax/libs/jqueryui/{$ui->ver}/themes/smoothness/jquery-ui.css";
|
488 |
-
wp_enqueue_style( 'jquery-ui-smoothness', $url, false, $ui->ver );
|
489 |
-
|
490 |
-
/**
|
491 |
-
* Filter JavaScript array.
|
492 |
-
*
|
493 |
-
* This filter can be used to extend the array that is passed to JavaScript
|
494 |
-
*
|
495 |
-
* @since 5.4
|
496 |
-
*/
|
497 |
-
$translation_array = apply_filters( 'bd_javascript_array', array(
|
498 |
-
'msg' => array(),
|
499 |
-
'validators' => array(),
|
500 |
-
'dt_iterators' => array(),
|
501 |
-
'pre_action_msg' => array(),
|
502 |
-
'error_msg' => array(),
|
503 |
-
'pro_iterators' => array(),
|
504 |
-
) );
|
505 |
-
wp_localize_script( self::JS_HANDLE, self::JS_VARIABLE, $translation_array );
|
506 |
-
|
507 |
-
/**
|
508 |
-
* Runs just after enqueuing scripts and styles in all Bulk WP admin pages.
|
509 |
-
*
|
510 |
-
* This action is primarily for registering additional scripts or styles.
|
511 |
-
*
|
512 |
-
* @since 5.5.1
|
513 |
-
*/
|
514 |
-
do_action( 'bd_after_admin_enqueue_scripts' );
|
515 |
-
}
|
516 |
-
|
517 |
-
/**
|
518 |
-
* Show the delete posts page.
|
519 |
-
*
|
520 |
-
* @Todo Move this function to Bulk_Delete_Posts class
|
521 |
-
*/
|
522 |
-
public function display_posts_page() {
|
523 |
-
?>
|
524 |
-
<div class="wrap">
|
525 |
-
<h2><?php _e( 'Bulk Delete Posts', 'bulk-delete' );?></h2>
|
526 |
-
<?php settings_errors(); ?>
|
527 |
-
|
528 |
-
<form method = "post">
|
529 |
-
<?php
|
530 |
-
// nonce for bulk delete
|
531 |
-
wp_nonce_field( 'sm-bulk-delete-posts', 'sm-bulk-delete-posts-nonce' );
|
532 |
-
|
533 |
-
/* Used to save closed meta boxes and their order */
|
534 |
-
wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
|
535 |
-
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
|
536 |
-
?>
|
537 |
-
<div id = "poststuff">
|
538 |
-
<div id="post-body" class="metabox-holder columns-1">
|
539 |
-
|
540 |
-
<div class="notice notice-warning">
|
541 |
-
<p><strong><?php _e( 'WARNING: Posts deleted once cannot be retrieved back. Use with caution.', 'bulk-delete' ); ?></strong></p>
|
542 |
-
</div>
|
543 |
-
|
544 |
-
<div id="postbox-container-2" class="postbox-container">
|
545 |
-
<?php do_meta_boxes( '', 'advanced', null ); ?>
|
546 |
-
</div> <!-- #postbox-container-2 -->
|
547 |
-
|
548 |
-
</div> <!-- #post-body -->
|
549 |
-
</div><!-- #poststuff -->
|
550 |
-
</form>
|
551 |
-
</div><!-- .wrap -->
|
552 |
-
|
553 |
-
<?php
|
554 |
-
/**
|
555 |
-
* Runs just before displaying the footer text in the "Bulk Delete Posts" admin page.
|
556 |
-
*
|
557 |
-
* This action is primarily for adding extra content in the footer of "Bulk Delete Posts" admin page.
|
558 |
-
*
|
559 |
-
* @since 5.0
|
560 |
-
*/
|
561 |
-
do_action( 'bd_admin_footer_posts_page' );
|
562 |
-
}
|
563 |
-
|
564 |
-
/**
|
565 |
-
* Display the delete pages page.
|
566 |
-
*
|
567 |
-
* @Todo Move this function to Bulk_Delete_Pages class
|
568 |
-
*
|
569 |
-
* @since 5.0
|
570 |
-
*/
|
571 |
-
public function display_pages_page() {
|
572 |
-
?>
|
573 |
-
<div class="wrap">
|
574 |
-
<h2><?php _e( 'Bulk Delete Pages', 'bulk-delete' );?></h2>
|
575 |
-
<?php settings_errors(); ?>
|
576 |
-
|
577 |
-
<form method = "post">
|
578 |
-
<?php
|
579 |
-
// nonce for bulk delete
|
580 |
-
wp_nonce_field( 'sm-bulk-delete-pages', 'sm-bulk-delete-pages-nonce' );
|
581 |
-
|
582 |
-
/* Used to save closed meta boxes and their order */
|
583 |
-
wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
|
584 |
-
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
|
585 |
-
?>
|
586 |
-
<div id = "poststuff">
|
587 |
-
<div id="post-body" class="metabox-holder columns-1">
|
588 |
-
|
589 |
-
<div class="notice notice-warning">
|
590 |
-
<p><strong><?php _e( 'WARNING: Pages deleted once cannot be retrieved back. Use with caution.', 'bulk-delete' ); ?></strong></p>
|
591 |
-
</div>
|
592 |
-
|
593 |
-
<div id="postbox-container-2" class="postbox-container">
|
594 |
-
<?php do_meta_boxes( '', 'advanced', null ); ?>
|
595 |
-
</div> <!-- #postbox-container-2 -->
|
596 |
-
|
597 |
-
</div> <!-- #post-body -->
|
598 |
-
</div><!-- #poststuff -->
|
599 |
-
</form>
|
600 |
-
</div><!-- .wrap -->
|
601 |
-
|
602 |
-
<?php
|
603 |
-
/**
|
604 |
-
* Runs just before displaying the footer text in the "Bulk Delete Pages" admin page.
|
605 |
-
*
|
606 |
-
* This action is primarily for adding extra content in the footer of "Bulk Delete Pages" admin page.
|
607 |
-
*
|
608 |
-
* @since 5.0
|
609 |
-
*/
|
610 |
-
do_action( 'bd_admin_footer_pages_page' );
|
611 |
-
}
|
612 |
-
|
613 |
-
/**
|
614 |
-
* Display the schedule page.
|
615 |
-
*/
|
616 |
-
public function display_cron_page() {
|
617 |
-
if ( ! class_exists( 'WP_List_Table' ) ) {
|
618 |
-
require_once ABSPATH . WPINC . '/class-wp-list-table.php';
|
619 |
-
}
|
620 |
-
|
621 |
-
if ( ! class_exists( 'Cron_List_Table' ) ) {
|
622 |
-
require_once self::$PLUGIN_DIR . '/include/cron/class-cron-list-table.php';
|
623 |
-
}
|
624 |
-
|
625 |
-
// Prepare Table of elements
|
626 |
-
$cron_list_table = new Cron_List_Table();
|
627 |
-
$cron_list_table->prepare_items();
|
628 |
-
?>
|
629 |
-
<div class="wrap">
|
630 |
-
<h2><?php _e( 'Bulk Delete Schedules', 'bulk-delete' );?></h2>
|
631 |
-
<?php settings_errors(); ?>
|
632 |
-
<?php
|
633 |
-
// Table of elements
|
634 |
-
$cron_list_table->display();
|
635 |
-
bd_display_available_addon_list();
|
636 |
-
?>
|
637 |
-
</div>
|
638 |
-
<?php
|
639 |
-
/**
|
640 |
-
* Runs just before displaying the footer text in the "Schedules" admin page.
|
641 |
-
*
|
642 |
-
* This action is primarily for adding extra content in the footer of "Schedules" admin page.
|
643 |
-
*
|
644 |
-
* @since 5.0
|
645 |
-
*/
|
646 |
-
do_action( 'bd_admin_footer_cron_page' );
|
647 |
-
}
|
648 |
-
}
|
649 |
-
|
650 |
-
/**
|
651 |
-
* The main function responsible for returning the one true Bulk_Delete
|
652 |
-
* Instance to functions everywhere.
|
653 |
-
*
|
654 |
-
* Use this function like you would a global variable, except without needing
|
655 |
-
* to declare the global.
|
656 |
-
*
|
657 |
-
* Example: `<?php $bulk_delete = BULK_DELETE(); ?>`
|
658 |
-
*
|
659 |
-
* @since 5.0
|
660 |
-
*
|
661 |
-
* @return Bulk_Delete The one true Bulk_Delete Instance
|
662 |
-
*/
|
663 |
-
function BULK_DELETE() {
|
664 |
-
return Bulk_Delete::instance();
|
665 |
}
|
666 |
|
667 |
-
//
|
668 |
-
|
|
4 |
* Plugin Script: bulk-delete.php
|
5 |
* Plugin URI: https://bulkwp.com
|
6 |
* Description: Bulk delete users and posts from selected categories, tags, post types, custom taxonomies or by post status like drafts, scheduled posts, revisions etc.
|
7 |
+
* Version: 6.0.0
|
8 |
* License: GPLv2 or later
|
9 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
* Author: Sudar
|
30 |
* along with this program; if not, write to the Free Software
|
31 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
32 |
*/
|
33 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
34 |
|
35 |
+
// Include the stub of the old `Bulk_Delete` class, so that old add-ons don't generate a fatal error.
|
36 |
+
require_once 'include/Deprecated/old-bulk-delete.php';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
|
38 |
+
if ( version_compare( PHP_VERSION, '5.3.0', '<' ) ) {
|
39 |
/**
|
40 |
+
* Version 6.0.0 of the Bulk Delete plugin dropped support for PHP 5.2.
|
41 |
+
* If you are still struck with PHP 5.2 and can't update, then use v5.6.1 of the plugin.
|
42 |
+
* But note that some add-ons may not work.
|
|
|
|
|
43 |
*
|
44 |
+
* @see http://sudarmuthu.com/blog/why-i-am-dropping-support-for-php-5-2-in-my-wordpress-plugins/
|
45 |
+
* @since 6.0.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
*/
|
47 |
+
function bulk_delete_compatibility_notice() {
|
48 |
+
?>
|
49 |
+
<div class="error">
|
50 |
+
<p>
|
51 |
+
<?php
|
52 |
+
printf(
|
53 |
+
__( 'Bulk Delete requires at least PHP 5.3 to function properly. Please upgrade PHP or use <a href="%s">v5.6.1 of Bulk Delete</a>.', 'bulk-delete' ), // @codingStandardsIgnoreLine
|
54 |
+
'https://downloads.wordpress.org/plugin/bulk-delete.5.6.1.zip'
|
55 |
+
);
|
56 |
+
?>
|
57 |
+
</p>
|
58 |
+
</div>
|
59 |
+
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
}
|
61 |
+
add_action( 'admin_notices', 'bulk_delete_compatibility_notice' );
|
62 |
|
63 |
/**
|
64 |
+
* Deactivate Bulk Delete.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
*
|
66 |
+
* @since 6.0.0
|
67 |
*/
|
68 |
+
function bulk_delete_deactivate() {
|
69 |
+
deactivate_plugins( plugin_basename( __FILE__ ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
}
|
71 |
+
add_action( 'admin_init', 'bulk_delete_deactivate' );
|
72 |
|
73 |
+
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
}
|
75 |
|
76 |
+
// PHP is at least 5.3, so we can safely include namespace code.
|
77 |
+
require_once 'load-bulk-delete.php';
|
78 |
+
bulk_delete_load( __FILE__ );
|
include/BulkDeleteAutoloader.php
ADDED
@@ -0,0 +1,224 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php namespace BulkWP\BulkDelete;
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Autoloader for Bulk Delete, based on the PSR-4 general purpose implementation.
|
5 |
+
*
|
6 |
+
* @see http://www.php-fig.org/psr/psr-4/
|
7 |
+
*
|
8 |
+
* This differs from WordPress coding standard in the following ways.
|
9 |
+
*
|
10 |
+
* - Class name and directory names use Snake case.
|
11 |
+
* - Use of namespaces.
|
12 |
+
*
|
13 |
+
* Given a foo-bar package of classes in the file system at the following
|
14 |
+
* paths ...
|
15 |
+
*
|
16 |
+
* /path/to/packages/foo-bar/
|
17 |
+
* src/
|
18 |
+
* Baz.php # Foo\Bar\Baz
|
19 |
+
* Qux/
|
20 |
+
* Quux.php # Foo\Bar\Qux\Quux
|
21 |
+
* tests/
|
22 |
+
* BazTest.php # Foo\Bar\BazTest
|
23 |
+
* Qux/
|
24 |
+
* QuuxTest.php # Foo\Bar\Qux\QuuxTest
|
25 |
+
*
|
26 |
+
* ... add the path to the class files for the \Foo\Bar\ namespace prefix
|
27 |
+
* as follows:
|
28 |
+
*
|
29 |
+
* <?php
|
30 |
+
* // instantiate the loader
|
31 |
+
* $loader = new \BulkWP\BulkDelete\BulkDeleteAutoloader;
|
32 |
+
*
|
33 |
+
* // register the autoloader
|
34 |
+
* $loader->register();
|
35 |
+
*
|
36 |
+
* // register the base directories for the namespace prefix
|
37 |
+
* $loader->addNamespace('Foo\Bar', '/path/to/packages/foo-bar/src');
|
38 |
+
* $loader->addNamespace('Foo\Bar', '/path/to/packages/foo-bar/tests');
|
39 |
+
*
|
40 |
+
* The following line would cause the autoloader to attempt to load the
|
41 |
+
* \Foo\Bar\Qux\Quux class from /path/to/packages/foo-bar/src/Qux/Quux.php:
|
42 |
+
*
|
43 |
+
* <?php
|
44 |
+
* new \Foo\Bar\Qux\Quux;
|
45 |
+
*
|
46 |
+
* The following line would cause the autoloader to attempt to load the
|
47 |
+
* \Foo\Bar\Qux\QuuxTest class from /path/to/packages/foo-bar/tests/Qux/QuuxTest.php:
|
48 |
+
*
|
49 |
+
* <?php
|
50 |
+
* new \Foo\Bar\Qux\QuuxTest;
|
51 |
+
* @since 6.0.0
|
52 |
+
*/
|
53 |
+
class BulkDeleteAutoloader {
|
54 |
+
/**
|
55 |
+
* An associative array where the key is a namespace prefix and the value
|
56 |
+
* is an array of base directories for classes in that namespace.
|
57 |
+
*
|
58 |
+
* @var array
|
59 |
+
*/
|
60 |
+
protected $prefixes = array();
|
61 |
+
|
62 |
+
/**
|
63 |
+
* An associative array containing the list files that needs to be autoloaded.
|
64 |
+
*
|
65 |
+
* @var array
|
66 |
+
*/
|
67 |
+
protected $files = array();
|
68 |
+
|
69 |
+
protected $custom_class_map = array();
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Register loader with SPL autoloader stack.
|
73 |
+
*
|
74 |
+
* @return void
|
75 |
+
*/
|
76 |
+
public function register() {
|
77 |
+
spl_autoload_register( array( $this, 'load_class' ) );
|
78 |
+
|
79 |
+
// file exists check is already done in `add_file`.
|
80 |
+
foreach ( $this->files as $file ) {
|
81 |
+
$this->require_file( $file );
|
82 |
+
}
|
83 |
+
}
|
84 |
+
|
85 |
+
/**
|
86 |
+
* Adds a base directory for a namespace prefix.
|
87 |
+
*
|
88 |
+
* @param string $prefix The namespace prefix.
|
89 |
+
* @param string $base_dir A base directory for class files in the
|
90 |
+
* namespace.
|
91 |
+
* @param bool $prepend If true, prepend the base directory to the stack
|
92 |
+
* instead of appending it; this causes it to be searched first rather
|
93 |
+
* than last.
|
94 |
+
*
|
95 |
+
* @return void
|
96 |
+
*/
|
97 |
+
public function add_namespace( $prefix, $base_dir, $prepend = false ) {
|
98 |
+
// normalize namespace prefix.
|
99 |
+
$prefix = trim( $prefix, '\\' ) . '\\';
|
100 |
+
|
101 |
+
// normalize the base directory with a trailing separator.
|
102 |
+
$base_dir = rtrim( $base_dir, DIRECTORY_SEPARATOR ) . '/';
|
103 |
+
|
104 |
+
// initialize the namespace prefix array.
|
105 |
+
if ( false === isset( $this->prefixes[ $prefix ] ) ) {
|
106 |
+
$this->prefixes[ $prefix ] = array();
|
107 |
+
}
|
108 |
+
|
109 |
+
// retain the base directory for the namespace prefix.
|
110 |
+
if ( $prepend ) {
|
111 |
+
array_unshift( $this->prefixes[ $prefix ], $base_dir );
|
112 |
+
} else {
|
113 |
+
array_push( $this->prefixes[ $prefix ], $base_dir );
|
114 |
+
}
|
115 |
+
}
|
116 |
+
|
117 |
+
/**
|
118 |
+
* Add a file to be autoloaded.
|
119 |
+
*
|
120 |
+
* @param string $filename File to be autoloaded.
|
121 |
+
*/
|
122 |
+
public function add_file( $filename ) {
|
123 |
+
if ( ! in_array( $filename, $this->files, true ) ) {
|
124 |
+
$this->files[] = $filename;
|
125 |
+
}
|
126 |
+
}
|
127 |
+
|
128 |
+
/**
|
129 |
+
* Loads the class file for a given class name.
|
130 |
+
*
|
131 |
+
* @param string $class The fully-qualified class name.
|
132 |
+
*
|
133 |
+
* @return false|string The mapped file name on success, or boolean false on
|
134 |
+
* failure.
|
135 |
+
*/
|
136 |
+
public function load_class( $class ) {
|
137 |
+
if ( array_key_exists( $class, $this->custom_class_map ) ) {
|
138 |
+
$file_loaded = $this->require_file( $this->custom_class_map[ $class ] );
|
139 |
+
|
140 |
+
if ( $file_loaded ) {
|
141 |
+
return true;
|
142 |
+
}
|
143 |
+
}
|
144 |
+
|
145 |
+
// the current namespace prefix.
|
146 |
+
$prefix = $class;
|
147 |
+
|
148 |
+
// work backwards through the namespace names of the fully-qualified class name to find a mapped file name.
|
149 |
+
while ( false !== $pos = strrpos( $prefix, '\\' ) ) {
|
150 |
+
// retain the trailing namespace separator in the prefix.
|
151 |
+
$prefix = substr( $class, 0, $pos + 1 );
|
152 |
+
|
153 |
+
// the rest is the relative class name.
|
154 |
+
$relative_class = substr( $class, $pos + 1 );
|
155 |
+
|
156 |
+
// try to load a mapped file for the prefix and relative class.
|
157 |
+
$mapped_file = $this->load_mapped_file( $prefix, $relative_class );
|
158 |
+
if ( $mapped_file !== false ) {
|
159 |
+
return $mapped_file;
|
160 |
+
}
|
161 |
+
|
162 |
+
// remove the trailing namespace separator for the next iteration
|
163 |
+
// of strrpos().
|
164 |
+
$prefix = rtrim( $prefix, '\\' );
|
165 |
+
}
|
166 |
+
|
167 |
+
// never found a mapped file.
|
168 |
+
return false;
|
169 |
+
}
|
170 |
+
|
171 |
+
/**
|
172 |
+
* Load the mapped file for a namespace prefix and relative class.
|
173 |
+
*
|
174 |
+
* @param string $prefix The namespace prefix.
|
175 |
+
* @param string $relative_class The relative class name.
|
176 |
+
*
|
177 |
+
* @return false|string Boolean false if no mapped file can be loaded, or the
|
178 |
+
* name of the mapped file that was loaded.
|
179 |
+
*/
|
180 |
+
protected function load_mapped_file( $prefix, $relative_class ) {
|
181 |
+
// are there any base directories for this namespace prefix?
|
182 |
+
if ( false === isset( $this->prefixes[ $prefix ] ) ) {
|
183 |
+
return false;
|
184 |
+
}
|
185 |
+
|
186 |
+
// look through base directories for this namespace prefix.
|
187 |
+
foreach ( $this->prefixes[ $prefix ] as $base_dir ) {
|
188 |
+
// replace the namespace prefix with the base directory,
|
189 |
+
// replace namespace separators with directory separators
|
190 |
+
// in the relative class name, append with .php.
|
191 |
+
$file = $base_dir . str_replace( '\\', '/', $relative_class ) . '.php';
|
192 |
+
|
193 |
+
// if the mapped file exists, require it.
|
194 |
+
if ( $this->require_file( $file ) ) {
|
195 |
+
// yes, we're done.
|
196 |
+
return $file;
|
197 |
+
}
|
198 |
+
}
|
199 |
+
|
200 |
+
// never found it.
|
201 |
+
return false;
|
202 |
+
}
|
203 |
+
|
204 |
+
/**
|
205 |
+
* If a file exists, require it from the file system.
|
206 |
+
*
|
207 |
+
* @param string $file The file to require.
|
208 |
+
*
|
209 |
+
* @return bool True if the file exists, false if not.
|
210 |
+
*/
|
211 |
+
protected function require_file( $file ) {
|
212 |
+
if ( file_exists( $file ) ) {
|
213 |
+
require_once $file;
|
214 |
+
|
215 |
+
return true;
|
216 |
+
}
|
217 |
+
|
218 |
+
return false;
|
219 |
+
}
|
220 |
+
|
221 |
+
public function set_custom_mapping( $custom_class_map ) {
|
222 |
+
$this->custom_class_map = $custom_class_map;
|
223 |
+
}
|
224 |
+
}
|
include/Core/Addon/AddonInfo.php
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Core\Addon;
|
4 |
+
|
5 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Data about an add-on.
|
9 |
+
*
|
10 |
+
* This is a `Record` class that only contains data about a particular add-on.
|
11 |
+
* `Info` suffix is generally considered bad, but this is an exception since the suffix makes sense here.
|
12 |
+
*
|
13 |
+
* @since 6.0.0
|
14 |
+
*/
|
15 |
+
class AddonInfo {
|
16 |
+
protected $name;
|
17 |
+
protected $code;
|
18 |
+
protected $version;
|
19 |
+
protected $author = 'Sudar Muthu';
|
20 |
+
protected $root_file;
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Construct AddonInfo from an array.
|
24 |
+
*
|
25 |
+
* @param array $details Details about the add-on.
|
26 |
+
*/
|
27 |
+
public function __construct( $details = array() ) {
|
28 |
+
if ( ! is_array( $details ) ) {
|
29 |
+
return;
|
30 |
+
}
|
31 |
+
|
32 |
+
$keys = array(
|
33 |
+
'name',
|
34 |
+
'code',
|
35 |
+
'version',
|
36 |
+
'author',
|
37 |
+
'root_file',
|
38 |
+
);
|
39 |
+
|
40 |
+
foreach ( $keys as $key ) {
|
41 |
+
if ( array_key_exists( $key, $details ) ) {
|
42 |
+
$this->{$key} = $details[ $key ];
|
43 |
+
}
|
44 |
+
}
|
45 |
+
}
|
46 |
+
|
47 |
+
public function get_name() {
|
48 |
+
return $this->name;
|
49 |
+
}
|
50 |
+
|
51 |
+
public function get_code() {
|
52 |
+
return $this->code;
|
53 |
+
}
|
54 |
+
|
55 |
+
public function get_version() {
|
56 |
+
return $this->version;
|
57 |
+
}
|
58 |
+
|
59 |
+
public function get_author() {
|
60 |
+
return $this->author;
|
61 |
+
}
|
62 |
+
|
63 |
+
public function get_root_file() {
|
64 |
+
return $this->root_file;
|
65 |
+
}
|
66 |
+
|
67 |
+
public function get_addon_directory() {
|
68 |
+
return plugin_dir_path( $this->root_file );
|
69 |
+
}
|
70 |
+
|
71 |
+
public function get_addon_directory_url() {
|
72 |
+
return plugin_dir_url( $this->root_file );
|
73 |
+
}
|
74 |
+
}
|
include/Core/Addon/AddonUpsellInfo.php
ADDED
@@ -0,0 +1,108 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Core\Addon;
|
4 |
+
|
5 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Upsell Data about an add-on.
|
9 |
+
*
|
10 |
+
* This is a `Record` class that only contains data about a particular add-on.
|
11 |
+
* `Info` suffix is generally considered bad, but this is an exception since the suffix makes sense here.
|
12 |
+
*
|
13 |
+
* @since 6.0.0
|
14 |
+
*/
|
15 |
+
class AddonUpsellInfo extends AddonInfo {
|
16 |
+
protected $description;
|
17 |
+
protected $slug;
|
18 |
+
protected $url;
|
19 |
+
protected $buy_url;
|
20 |
+
protected $upsell_title;
|
21 |
+
protected $upsell_message;
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Construct AddonUpsellInfo from an array.
|
25 |
+
*
|
26 |
+
* @param array $details Details about the add-on.
|
27 |
+
*/
|
28 |
+
public function __construct( $details = array() ) {
|
29 |
+
if ( ! is_array( $details ) ) {
|
30 |
+
return;
|
31 |
+
}
|
32 |
+
|
33 |
+
parent::__construct( $details );
|
34 |
+
|
35 |
+
$keys = array(
|
36 |
+
'description',
|
37 |
+
'slug',
|
38 |
+
'url',
|
39 |
+
'buy_url',
|
40 |
+
'upsell_title',
|
41 |
+
'upsell_message',
|
42 |
+
);
|
43 |
+
|
44 |
+
foreach ( $keys as $key ) {
|
45 |
+
if ( array_key_exists( $key, $details ) ) {
|
46 |
+
$this->{$key} = $details[ $key ];
|
47 |
+
}
|
48 |
+
}
|
49 |
+
}
|
50 |
+
|
51 |
+
public function get_description() {
|
52 |
+
return $this->description;
|
53 |
+
}
|
54 |
+
|
55 |
+
public function get_slug() {
|
56 |
+
return $this->slug;
|
57 |
+
}
|
58 |
+
|
59 |
+
public function get_url() {
|
60 |
+
return $this->url;
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Get the url where users can buy the add-on.
|
65 |
+
*
|
66 |
+
* This url might include GA campaign parameters.
|
67 |
+
* Addon url is used if buy url is not explicitly set.
|
68 |
+
*
|
69 |
+
* @return string Url from where the add-on could be bought or just url if it not set.
|
70 |
+
*/
|
71 |
+
public function get_buy_url() {
|
72 |
+
if ( empty( $this->buy_url ) ) {
|
73 |
+
return $this->url;
|
74 |
+
}
|
75 |
+
|
76 |
+
return $this->buy_url;
|
77 |
+
}
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Get upsell title for the addon.
|
81 |
+
*
|
82 |
+
* Name is used if title is not explicitly set.
|
83 |
+
*
|
84 |
+
* @return string Upsell title for addon or Name if it not set.
|
85 |
+
*/
|
86 |
+
public function get_upsell_title() {
|
87 |
+
if ( empty( $this->upsell_title ) ) {
|
88 |
+
return $this->name;
|
89 |
+
}
|
90 |
+
|
91 |
+
return $this->upsell_title;
|
92 |
+
}
|
93 |
+
|
94 |
+
/**
|
95 |
+
* Get upsell message for the addon.
|
96 |
+
*
|
97 |
+
* Description is used if title is not explicitly set.
|
98 |
+
*
|
99 |
+
* @return string Upsell description for addon or Description if it not set.
|
100 |
+
*/
|
101 |
+
public function get_upsell_message() {
|
102 |
+
if ( empty( $this->upsell_message ) ) {
|
103 |
+
return $this->description;
|
104 |
+
}
|
105 |
+
|
106 |
+
return $this->upsell_message;
|
107 |
+
}
|
108 |
+
}
|
include/Core/Addon/BaseAddon.php
ADDED
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Core\Addon;
|
4 |
+
|
5 |
+
use BD_License_Handler;
|
6 |
+
use BulkWP\BulkDelete\Core\BulkDelete;
|
7 |
+
|
8 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Encapsulates the logic for a add-on.
|
12 |
+
*
|
13 |
+
* @since 6.0.0
|
14 |
+
*/
|
15 |
+
abstract class BaseAddon {
|
16 |
+
/**
|
17 |
+
* Details of the Add-on.
|
18 |
+
*
|
19 |
+
* @var \BulkWP\BulkDelete\Core\Addon\AddonInfo
|
20 |
+
*/
|
21 |
+
protected $addon_info;
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Handler for license.
|
25 |
+
*
|
26 |
+
* @var \BD_License_Handler
|
27 |
+
*/
|
28 |
+
protected $license_handler;
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Initialize and setup variables.
|
32 |
+
*
|
33 |
+
* @return void
|
34 |
+
*/
|
35 |
+
abstract protected function initialize();
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Register the add-on.
|
39 |
+
*
|
40 |
+
* This method will be called in the `bd_loaded` hook.
|
41 |
+
*
|
42 |
+
* @return void
|
43 |
+
*/
|
44 |
+
abstract public function register();
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Create a new instance of the add-on.
|
48 |
+
*
|
49 |
+
* @param \BulkWP\BulkDelete\Core\Addon\AddonInfo $addon_info Add-on Details.
|
50 |
+
*/
|
51 |
+
public function __construct( $addon_info ) {
|
52 |
+
$this->addon_info = $addon_info;
|
53 |
+
|
54 |
+
$this->initialize();
|
55 |
+
$this->setup_license_handler();
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Get details about the add-on.
|
60 |
+
*
|
61 |
+
* @return \BulkWP\BulkDelete\Core\Addon\AddonInfo Add-on Info.
|
62 |
+
*/
|
63 |
+
public function get_info() {
|
64 |
+
return $this->addon_info;
|
65 |
+
}
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Get reference to the main Bulk Delete object.
|
69 |
+
*
|
70 |
+
* @return \BulkWP\BulkDelete\Core\BulkDelete BulkDelete object.
|
71 |
+
*/
|
72 |
+
public function get_bd() {
|
73 |
+
return BulkDelete::get_instance();
|
74 |
+
}
|
75 |
+
|
76 |
+
/**
|
77 |
+
* Setup License Handler.
|
78 |
+
*
|
79 |
+
* TODO: Need this to be refactored.
|
80 |
+
*/
|
81 |
+
protected function setup_license_handler() {
|
82 |
+
$this->license_handler = new BD_License_Handler(
|
83 |
+
$this->addon_info->get_name(),
|
84 |
+
$this->addon_info->get_code(),
|
85 |
+
$this->addon_info->get_version(),
|
86 |
+
$this->addon_info->get_root_file(),
|
87 |
+
$this->addon_info->get_author()
|
88 |
+
);
|
89 |
+
}
|
90 |
+
}
|
include/Core/Addon/FeatureAddon.php
ADDED
@@ -0,0 +1,106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Core\Addon;
|
4 |
+
|
5 |
+
use BulkWP\BulkDelete\Core\Base\BasePage;
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
8 |
+
|
9 |
+
/**
|
10 |
+
* A Feature Add-on.
|
11 |
+
*
|
12 |
+
* All Feature Add-ons will extend this class.
|
13 |
+
* A Feature Add-on contains a bunch of modules and may also have Schedulers.
|
14 |
+
*
|
15 |
+
* @since 6.0.0
|
16 |
+
*/
|
17 |
+
abstract class FeatureAddon extends BaseAddon {
|
18 |
+
/**
|
19 |
+
* List of pages that are registered by this add-on.
|
20 |
+
*
|
21 |
+
* @var \BulkWP\BulkDelete\Core\Base\BaseAddonPage[]
|
22 |
+
*/
|
23 |
+
protected $pages = array();
|
24 |
+
|
25 |
+
/**
|
26 |
+
* List of modules that are registered by this add-on.
|
27 |
+
*
|
28 |
+
* This is an associate array, where the key is the item type and value is the array of modules.
|
29 |
+
* Eg: $modules['item_type'] = array( $module1, $module2 );
|
30 |
+
*
|
31 |
+
* @var array
|
32 |
+
*/
|
33 |
+
protected $modules = array();
|
34 |
+
|
35 |
+
/**
|
36 |
+
* List of schedulers that are registered by this add-on.
|
37 |
+
*
|
38 |
+
* @var \BulkWP\BulkDelete\Core\Base\BaseScheduler[]
|
39 |
+
*/
|
40 |
+
protected $schedulers = array();
|
41 |
+
|
42 |
+
// phpcs:ignore Squiz.Commenting.FunctionComment.Missing
|
43 |
+
public function register() {
|
44 |
+
foreach ( $this->pages as $page ) {
|
45 |
+
$page->for_addon( $this->addon_info );
|
46 |
+
}
|
47 |
+
|
48 |
+
if ( ! empty( $this->pages ) ) {
|
49 |
+
add_filter( 'bd_primary_pages', array( $this, 'register_pages' ) );
|
50 |
+
}
|
51 |
+
|
52 |
+
foreach ( array_keys( $this->modules ) as $page_slug ) {
|
53 |
+
add_action( "bd_after_modules_{$page_slug}", array( $this, 'register_modules_in_page' ) );
|
54 |
+
}
|
55 |
+
|
56 |
+
foreach ( $this->schedulers as $scheduler ) {
|
57 |
+
$scheduler->register();
|
58 |
+
}
|
59 |
+
}
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Register pages.
|
63 |
+
*
|
64 |
+
* @param \BulkWP\BulkDelete\Core\Base\BaseDeletePage[] $primary_pages List of registered Primary pages.
|
65 |
+
*
|
66 |
+
* @return \BulkWP\BulkDelete\Core\Base\BaseDeletePage[] Modified list of primary pages.
|
67 |
+
*/
|
68 |
+
public function register_pages( $primary_pages ) {
|
69 |
+
foreach ( $this->pages as $page ) {
|
70 |
+
/**
|
71 |
+
* After the modules are registered in the delete posts page.
|
72 |
+
*
|
73 |
+
* @since 6.0.0
|
74 |
+
*
|
75 |
+
* @param \BulkWP\BulkDelete\Core\Base\BaseDeletePage $page The page in which the modules are registered.
|
76 |
+
*/
|
77 |
+
do_action( "bd_after_modules_{$page->get_page_slug()}", $page );
|
78 |
+
|
79 |
+
/**
|
80 |
+
* After the modules are registered in a delete page.
|
81 |
+
*
|
82 |
+
* @since 6.0.0
|
83 |
+
*
|
84 |
+
* @param BasePage $posts_page The page in which the modules are registered.
|
85 |
+
*/
|
86 |
+
do_action( 'bd_after_modules', $page );
|
87 |
+
|
88 |
+
$primary_pages[ $page->get_page_slug() ] = $page;
|
89 |
+
}
|
90 |
+
|
91 |
+
return $primary_pages;
|
92 |
+
}
|
93 |
+
|
94 |
+
/**
|
95 |
+
* Register modules for a page.
|
96 |
+
*
|
97 |
+
* @param \BulkWP\BulkDelete\Core\Base\BaseDeletePage $page Page.
|
98 |
+
*/
|
99 |
+
public function register_modules_in_page( $page ) {
|
100 |
+
$modules = $this->modules[ $page->get_page_slug() ];
|
101 |
+
|
102 |
+
foreach ( $modules as $module ) {
|
103 |
+
$page->add_module( $module );
|
104 |
+
}
|
105 |
+
}
|
106 |
+
}
|
include/Core/Addon/SchedulerAddon.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Core\Addon;
|
4 |
+
|
5 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Encapsulates the logic for a Scheduler add-on.
|
9 |
+
*
|
10 |
+
* All Scheduler add-ons will be extending this class.
|
11 |
+
*
|
12 |
+
* @since 6.0.0
|
13 |
+
*/
|
14 |
+
abstract class SchedulerAddon extends BaseAddon {
|
15 |
+
/**
|
16 |
+
* Name of the Scheduler class.
|
17 |
+
*
|
18 |
+
* @var string
|
19 |
+
*/
|
20 |
+
protected $scheduler_class_name;
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Register and setup the add-on.
|
24 |
+
*/
|
25 |
+
public function register() {
|
26 |
+
$scheduler = new $this->scheduler_class_name();
|
27 |
+
$scheduler->register();
|
28 |
+
}
|
29 |
+
}
|
include/Core/Addon/UpsellModule.php
ADDED
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Core\Addon;
|
4 |
+
|
5 |
+
use BulkWP\BulkDelete\Core\Base\BaseModule;
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
8 |
+
|
9 |
+
/**
|
10 |
+
* A Module that upsells an add-on.
|
11 |
+
*
|
12 |
+
* Upseller Module is displayed for add-ons with a description and a link to buy them.
|
13 |
+
* If an add-on is installed, then the Upseller Module is automatically deactivated.
|
14 |
+
*
|
15 |
+
* Methods that are not needed are left empty.
|
16 |
+
*
|
17 |
+
* @since 6.0.0
|
18 |
+
*/
|
19 |
+
class UpsellModule extends BaseModule {
|
20 |
+
/**
|
21 |
+
* Details about the add-on.
|
22 |
+
*
|
23 |
+
* @var \BulkWP\BulkDelete\Core\Addon\AddonUpsellInfo
|
24 |
+
*/
|
25 |
+
protected $addon_upsell_info;
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Create the UpsellModule using add-on info.
|
29 |
+
*
|
30 |
+
* @param \BulkWP\BulkDelete\Core\Addon\AddonUpsellInfo $addon_upsell_info Addon Upsell Info.
|
31 |
+
*/
|
32 |
+
public function __construct( $addon_upsell_info ) {
|
33 |
+
$this->addon_upsell_info = $addon_upsell_info;
|
34 |
+
|
35 |
+
$this->meta_box_slug = $this->addon_upsell_info->get_slug();
|
36 |
+
$this->messages = array(
|
37 |
+
'box_label' => $addon_upsell_info->get_upsell_title(),
|
38 |
+
);
|
39 |
+
}
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Upsell modules will use the name of the Add-on as their name.
|
43 |
+
*
|
44 |
+
* @return string Upsell Module name.
|
45 |
+
*/
|
46 |
+
public function get_name() {
|
47 |
+
return str_replace( ' ', '', $this->addon_upsell_info->get_name() );
|
48 |
+
}
|
49 |
+
|
50 |
+
public function render() {
|
51 |
+
?>
|
52 |
+
|
53 |
+
<p>
|
54 |
+
<?php echo $this->addon_upsell_info->get_upsell_message(); ?>
|
55 |
+
<a href="<?php echo esc_url( $this->addon_upsell_info->get_buy_url() ); ?>"><?php _e( 'Buy Now', 'bulk-delete' ); ?></a>
|
56 |
+
</p>
|
57 |
+
|
58 |
+
<?php
|
59 |
+
}
|
60 |
+
|
61 |
+
protected function initialize() {
|
62 |
+
// Empty by design.
|
63 |
+
}
|
64 |
+
|
65 |
+
protected function parse_common_filters( $request ) {
|
66 |
+
// Empty by design.
|
67 |
+
}
|
68 |
+
|
69 |
+
protected function convert_user_input_to_options( $request, $options ) {
|
70 |
+
// Empty by design.
|
71 |
+
}
|
72 |
+
|
73 |
+
protected function get_success_message( $items_deleted ) {
|
74 |
+
// Empty by design.
|
75 |
+
}
|
76 |
+
|
77 |
+
protected function do_delete( $options ) {
|
78 |
+
// Empty by design.
|
79 |
+
}
|
80 |
+
}
|
include/Core/Addon/Upseller.php
ADDED
@@ -0,0 +1,208 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Core\Addon;
|
4 |
+
|
5 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Upsell pro add-ons.
|
9 |
+
*
|
10 |
+
* @since 6.0.0
|
11 |
+
*/
|
12 |
+
class Upseller {
|
13 |
+
/**
|
14 |
+
* Setup hooks.
|
15 |
+
*/
|
16 |
+
public function load() {
|
17 |
+
add_action( 'bd_after_modules', array( $this, 'load_upsell_modules' ) );
|
18 |
+
}
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Load upsell modules after free modules.
|
22 |
+
*
|
23 |
+
* @param \BulkWP\BulkDelete\Core\Base\BaseDeletePage $page The page to which the modules are added.
|
24 |
+
*/
|
25 |
+
public function load_upsell_modules( $page ) {
|
26 |
+
$upsell_addon_details = $this->get_upsell_addon_details_for_page( $page );
|
27 |
+
|
28 |
+
foreach ( $upsell_addon_details as $upsell_addon_detail ) {
|
29 |
+
$page->add_module( new UpsellModule( new AddonUpsellInfo( $upsell_addon_detail ) ) );
|
30 |
+
}
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Get Upsell add-on to be shown on a particular page.
|
35 |
+
*
|
36 |
+
* @param \BulkWP\BulkDelete\Core\Base\BaseDeletePage $page Delete Page in which upsell add-ons to be shown.
|
37 |
+
*
|
38 |
+
* @return array List of Upsell modules.
|
39 |
+
*/
|
40 |
+
protected function get_upsell_addon_details_for_page( $page ) {
|
41 |
+
switch ( $page->get_item_type() ) {
|
42 |
+
case 'posts':
|
43 |
+
return $this->get_post_upsell_addons();
|
44 |
+
case 'pages':
|
45 |
+
return $this->get_page_upsell_addons();
|
46 |
+
case 'users':
|
47 |
+
return $this->get_user_upsell_addons();
|
48 |
+
case 'metas':
|
49 |
+
return $this->get_meta_upsell_addons();
|
50 |
+
default:
|
51 |
+
return array();
|
52 |
+
}
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Get upsell add-ons for delete posts page.
|
57 |
+
*
|
58 |
+
* Eventually this will come from a feed.
|
59 |
+
*
|
60 |
+
* @return array List of upsell add-on details.
|
61 |
+
*/
|
62 |
+
protected function get_post_upsell_addons() {
|
63 |
+
$addon_upsell_details = array(
|
64 |
+
array(
|
65 |
+
'name' => 'Bulk Delete Posts by Custom Field',
|
66 |
+
'description' => 'This addon adds the ability to delete posts based on custom field. This will be really useful, if your plugin or theme uses custom fields to store additional information about a post.',
|
67 |
+
'slug' => 'bulk-delete-posts-by-custom-field',
|
68 |
+
'url' => 'https://bulkwp.com/addons/bulk-delete-posts-by-custom-field/?utm_campaign=Upsell&utm_medium=wp-admin&utm_source=upsell-module&utm_content=bd-cf',
|
69 |
+
'buy_url' => '',
|
70 |
+
'upsell_title' => 'Want to delete Posts based on Custom Field (Post Meta)?',
|
71 |
+
'upsell_message' => '<strong>Bulk Delete Posts by Custom Field</strong> add-on allows you to delete posts based on custom field (also known as post meta).',
|
72 |
+
),
|
73 |
+
array(
|
74 |
+
'name' => 'Bulk Delete Posts by Title',
|
75 |
+
'description' => 'This addon adds the ability to delete posts based on title.',
|
76 |
+
'slug' => 'bulk-delete-posts-by-title',
|
77 |
+
'url' => 'https://bulkwp.com/addons/bulk-delete-posts-by-title/?utm_campaign=Upsell&utm_medium=wp-admin&utm_source=upsell-module&utm_content=bd-ti',
|
78 |
+
'buy_url' => '',
|
79 |
+
'upsell_title' => 'Want to delete Posts based on title?',
|
80 |
+
'upsell_message' => '<strong>Bulk Delete Posts by Title</strong> add-on allows you to delete posts based on title.',
|
81 |
+
),
|
82 |
+
array(
|
83 |
+
'name' => 'Bulk Delete Posts by Duplicate Title',
|
84 |
+
'description' => 'This addon adds the ability to delete posts based on duplicate title.',
|
85 |
+
'slug' => 'bulk-delete-posts-by-duplicate-title',
|
86 |
+
'url' => 'https://bulkwp.com/addons/bulk-delete-posts-by-duplicate-title/?utm_campaign=Upsell&utm_medium=wp-admin&utm_source=upsell-module&utm_content=bd-dti',
|
87 |
+
'buy_url' => '',
|
88 |
+
'upsell_title' => 'Want to delete Posts that have duplicate titles?',
|
89 |
+
'upsell_message' => '<strong>Bulk Delete Posts by Duplicate Title</strong> add-on allows you to delete posts that have duplicate title.',
|
90 |
+
),
|
91 |
+
array(
|
92 |
+
'name' => 'Bulk Delete Posts by Content',
|
93 |
+
'description' => 'This addon adds the ability to delete posts based on content.',
|
94 |
+
'slug' => 'bulk-delete-posts-by-content',
|
95 |
+
'url' => 'https://bulkwp.com/addons/bulk-delete-posts-by-content/?utm_campaign=Upsell&utm_medium=wp-admin&utm_source=upsell-module&utm_content=bd-p-co',
|
96 |
+
'buy_url' => '',
|
97 |
+
'upsell_title' => 'Want to delete Posts based on the post content?',
|
98 |
+
'upsell_message' => '<strong>Bulk Delete Posts by Content</strong> add-on allows you to delete posts based on its post content.',
|
99 |
+
),
|
100 |
+
array(
|
101 |
+
'name' => 'Bulk Delete Posts by User',
|
102 |
+
'description' => 'This addon adds the ability to delete posts based on the author who created the post.',
|
103 |
+
'slug' => 'bulk-delete-posts-by-user',
|
104 |
+
'url' => 'https://bulkwp.com/addons/bulk-delete-posts-by-user/?utm_campaign=Upsell&utm_medium=wp-admin&utm_source=upsell-module&utm_content=bd-p-u',
|
105 |
+
'buy_url' => '',
|
106 |
+
'upsell_title' => 'Want to delete Posts based on the user who created it?',
|
107 |
+
'upsell_message' => '<strong>Bulk Delete Posts by User</strong> add-on allows you to delete posts based on user who created the post.',
|
108 |
+
),
|
109 |
+
array(
|
110 |
+
'name' => 'Bulk Delete Posts by Attachment',
|
111 |
+
'description' => 'This addon adds the ability to delete posts based on attachment.',
|
112 |
+
'slug' => 'bulk-delete-posts-by-attachment',
|
113 |
+
'url' => 'https://bulkwp.com/addons/bulk-delete-posts-by-attachment/?utm_campaign=Upsell&utm_medium=wp-admin&utm_source=upsell-module&utm_content=bd-p-at',
|
114 |
+
'buy_url' => '',
|
115 |
+
'upsell_title' => 'Want to delete Posts based on whether it has an attachment?',
|
116 |
+
'upsell_message' => "<strong>Bulk Delete Posts by Attachment</strong> add-on allows you to delete posts based on whether a post contains (or doesn't contain) an attachment.",
|
117 |
+
),
|
118 |
+
array(
|
119 |
+
'name' => 'Bulk Delete From Trash',
|
120 |
+
'description' => 'This addon adds the ability to delete posts or pages from trash.',
|
121 |
+
'slug' => 'bulk-delete-from-trash',
|
122 |
+
'url' => 'https://bulkwp.com/addons/bulk-delete-from-trash/?utm_campaign=Upsell&utm_medium=wp-admin&utm_source=upsell-module&utm_content=bd-th',
|
123 |
+
'buy_url' => '',
|
124 |
+
'upsell_title' => 'Want to delete Posts that are in trash?',
|
125 |
+
'upsell_message' => '<strong>Bulk Delete From Trash</strong> add-on allows you to delete posts that are in trash.',
|
126 |
+
),
|
127 |
+
);
|
128 |
+
|
129 |
+
/**
|
130 |
+
* List of Upsell add-ons based on item type.
|
131 |
+
*
|
132 |
+
* @since 6.0.0
|
133 |
+
*
|
134 |
+
* @param array $addon_upsell_details Add-on details.
|
135 |
+
* @param string $item_type Item type.
|
136 |
+
*/
|
137 |
+
return apply_filters( 'bd_upsell_addons', $addon_upsell_details, 'posts' );
|
138 |
+
}
|
139 |
+
|
140 |
+
/**
|
141 |
+
* Get upsell add-ons for delete pages page.
|
142 |
+
*
|
143 |
+
* Eventually this will come from a feed.
|
144 |
+
*
|
145 |
+
* @return array List of upsell add-on details.
|
146 |
+
*/
|
147 |
+
protected function get_page_upsell_addons() {
|
148 |
+
$addon_details = array(
|
149 |
+
array(
|
150 |
+
'name' => 'Bulk Delete From Trash',
|
151 |
+
'description' => 'This addon adds the ability to delete posts or pages from trash.',
|
152 |
+
'slug' => 'bulk-delete-from-trash',
|
153 |
+
'url' => 'https://bulkwp.com/addons/bulk-delete-from-trash/?utm_campaign=Upsell&utm_medium=wp-admin&utm_source=upsell-module&utm_content=bd-th',
|
154 |
+
'buy_url' => '',
|
155 |
+
'upsell_title' => 'Want to delete pages that are in trash?',
|
156 |
+
'upsell_message' => '<strong>Bulk Delete From Trash</strong> add-on allows you to delete pages that are in trash.',
|
157 |
+
),
|
158 |
+
);
|
159 |
+
|
160 |
+
/**
|
161 |
+
* List of Upsell add-ons based on item type.
|
162 |
+
*
|
163 |
+
* @since 6.0.0
|
164 |
+
*
|
165 |
+
* @param array $addon_details Add-on details.
|
166 |
+
* @param string $item_type Item type.
|
167 |
+
*/
|
168 |
+
return apply_filters( 'bd_upsell_addons', $addon_details, 'pages' );
|
169 |
+
}
|
170 |
+
|
171 |
+
/**
|
172 |
+
* Get upsell add-ons for delete users page.
|
173 |
+
*
|
174 |
+
* Eventually this will come from a feed.
|
175 |
+
*
|
176 |
+
* @return array List of upsell add-on details.
|
177 |
+
*/
|
178 |
+
protected function get_user_upsell_addons() {
|
179 |
+
/**
|
180 |
+
* List of Upsell add-ons based on item type.
|
181 |
+
*
|
182 |
+
* @since 6.0.0
|
183 |
+
*
|
184 |
+
* @param array $addon_details Add-on details.
|
185 |
+
* @param string $item_type Item type.
|
186 |
+
*/
|
187 |
+
return apply_filters( 'bd_upsell_addons', array(), 'users' );
|
188 |
+
}
|
189 |
+
|
190 |
+
/**
|
191 |
+
* Get upsell add-ons for delete metas page.
|
192 |
+
*
|
193 |
+
* Eventually this will come from a feed.
|
194 |
+
*
|
195 |
+
* @return array List of upsell add-on details.
|
196 |
+
*/
|
197 |
+
protected function get_meta_upsell_addons() {
|
198 |
+
/**
|
199 |
+
* List of Upsell add-ons based on item type.
|
200 |
+
*
|
201 |
+
* @since 6.0.0
|
202 |
+
*
|
203 |
+
* @param array $addon_details Add-on details.
|
204 |
+
* @param string $item_type Item type.
|
205 |
+
*/
|
206 |
+
return apply_filters( 'bd_upsell_addons', array(), 'metas' );
|
207 |
+
}
|
208 |
+
}
|
include/Core/Base/BaseAddonPage.php
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Core\Base;
|
4 |
+
|
5 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Base class for an Add-on page.
|
9 |
+
*
|
10 |
+
* @since 6.0.0
|
11 |
+
*/
|
12 |
+
abstract class BaseAddonPage extends BaseDeletePage {
|
13 |
+
/**
|
14 |
+
* Details about the add-on to which this page is added.
|
15 |
+
*
|
16 |
+
* @var \BulkWP\BulkDelete\Core\Addon\AddonInfo
|
17 |
+
*/
|
18 |
+
protected $addon_info;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Set the add-on in which this page is part of.
|
22 |
+
*
|
23 |
+
* @param \BulkWP\BulkDelete\Core\Addon\AddonInfo $addon_info Add-on info.
|
24 |
+
*/
|
25 |
+
public function for_addon( $addon_info ) {
|
26 |
+
$this->addon_info = $addon_info;
|
27 |
+
}
|
28 |
+
}
|
include/Core/Base/BaseDeletePage.php
ADDED
@@ -0,0 +1,227 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Core\Base;
|
4 |
+
|
5 |
+
use BulkWP\BulkDelete\Core\BulkDelete;
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Base class for all Bulk Delete pages that will have modules.
|
11 |
+
*
|
12 |
+
* @since 6.0.0
|
13 |
+
*/
|
14 |
+
abstract class BaseDeletePage extends BasePage {
|
15 |
+
/**
|
16 |
+
* Item Type. Possible values 'posts', 'pages', 'users' etc.
|
17 |
+
*
|
18 |
+
* @var string
|
19 |
+
*/
|
20 |
+
protected $item_type;
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Modules registered to this page.
|
24 |
+
*
|
25 |
+
* @var \BulkWP\BulkDelete\Core\Base\BaseModule[]
|
26 |
+
*/
|
27 |
+
protected $modules = array();
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Register the modules after the page is registered.
|
31 |
+
*/
|
32 |
+
public function register() {
|
33 |
+
parent::register();
|
34 |
+
|
35 |
+
if ( $this->has_modules() ) {
|
36 |
+
$this->register_modules();
|
37 |
+
}
|
38 |
+
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Add a module to the page.
|
42 |
+
*
|
43 |
+
* @param \BulkWP\BulkDelete\Core\Base\BaseModule $module Module to add.
|
44 |
+
*/
|
45 |
+
public function add_module( $module ) {
|
46 |
+
if ( in_array( $module, $this->modules, true ) ) {
|
47 |
+
return;
|
48 |
+
}
|
49 |
+
|
50 |
+
$this->modules[ $module->get_name() ] = $module;
|
51 |
+
}
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Get module object instance by module class name.
|
55 |
+
*
|
56 |
+
* @param string $module_class_name Module class name.
|
57 |
+
*
|
58 |
+
* @return \BulkWP\BulkDelete\Core\Base\BaseModule|null Module object instance or null if no match found.
|
59 |
+
*/
|
60 |
+
public function get_module( $module_class_name ) {
|
61 |
+
$short_class_name = bd_get_short_class_name( $module_class_name );
|
62 |
+
|
63 |
+
if ( isset( $this->modules[ $short_class_name ] ) ) {
|
64 |
+
return $this->modules[ $short_class_name ];
|
65 |
+
}
|
66 |
+
|
67 |
+
return null;
|
68 |
+
}
|
69 |
+
|
70 |
+
protected function register_hooks() {
|
71 |
+
parent::register_hooks();
|
72 |
+
|
73 |
+
add_action( 'admin_print_scripts-' . $this->hook_suffix, array( $this, 'enqueue_assets' ) );
|
74 |
+
add_action( "load-{$this->hook_suffix}", array( $this, 'on_load_page' ) );
|
75 |
+
}
|
76 |
+
|
77 |
+
/**
|
78 |
+
* Enqueue Scripts and Styles.
|
79 |
+
*/
|
80 |
+
public function enqueue_assets() {
|
81 |
+
/**
|
82 |
+
* Runs just before enqueuing scripts and styles in all Bulk WP admin pages.
|
83 |
+
*
|
84 |
+
* This action is primarily for registering or deregistering additional scripts or styles.
|
85 |
+
*
|
86 |
+
* @param \BulkWP\BulkDelete\Core\Base\BaseDeletePage The current page.
|
87 |
+
*
|
88 |
+
* @since 5.5.1
|
89 |
+
* @since 6.0.0 Added $page parameter.
|
90 |
+
*/
|
91 |
+
do_action( 'bd_before_admin_enqueue_scripts', $this );
|
92 |
+
|
93 |
+
wp_enqueue_style( 'jquery-ui-smoothness', $this->get_plugin_dir_url() . 'assets/css/jquery-ui-smoothness.min.css', array(), '1.12.1' );
|
94 |
+
|
95 |
+
wp_enqueue_script(
|
96 |
+
'jquery-ui-timepicker-addon',
|
97 |
+
$this->get_plugin_dir_url() . 'assets/js/jquery-ui-timepicker-addon.min.js',
|
98 |
+
array( 'jquery-ui-slider', 'jquery-ui-datepicker' ),
|
99 |
+
'1.6.3',
|
100 |
+
true
|
101 |
+
);
|
102 |
+
wp_enqueue_style( 'jquery-ui-timepicker', $this->get_plugin_dir_url() . 'assets/css/jquery-ui-timepicker-addon.min.css', array( 'jquery-ui-smoothness' ), '1.6.3' );
|
103 |
+
|
104 |
+
wp_enqueue_script( 'select2', $this->get_plugin_dir_url() . 'assets/js/select2.min.js', array( 'jquery' ), '4.0.5', true );
|
105 |
+
wp_enqueue_style( 'select2', $this->get_plugin_dir_url() . 'assets/css/select2.min.css', array(), '4.0.5' );
|
106 |
+
|
107 |
+
$postfix = ( defined( 'SCRIPT_DEBUG' ) && true === SCRIPT_DEBUG ) ? '' : '.min';
|
108 |
+
wp_enqueue_script(
|
109 |
+
'bulk-delete',
|
110 |
+
$this->get_plugin_dir_url() . 'assets/js/bulk-delete' . $postfix . '.js',
|
111 |
+
array( 'jquery-ui-timepicker-addon', 'jquery-ui-tooltip', 'postbox' ),
|
112 |
+
BulkDelete::VERSION,
|
113 |
+
true
|
114 |
+
);
|
115 |
+
wp_enqueue_style(
|
116 |
+
'bulk-delete',
|
117 |
+
$this->get_plugin_dir_url() . 'assets/css/bulk-delete' . $postfix . '.css',
|
118 |
+
array( 'jquery-ui-smoothness', 'jquery-ui-timepicker', 'select2' ),
|
119 |
+
BulkDelete::VERSION
|
120 |
+
);
|
121 |
+
|
122 |
+
/**
|
123 |
+
* Filter JavaScript array.
|
124 |
+
*
|
125 |
+
* This filter can be used to extend the array that is passed to JavaScript
|
126 |
+
*
|
127 |
+
* @since 5.4
|
128 |
+
*/
|
129 |
+
$translation_array = apply_filters( 'bd_javascript_array', array(
|
130 |
+
'msg' => array(),
|
131 |
+
'validators' => array(),
|
132 |
+
'dt_iterators' => array(),
|
133 |
+
'pre_action_msg' => array(),
|
134 |
+
'error_msg' => array(),
|
135 |
+
'pro_iterators' => array(),
|
136 |
+
) );
|
137 |
+
wp_localize_script( 'bulk-delete', 'BulkWP', $translation_array ); // TODO: Change JavaScript variable to BulkWP.BulkDelete.
|
138 |
+
|
139 |
+
/**
|
140 |
+
* Runs just after enqueuing scripts and styles in all Bulk WP admin pages.
|
141 |
+
*
|
142 |
+
* This action is primarily for registering additional scripts or styles.
|
143 |
+
*
|
144 |
+
* @param \BulkWP\BulkDelete\Core\Base\BaseDeletePage The current page.
|
145 |
+
*
|
146 |
+
* @since 5.5.1
|
147 |
+
* @since 6.0.0 Added $page parameter.
|
148 |
+
*/
|
149 |
+
do_action( 'bd_after_admin_enqueue_scripts', $this );
|
150 |
+
}
|
151 |
+
|
152 |
+
/**
|
153 |
+
* Trigger the add_meta_boxes hooks to allow modules to be added when the page is loaded.
|
154 |
+
*/
|
155 |
+
public function on_load_page() {
|
156 |
+
do_action( 'add_meta_boxes_' . $this->hook_suffix, null );
|
157 |
+
}
|
158 |
+
|
159 |
+
/**
|
160 |
+
* Add additional nonce fields that are related to modules.
|
161 |
+
*/
|
162 |
+
protected function render_nonce_fields() {
|
163 |
+
parent::render_nonce_fields();
|
164 |
+
|
165 |
+
// Used to save closed meta boxes and their order.
|
166 |
+
wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
|
167 |
+
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
|
168 |
+
}
|
169 |
+
|
170 |
+
/**
|
171 |
+
* Render meta boxes in body.
|
172 |
+
*/
|
173 |
+
protected function render_body() {
|
174 |
+
do_meta_boxes( '', 'advanced', null );
|
175 |
+
}
|
176 |
+
|
177 |
+
/**
|
178 |
+
* Render footer.
|
179 |
+
*/
|
180 |
+
protected function render_footer() {
|
181 |
+
parent::render_footer();
|
182 |
+
|
183 |
+
/**
|
184 |
+
* Runs just before displaying the footer text in the admin page.
|
185 |
+
*
|
186 |
+
* This action is primarily for adding extra content in the footer of admin page.
|
187 |
+
*
|
188 |
+
* @since 5.5.4
|
189 |
+
*/
|
190 |
+
do_action( "bd_admin_footer_for_{$this->item_type}" );
|
191 |
+
}
|
192 |
+
|
193 |
+
/**
|
194 |
+
* Does this page have any modules?
|
195 |
+
*
|
196 |
+
* @return bool True if page has modules, False otherwise.
|
197 |
+
*/
|
198 |
+
protected function has_modules() {
|
199 |
+
return ! empty( $this->modules );
|
200 |
+
}
|
201 |
+
|
202 |
+
/**
|
203 |
+
* Load all the registered modules.
|
204 |
+
*/
|
205 |
+
protected function register_modules() {
|
206 |
+
foreach ( $this->modules as $module ) {
|
207 |
+
$module->register( $this->hook_suffix, $this->page_slug );
|
208 |
+
$this->actions[] = $module->get_action();
|
209 |
+
}
|
210 |
+
|
211 |
+
/**
|
212 |
+
* Triggered after all modules are registered.
|
213 |
+
*
|
214 |
+
* @since 6.0.0
|
215 |
+
*/
|
216 |
+
do_action( "bd_add_meta_box_for_{$this->get_item_type()}" );
|
217 |
+
}
|
218 |
+
|
219 |
+
/**
|
220 |
+
* Get the item type of the page.
|
221 |
+
*
|
222 |
+
* @return string Item type of the page.
|
223 |
+
*/
|
224 |
+
public function get_item_type() {
|
225 |
+
return $this->item_type;
|
226 |
+
}
|
227 |
+
}
|
include/Core/Base/BaseModule.php
ADDED
@@ -0,0 +1,442 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Core\Base;
|
4 |
+
|
5 |
+
use BulkWP\BulkDelete\Core\Base\Mixin\Renderer;
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Encapsulates the Bulk Delete Meta box Module Logic.
|
11 |
+
*
|
12 |
+
* All Bulk Delete Meta box Modules should extend this class.
|
13 |
+
* This class extends Renderer Mixin class since Bulk Delete still supports PHP 5.3.
|
14 |
+
* Once PHP 5.3 support is dropped, Renderer will be implemented as a Trait and this class will `use` it.
|
15 |
+
*
|
16 |
+
* @since 6.0.0
|
17 |
+
*/
|
18 |
+
abstract class BaseModule extends Renderer {
|
19 |
+
/**
|
20 |
+
* Item Type. Possible values 'posts', 'pages', 'users' etc.
|
21 |
+
*
|
22 |
+
* @var string
|
23 |
+
*/
|
24 |
+
protected $item_type;
|
25 |
+
|
26 |
+
/**
|
27 |
+
* The hook suffix of the screen where this meta box would be shown.
|
28 |
+
*
|
29 |
+
* @var string
|
30 |
+
*/
|
31 |
+
protected $page_hook_suffix;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Slug of the page where this module will be shown.
|
35 |
+
*
|
36 |
+
* @var string
|
37 |
+
*/
|
38 |
+
protected $page_slug;
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Slug of the meta box.
|
42 |
+
*
|
43 |
+
* @var string
|
44 |
+
*/
|
45 |
+
protected $meta_box_slug;
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Action in which the delete operation should be performed.
|
49 |
+
*
|
50 |
+
* @var string
|
51 |
+
*/
|
52 |
+
protected $action = '';
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Hook for scheduler.
|
56 |
+
*
|
57 |
+
* @var string
|
58 |
+
*/
|
59 |
+
protected $cron_hook;
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Url of the scheduler addon.
|
63 |
+
*
|
64 |
+
* @var string
|
65 |
+
*/
|
66 |
+
protected $scheduler_url;
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Messages shown to the user.
|
70 |
+
*
|
71 |
+
* @var array
|
72 |
+
*/
|
73 |
+
protected $messages = array(
|
74 |
+
'box_label' => '',
|
75 |
+
'cron_label' => '',
|
76 |
+
'validation_error' => '',
|
77 |
+
'confirm_deletion' => '',
|
78 |
+
'scheduled' => '',
|
79 |
+
'nothing_to_delete' => '',
|
80 |
+
'deleted_one' => '',
|
81 |
+
'deleted_multiple' => '',
|
82 |
+
);
|
83 |
+
|
84 |
+
/**
|
85 |
+
* Initialize and setup variables.
|
86 |
+
*
|
87 |
+
* @return void
|
88 |
+
*/
|
89 |
+
abstract protected function initialize();
|
90 |
+
|
91 |
+
/**
|
92 |
+
* Render the Modules.
|
93 |
+
*
|
94 |
+
* @return void
|
95 |
+
*/
|
96 |
+
abstract public function render();
|
97 |
+
|
98 |
+
/**
|
99 |
+
* Process common filters.
|
100 |
+
*
|
101 |
+
* @param array $request Request array.
|
102 |
+
*
|
103 |
+
* @return array User options.
|
104 |
+
*/
|
105 |
+
abstract protected function parse_common_filters( $request );
|
106 |
+
|
107 |
+
/**
|
108 |
+
* Process user input and create metabox options.
|
109 |
+
*
|
110 |
+
* @param array $request Request array.
|
111 |
+
* @param array $options User options.
|
112 |
+
*
|
113 |
+
* @return array User options.
|
114 |
+
*/
|
115 |
+
abstract protected function convert_user_input_to_options( $request, $options );
|
116 |
+
|
117 |
+
/**
|
118 |
+
* Perform the deletion.
|
119 |
+
*
|
120 |
+
* @param array $options Array of Delete options.
|
121 |
+
*
|
122 |
+
* @return int Number of items that were deleted.
|
123 |
+
*/
|
124 |
+
abstract protected function do_delete( $options );
|
125 |
+
|
126 |
+
/**
|
127 |
+
* Create new instances of Modules.
|
128 |
+
*/
|
129 |
+
public function __construct() {
|
130 |
+
$this->initialize();
|
131 |
+
}
|
132 |
+
|
133 |
+
/**
|
134 |
+
* Register.
|
135 |
+
*
|
136 |
+
* @param string $hook_suffix Page Hook Suffix.
|
137 |
+
* @param string $page_slug Page slug.
|
138 |
+
*/
|
139 |
+
public function register( $hook_suffix, $page_slug ) {
|
140 |
+
$this->page_hook_suffix = $hook_suffix;
|
141 |
+
$this->page_slug = $page_slug;
|
142 |
+
|
143 |
+
add_action( "add_meta_boxes_{$this->page_hook_suffix}", array( $this, 'setup_metabox' ) );
|
144 |
+
|
145 |
+
add_filter( 'bd_javascript_array', array( $this, 'filter_js_array' ) );
|
146 |
+
|
147 |
+
if ( ! empty( $this->action ) ) {
|
148 |
+
add_action( 'bd_' . $this->action, array( $this, 'process' ) );
|
149 |
+
}
|
150 |
+
}
|
151 |
+
|
152 |
+
/**
|
153 |
+
* Setup the meta box.
|
154 |
+
*/
|
155 |
+
public function setup_metabox() {
|
156 |
+
add_meta_box(
|
157 |
+
$this->meta_box_slug,
|
158 |
+
$this->messages['box_label'],
|
159 |
+
array( $this, 'render_box' ),
|
160 |
+
$this->page_hook_suffix,
|
161 |
+
'advanced'
|
162 |
+
);
|
163 |
+
}
|
164 |
+
|
165 |
+
/**
|
166 |
+
* Render the meta box.
|
167 |
+
*/
|
168 |
+
public function render_box() {
|
169 |
+
if ( $this->is_hidden() ) {
|
170 |
+
printf(
|
171 |
+
/* translators: 1 Module url */
|
172 |
+
__( 'This section just got enabled. Kindly <a href = "%1$s">refresh</a> the page to fully enable it.', 'bulk-delete' ),
|
173 |
+
'admin.php?page=' . esc_attr( $this->page_slug )
|
174 |
+
);
|
175 |
+
|
176 |
+
return;
|
177 |
+
}
|
178 |
+
|
179 |
+
$this->render();
|
180 |
+
}
|
181 |
+
|
182 |
+
/**
|
183 |
+
* Is the current meta box hidden by user.
|
184 |
+
*
|
185 |
+
* @return bool True, if hidden. False, otherwise.
|
186 |
+
*/
|
187 |
+
protected function is_hidden() {
|
188 |
+
$current_user = wp_get_current_user();
|
189 |
+
$user_meta_field = $this->get_hidden_box_user_meta_field();
|
190 |
+
$hidden_boxes = get_user_meta( $current_user->ID, $user_meta_field, true );
|
191 |
+
|
192 |
+
return is_array( $hidden_boxes ) && in_array( $this->meta_box_slug, $hidden_boxes, true );
|
193 |
+
}
|
194 |
+
|
195 |
+
/**
|
196 |
+
* Get the user meta field that stores the status of the hidden meta boxes.
|
197 |
+
*
|
198 |
+
* @return string Name of the User Meta field.
|
199 |
+
*/
|
200 |
+
protected function get_hidden_box_user_meta_field() {
|
201 |
+
if ( 'posts' === $this->item_type ) {
|
202 |
+
return 'metaboxhidden_toplevel_page_bulk-delete-posts';
|
203 |
+
} else {
|
204 |
+
return 'metaboxhidden_bulk-wp_page_' . $this->page_slug;
|
205 |
+
}
|
206 |
+
}
|
207 |
+
|
208 |
+
/**
|
209 |
+
* Filter the js array.
|
210 |
+
*
|
211 |
+
* Use `append_to_js_array` function to append any module specific js options.
|
212 |
+
*
|
213 |
+
* @see $this->append_to_js_array
|
214 |
+
*
|
215 |
+
* @param array $js_array JavaScript Array.
|
216 |
+
*
|
217 |
+
* @return array Modified JavaScript Array
|
218 |
+
*/
|
219 |
+
public function filter_js_array( $js_array ) {
|
220 |
+
$js_array['dt_iterators'][] = '_' . $this->field_slug;
|
221 |
+
|
222 |
+
$js_array['pre_action_msg'][ $this->action ] = $this->action . '_confirm';
|
223 |
+
$js_array['error_msg'][ $this->action ] = $this->action . '_error';
|
224 |
+
|
225 |
+
$js_array['msg'][ $this->action . '_confirm' ] = __( 'Are you sure you want to delete all the posts based on the selected option?', 'bulk-delete' );
|
226 |
+
$js_array['msg'][ $this->action . '_error' ] = __( 'Please select posts from at least one option', 'bulk-delete' );
|
227 |
+
|
228 |
+
if ( ! empty( $this->messages['confirm_deletion'] ) ) {
|
229 |
+
$js_array['msg'][ $this->action . '_confirm' ] = $this->messages['confirm_deletion'];
|
230 |
+
}
|
231 |
+
|
232 |
+
if ( ! empty( $this->messages['validation_error'] ) ) {
|
233 |
+
$js_array['msg'][ $this->action . '_error' ] = $this->messages['validation_error'];
|
234 |
+
}
|
235 |
+
|
236 |
+
return $this->append_to_js_array( $js_array );
|
237 |
+
}
|
238 |
+
|
239 |
+
/**
|
240 |
+
* Append any module specific options to JS array.
|
241 |
+
*
|
242 |
+
* This function will be overridden by the child classes.
|
243 |
+
*
|
244 |
+
* @param array $js_array JavaScript Array.
|
245 |
+
*
|
246 |
+
* @return array Modified JavaScript Array
|
247 |
+
*/
|
248 |
+
protected function append_to_js_array( $js_array ) {
|
249 |
+
return $js_array;
|
250 |
+
}
|
251 |
+
|
252 |
+
/**
|
253 |
+
* Helper function for processing deletion.
|
254 |
+
* Setups up cron and invokes the actual delete method.
|
255 |
+
*
|
256 |
+
* @param array $request Request array.
|
257 |
+
*/
|
258 |
+
public function process( $request ) {
|
259 |
+
$options = $this->parse_common_filters( $request );
|
260 |
+
$options = $this->convert_user_input_to_options( $request, $options );
|
261 |
+
$cron_options = $this->parse_cron_filters( $request );
|
262 |
+
|
263 |
+
/**
|
264 |
+
* Filter the processed delete options.
|
265 |
+
*
|
266 |
+
* @since 6.0.0
|
267 |
+
*
|
268 |
+
* @param array $options Processed options.
|
269 |
+
* @param array $request Request array.
|
270 |
+
* @param \BulkWP\BulkDelete\Core\Base\BaseModule The delete module.
|
271 |
+
*/
|
272 |
+
$options = apply_filters( 'bd_processed_delete_options', $options, $request, $this );
|
273 |
+
|
274 |
+
if ( $this->is_scheduled( $cron_options ) ) {
|
275 |
+
$msg = $this->schedule_deletion( $cron_options, $options );
|
276 |
+
} else {
|
277 |
+
$items_deleted = $this->delete( $options );
|
278 |
+
$msg = sprintf( $this->get_success_message( $items_deleted ), $items_deleted );
|
279 |
+
}
|
280 |
+
|
281 |
+
add_settings_error(
|
282 |
+
$this->page_slug,
|
283 |
+
$this->action,
|
284 |
+
$msg,
|
285 |
+
'updated'
|
286 |
+
);
|
287 |
+
}
|
288 |
+
|
289 |
+
/**
|
290 |
+
* Delete items based on delete options.
|
291 |
+
*
|
292 |
+
* @param array $options Delete Options.
|
293 |
+
*
|
294 |
+
* @return int Number of items deleted.
|
295 |
+
*/
|
296 |
+
public function delete( $options ) {
|
297 |
+
/**
|
298 |
+
* Filter delete options before deleting items.
|
299 |
+
*
|
300 |
+
* @since 6.0.0 Added `Modules` parameter.
|
301 |
+
*
|
302 |
+
* @param array $options Delete options.
|
303 |
+
* @param \BulkWP\BulkDelete\Core\Base\BaseModule Modules that is triggering deletion.
|
304 |
+
*/
|
305 |
+
$options = apply_filters( 'bd_delete_options', $options, $this );
|
306 |
+
|
307 |
+
return $this->do_delete( $options );
|
308 |
+
}
|
309 |
+
|
310 |
+
/**
|
311 |
+
* Get Success Message.
|
312 |
+
*
|
313 |
+
* @param int $items_deleted Number of items that were deleted.
|
314 |
+
*
|
315 |
+
* @return string Success message.
|
316 |
+
*/
|
317 |
+
protected function get_success_message( $items_deleted ) {
|
318 |
+
if ( 0 === $items_deleted ) {
|
319 |
+
if ( ! empty( $this->messages['nothing_to_delete'] ) ) {
|
320 |
+
return $this->messages['nothing_to_delete'];
|
321 |
+
}
|
322 |
+
}
|
323 |
+
|
324 |
+
return _n( $this->messages['deleted_one'], $this->messages['deleted_multiple'], $items_deleted, 'bulk-delete' ); // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralSingle, WordPress.WP.I18n.NonSingularStringLiteralPlural
|
325 |
+
}
|
326 |
+
|
327 |
+
/**
|
328 |
+
* Getter for cron_hook.
|
329 |
+
*
|
330 |
+
* @return string Cron Hook name.
|
331 |
+
*/
|
332 |
+
public function get_cron_hook() {
|
333 |
+
return $this->cron_hook;
|
334 |
+
}
|
335 |
+
|
336 |
+
/**
|
337 |
+
* Getter for field slug.
|
338 |
+
*
|
339 |
+
* @return string Field Slug.
|
340 |
+
*/
|
341 |
+
public function get_field_slug() {
|
342 |
+
return $this->field_slug;
|
343 |
+
}
|
344 |
+
|
345 |
+
/**
|
346 |
+
* Getter for action.
|
347 |
+
*
|
348 |
+
* @return string Modules action.
|
349 |
+
*/
|
350 |
+
public function get_action() {
|
351 |
+
return $this->action;
|
352 |
+
}
|
353 |
+
|
354 |
+
/**
|
355 |
+
* Is the current deletion request a scheduled request?
|
356 |
+
*
|
357 |
+
* @param array $cron_options Request object.
|
358 |
+
*
|
359 |
+
* @return bool True if it is a scheduled request, False otherwise.
|
360 |
+
*/
|
361 |
+
protected function is_scheduled( $cron_options ) {
|
362 |
+
return $cron_options['is_scheduled'];
|
363 |
+
}
|
364 |
+
|
365 |
+
/**
|
366 |
+
* Schedule Deletion of items.
|
367 |
+
*
|
368 |
+
* @param array $cron_options Cron options.
|
369 |
+
* @param array $options Deletion option.
|
370 |
+
*
|
371 |
+
* @return string Message.
|
372 |
+
*/
|
373 |
+
protected function schedule_deletion( $cron_options, $options ) {
|
374 |
+
$options['cron_label'] = $cron_options['cron_label'];
|
375 |
+
|
376 |
+
if ( '-1' === $cron_options['frequency'] ) {
|
377 |
+
wp_schedule_single_event( $cron_options['start_time'], $this->cron_hook, array( $options ) );
|
378 |
+
} else {
|
379 |
+
wp_schedule_event( $cron_options['start_time'], $cron_options['frequency'], $this->cron_hook, array( $options ) );
|
380 |
+
}
|
381 |
+
|
382 |
+
return $this->messages['scheduled'] . ' ' . $this->get_task_list_link();
|
383 |
+
}
|
384 |
+
|
385 |
+
/**
|
386 |
+
* Get the link to the page that lists all the scheduled tasks.
|
387 |
+
*
|
388 |
+
* @return string Link to scheduled tasks page.
|
389 |
+
*/
|
390 |
+
protected function get_task_list_link() {
|
391 |
+
return sprintf(
|
392 |
+
/* translators: 1 Cron page url */
|
393 |
+
__( 'See the full list of <a href = "%s">scheduled tasks</a>', 'bulk-delete' ),
|
394 |
+
get_bloginfo( 'wpurl' ) . '/wp-admin/admin.php?page=' . \Bulk_Delete::CRON_PAGE_SLUG
|
395 |
+
);
|
396 |
+
}
|
397 |
+
|
398 |
+
/**
|
399 |
+
* Parse request and create cron options.
|
400 |
+
*
|
401 |
+
* @param array $request Request array.
|
402 |
+
*
|
403 |
+
* @return array Parsed cron option.
|
404 |
+
*/
|
405 |
+
protected function parse_cron_filters( $request ) {
|
406 |
+
$cron_options = array(
|
407 |
+
'is_scheduled' => false,
|
408 |
+
);
|
409 |
+
|
410 |
+
$scheduled = bd_array_get_bool( $request, 'smbd_' . $this->field_slug . '_cron', false );
|
411 |
+
|
412 |
+
if ( $scheduled ) {
|
413 |
+
$cron_options['is_scheduled'] = true;
|
414 |
+
$cron_options['frequency'] = sanitize_text_field( $request[ 'smbd_' . $this->field_slug . '_cron_freq' ] );
|
415 |
+
$cron_options['start_time'] = bd_get_gmt_offseted_time( sanitize_text_field( $request[ 'smbd_' . $this->field_slug . '_cron_start' ] ) );
|
416 |
+
|
417 |
+
$cron_options['cron_label'] = $this->get_cron_label();
|
418 |
+
}
|
419 |
+
|
420 |
+
return $cron_options;
|
421 |
+
}
|
422 |
+
|
423 |
+
/**
|
424 |
+
* Get the human readable label for the Schedule job.
|
425 |
+
*
|
426 |
+
* @return string Human readable label for schedule job.
|
427 |
+
*/
|
428 |
+
public function get_cron_label() {
|
429 |
+
return $this->messages['cron_label'];
|
430 |
+
}
|
431 |
+
|
432 |
+
/**
|
433 |
+
* Get the name of the module.
|
434 |
+
*
|
435 |
+
* This is used as the key to identify the module from page.
|
436 |
+
*
|
437 |
+
* @return string Module name.
|
438 |
+
*/
|
439 |
+
public function get_name() {
|
440 |
+
return bd_get_short_class_name( $this );
|
441 |
+
}
|
442 |
+
}
|
include/Core/Base/BasePage.php
ADDED
@@ -0,0 +1,349 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace BulkWP\BulkDelete\Core\Base;
|
3 |
+
|
4 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Base class for all Admin Page including Bulk Delete pages and setting pages.
|
8 |
+
*
|
9 |
+
* All concrete implementation of a Bulk Delete Admin page will extend this class.
|
10 |
+
*
|
11 |
+
* @since 6.0.0
|
12 |
+
*/
|
13 |
+
abstract class BasePage {
|
14 |
+
/**
|
15 |
+
* Slug of Bulk WP Menu.
|
16 |
+
*/
|
17 |
+
const BULK_WP_MENU_SLUG = 'bulk-delete-posts';
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Path to main plugin file.
|
21 |
+
*
|
22 |
+
* @var string
|
23 |
+
*/
|
24 |
+
protected $plugin_file;
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Page Slug.
|
28 |
+
*
|
29 |
+
* @var string
|
30 |
+
*/
|
31 |
+
protected $page_slug;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Hook Suffix of the current page.
|
35 |
+
*
|
36 |
+
* @var string
|
37 |
+
*/
|
38 |
+
protected $hook_suffix;
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Current screen.
|
42 |
+
*
|
43 |
+
* @var \WP_Screen
|
44 |
+
*/
|
45 |
+
protected $screen;
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Minimum capability needed for viewing this page.
|
49 |
+
*
|
50 |
+
* @var string
|
51 |
+
*/
|
52 |
+
protected $capability = 'manage_options';
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Labels used in this page.
|
56 |
+
*
|
57 |
+
* @var array
|
58 |
+
*/
|
59 |
+
protected $label = array(
|
60 |
+
'page_title' => '',
|
61 |
+
'menu_title' => '',
|
62 |
+
);
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Messages shown to the user.
|
66 |
+
*
|
67 |
+
* @var array
|
68 |
+
*/
|
69 |
+
protected $messages = array(
|
70 |
+
'warning_message' => '',
|
71 |
+
);
|
72 |
+
|
73 |
+
/**
|
74 |
+
* Actions used in this page.
|
75 |
+
*
|
76 |
+
* @var array
|
77 |
+
*/
|
78 |
+
protected $actions = array();
|
79 |
+
|
80 |
+
/**
|
81 |
+
* Should the link to this page be displayed in the plugin list. Default false.
|
82 |
+
*
|
83 |
+
* @var bool
|
84 |
+
*/
|
85 |
+
protected $show_link_in_plugin_list = false;
|
86 |
+
|
87 |
+
/**
|
88 |
+
* Initialize and setup variables and attributes of the page.
|
89 |
+
*
|
90 |
+
* @return void
|
91 |
+
*/
|
92 |
+
abstract protected function initialize();
|
93 |
+
|
94 |
+
/**
|
95 |
+
* Render body content.
|
96 |
+
*
|
97 |
+
* @return void
|
98 |
+
*/
|
99 |
+
abstract protected function render_body();
|
100 |
+
|
101 |
+
/**
|
102 |
+
* BasePage constructor.
|
103 |
+
*
|
104 |
+
* @param string $plugin_file Path to the main plugin file.
|
105 |
+
*/
|
106 |
+
public function __construct( $plugin_file ) {
|
107 |
+
$this->plugin_file = $plugin_file;
|
108 |
+
$this->initialize();
|
109 |
+
}
|
110 |
+
|
111 |
+
/**
|
112 |
+
* Register the page.
|
113 |
+
*
|
114 |
+
* This function will be called in the `admin_menu` hook.
|
115 |
+
*/
|
116 |
+
public function register() {
|
117 |
+
$this->register_page();
|
118 |
+
$this->register_hooks();
|
119 |
+
}
|
120 |
+
|
121 |
+
/**
|
122 |
+
* Register page as a submenu to the Bulk WP Menu.
|
123 |
+
*/
|
124 |
+
protected function register_page() {
|
125 |
+
$hook_suffix = add_submenu_page(
|
126 |
+
self::BULK_WP_MENU_SLUG,
|
127 |
+
$this->label['page_title'],
|
128 |
+
$this->label['menu_title'],
|
129 |
+
$this->capability,
|
130 |
+
$this->page_slug,
|
131 |
+
array( $this, 'render_page' )
|
132 |
+
);
|
133 |
+
|
134 |
+
if ( false !== $hook_suffix ) {
|
135 |
+
$this->hook_suffix = $hook_suffix;
|
136 |
+
}
|
137 |
+
}
|
138 |
+
|
139 |
+
/**
|
140 |
+
* Register hooks.
|
141 |
+
*/
|
142 |
+
protected function register_hooks() {
|
143 |
+
add_filter( 'bd_action_nonce_check', array( $this, 'verify_nonce' ), 10, 2 );
|
144 |
+
|
145 |
+
add_action( "load-{$this->hook_suffix}", array( $this, 'setup_contextual_help' ) );
|
146 |
+
add_filter( 'bd_admin_help_tabs', array( $this, 'render_help_tab' ), 10, 2 );
|
147 |
+
|
148 |
+
add_action( "bd_admin_footer_for_{$this->page_slug}", array( $this, 'modify_admin_footer' ) );
|
149 |
+
|
150 |
+
if ( $this->show_link_in_plugin_list ) {
|
151 |
+
add_filter( 'bd_plugin_action_links', array( $this, 'append_to_plugin_action_links' ) );
|
152 |
+
}
|
153 |
+
}
|
154 |
+
|
155 |
+
/**
|
156 |
+
* Check for nonce before executing the action.
|
157 |
+
*
|
158 |
+
* @param bool $result The current result.
|
159 |
+
* @param string $action Action name.
|
160 |
+
*
|
161 |
+
* @return bool True if nonce is verified, False otherwise.
|
162 |
+
*/
|
163 |
+
public function verify_nonce( $result, $action ) {
|
164 |
+
/**
|
165 |
+
* List of actions for page.
|
166 |
+
*
|
167 |
+
* @param array $actions Actions.
|
168 |
+
* @param BasePage $page Page objects.
|
169 |
+
*
|
170 |
+
* @since 6.0.0
|
171 |
+
*/
|
172 |
+
$page_actions = apply_filters( 'bd_page_actions', $this->actions, $this );
|
173 |
+
|
174 |
+
if ( in_array( $action, $page_actions, true ) ) {
|
175 |
+
if ( check_admin_referer( "bd-{$this->page_slug}", "bd-{$this->page_slug}-nonce" ) ) {
|
176 |
+
return true;
|
177 |
+
}
|
178 |
+
}
|
179 |
+
|
180 |
+
return $result;
|
181 |
+
}
|
182 |
+
|
183 |
+
/**
|
184 |
+
* Setup hooks for rendering contextual help.
|
185 |
+
*/
|
186 |
+
public function setup_contextual_help() {
|
187 |
+
/**
|
188 |
+
* Add contextual help for admin screens.
|
189 |
+
*
|
190 |
+
* @since 5.1
|
191 |
+
*
|
192 |
+
* @param string Hook suffix of the current page.
|
193 |
+
*/
|
194 |
+
do_action( 'bd_add_contextual_help', $this->hook_suffix );
|
195 |
+
}
|
196 |
+
|
197 |
+
/**
|
198 |
+
* Modify help tabs for the current page.
|
199 |
+
*
|
200 |
+
* @param array $help_tabs Current list of help tabs.
|
201 |
+
* @param string $hook_suffix Hook Suffix of the page.
|
202 |
+
*
|
203 |
+
* @return array Modified list of help tabs.
|
204 |
+
*/
|
205 |
+
public function render_help_tab( $help_tabs, $hook_suffix ) {
|
206 |
+
if ( $this->hook_suffix === $hook_suffix ) {
|
207 |
+
$help_tabs = $this->add_help_tab( $help_tabs );
|
208 |
+
}
|
209 |
+
|
210 |
+
return $help_tabs;
|
211 |
+
}
|
212 |
+
|
213 |
+
/**
|
214 |
+
* Add help tabs.
|
215 |
+
*
|
216 |
+
* Help tabs can be added by overriding this function in the child class.
|
217 |
+
*
|
218 |
+
* @param array $help_tabs Current list of help tabs.
|
219 |
+
*
|
220 |
+
* @return array List of help tabs.
|
221 |
+
*/
|
222 |
+
protected function add_help_tab( $help_tabs ) {
|
223 |
+
return $help_tabs;
|
224 |
+
}
|
225 |
+
|
226 |
+
/**
|
227 |
+
* Render the page.
|
228 |
+
*/
|
229 |
+
public function render_page() {
|
230 |
+
?>
|
231 |
+
<div class="wrap">
|
232 |
+
<h2><?php echo esc_html( $this->label['page_title'] ); ?></h2>
|
233 |
+
<?php settings_errors(); ?>
|
234 |
+
|
235 |
+
<form method="post">
|
236 |
+
<?php $this->render_nonce_fields(); ?>
|
237 |
+
|
238 |
+
<div id = "poststuff">
|
239 |
+
<div id="post-body" class="metabox-holder columns-1">
|
240 |
+
|
241 |
+
<?php $this->render_header(); ?>
|
242 |
+
|
243 |
+
<div id="postbox-container-2" class="postbox-container">
|
244 |
+
<?php $this->render_body(); ?>
|
245 |
+
</div> <!-- #postbox-container-2 -->
|
246 |
+
|
247 |
+
</div> <!-- #post-body -->
|
248 |
+
</div><!-- #poststuff -->
|
249 |
+
</form>
|
250 |
+
</div><!-- .wrap -->
|
251 |
+
<?php
|
252 |
+
$this->render_footer();
|
253 |
+
}
|
254 |
+
|
255 |
+
/**
|
256 |
+
* Print nonce fields.
|
257 |
+
*/
|
258 |
+
protected function render_nonce_fields() {
|
259 |
+
wp_nonce_field( "bd-{$this->page_slug}", "bd-{$this->page_slug}-nonce" );
|
260 |
+
}
|
261 |
+
|
262 |
+
/**
|
263 |
+
* Render page header.
|
264 |
+
*/
|
265 |
+
protected function render_header() {
|
266 |
+
if ( empty( $this->messages['warning_message'] ) ) {
|
267 |
+
return;
|
268 |
+
}
|
269 |
+
?>
|
270 |
+
<div class="notice notice-warning">
|
271 |
+
<p>
|
272 |
+
<strong>
|
273 |
+
<?php echo esc_html( $this->messages['warning_message'] ); ?>
|
274 |
+
</strong>
|
275 |
+
</p>
|
276 |
+
</div>
|
277 |
+
<?php
|
278 |
+
}
|
279 |
+
|
280 |
+
/**
|
281 |
+
* Render page footer.
|
282 |
+
*/
|
283 |
+
protected function render_footer() {
|
284 |
+
/**
|
285 |
+
* Runs just before displaying the footer text in the admin page.
|
286 |
+
*
|
287 |
+
* This action is primarily for adding extra content in the footer of admin page.
|
288 |
+
*
|
289 |
+
* @since 5.5.4
|
290 |
+
*/
|
291 |
+
do_action( "bd_admin_footer_for_{$this->page_slug}" );
|
292 |
+
}
|
293 |
+
|
294 |
+
/**
|
295 |
+
* Modify admin footer in Bulk Delete plugin pages.
|
296 |
+
*/
|
297 |
+
public function modify_admin_footer() {
|
298 |
+
add_filter( 'admin_footer_text', 'bd_add_rating_link' );
|
299 |
+
}
|
300 |
+
|
301 |
+
/**
|
302 |
+
* Append link to the current page in plugin list.
|
303 |
+
*
|
304 |
+
* @param array $links Array of links.
|
305 |
+
*
|
306 |
+
* @return array Modified list of links.
|
307 |
+
*/
|
308 |
+
public function append_to_plugin_action_links( $links ) {
|
309 |
+
$links[ $this->get_page_slug() ] = '<a href="admin.php?page=' . $this->get_page_slug() . '">' . $this->label['page_title'] . '</a>';
|
310 |
+
|
311 |
+
return $links;
|
312 |
+
}
|
313 |
+
|
314 |
+
/**
|
315 |
+
* Getter for screen.
|
316 |
+
*
|
317 |
+
* @return \WP_Screen Current screen.
|
318 |
+
*/
|
319 |
+
public function get_screen() {
|
320 |
+
return $this->screen;
|
321 |
+
}
|
322 |
+
|
323 |
+
/**
|
324 |
+
* Getter for page_slug.
|
325 |
+
*
|
326 |
+
* @return string Slug of the page.
|
327 |
+
*/
|
328 |
+
public function get_page_slug() {
|
329 |
+
return $this->page_slug;
|
330 |
+
}
|
331 |
+
|
332 |
+
/**
|
333 |
+
* Getter for Hook Suffix.
|
334 |
+
*
|
335 |
+
* @return string Hook Suffix of the page.
|
336 |
+
*/
|
337 |
+
public function get_hook_suffix() {
|
338 |
+
return $this->hook_suffix;
|
339 |
+
}
|
340 |
+
|
341 |
+
/**
|
342 |
+
* Get the url to the plugin directory.
|
343 |
+
*
|
344 |
+
* @return string Url to plugin directory.
|
345 |
+
*/
|
346 |
+
protected function get_plugin_dir_url() {
|
347 |
+
return plugin_dir_url( $this->plugin_file );
|
348 |
+
}
|
349 |
+
}
|
include/Core/Base/BaseScheduler.php
ADDED
@@ -0,0 +1,124 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Core\Base;
|
4 |
+
|
5 |
+
use BulkWP\BulkDelete\Core\BulkDelete;
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Encapsulates the logic for running a scheduler for a module.
|
11 |
+
*
|
12 |
+
* All Schedulers for Modules will be extending this class.
|
13 |
+
*
|
14 |
+
* @since 6.0.0
|
15 |
+
*/
|
16 |
+
abstract class BaseScheduler {
|
17 |
+
/**
|
18 |
+
* The page slug of the module for which this is the Scheduler.
|
19 |
+
*
|
20 |
+
* @var string
|
21 |
+
*/
|
22 |
+
protected $page_slug;
|
23 |
+
|
24 |
+
/**
|
25 |
+
* The class name of the module to which this is the scheduler.
|
26 |
+
*
|
27 |
+
* @var string
|
28 |
+
*/
|
29 |
+
protected $module_class_name;
|
30 |
+
|
31 |
+
/**
|
32 |
+
* The module to which this is the scheduler.
|
33 |
+
*
|
34 |
+
* @var \BulkWP\BulkDelete\Core\Base\BaseModule
|
35 |
+
*/
|
36 |
+
protected $module = null;
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Initialize and setup variables.
|
40 |
+
*
|
41 |
+
* This method can be overridden by sub-classes if additional customization is needed.
|
42 |
+
*/
|
43 |
+
abstract protected function initialize();
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Create new instances of the Scheduler.
|
47 |
+
*/
|
48 |
+
public function __construct() {
|
49 |
+
$this->initialize();
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Register the scheduler.
|
54 |
+
*
|
55 |
+
* Setups the hooks and filters.
|
56 |
+
*/
|
57 |
+
public function register() {
|
58 |
+
add_action( 'init', array( $this, 'setup_cron' ) );
|
59 |
+
|
60 |
+
add_filter( 'bd_javascript_array', array( $this, 'filter_js_array' ) );
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Setup cron job.
|
65 |
+
*/
|
66 |
+
public function setup_cron() {
|
67 |
+
$this->setup_module();
|
68 |
+
|
69 |
+
$cron_hook = $this->module->get_cron_hook();
|
70 |
+
if ( ! empty( $cron_hook ) ) {
|
71 |
+
add_action( $cron_hook, array( $this, 'do_delete' ) );
|
72 |
+
}
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* Setup module from class name.
|
77 |
+
*/
|
78 |
+
protected function setup_module() {
|
79 |
+
$bd = BulkDelete::get_instance();
|
80 |
+
|
81 |
+
$this->module = $bd->get_module( $this->page_slug, $this->module_class_name );
|
82 |
+
}
|
83 |
+
|
84 |
+
/**
|
85 |
+
* Filter JS Array and add pro hooks.
|
86 |
+
*
|
87 |
+
* @param array $js_array JavaScript Array.
|
88 |
+
*
|
89 |
+
* @return array Modified JavaScript Array
|
90 |
+
*/
|
91 |
+
public function filter_js_array( $js_array ) {
|
92 |
+
$js_array['pro_iterators'][] = $this->module->get_field_slug();
|
93 |
+
|
94 |
+
return $js_array;
|
95 |
+
}
|
96 |
+
|
97 |
+
/**
|
98 |
+
* Trigger the deletion.
|
99 |
+
*
|
100 |
+
* @param array $delete_options Delete options.
|
101 |
+
*/
|
102 |
+
public function do_delete( $delete_options ) {
|
103 |
+
/**
|
104 |
+
* Triggered before the scheduler is run.
|
105 |
+
*
|
106 |
+
* @since 6.0.0
|
107 |
+
*
|
108 |
+
* @param string $label Cron Label.
|
109 |
+
*/
|
110 |
+
do_action( 'bd_before_scheduler', $this->module->get_cron_label() );
|
111 |
+
|
112 |
+
$items_deleted = $this->module->delete( $delete_options );
|
113 |
+
|
114 |
+
/**
|
115 |
+
* Triggered after the scheduler is run.
|
116 |
+
*
|
117 |
+
* @since 6.0.0
|
118 |
+
*
|
119 |
+
* @param string $label Cron Label.
|
120 |
+
* @param int $items_deleted Number of items that were deleted.
|
121 |
+
*/
|
122 |
+
do_action( 'bd_after_scheduler', $this->module->get_cron_label(), $items_deleted );
|
123 |
+
}
|
124 |
+
}
|
include/Core/Base/Mixin/Fetcher.php
ADDED
@@ -0,0 +1,200 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Core\Base\Mixin;
|
4 |
+
|
5 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Container of all Fetch related methods.
|
9 |
+
*
|
10 |
+
* Ideally this should be a Trait. Since Bulk Delete still supports PHP 5.3, this is implemented as a class.
|
11 |
+
* Once the minimum requirement is increased to PHP 5.3, this will be changed into a Trait.
|
12 |
+
*
|
13 |
+
* @since 6.0.0
|
14 |
+
*/
|
15 |
+
abstract class Fetcher {
|
16 |
+
/**
|
17 |
+
* Get the list of public post types registered in WordPress.
|
18 |
+
*
|
19 |
+
* @return \WP_Post_Type[]
|
20 |
+
*/
|
21 |
+
protected function get_post_types() {
|
22 |
+
return bd_get_post_types();
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Get the list of post statuses.
|
27 |
+
*
|
28 |
+
* This includes all custom post status, but excludes built-in private posts.
|
29 |
+
*
|
30 |
+
* @return array List of post status objects.
|
31 |
+
*/
|
32 |
+
protected function get_post_statuses() {
|
33 |
+
return bd_get_post_statuses();
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Get the list of post types by post status and count.
|
38 |
+
*
|
39 |
+
* @return array Post types by post status.
|
40 |
+
*/
|
41 |
+
protected function get_post_types_by_status() {
|
42 |
+
$post_types_by_status = array();
|
43 |
+
|
44 |
+
$post_types = $this->get_post_types();
|
45 |
+
$post_statuses = $this->get_post_statuses();
|
46 |
+
|
47 |
+
foreach ( $post_types as $post_type ) {
|
48 |
+
$post_type_name = $post_type->name;
|
49 |
+
$count_posts = wp_count_posts( $post_type_name );
|
50 |
+
|
51 |
+
foreach ( $post_statuses as $post_status ) {
|
52 |
+
$post_status_name = $post_status->name;
|
53 |
+
|
54 |
+
if ( ! property_exists( $count_posts, $post_status_name ) ) {
|
55 |
+
continue;
|
56 |
+
}
|
57 |
+
|
58 |
+
if ( 0 === $count_posts->{$post_status_name} ) {
|
59 |
+
continue;
|
60 |
+
}
|
61 |
+
|
62 |
+
$post_types_by_status[ $post_type->labels->singular_name ][ "$post_type_name-$post_status_name" ] = $post_status->label . ' (' . $count_posts->{$post_status_name} . ' ' . __( 'Posts', 'bulk-delete' ) . ')';
|
63 |
+
}
|
64 |
+
}
|
65 |
+
|
66 |
+
return $post_types_by_status;
|
67 |
+
}
|
68 |
+
|
69 |
+
/**
|
70 |
+
* Get the list of sticky posts.
|
71 |
+
*
|
72 |
+
* @return array List of sticky posts.
|
73 |
+
*/
|
74 |
+
protected function get_sticky_posts() {
|
75 |
+
$sticky_post_ids = get_option( 'sticky_posts' );
|
76 |
+
|
77 |
+
if ( empty( $sticky_post_ids ) ) {
|
78 |
+
return array();
|
79 |
+
}
|
80 |
+
|
81 |
+
return get_posts(
|
82 |
+
array(
|
83 |
+
'numberposts' => count( $sticky_post_ids ),
|
84 |
+
'post__in' => $sticky_post_ids,
|
85 |
+
)
|
86 |
+
);
|
87 |
+
}
|
88 |
+
|
89 |
+
/**
|
90 |
+
* Get the list of categories.
|
91 |
+
*
|
92 |
+
* @return array List of categories.
|
93 |
+
*/
|
94 |
+
protected function get_categories() {
|
95 |
+
$enhanced_select_threshold = $this->get_enhanced_select_threshold();
|
96 |
+
|
97 |
+
$categories = get_categories(
|
98 |
+
array(
|
99 |
+
'hide_empty' => false,
|
100 |
+
'number' => $enhanced_select_threshold,
|
101 |
+
)
|
102 |
+
);
|
103 |
+
|
104 |
+
return $categories;
|
105 |
+
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
* Are tags present in this WordPress installation?
|
109 |
+
*
|
110 |
+
* Only one tag is retrieved to check if tags are present for performance reasons.
|
111 |
+
*
|
112 |
+
* @return bool True if tags are present, False otherwise.
|
113 |
+
*/
|
114 |
+
protected function are_tags_present() {
|
115 |
+
$tags = $this->get_tags( 1 );
|
116 |
+
|
117 |
+
return ( count( $tags ) > 0 );
|
118 |
+
}
|
119 |
+
|
120 |
+
/**
|
121 |
+
* Get the list of tags.
|
122 |
+
*
|
123 |
+
* @param int $max_count The maximum number of tags to be returned (Optional). Default 0.
|
124 |
+
* If 0 then the maximum number of tags specified in `get_enhanced_select_threshold` will be returned.
|
125 |
+
*
|
126 |
+
* @return array List of tags.
|
127 |
+
*/
|
128 |
+
protected function get_tags( $max_count = 0 ) {
|
129 |
+
if ( absint( $max_count ) === 0 ) {
|
130 |
+
$max_count = $this->get_enhanced_select_threshold();
|
131 |
+
}
|
132 |
+
|
133 |
+
$tags = get_tags(
|
134 |
+
array(
|
135 |
+
'hide_empty' => false,
|
136 |
+
'number' => $max_count,
|
137 |
+
)
|
138 |
+
);
|
139 |
+
|
140 |
+
return $tags;
|
141 |
+
}
|
142 |
+
|
143 |
+
/**
|
144 |
+
* Are sticky post present in this WordPress installation?
|
145 |
+
*
|
146 |
+
* @return bool True if sticky posts are present, False otherwise.
|
147 |
+
*/
|
148 |
+
protected function are_sticky_posts_present() {
|
149 |
+
$sticky_post_ids = get_option( 'sticky_posts' );
|
150 |
+
|
151 |
+
if ( ! is_array( $sticky_post_ids ) ) {
|
152 |
+
return false;
|
153 |
+
}
|
154 |
+
|
155 |
+
return ( count( $sticky_post_ids ) > 0 );
|
156 |
+
}
|
157 |
+
|
158 |
+
/**
|
159 |
+
* Check if private posts are present in a post type.
|
160 |
+
*
|
161 |
+
* @param string $post_type Post type.
|
162 |
+
*
|
163 |
+
* @return bool
|
164 |
+
*/
|
165 |
+
protected function are_private_posts_present( $post_type = 'any' ) {
|
166 |
+
$args = array(
|
167 |
+
'post_status' => array( 'private' ),
|
168 |
+
'post_type' => $post_type,
|
169 |
+
);
|
170 |
+
$query = new \WP_Query( $args );
|
171 |
+
|
172 |
+
return $query->have_posts();
|
173 |
+
}
|
174 |
+
|
175 |
+
/**
|
176 |
+
* Get the number of users present in a role.
|
177 |
+
*
|
178 |
+
* `count_users` function is very expensive. So this function takes an optional parameter to cache it.
|
179 |
+
*
|
180 |
+
* @see count_users
|
181 |
+
*
|
182 |
+
* @param string $role Role slug.
|
183 |
+
* @param array|null $users_count Result of the `count_users` function. Default null.
|
184 |
+
*
|
185 |
+
* @return int Number of users in that role.
|
186 |
+
*/
|
187 |
+
protected function get_user_count_by_role( $role, $users_count = null ) {
|
188 |
+
if ( is_null( $users_count ) || ! is_array( $users_count ) ) {
|
189 |
+
$users_count = count_users();
|
190 |
+
}
|
191 |
+
|
192 |
+
$roles = $users_count['avail_roles'];
|
193 |
+
|
194 |
+
if ( ! array_key_exists( $role, $roles ) ) {
|
195 |
+
return 0;
|
196 |
+
}
|
197 |
+
|
198 |
+
return $roles[ $role ];
|
199 |
+
}
|
200 |
+
}
|
include/Core/Base/Mixin/Renderer.php
ADDED
@@ -0,0 +1,636 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Core\Base\Mixin;
|
4 |
+
|
5 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Container of all Render methods.
|
9 |
+
*
|
10 |
+
* Ideally this should be a Trait. Since Bulk Delete still supports PHP 5.3, this is implemented as a class.
|
11 |
+
* Once the minimum requirement is increased to PHP 5.3, this will be changed into a Trait.
|
12 |
+
*
|
13 |
+
* @since 6.0.0
|
14 |
+
*/
|
15 |
+
abstract class Renderer extends Fetcher {
|
16 |
+
/**
|
17 |
+
* Slug for the form fields.
|
18 |
+
*
|
19 |
+
* @var string
|
20 |
+
*/
|
21 |
+
protected $field_slug;
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Render post status including custom post status.
|
25 |
+
*
|
26 |
+
* @param string $post_type The post type for which the post status should be displayed.
|
27 |
+
*/
|
28 |
+
protected function render_post_status( $post_type = 'post' ) {
|
29 |
+
$post_statuses = $this->get_post_statuses();
|
30 |
+
$post_count = wp_count_posts( $post_type );
|
31 |
+
|
32 |
+
foreach ( $post_statuses as $post_status ) : ?>
|
33 |
+
<tr>
|
34 |
+
<td>
|
35 |
+
<input name="smbd_<?php echo esc_attr( $this->field_slug ); ?>[]" id="smbd_<?php echo esc_attr( $post_status->name ); ?>"
|
36 |
+
value="<?php echo esc_attr( $post_status->name ); ?>" type="checkbox">
|
37 |
+
|
38 |
+
<label for="smbd_<?php echo esc_attr( $post_status->name ); ?>">
|
39 |
+
<?php echo esc_html( $post_status->label ), ' '; ?>
|
40 |
+
<?php if ( property_exists( $post_count, $post_status->name ) ) : ?>
|
41 |
+
(<?php echo absint( $post_count->{ $post_status->name } ) . ' ', __( 'Posts', 'bulk-delete' ); ?>)
|
42 |
+
<?php endif; ?>
|
43 |
+
</label>
|
44 |
+
</td>
|
45 |
+
</tr>
|
46 |
+
<?php endforeach;
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Render Post Types as radio buttons.
|
51 |
+
*/
|
52 |
+
protected function render_post_type_as_radios() {
|
53 |
+
$post_types = $this->get_post_types();
|
54 |
+
?>
|
55 |
+
|
56 |
+
<?php foreach ( $post_types as $post_type ) : ?>
|
57 |
+
|
58 |
+
<tr>
|
59 |
+
<td scope="row">
|
60 |
+
<input type="radio" name="<?php echo esc_attr( $this->field_slug ); ?>_post_type"
|
61 |
+
value="<?php echo esc_attr( $post_type->name ); ?>"
|
62 |
+
id="smbd_post_type_<?php echo esc_html( $post_type->name ); ?>">
|
63 |
+
|
64 |
+
<label for="smbd_post_type_<?php echo esc_html( $post_type->name ); ?>">
|
65 |
+
<?php echo esc_html( $post_type->label ); ?>
|
66 |
+
</label>
|
67 |
+
</td>
|
68 |
+
</tr>
|
69 |
+
|
70 |
+
<?php endforeach; ?>
|
71 |
+
<?php
|
72 |
+
}
|
73 |
+
|
74 |
+
/**
|
75 |
+
* Render Post type with status and post count checkboxes.
|
76 |
+
*/
|
77 |
+
protected function render_post_type_with_status() {
|
78 |
+
$post_types_by_status = $this->get_post_types_by_status();
|
79 |
+
?>
|
80 |
+
<tr>
|
81 |
+
<td scope="row" colspan="2">
|
82 |
+
<select class="enhanced-post-types-with-status" multiple="multiple" data-placeholder="Select Post Type" name="smbd_<?php echo esc_attr( $this->field_slug ); ?>[]">
|
83 |
+
<?php foreach ( $post_types_by_status as $post_type => $all_status ) : ?>
|
84 |
+
<optgroup label="<?php echo esc_html( $post_type ); ?>">
|
85 |
+
<?php foreach ( $all_status as $status_key => $status_value ) : ?>
|
86 |
+
<option value="<?php echo esc_attr( $status_key ); ?>"><?php echo esc_html( $status_value ); ?></option>
|
87 |
+
<?php endforeach; ?>
|
88 |
+
</optgroup>
|
89 |
+
<?php endforeach; ?>
|
90 |
+
</select>
|
91 |
+
</td>
|
92 |
+
</tr>
|
93 |
+
<?php
|
94 |
+
}
|
95 |
+
|
96 |
+
/**
|
97 |
+
* Split post type and status.
|
98 |
+
*
|
99 |
+
* @param string $str Post type and status combination.
|
100 |
+
*
|
101 |
+
* @return array Post type and status as elements of array.
|
102 |
+
*/
|
103 |
+
protected function split_post_type_and_status( $str ) {
|
104 |
+
$type_status = array();
|
105 |
+
|
106 |
+
$str_arr = explode( '-', $str );
|
107 |
+
|
108 |
+
if ( count( $str_arr ) > 1 ) {
|
109 |
+
$type_status['status'] = end( $str_arr );
|
110 |
+
$type_status['type'] = implode( '-', array_slice( $str_arr, 0, - 1 ) );
|
111 |
+
} else {
|
112 |
+
$type_status['status'] = 'publish';
|
113 |
+
$type_status['type'] = $str;
|
114 |
+
}
|
115 |
+
|
116 |
+
return $type_status;
|
117 |
+
}
|
118 |
+
|
119 |
+
/**
|
120 |
+
* Render post reassign settings.
|
121 |
+
*/
|
122 |
+
protected function render_post_reassign_settings() {
|
123 |
+
?>
|
124 |
+
<tr>
|
125 |
+
<td scope="row" colspan="2">
|
126 |
+
<label><input name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_post_reassign" value="false" type="radio"
|
127 |
+
checked="checked" class="post-reassign"> <?php _e( 'Also delete all posts of the users', 'bulk-delete' ); ?></label>
|
128 |
+
<label><input name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_post_reassign" value="true" type="radio"
|
129 |
+
id="smbd_<?php echo esc_attr( $this->field_slug ); ?>_post_reassign" class="post-reassign"> <?php _e( 'Re-assign the posts to', 'bulk-delete' ); ?></label>
|
130 |
+
<?php
|
131 |
+
wp_dropdown_users(
|
132 |
+
array(
|
133 |
+
'name' => 'smbd_' . esc_attr( $this->field_slug ) . '_reassign_user_id',
|
134 |
+
'class' => 'reassign-user',
|
135 |
+
'show_option_none' => __( 'Select User', 'bulk-delete' ),
|
136 |
+
)
|
137 |
+
);
|
138 |
+
?>
|
139 |
+
</td>
|
140 |
+
</tr>
|
141 |
+
<?php
|
142 |
+
}
|
143 |
+
|
144 |
+
/**
|
145 |
+
* Render user role dropdown.
|
146 |
+
*
|
147 |
+
* @param bool $show_users_with_no_roles Should users with no user roles be shown? Default false.
|
148 |
+
*/
|
149 |
+
protected function render_user_role_dropdown( $show_users_with_no_roles = false ) {
|
150 |
+
$roles = get_editable_roles();
|
151 |
+
$users_count = count_users();
|
152 |
+
?>
|
153 |
+
|
154 |
+
<select name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_roles[]" class="enhanced-role-dropdown"
|
155 |
+
multiple="multiple" data-placeholder="<?php _e( 'Select User Role', 'bulk-delete' ); ?>">
|
156 |
+
|
157 |
+
<?php foreach ( $roles as $role => $role_details ) : ?>
|
158 |
+
<option value="<?php echo esc_attr( $role ); ?>">
|
159 |
+
<?php echo esc_html( $role_details['name'] ), ' (', absint( $this->get_user_count_by_role( $role, $users_count ) ), ' ', __( 'Users', 'bulk-delete' ), ')'; ?>
|
160 |
+
</option>
|
161 |
+
<?php endforeach; ?>
|
162 |
+
|
163 |
+
<?php if ( $show_users_with_no_roles ) : ?>
|
164 |
+
<?php if ( isset( $users_count['avail_roles']['none'] ) && $users_count['avail_roles']['none'] > 0 ) : ?>
|
165 |
+
<option value="none">
|
166 |
+
<?php echo __( 'No role', 'bulk-delete' ), ' (', absint( $users_count['avail_roles']['none'] ), ' ', __( 'Users', 'bulk-delete' ), ')'; ?>
|
167 |
+
</option>
|
168 |
+
<?php endif; ?>
|
169 |
+
<?php endif; ?>
|
170 |
+
</select>
|
171 |
+
|
172 |
+
<?php
|
173 |
+
}
|
174 |
+
|
175 |
+
/**
|
176 |
+
* Render Post type dropdown.
|
177 |
+
*/
|
178 |
+
protected function render_post_type_dropdown() {
|
179 |
+
bd_render_post_type_dropdown( $this->field_slug );
|
180 |
+
}
|
181 |
+
|
182 |
+
/**
|
183 |
+
* Render Taxonomy dropdown.
|
184 |
+
*/
|
185 |
+
protected function render_taxonomy_dropdown() {
|
186 |
+
$taxonomies = get_taxonomies( array(), 'objects' );
|
187 |
+
?>
|
188 |
+
|
189 |
+
<select name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_taxonomy" class="enhanced-taxonomy-list" data-placeholder="<?php _e( 'Select Taxonomy', 'bulk-delete' ); ?>">
|
190 |
+
<?php foreach ( $taxonomies as $taxonomy ) : ?>
|
191 |
+
<option value="<?php echo esc_attr( $taxonomy->name ); ?>">
|
192 |
+
<?php echo esc_html( $taxonomy->label . ' (' . $taxonomy->name . ')' ); ?>
|
193 |
+
</option>
|
194 |
+
<?php endforeach; ?>
|
195 |
+
</select>
|
196 |
+
<?php
|
197 |
+
}
|
198 |
+
|
199 |
+
/**
|
200 |
+
* Render Category dropdown.
|
201 |
+
*/
|
202 |
+
protected function render_category_dropdown() {
|
203 |
+
$categories = $this->get_categories();
|
204 |
+
?>
|
205 |
+
|
206 |
+
<select name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_category[]" data-placeholder="<?php _e( 'Select Categories', 'bulk-delete' ); ?>"
|
207 |
+
class="<?php echo sanitize_html_class( $this->enable_ajax_if_needed_to_dropdown_class_name( count( $categories ), 'select2-taxonomy' ) ); ?>"
|
208 |
+
data-taxonomy="category" multiple>
|
209 |
+
|
210 |
+
<option value="all">
|
211 |
+
<?php _e( 'All Categories', 'bulk-delete' ); ?>
|
212 |
+
</option>
|
213 |
+
|
214 |
+
<?php foreach ( $categories as $category ) : ?>
|
215 |
+
<option value="<?php echo absint( $category->cat_ID ); ?>">
|
216 |
+
<?php echo esc_html( $category->cat_name ), ' (', absint( $category->count ), ' ', __( 'Posts', 'bulk-delete' ), ')'; ?>
|
217 |
+
</option>
|
218 |
+
<?php endforeach; ?>
|
219 |
+
|
220 |
+
</select>
|
221 |
+
<?php
|
222 |
+
}
|
223 |
+
|
224 |
+
/**
|
225 |
+
* Render String based comparison operators dropdown.
|
226 |
+
*/
|
227 |
+
protected function render_string_comparison_operators() {
|
228 |
+
?>
|
229 |
+
<select name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_operator">
|
230 |
+
<option value="equal_to"><?php _e( 'equal to', 'bulk-delete' ); ?></option>
|
231 |
+
<option value="not_equal_to"><?php _e( 'not equal to', 'bulk-delete' ); ?></option>
|
232 |
+
<option value="starts_with"><?php _e( 'starts with', 'bulk-delete' ); ?></option>
|
233 |
+
<option value="ends_with"><?php _e( 'ends with', 'bulk-delete' ); ?></option>
|
234 |
+
<option value="contains"><?php _e( 'contains', 'bulk-delete' ); ?></option>
|
235 |
+
<option value="not_contains"><?php _e( 'not contains', 'bulk-delete' ); ?></option>
|
236 |
+
</select>
|
237 |
+
<?php
|
238 |
+
}
|
239 |
+
|
240 |
+
/**
|
241 |
+
* Render number based comparison operators dropdown.
|
242 |
+
*/
|
243 |
+
protected function render_number_comparison_operators() {
|
244 |
+
?>
|
245 |
+
<select name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_operator">
|
246 |
+
<option value="="><?php _e( 'equal to', 'bulk-delete' ); ?></option>
|
247 |
+
<option value="!="><?php _e( 'not equal to', 'bulk-delete' ); ?></option>
|
248 |
+
<option value="<"><?php _e( 'less than', 'bulk-delete' ); ?></option>
|
249 |
+
<option value=">"><?php _e( 'greater than', 'bulk-delete' ); ?></option>
|
250 |
+
</select>
|
251 |
+
<?php
|
252 |
+
}
|
253 |
+
|
254 |
+
/**
|
255 |
+
* Render data types dropdown.
|
256 |
+
*/
|
257 |
+
protected function render_data_types_dropdown() {
|
258 |
+
?>
|
259 |
+
<select name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_type" class="meta-type">
|
260 |
+
<option value="numeric"><?php _e( 'Number', 'bulk-delete' ); ?></option>
|
261 |
+
<option value="string"><?php _e( 'Character', 'bulk-delete' ); ?></option>
|
262 |
+
<option value="date"><?php _e( 'Date', 'bulk-delete' ); ?></option>
|
263 |
+
</select>
|
264 |
+
<?php
|
265 |
+
}
|
266 |
+
/**
|
267 |
+
* Render numeric comparison operators dropdown.
|
268 |
+
*
|
269 |
+
* @param string $class Class to be applied.
|
270 |
+
* @param array $operators List of Operators needed.
|
271 |
+
*/
|
272 |
+
protected function render_numeric_operators_dropdown( $class = 'numeric', $operators = array( 'all' ) ) {
|
273 |
+
$all_numeric_operators = array(
|
274 |
+
'=' => 'equal to',
|
275 |
+
'!=' => 'not equal to',
|
276 |
+
'<' => 'less than',
|
277 |
+
'<=' => 'less than or equal to',
|
278 |
+
'>' => 'greater than',
|
279 |
+
'>=' => 'greater than or equal to',
|
280 |
+
'IN' => 'in',
|
281 |
+
'NOT IN' => 'not in',
|
282 |
+
'BETWEEN' => 'between',
|
283 |
+
'NOT BETWEEN' => 'not between',
|
284 |
+
'EXISTS' => 'exists',
|
285 |
+
'NOT EXISTS' => 'not exists',
|
286 |
+
);
|
287 |
+
if ( in_array( 'all', $operators, true ) ) {
|
288 |
+
$operators = array_keys( $all_numeric_operators );
|
289 |
+
}
|
290 |
+
?>
|
291 |
+
<select name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_operator" class= "<?php echo esc_attr( $class ); ?>">
|
292 |
+
<?php
|
293 |
+
foreach ( $operators as $operator ) {
|
294 |
+
echo '<option value="' . $operator . '">' . __( $all_numeric_operators[ $operator ], 'bulk-delete' ) . '</option>';
|
295 |
+
}
|
296 |
+
?>
|
297 |
+
</select>
|
298 |
+
<?php
|
299 |
+
}
|
300 |
+
/**
|
301 |
+
* Render string comparison operators dropdown.
|
302 |
+
*
|
303 |
+
* @param string $class Class to be applied.
|
304 |
+
* @param array $operators List of Operators needed.
|
305 |
+
*/
|
306 |
+
protected function render_string_operators_dropdown( $class = 'string', $operators = array( 'all' ) ) {
|
307 |
+
// STARTS_WITH and ENDS_WITH operators needs a handler as SQL does not support these operators in queries.
|
308 |
+
$all_string_operators = array(
|
309 |
+
'=' => 'equal to',
|
310 |
+
'!=' => 'not equal to',
|
311 |
+
'IN' => 'in',
|
312 |
+
'NOT IN' => 'not in',
|
313 |
+
'LIKE' => 'contains',
|
314 |
+
'NOT LIKE' => 'not contains',
|
315 |
+
'EXISTS' => 'exists',
|
316 |
+
'NOT EXISTS' => 'not exists',
|
317 |
+
'STARTS_WITH' => 'starts with',
|
318 |
+
'ENDS_WITH' => 'ends with',
|
319 |
+
);
|
320 |
+
if ( in_array( 'all', $operators, true ) ) {
|
321 |
+
$operators = array_keys( $all_string_operators );
|
322 |
+
}
|
323 |
+
?>
|
324 |
+
<select name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_operator" class="<?php echo esc_attr( $class ); ?>">
|
325 |
+
<?php
|
326 |
+
foreach ( $operators as $operator ) {
|
327 |
+
echo '<option value="' . $operator . '">' . __( $all_string_operators[ $operator ], 'bulk-delete' ) . '</option>';
|
328 |
+
}
|
329 |
+
?>
|
330 |
+
</select>
|
331 |
+
<?php
|
332 |
+
}
|
333 |
+
|
334 |
+
/**
|
335 |
+
* Render Tags dropdown.
|
336 |
+
*/
|
337 |
+
protected function render_tags_dropdown() {
|
338 |
+
$tags = $this->get_tags();
|
339 |
+
?>
|
340 |
+
|
341 |
+
<select name="smbd_<?php echo esc_attr( $this->field_slug ); ?>[]" data-placeholder="<?php _e( 'Select Tags', 'bulk-delete' ); ?>"
|
342 |
+
class="<?php echo sanitize_html_class( $this->enable_ajax_if_needed_to_dropdown_class_name( count( $tags ), 'select2-taxonomy' ) ); ?>"
|
343 |
+
data-taxonomy="post_tag" multiple>
|
344 |
+
|
345 |
+
<option value="all">
|
346 |
+
<?php _e( 'All Tags', 'bulk-delete' ); ?>
|
347 |
+
</option>
|
348 |
+
|
349 |
+
<?php foreach ( $tags as $tag ) : ?>
|
350 |
+
<option value="<?php echo absint( $tag->term_id ); ?>">
|
351 |
+
<?php echo esc_html( $tag->name ), ' (', absint( $tag->count ), ' ', __( 'Posts', 'bulk-delete' ), ')'; ?>
|
352 |
+
</option>
|
353 |
+
<?php endforeach; ?>
|
354 |
+
</select>
|
355 |
+
<?php
|
356 |
+
}
|
357 |
+
|
358 |
+
/**
|
359 |
+
* Get the class name for select2 dropdown based on the number of items present.
|
360 |
+
*
|
361 |
+
* @param int $count The number of items present.
|
362 |
+
* @param string $class_name Primary class name.
|
363 |
+
*
|
364 |
+
* @return string Class name.
|
365 |
+
*/
|
366 |
+
protected function enable_ajax_if_needed_to_dropdown_class_name( $count, $class_name ) {
|
367 |
+
if ( $count >= $this->get_enhanced_select_threshold() ) {
|
368 |
+
$class_name .= '-ajax';
|
369 |
+
}
|
370 |
+
|
371 |
+
return $class_name;
|
372 |
+
}
|
373 |
+
|
374 |
+
/**
|
375 |
+
* Render Sticky Posts dropdown.
|
376 |
+
*/
|
377 |
+
protected function render_sticky_posts_dropdown() {
|
378 |
+
$sticky_posts = $this->get_sticky_posts();
|
379 |
+
?>
|
380 |
+
|
381 |
+
<table class="optiontable">
|
382 |
+
<?php if ( count( $sticky_posts ) > 1 ) : ?>
|
383 |
+
<tr>
|
384 |
+
<td scope="row">
|
385 |
+
<label>
|
386 |
+
<input type="checkbox" name="smbd_<?php echo esc_attr( $this->field_slug ); ?>[]" value="all">
|
387 |
+
<?php echo __( 'All sticky posts', 'bulk-delete' ), ' (', count( $sticky_posts ), ' ', __( 'Posts', 'bulk-delete' ), ')'; ?>
|
388 |
+
</label>
|
389 |
+
</td>
|
390 |
+
</tr>
|
391 |
+
<?php endif; ?>
|
392 |
+
|
393 |
+
<?php foreach ( $sticky_posts as $post ) : ?>
|
394 |
+
<?php $author = get_userdata( $post->post_author ); ?>
|
395 |
+
<tr>
|
396 |
+
<td scope="row">
|
397 |
+
<label>
|
398 |
+
<input type="checkbox" name="smbd_<?php echo esc_attr( $this->field_slug ); ?>[]" value="<?php echo absint( $post->ID ); ?>">
|
399 |
+
<?php
|
400 |
+
echo esc_html( $post->post_title ), ' - ',
|
401 |
+
__( 'Published on', 'bulk-delete' ), ' ', get_the_date( get_option( 'date_format' ), $post->ID ),
|
402 |
+
__( ' by ', 'bulk-delete' ), esc_html( $author->display_name );
|
403 |
+
?>
|
404 |
+
</label>
|
405 |
+
</td>
|
406 |
+
</tr>
|
407 |
+
<?php endforeach; ?>
|
408 |
+
</table>
|
409 |
+
<?php
|
410 |
+
}
|
411 |
+
|
412 |
+
/**
|
413 |
+
* Renders exclude sticky posts checkbox.
|
414 |
+
*/
|
415 |
+
protected function render_exclude_sticky_settings() {
|
416 |
+
if ( $this->are_sticky_posts_present() ) : // phpcs:ignore?>
|
417 |
+
<tr>
|
418 |
+
<td scope="row">
|
419 |
+
<input name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_exclude_sticky" id="smbd_<?php echo esc_attr( $this->field_slug ); ?>_exclude_sticky" value="true" type="checkbox">
|
420 |
+
</td>
|
421 |
+
<td>
|
422 |
+
<label for="smbd_<?php echo esc_attr( $this->field_slug ); ?>_exclude_sticky"><?php _e( 'Exclude sticky posts', 'bulk-delete' ); ?></label>
|
423 |
+
</td>
|
424 |
+
</tr>
|
425 |
+
<?php endif; // phpcs:ignore?>
|
426 |
+
<?php
|
427 |
+
}
|
428 |
+
|
429 |
+
/**
|
430 |
+
* Render Post Types as checkboxes.
|
431 |
+
*
|
432 |
+
* @since 5.6.0
|
433 |
+
*
|
434 |
+
* @param string $name Name of post type checkboxes.
|
435 |
+
*/
|
436 |
+
protected function render_post_type_checkboxes( $name ) {
|
437 |
+
$post_types = bd_get_post_types();
|
438 |
+
?>
|
439 |
+
|
440 |
+
<?php foreach ( $post_types as $post_type ) : ?>
|
441 |
+
|
442 |
+
<tr>
|
443 |
+
<td scope="row">
|
444 |
+
<input type="checkbox" name="<?php echo esc_attr( $name ); ?>[]" value="<?php echo esc_attr( $post_type->name ); ?>"
|
445 |
+
id="smbd_post_type_<?php echo esc_html( $post_type->name ); ?>" checked>
|
446 |
+
|
447 |
+
<label for="smbd_post_type_<?php echo esc_html( $post_type->name ); ?>">
|
448 |
+
<?php echo esc_html( $post_type->label ); ?>
|
449 |
+
</label>
|
450 |
+
</td>
|
451 |
+
</tr>
|
452 |
+
|
453 |
+
<?php endforeach; ?>
|
454 |
+
<?php
|
455 |
+
}
|
456 |
+
|
457 |
+
/**
|
458 |
+
* Render the "private post" setting fields.
|
459 |
+
*/
|
460 |
+
protected function render_private_post_settings() {
|
461 |
+
bd_render_private_post_settings( $this->field_slug );
|
462 |
+
}
|
463 |
+
|
464 |
+
/**
|
465 |
+
* Get the threshold after which enhanced select should be used.
|
466 |
+
*
|
467 |
+
* @return int Threshold.
|
468 |
+
*/
|
469 |
+
protected function get_enhanced_select_threshold() {
|
470 |
+
/**
|
471 |
+
* Filter the enhanced select threshold.
|
472 |
+
*
|
473 |
+
* @since 6.0.0
|
474 |
+
*
|
475 |
+
* @param int Threshold.
|
476 |
+
*/
|
477 |
+
return apply_filters( 'bd_enhanced_select_threshold', 1000 );
|
478 |
+
}
|
479 |
+
|
480 |
+
/**
|
481 |
+
* Render sticky settings.
|
482 |
+
*/
|
483 |
+
protected function render_sticky_action_settings() {
|
484 |
+
?>
|
485 |
+
<tr>
|
486 |
+
<td scope="row" colspan="2">
|
487 |
+
<label>
|
488 |
+
<input name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_sticky_action" value="unsticky" type="radio" checked>
|
489 |
+
<?php _e( 'Remove Sticky', 'bulk-delete' ); ?>
|
490 |
+
</label>
|
491 |
+
<label>
|
492 |
+
<input name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_sticky_action" value="delete" type="radio">
|
493 |
+
<?php _e( 'Delete Post', 'bulk-delete' ); ?>
|
494 |
+
</label>
|
495 |
+
</td>
|
496 |
+
</tr>
|
497 |
+
<?php
|
498 |
+
}
|
499 |
+
|
500 |
+
/**
|
501 |
+
* Render filtering table header.
|
502 |
+
*/
|
503 |
+
protected function render_filtering_table_header() {
|
504 |
+
bd_render_filtering_table_header();
|
505 |
+
}
|
506 |
+
|
507 |
+
/**
|
508 |
+
* Render restrict settings.
|
509 |
+
*/
|
510 |
+
protected function render_restrict_settings() {
|
511 |
+
bd_render_restrict_settings( $this->field_slug, $this->item_type );
|
512 |
+
}
|
513 |
+
|
514 |
+
/**
|
515 |
+
* Render delete settings.
|
516 |
+
*/
|
517 |
+
protected function render_delete_settings() {
|
518 |
+
bd_render_delete_settings( $this->field_slug );
|
519 |
+
/**
|
520 |
+
* This action is primarily for adding delete attachment settings.
|
521 |
+
*
|
522 |
+
* @since 6.0.0
|
523 |
+
*
|
524 |
+
* @param \BulkWP\BulkDelete\Core\Base\BaseModule The delete module.
|
525 |
+
*/
|
526 |
+
do_action( 'bd_render_attachment_settings', $this );
|
527 |
+
}
|
528 |
+
|
529 |
+
/**
|
530 |
+
* Render limit settings.
|
531 |
+
*
|
532 |
+
* @param string $item_type Item Type to be displayed in label.
|
533 |
+
*/
|
534 |
+
protected function render_limit_settings( $item_type = '' ) {
|
535 |
+
if ( empty( $item_type ) ) {
|
536 |
+
$item_type = $this->item_type;
|
537 |
+
}
|
538 |
+
bd_render_limit_settings( $this->field_slug, $item_type );
|
539 |
+
}
|
540 |
+
|
541 |
+
/**
|
542 |
+
* Render cron settings based on whether scheduler is present or not.
|
543 |
+
*/
|
544 |
+
protected function render_cron_settings() {
|
545 |
+
$pro_class = '';
|
546 |
+
|
547 |
+
$disabled_attr = 'disabled';
|
548 |
+
if ( empty( $this->scheduler_url ) ) {
|
549 |
+
$disabled_attr = '';
|
550 |
+
}
|
551 |
+
?>
|
552 |
+
|
553 |
+
<tr>
|
554 |
+
<td scope="row" colspan="2">
|
555 |
+
<label><input name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_cron" value="false" type="radio"
|
556 |
+
checked="checked"> <?php _e( 'Delete now', 'bulk-delete' ); ?></label>
|
557 |
+
<label><input name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_cron" value="true" type="radio"
|
558 |
+
id="smbd_<?php echo esc_attr( $this->field_slug ); ?>_cron" <?php echo esc_attr( $disabled_attr ); ?>> <?php _e( 'Schedule', 'bulk-delete' ); ?></label>
|
559 |
+
<input name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_cron_start"
|
560 |
+
id="smbd_<?php echo esc_attr( $this->field_slug ); ?>_cron_start" value="now"
|
561 |
+
type="text" <?php echo esc_attr( $disabled_attr ); ?> autocomplete="off"><?php _e( 'repeat ', 'bulk-delete' ); ?>
|
562 |
+
|
563 |
+
<select name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_cron_freq"
|
564 |
+
id="smbd_<?php echo esc_attr( $this->field_slug ); ?>_cron_freq" <?php echo esc_attr( $disabled_attr ); ?>>
|
565 |
+
|
566 |
+
<option value="-1"><?php _e( "Don't repeat", 'bulk-delete' ); ?></option>
|
567 |
+
<?php
|
568 |
+
/**
|
569 |
+
* List of cron schedules.
|
570 |
+
*
|
571 |
+
* @since 6.0.0
|
572 |
+
*
|
573 |
+
* @param array $cron_schedules List of cron schedules.
|
574 |
+
* @param \BulkWP\BulkDelete\Core\Base\BaseModule $module Module.
|
575 |
+
*/
|
576 |
+
$cron_schedules = apply_filters( 'bd_cron_schedules', wp_get_schedules(), $this );
|
577 |
+
?>
|
578 |
+
|
579 |
+
<?php foreach ( $cron_schedules as $key => $value ) : ?>
|
580 |
+
<option
|
581 |
+
value="<?php echo esc_attr( $key ); ?>"><?php echo esc_html( $value['display'] ); ?></option>
|
582 |
+
<?php endforeach; ?>
|
583 |
+
</select>
|
584 |
+
|
585 |
+
<?php if ( ! empty( $this->scheduler_url ) ) : ?>
|
586 |
+
<?php
|
587 |
+
$pro_class = 'bd-' . str_replace( '_', '-', $this->field_slug ) . '-pro';
|
588 |
+
|
589 |
+
/**
|
590 |
+
* HTML class of the span that displays the 'Pro only feature' message.
|
591 |
+
*
|
592 |
+
* @since 6.0.0
|
593 |
+
*
|
594 |
+
* @param string $pro_class HTML class.
|
595 |
+
* @param string $field_slug Field Slug of module.
|
596 |
+
* @param \BulkWP\BulkDelete\Core\Base\BaseModule $module Module.
|
597 |
+
*/
|
598 |
+
$pro_class = apply_filters( 'bd_pro_only_feature_class', $pro_class, $this->field_slug, $this )
|
599 |
+
?>
|
600 |
+
|
601 |
+
<span class="<?php echo sanitize_html_class( $pro_class ); ?>" style="color:red">
|
602 |
+
<?php _e( 'Only available in Pro Addon', 'bulk-delete' ); ?> <a
|
603 |
+
href="<?php echo esc_url( $this->scheduler_url ); ?>">Buy now</a>
|
604 |
+
</span>
|
605 |
+
<?php endif; ?>
|
606 |
+
</td>
|
607 |
+
</tr>
|
608 |
+
|
609 |
+
<tr
|
610 |
+
<?php if ( ! empty( $pro_class ) ) : ?>
|
611 |
+
class="<?php echo sanitize_html_class( $pro_class ); ?>" style="display: none;"
|
612 |
+
<?php endif; ?>
|
613 |
+
>
|
614 |
+
|
615 |
+
<td scope="row" colspan="2">
|
616 |
+
<?php
|
617 |
+
_e( 'Enter time in <strong>Y-m-d H:i:s</strong> format or enter <strong>now</strong> to use current time.', 'bulk-delete' );
|
618 |
+
|
619 |
+
$markup = __( 'Want to add new a Cron schedule?', 'bulk-delete' ) . ' ' .
|
620 |
+
'<a href="https://bulkwp.com/docs/add-a-new-cron-schedule/" target="_blank" rel="noopener">' . __( 'Find out how', 'bulk-delete' ) . '</a>';
|
621 |
+
|
622 |
+
$content = __( 'Learn how to add your desired Cron schedule.', 'bulk-delete' );
|
623 |
+
echo ' ', bd_generate_help_tooltip( $markup, $content );
|
624 |
+
?>
|
625 |
+
</td>
|
626 |
+
</tr>
|
627 |
+
<?php
|
628 |
+
}
|
629 |
+
|
630 |
+
/**
|
631 |
+
* Render submit button.
|
632 |
+
*/
|
633 |
+
protected function render_submit_button() {
|
634 |
+
bd_render_submit_button( $this->action );
|
635 |
+
}
|
636 |
+
}
|
include/Core/BulkDelete.php
ADDED
@@ -0,0 +1,692 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Core;
|
4 |
+
|
5 |
+
use BulkWP\BulkDelete\Core\Addon\Upseller;
|
6 |
+
use BulkWP\BulkDelete\Core\Base\BasePage;
|
7 |
+
use BulkWP\BulkDelete\Core\Cron\CronListPage;
|
8 |
+
use BulkWP\BulkDelete\Core\Metas\DeleteMetasPage;
|
9 |
+
use BulkWP\BulkDelete\Core\Metas\Modules\DeleteCommentMetaModule;
|
10 |
+
use BulkWP\BulkDelete\Core\Metas\Modules\DeletePostMetaModule;
|
11 |
+
use BulkWP\BulkDelete\Core\Metas\Modules\DeleteUserMetaModule;
|
12 |
+
use BulkWP\BulkDelete\Core\Pages\DeletePagesPage;
|
13 |
+
use BulkWP\BulkDelete\Core\Pages\Modules\DeletePagesByStatusModule;
|
14 |
+
use BulkWP\BulkDelete\Core\Posts\DeletePostsPage;
|
15 |
+
use BulkWP\BulkDelete\Core\Posts\Modules\DeletePostsByCategoryModule;
|
16 |
+
use BulkWP\BulkDelete\Core\Posts\Modules\DeletePostsByCommentsModule;
|
17 |
+
use BulkWP\BulkDelete\Core\Posts\Modules\DeletePostsByPostTypeModule;
|
18 |
+
use BulkWP\BulkDelete\Core\Posts\Modules\DeletePostsByRevisionModule;
|
19 |
+
use BulkWP\BulkDelete\Core\Posts\Modules\DeletePostsByStatusModule;
|
20 |
+
use BulkWP\BulkDelete\Core\Posts\Modules\DeletePostsByStickyPostModule;
|
21 |
+
use BulkWP\BulkDelete\Core\Posts\Modules\DeletePostsByTagModule;
|
22 |
+
use BulkWP\BulkDelete\Core\Posts\Modules\DeletePostsByTaxonomyModule;
|
23 |
+
use BulkWP\BulkDelete\Core\Posts\Modules\DeletePostsByURLModule;
|
24 |
+
use BulkWP\BulkDelete\Core\SystemInfo\SystemInfoPage;
|
25 |
+
use BulkWP\BulkDelete\Core\Terms\DeleteTermsPage;
|
26 |
+
use BulkWP\BulkDelete\Core\Terms\Modules\DeleteTermsByNameModule;
|
27 |
+
use BulkWP\BulkDelete\Core\Terms\Modules\DeleteTermsByPostCountModule;
|
28 |
+
use BulkWP\BulkDelete\Core\Users\DeleteUsersPage;
|
29 |
+
use BulkWP\BulkDelete\Core\Users\Modules\DeleteUsersByUserMetaModule;
|
30 |
+
use BulkWP\BulkDelete\Core\Users\Modules\DeleteUsersByUserRoleModule;
|
31 |
+
|
32 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Main Plugin class.
|
36 |
+
*
|
37 |
+
* @since 5.0 Converted to Singleton
|
38 |
+
* @since 6.0.0 Renamed to BulkDelete and added namespace.
|
39 |
+
*/
|
40 |
+
final class BulkDelete {
|
41 |
+
/**
|
42 |
+
* The one true BulkDelete instance.
|
43 |
+
*
|
44 |
+
* @var BulkDelete
|
45 |
+
*
|
46 |
+
* @since 5.0
|
47 |
+
*/
|
48 |
+
private static $instance;
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Path to the main plugin file.
|
52 |
+
*
|
53 |
+
* @var string
|
54 |
+
*/
|
55 |
+
private $plugin_file;
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Path where translations are stored.
|
59 |
+
*
|
60 |
+
* @var string
|
61 |
+
*/
|
62 |
+
private $translations_path;
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Has the plugin loaded?
|
66 |
+
*
|
67 |
+
* @since 6.0.0
|
68 |
+
*
|
69 |
+
* @var bool
|
70 |
+
*/
|
71 |
+
private $loaded = false;
|
72 |
+
|
73 |
+
/**
|
74 |
+
* Controller that handles all requests and nonce checks.
|
75 |
+
*
|
76 |
+
* @var \BulkWP\BulkDelete\Core\Controller
|
77 |
+
*/
|
78 |
+
private $controller;
|
79 |
+
|
80 |
+
/**
|
81 |
+
* Upseller responsible for upselling add-ons.
|
82 |
+
*
|
83 |
+
* @since 6.0.0
|
84 |
+
*
|
85 |
+
* @var \BulkWP\BulkDelete\Core\Addon\Upseller
|
86 |
+
*/
|
87 |
+
private $upseller;
|
88 |
+
|
89 |
+
/**
|
90 |
+
* Bulk Delete Autoloader.
|
91 |
+
*
|
92 |
+
* Will be used by add-ons to extend the namespace.
|
93 |
+
*
|
94 |
+
* @var \BulkWP\BulkDelete\BulkDeleteAutoloader
|
95 |
+
*/
|
96 |
+
private $loader;
|
97 |
+
|
98 |
+
/**
|
99 |
+
* List of Primary Admin pages.
|
100 |
+
*
|
101 |
+
* @var \BulkWP\BulkDelete\Core\Base\BaseDeletePage[]
|
102 |
+
*
|
103 |
+
* @since 6.0.0
|
104 |
+
*/
|
105 |
+
private $primary_pages = array();
|
106 |
+
|
107 |
+
/**
|
108 |
+
* List of Secondary Admin pages.
|
109 |
+
*
|
110 |
+
* @var BasePage[]
|
111 |
+
*
|
112 |
+
* @since 6.0.0
|
113 |
+
*/
|
114 |
+
private $secondary_pages = array();
|
115 |
+
|
116 |
+
/**
|
117 |
+
* Plugin version.
|
118 |
+
*/
|
119 |
+
const VERSION = '6.0.0';
|
120 |
+
|
121 |
+
/**
|
122 |
+
* Set the BulkDelete constructor as private.
|
123 |
+
*
|
124 |
+
* An instance should be created by calling the `get_instance` method.
|
125 |
+
*
|
126 |
+
* @see BulkDelete::get_instance()
|
127 |
+
*/
|
128 |
+
private function __construct() {}
|
129 |
+
|
130 |
+
/**
|
131 |
+
* Main BulkDelete Instance.
|
132 |
+
*
|
133 |
+
* Insures that only one instance of BulkDelete exists in memory at any one
|
134 |
+
* time. Also prevents needing to define globals all over the place.
|
135 |
+
*
|
136 |
+
* @since 5.0
|
137 |
+
* @static
|
138 |
+
* @staticvar array $instance
|
139 |
+
*
|
140 |
+
* @return BulkDelete The one true instance of BulkDelete.
|
141 |
+
*/
|
142 |
+
public static function get_instance() {
|
143 |
+
if ( ! isset( self::$instance ) && ! ( self::$instance instanceof BulkDelete ) ) {
|
144 |
+
self::$instance = new BulkDelete();
|
145 |
+
}
|
146 |
+
|
147 |
+
return self::$instance;
|
148 |
+
}
|
149 |
+
|
150 |
+
/**
|
151 |
+
* Load the plugin if it is not loaded.
|
152 |
+
* The plugin will be loaded only it is an admin request or a cron request.
|
153 |
+
*
|
154 |
+
* This function will be invoked in the `plugins_loaded` hook.
|
155 |
+
*/
|
156 |
+
public function load() {
|
157 |
+
if ( $this->loaded ) {
|
158 |
+
return;
|
159 |
+
}
|
160 |
+
|
161 |
+
if ( ! $this->is_admin_or_cron() ) {
|
162 |
+
return;
|
163 |
+
}
|
164 |
+
|
165 |
+
$this->load_dependencies();
|
166 |
+
$this->setup_actions();
|
167 |
+
|
168 |
+
$this->loaded = true;
|
169 |
+
|
170 |
+
/**
|
171 |
+
* Bulk Delete plugin loaded.
|
172 |
+
*
|
173 |
+
* @since 6.0.0
|
174 |
+
*
|
175 |
+
* @param string Plugin main file.
|
176 |
+
*/
|
177 |
+
do_action( 'bd_loaded', $this->get_plugin_file() );
|
178 |
+
|
179 |
+
$this->load_primary_pages();
|
180 |
+
}
|
181 |
+
|
182 |
+
/**
|
183 |
+
* Throw error on object clone.
|
184 |
+
*
|
185 |
+
* The whole idea of the singleton design pattern is that there is a single
|
186 |
+
* object therefore, we don't want the object to be cloned.
|
187 |
+
*
|
188 |
+
* @since 5.0
|
189 |
+
* @access protected
|
190 |
+
*
|
191 |
+
* @return void
|
192 |
+
*/
|
193 |
+
public function __clone() {
|
194 |
+
_doing_it_wrong( __FUNCTION__, __( "This class can't be cloned. Use `get_instance()` method to get an instance.", 'bulk-delete' ), '5.0' );
|
195 |
+
}
|
196 |
+
|
197 |
+
/**
|
198 |
+
* Disable unserializing of the class.
|
199 |
+
*
|
200 |
+
* @since 5.0
|
201 |
+
* @access protected
|
202 |
+
*
|
203 |
+
* @return void
|
204 |
+
*/
|
205 |
+
public function __wakeup() {
|
206 |
+
_doing_it_wrong( __FUNCTION__, __( "This class can't be serialized. Use `get_instance()` method to get an instance.", 'bulk-delete' ), '5.0' );
|
207 |
+
}
|
208 |
+
|
209 |
+
/**
|
210 |
+
* Load all dependencies.
|
211 |
+
*
|
212 |
+
* @since 6.0.0
|
213 |
+
*/
|
214 |
+
private function load_dependencies() {
|
215 |
+
$this->controller = new Controller();
|
216 |
+
$this->controller->load();
|
217 |
+
|
218 |
+
$this->upseller = new Upseller();
|
219 |
+
$this->upseller->load();
|
220 |
+
}
|
221 |
+
|
222 |
+
/**
|
223 |
+
* Loads the plugin's actions and hooks.
|
224 |
+
*
|
225 |
+
* @access private
|
226 |
+
*
|
227 |
+
* @since 5.0
|
228 |
+
*
|
229 |
+
* @return void
|
230 |
+
*/
|
231 |
+
private function setup_actions() {
|
232 |
+
add_action( 'init', array( $this, 'on_init' ) );
|
233 |
+
|
234 |
+
add_action( 'admin_menu', array( $this, 'on_admin_menu' ) );
|
235 |
+
}
|
236 |
+
|
237 |
+
/**
|
238 |
+
* Triggered when the `init` hook is fired.
|
239 |
+
*
|
240 |
+
* @since 6.0.0
|
241 |
+
*/
|
242 |
+
public function on_init() {
|
243 |
+
$this->load_textdomain();
|
244 |
+
}
|
245 |
+
|
246 |
+
/**
|
247 |
+
* Loads the plugin language files.
|
248 |
+
*
|
249 |
+
* @since 5.0
|
250 |
+
*/
|
251 |
+
private function load_textdomain() {
|
252 |
+
load_plugin_textdomain( 'bulk-delete', false, $this->get_translations_path() );
|
253 |
+
}
|
254 |
+
|
255 |
+
/**
|
256 |
+
* Triggered when the `admin_menu` hook is fired.
|
257 |
+
*
|
258 |
+
* Register all admin pages.
|
259 |
+
*
|
260 |
+
* @since 6.0.0
|
261 |
+
*/
|
262 |
+
public function on_admin_menu() {
|
263 |
+
foreach ( $this->get_primary_pages() as $page ) {
|
264 |
+
$page->register();
|
265 |
+
}
|
266 |
+
|
267 |
+
\Bulk_Delete_Misc::add_menu();
|
268 |
+
|
269 |
+
/**
|
270 |
+
* Runs just after adding all *delete* menu items to Bulk WP main menu.
|
271 |
+
*
|
272 |
+
* This action is primarily for adding extra *delete* menu items to the Bulk WP main menu.
|
273 |
+
*
|
274 |
+
* @since 5.3
|
275 |
+
*/
|
276 |
+
do_action( 'bd_after_primary_menus' );
|
277 |
+
|
278 |
+
/**
|
279 |
+
* Runs just before adding non-action menu items to Bulk WP main menu.
|
280 |
+
*
|
281 |
+
* This action is primarily for adding extra menu items before non-action menu items to the Bulk WP main menu.
|
282 |
+
*
|
283 |
+
* @since 5.3
|
284 |
+
*/
|
285 |
+
do_action( 'bd_before_secondary_menus' );
|
286 |
+
|
287 |
+
foreach ( $this->get_secondary_pages() as $page ) {
|
288 |
+
$page->register();
|
289 |
+
}
|
290 |
+
|
291 |
+
$this->addon_page = add_submenu_page(
|
292 |
+
\Bulk_Delete::POSTS_PAGE_SLUG,
|
293 |
+
__( 'Addon Licenses', 'bulk-delete' ),
|
294 |
+
__( 'Addon Licenses', 'bulk-delete' ),
|
295 |
+
'activate_plugins',
|
296 |
+
\Bulk_Delete::ADDON_PAGE_SLUG,
|
297 |
+
array( 'BD_License', 'display_addon_page' )
|
298 |
+
);
|
299 |
+
|
300 |
+
/**
|
301 |
+
* Runs just after adding all menu items to Bulk WP main menu.
|
302 |
+
*
|
303 |
+
* This action is primarily for adding extra menu items to the Bulk WP main menu.
|
304 |
+
*
|
305 |
+
* @since 5.3
|
306 |
+
*/
|
307 |
+
do_action( 'bd_after_all_menus' );
|
308 |
+
}
|
309 |
+
|
310 |
+
/**
|
311 |
+
* Get the list of registered admin pages.
|
312 |
+
*
|
313 |
+
* @since 6.0.0
|
314 |
+
*
|
315 |
+
* @return \BulkWP\BulkDelete\Core\Base\BaseDeletePage[] List of Primary Admin pages.
|
316 |
+
*/
|
317 |
+
private function get_primary_pages() {
|
318 |
+
if ( empty( $this->primary_pages ) ) {
|
319 |
+
$this->load_primary_pages();
|
320 |
+
}
|
321 |
+
|
322 |
+
return $this->primary_pages;
|
323 |
+
}
|
324 |
+
|
325 |
+
/**
|
326 |
+
* Load Primary admin pages.
|
327 |
+
*
|
328 |
+
* The pages need to be loaded in `init` hook, since the association between page and modules is needed in cron requests.
|
329 |
+
*/
|
330 |
+
private function load_primary_pages() {
|
331 |
+
$posts_page = $this->get_delete_posts_admin_page();
|
332 |
+
$pages_page = $this->get_delete_pages_admin_page();
|
333 |
+
$users_page = $this->get_delete_users_admin_page();
|
334 |
+
$metas_page = $this->get_delete_metas_admin_page();
|
335 |
+
$terms_page = $this->get_delete_terms_admin_page();
|
336 |
+
|
337 |
+
$this->primary_pages[ $posts_page->get_page_slug() ] = $posts_page;
|
338 |
+
$this->primary_pages[ $pages_page->get_page_slug() ] = $pages_page;
|
339 |
+
$this->primary_pages[ $users_page->get_page_slug() ] = $users_page;
|
340 |
+
$this->primary_pages[ $metas_page->get_page_slug() ] = $metas_page;
|
341 |
+
$this->primary_pages[ $terms_page->get_page_slug() ] = $terms_page;
|
342 |
+
|
343 |
+
/**
|
344 |
+
* List of primary admin pages.
|
345 |
+
*
|
346 |
+
* @since 6.0.0
|
347 |
+
*
|
348 |
+
* @param \BulkWP\BulkDelete\Core\Base\BaseDeletePage[] List of Admin pages.
|
349 |
+
*/
|
350 |
+
$this->primary_pages = apply_filters( 'bd_primary_pages', $this->primary_pages );
|
351 |
+
}
|
352 |
+
|
353 |
+
/**
|
354 |
+
* Get Bulk Delete Posts admin page.
|
355 |
+
*
|
356 |
+
* @return \BulkWP\BulkDelete\Core\Posts\DeletePostsPage
|
357 |
+
*/
|
358 |
+
private function get_delete_posts_admin_page() {
|
359 |
+
$posts_page = new DeletePostsPage( $this->get_plugin_file() );
|
360 |
+
|
361 |
+
$posts_page->add_module( new DeletePostsByStatusModule() );
|
362 |
+
$posts_page->add_module( new DeletePostsByCategoryModule() );
|
363 |
+
$posts_page->add_module( new DeletePostsByTagModule() );
|
364 |
+
$posts_page->add_module( new DeletePostsByTaxonomyModule() );
|
365 |
+
$posts_page->add_module( new DeletePostsByPostTypeModule() );
|
366 |
+
$posts_page->add_module( new DeletePostsByCommentsModule() );
|
367 |
+
$posts_page->add_module( new DeletePostsByURLModule() );
|
368 |
+
$posts_page->add_module( new DeletePostsByRevisionModule() );
|
369 |
+
$posts_page->add_module( new DeletePostsByStickyPostModule() );
|
370 |
+
|
371 |
+
/**
|
372 |
+
* After the modules are registered in the delete posts page.
|
373 |
+
*
|
374 |
+
* @since 6.0.0
|
375 |
+
*
|
376 |
+
* @param DeletePostsPage $posts_page The page in which the modules are registered.
|
377 |
+
*/
|
378 |
+
do_action( "bd_after_modules_{$posts_page->get_page_slug()}", $posts_page );
|
379 |
+
|
380 |
+
/**
|
381 |
+
* After the modules are registered in a delete page.
|
382 |
+
*
|
383 |
+
* @since 6.0.0
|
384 |
+
*
|
385 |
+
* @param BasePage $posts_page The page in which the modules are registered.
|
386 |
+
*/
|
387 |
+
do_action( 'bd_after_modules', $posts_page );
|
388 |
+
|
389 |
+
return $posts_page;
|
390 |
+
}
|
391 |
+
|
392 |
+
/**
|
393 |
+
* Get Bulk Delete Pages admin page.
|
394 |
+
*
|
395 |
+
* @since 6.0.0
|
396 |
+
*
|
397 |
+
* @return \BulkWP\BulkDelete\Core\Pages\DeletePagesPage
|
398 |
+
*/
|
399 |
+
private function get_delete_pages_admin_page() {
|
400 |
+
$pages_page = new DeletePagesPage( $this->get_plugin_file() );
|
401 |
+
|
402 |
+
$pages_page->add_module( new DeletePagesByStatusModule() );
|
403 |
+
|
404 |
+
/**
|
405 |
+
* After the modules are registered in the delete pages page.
|
406 |
+
*
|
407 |
+
* @since 6.0.0
|
408 |
+
*
|
409 |
+
* @param DeletePagesPage $pages_page The page in which the modules are registered.
|
410 |
+
*/
|
411 |
+
do_action( "bd_after_modules_{$pages_page->get_page_slug()}", $pages_page );
|
412 |
+
|
413 |
+
/**
|
414 |
+
* After the modules are registered in a delete page.
|
415 |
+
*
|
416 |
+
* @since 6.0.0
|
417 |
+
*
|
418 |
+
* @param BasePage $pages_page The page in which the modules are registered.
|
419 |
+
*/
|
420 |
+
do_action( 'bd_after_modules', $pages_page );
|
421 |
+
|
422 |
+
return $pages_page;
|
423 |
+
}
|
424 |
+
|
425 |
+
/**
|
426 |
+
* Get Bulk Delete Users admin page.
|
427 |
+
*
|
428 |
+
* @since 6.0.0
|
429 |
+
*
|
430 |
+
* @return \BulkWP\BulkDelete\Core\Users\DeleteUsersPage
|
431 |
+
*/
|
432 |
+
private function get_delete_users_admin_page() {
|
433 |
+
$users_page = new DeleteUsersPage( $this->get_plugin_file() );
|
434 |
+
|
435 |
+
$users_page->add_module( new DeleteUsersByUserRoleModule() );
|
436 |
+
$users_page->add_module( new DeleteUsersByUserMetaModule() );
|
437 |
+
|
438 |
+
/**
|
439 |
+
* After the modules are registered in the delete users page.
|
440 |
+
*
|
441 |
+
* @since 6.0.0
|
442 |
+
*
|
443 |
+
* @param DeleteUsersPage $users_page The page in which the modules are registered.
|
444 |
+
*/
|
445 |
+
do_action( "bd_after_modules_{$users_page->get_page_slug()}", $users_page );
|
446 |
+
|
447 |
+
/**
|
448 |
+
* After the modules are registered in a delete page.
|
449 |
+
*
|
450 |
+
* @since 6.0.0
|
451 |
+
*
|
452 |
+
* @param BasePage $users_page The page in which the modules are registered.
|
453 |
+
*/
|
454 |
+
do_action( 'bd_after_modules', $users_page );
|
455 |
+
|
456 |
+
return $users_page;
|
457 |
+
}
|
458 |
+
|
459 |
+
/**
|
460 |
+
* Get Bulk Delete Metas admin page.
|
461 |
+
*
|
462 |
+
* @since 6.0.0
|
463 |
+
*
|
464 |
+
* @return \BulkWP\BulkDelete\Core\Metas\DeleteMetasPage
|
465 |
+
*/
|
466 |
+
private function get_delete_metas_admin_page() {
|
467 |
+
$metas_page = new DeleteMetasPage( $this->get_plugin_file() );
|
468 |
+
|
469 |
+
$metas_page->add_module( new DeletePostMetaModule() );
|
470 |
+
$metas_page->add_module( new DeleteUserMetaModule() );
|
471 |
+
$metas_page->add_module( new DeleteCommentMetaModule() );
|
472 |
+
|
473 |
+
/**
|
474 |
+
* After the modules are registered in the delete metas page.
|
475 |
+
*
|
476 |
+
* @since 6.0.0
|
477 |
+
*
|
478 |
+
* @param DeleteMetasPage $metas_page The page in which the modules are registered.
|
479 |
+
*/
|
480 |
+
do_action( "bd_after_modules_{$metas_page->get_page_slug()}", $metas_page );
|
481 |
+
|
482 |
+
/**
|
483 |
+
* After the modules are registered in a delete page.
|
484 |
+
*
|
485 |
+
* @since 6.0.0
|
486 |
+
*
|
487 |
+
* @param BasePage $metas_page The page in which the modules are registered.
|
488 |
+
*/
|
489 |
+
do_action( 'bd_after_modules', $metas_page );
|
490 |
+
|
491 |
+
return $metas_page;
|
492 |
+
}
|
493 |
+
|
494 |
+
/**
|
495 |
+
* Get Bulk Delete Terms admin page.
|
496 |
+
*
|
497 |
+
* @since 6.0.0
|
498 |
+
*
|
499 |
+
* @return \BulkWP\BulkDelete\Core\Terms\DeleteTermsPage
|
500 |
+
*/
|
501 |
+
private function get_delete_terms_admin_page() {
|
502 |
+
$terms_page = new DeleteTermsPage( $this->get_plugin_file() );
|
503 |
+
|
504 |
+
$terms_page->add_module( new DeleteTermsByNameModule() );
|
505 |
+
$terms_page->add_module( new DeleteTermsByPostCountModule() );
|
506 |
+
|
507 |
+
/**
|
508 |
+
* After the modules are registered in the delete terms page.
|
509 |
+
*
|
510 |
+
* @since 6.0.0
|
511 |
+
*
|
512 |
+
* @param DeleteTermsPage $terms_page The page in which the modules are registered.
|
513 |
+
*/
|
514 |
+
do_action( "bd_after_modules_{$terms_page->get_page_slug()}", $terms_page );
|
515 |
+
|
516 |
+
/**
|
517 |
+
* After the modules are registered in a delete page.
|
518 |
+
*
|
519 |
+
* @since 6.0.0
|
520 |
+
*
|
521 |
+
* @param BasePage $terms_page The page in which the modules are registered.
|
522 |
+
*/
|
523 |
+
do_action( 'bd_after_modules', $terms_page );
|
524 |
+
|
525 |
+
return $terms_page;
|
526 |
+
}
|
527 |
+
|
528 |
+
/**
|
529 |
+
* Get the Cron List admin page.
|
530 |
+
*
|
531 |
+
* @since 6.0.0
|
532 |
+
*
|
533 |
+
* @return \BulkWP\BulkDelete\Core\Cron\CronListPage
|
534 |
+
*/
|
535 |
+
private function get_cron_list_admin_page() {
|
536 |
+
$cron_list_page = new CronListPage( $this->get_plugin_file() );
|
537 |
+
|
538 |
+
return $cron_list_page;
|
539 |
+
}
|
540 |
+
|
541 |
+
/**
|
542 |
+
* Get the System Info page.
|
543 |
+
*
|
544 |
+
* @since 6.0.0
|
545 |
+
*
|
546 |
+
* @return \BulkWP\BulkDelete\Core\SystemInfo\SystemInfoPage
|
547 |
+
*/
|
548 |
+
private function get_system_info_page() {
|
549 |
+
$system_info_page = new SystemInfoPage( $this->get_plugin_file() );
|
550 |
+
|
551 |
+
return $system_info_page;
|
552 |
+
}
|
553 |
+
|
554 |
+
/**
|
555 |
+
* Get the list of secondary pages.
|
556 |
+
*
|
557 |
+
* @return BasePage[] Secondary Pages.
|
558 |
+
*/
|
559 |
+
private function get_secondary_pages() {
|
560 |
+
if ( empty( $this->secondary_pages ) ) {
|
561 |
+
$cron_list_page = $this->get_cron_list_admin_page();
|
562 |
+
$system_info_page = $this->get_system_info_page();
|
563 |
+
|
564 |
+
$this->secondary_pages[ $cron_list_page->get_page_slug() ] = $cron_list_page;
|
565 |
+
$this->secondary_pages[ $system_info_page->get_page_slug() ] = $system_info_page;
|
566 |
+
}
|
567 |
+
|
568 |
+
/**
|
569 |
+
* List of secondary admin pages.
|
570 |
+
*
|
571 |
+
* @since 6.0.0
|
572 |
+
*
|
573 |
+
* @param BasePage[] List of Admin pages.
|
574 |
+
*/
|
575 |
+
return apply_filters( 'bd_secondary_pages', $this->secondary_pages );
|
576 |
+
}
|
577 |
+
|
578 |
+
/**
|
579 |
+
* Get path to main plugin file.
|
580 |
+
*
|
581 |
+
* @return string Plugin file.
|
582 |
+
*/
|
583 |
+
public function get_plugin_file() {
|
584 |
+
return $this->plugin_file;
|
585 |
+
}
|
586 |
+
|
587 |
+
/**
|
588 |
+
* Set path to main plugin file.
|
589 |
+
*
|
590 |
+
* @param string $plugin_file Path to main plugin file.
|
591 |
+
*/
|
592 |
+
public function set_plugin_file( $plugin_file ) {
|
593 |
+
$this->plugin_file = $plugin_file;
|
594 |
+
$this->translations_path = dirname( plugin_basename( $this->get_plugin_file() ) ) . '/languages/';
|
595 |
+
}
|
596 |
+
|
597 |
+
/**
|
598 |
+
* Get path to translations.
|
599 |
+
*
|
600 |
+
* @return string Translations path.
|
601 |
+
*/
|
602 |
+
public function get_translations_path() {
|
603 |
+
return $this->translations_path;
|
604 |
+
}
|
605 |
+
|
606 |
+
/**
|
607 |
+
* Get the hook suffix of a page.
|
608 |
+
*
|
609 |
+
* @param string $page_slug Page slug.
|
610 |
+
*
|
611 |
+
* @return string|null Hook suffix if found, null otherwise.
|
612 |
+
*/
|
613 |
+
public function get_page_hook_suffix( $page_slug ) {
|
614 |
+
$admin_page = '';
|
615 |
+
|
616 |
+
if ( array_key_exists( $page_slug, $this->get_primary_pages() ) ) {
|
617 |
+
$admin_page = $this->primary_pages[ $page_slug ];
|
618 |
+
}
|
619 |
+
|
620 |
+
if ( array_key_exists( $page_slug, $this->get_secondary_pages() ) ) {
|
621 |
+
$admin_page = $this->secondary_pages[ $page_slug ];
|
622 |
+
}
|
623 |
+
|
624 |
+
if ( $admin_page instanceof BasePage ) {
|
625 |
+
return $admin_page->get_hook_suffix();
|
626 |
+
}
|
627 |
+
|
628 |
+
return null;
|
629 |
+
}
|
630 |
+
|
631 |
+
/**
|
632 |
+
* Register Add-on Namespace.
|
633 |
+
*
|
634 |
+
* @param \BulkWP\BulkDelete\Core\Addon\AddonInfo $addon_info Add-on Info.
|
635 |
+
*/
|
636 |
+
public function register_addon_namespace( $addon_info ) {
|
637 |
+
$this->loader->add_namespace( 'BulkWP\BulkDelete', $addon_info->get_addon_directory() . 'includes' );
|
638 |
+
}
|
639 |
+
|
640 |
+
/**
|
641 |
+
* Setter for Autoloader.
|
642 |
+
*
|
643 |
+
* @param \BulkWP\BulkDelete\BulkDeleteAutoloader $loader Autoloader.
|
644 |
+
*/
|
645 |
+
public function set_loader( $loader ) {
|
646 |
+
$this->loader = $loader;
|
647 |
+
}
|
648 |
+
|
649 |
+
/**
|
650 |
+
* Get the module object instance by page slug and module class name.
|
651 |
+
*
|
652 |
+
* @param string $page_slug Page Slug.
|
653 |
+
* @param string $module_class_name Module class name.
|
654 |
+
*
|
655 |
+
* @return \BulkWP\BulkDelete\Core\Base\BaseModule|null Module object instance or null if no match found.
|
656 |
+
*/
|
657 |
+
public function get_module( $page_slug, $module_class_name ) {
|
658 |
+
$page = $this->get_page( $page_slug );
|
659 |
+
|
660 |
+
if ( is_null( $page ) ) {
|
661 |
+
return null;
|
662 |
+
}
|
663 |
+
|
664 |
+
return $page->get_module( $module_class_name );
|
665 |
+
}
|
666 |
+
|
667 |
+
/**
|
668 |
+
* Get the page object instance by page slug.
|
669 |
+
*
|
670 |
+
* @param string $page_slug Page slug.
|
671 |
+
*
|
672 |
+
* @return \BulkWP\BulkDelete\Core\Base\BaseDeletePage|null Page object instance or null if no match found.
|
673 |
+
*/
|
674 |
+
public function get_page( $page_slug ) {
|
675 |
+
$pages = $this->get_primary_pages();
|
676 |
+
|
677 |
+
if ( ! isset( $pages[ $page_slug ] ) ) {
|
678 |
+
return null;
|
679 |
+
}
|
680 |
+
|
681 |
+
return $pages[ $page_slug ];
|
682 |
+
}
|
683 |
+
|
684 |
+
/**
|
685 |
+
* Is the current request an admin or cron request?
|
686 |
+
*
|
687 |
+
* @return bool True, if yes, False otherwise.
|
688 |
+
*/
|
689 |
+
private function is_admin_or_cron() {
|
690 |
+
return is_admin() || defined( 'DOING_CRON' ) || isset( $_GET['doing_wp_cron'] );
|
691 |
+
}
|
692 |
+
}
|
include/Core/Controller.php
ADDED
@@ -0,0 +1,272 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Core;
|
4 |
+
|
5 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Bulk Delete Controller.
|
9 |
+
*
|
10 |
+
* Handle all requests and automatically perform nonce checks.
|
11 |
+
*
|
12 |
+
* @since 5.5.4
|
13 |
+
* @since 6.0.0 Added namespace.
|
14 |
+
*/
|
15 |
+
class Controller {
|
16 |
+
/**
|
17 |
+
* Load the controller and setup hooks and actions.
|
18 |
+
*
|
19 |
+
* @since 6.0.0
|
20 |
+
*/
|
21 |
+
public function load() {
|
22 |
+
add_action( 'admin_init', array( $this, 'request_handler' ) );
|
23 |
+
|
24 |
+
add_action( 'bd_pre_bulk_action', array( $this, 'increase_timeout' ), 9 );
|
25 |
+
add_action( 'bd_before_scheduler', array( $this, 'increase_timeout' ), 9 );
|
26 |
+
|
27 |
+
add_filter( 'bd_get_action_nonce_check', array( $this, 'verify_get_request_nonce' ), 10, 2 );
|
28 |
+
|
29 |
+
add_action( 'wp_ajax_bd_load_taxonomy_term', array( $this, 'load_taxonomy_term' ) );
|
30 |
+
|
31 |
+
add_filter( 'bd_help_tooltip', 'bd_generate_help_tooltip', 10, 2 );
|
32 |
+
add_filter( 'plugin_action_links', array( $this, 'filter_plugin_action_links' ), 10, 2 );
|
33 |
+
|
34 |
+
$this->load_old_hooks();
|
35 |
+
|
36 |
+
if ( defined( 'BD_DEBUG' ) && BD_DEBUG ) {
|
37 |
+
add_action( 'bd_after_query', array( $this, 'log_sql_query' ) );
|
38 |
+
}
|
39 |
+
}
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Handle both POST and GET requests.
|
43 |
+
* This method automatically triggers all the actions after checking the nonce.
|
44 |
+
*/
|
45 |
+
public function request_handler() {
|
46 |
+
if ( isset( $_POST['bd_action'] ) ) {
|
47 |
+
$bd_action = sanitize_text_field( $_POST['bd_action'] );
|
48 |
+
$nonce_valid = false;
|
49 |
+
|
50 |
+
if ( 'delete_jetpack_messages' === $bd_action && wp_verify_nonce( $_POST['sm-bulk-delete-misc-nonce'], 'sm-bulk-delete-misc' ) ) {
|
51 |
+
$nonce_valid = true;
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Perform nonce check.
|
56 |
+
*
|
57 |
+
* @since 5.5
|
58 |
+
*/
|
59 |
+
if ( ! apply_filters( 'bd_action_nonce_check', $nonce_valid, $bd_action ) ) {
|
60 |
+
return;
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Before performing a bulk action.
|
65 |
+
* This hook is for doing actions just before performing any bulk operation.
|
66 |
+
*
|
67 |
+
* @since 5.4
|
68 |
+
*/
|
69 |
+
do_action( 'bd_pre_bulk_action', $bd_action );
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Perform the bulk operation.
|
73 |
+
* This hook is for doing the bulk operation. Nonce check has already happened by this point.
|
74 |
+
*
|
75 |
+
* @since 5.4
|
76 |
+
*/
|
77 |
+
do_action( 'bd_' . $bd_action, $_POST );
|
78 |
+
}
|
79 |
+
|
80 |
+
if ( isset( $_GET['bd_action'] ) ) {
|
81 |
+
$bd_action = sanitize_text_field( $_GET['bd_action'] );
|
82 |
+
$nonce_valid = false;
|
83 |
+
|
84 |
+
/**
|
85 |
+
* Perform nonce check.
|
86 |
+
*
|
87 |
+
* @since 5.5.4
|
88 |
+
*/
|
89 |
+
if ( ! apply_filters( 'bd_get_action_nonce_check', $nonce_valid, $bd_action ) ) {
|
90 |
+
return;
|
91 |
+
}
|
92 |
+
|
93 |
+
/**
|
94 |
+
* Perform the bulk operation.
|
95 |
+
* This hook is for doing the bulk operation. Nonce check has already happened by this point.
|
96 |
+
*
|
97 |
+
* @since 5.5.4
|
98 |
+
*/
|
99 |
+
do_action( 'bd_' . $bd_action, $_GET );
|
100 |
+
}
|
101 |
+
}
|
102 |
+
|
103 |
+
/**
|
104 |
+
* Increase PHP timeout.
|
105 |
+
*
|
106 |
+
* This is to prevent bulk operations from timing out
|
107 |
+
*
|
108 |
+
* @since 5.5.4
|
109 |
+
*/
|
110 |
+
public function increase_timeout() {
|
111 |
+
// phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged
|
112 |
+
@set_time_limit( 0 );
|
113 |
+
}
|
114 |
+
|
115 |
+
/**
|
116 |
+
* Verify if GET request has a valid nonce.
|
117 |
+
*
|
118 |
+
* @since 5.5.4
|
119 |
+
*
|
120 |
+
* @param bool $result Whether nonce is valid.
|
121 |
+
* @param string $action Action name.
|
122 |
+
*
|
123 |
+
* @return bool True if nonce is valid, otherwise return $result.
|
124 |
+
*/
|
125 |
+
public function verify_get_request_nonce( $result, $action ) {
|
126 |
+
if ( check_admin_referer( "bd-{$action}", "bd-{$action}-nonce" ) ) {
|
127 |
+
return true;
|
128 |
+
}
|
129 |
+
|
130 |
+
return $result;
|
131 |
+
}
|
132 |
+
|
133 |
+
/**
|
134 |
+
* Ajax call back function for getting taxonomies to load select2 options.
|
135 |
+
*
|
136 |
+
* @since 6.0.0
|
137 |
+
*/
|
138 |
+
public function load_taxonomy_term() {
|
139 |
+
$response = array();
|
140 |
+
|
141 |
+
$taxonomy = sanitize_text_field( $_GET['taxonomy'] );
|
142 |
+
|
143 |
+
$terms = get_terms(
|
144 |
+
array(
|
145 |
+
'taxonomy' => $taxonomy,
|
146 |
+
'hide_empty' => false,
|
147 |
+
'search' => sanitize_text_field( $_GET['q'] ),
|
148 |
+
)
|
149 |
+
);
|
150 |
+
|
151 |
+
if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) {
|
152 |
+
foreach ( $terms as $term ) {
|
153 |
+
$response[] = array(
|
154 |
+
absint( $term->term_id ),
|
155 |
+
$term->name . ' (' . $term->count . __( ' Posts', 'bulk-delete' ) . ')',
|
156 |
+
);
|
157 |
+
}
|
158 |
+
}
|
159 |
+
|
160 |
+
echo wp_json_encode( $response );
|
161 |
+
die;
|
162 |
+
}
|
163 |
+
|
164 |
+
/**
|
165 |
+
* Adds the settings link in the Plugin page.
|
166 |
+
*
|
167 |
+
* Based on http://striderweb.com/nerdaphernalia/2008/06/wp-use-action-links/.
|
168 |
+
*
|
169 |
+
* @since 6.0.0 Moved into Controller class.
|
170 |
+
*
|
171 |
+
* @staticvar string $this_plugin
|
172 |
+
*
|
173 |
+
* @param array $action_links Action Links.
|
174 |
+
* @param string $file Plugin file name.
|
175 |
+
*
|
176 |
+
* @return array Modified links.
|
177 |
+
*/
|
178 |
+
public function filter_plugin_action_links( $action_links, $file ) {
|
179 |
+
static $this_plugin;
|
180 |
+
|
181 |
+
if ( ! $this_plugin ) {
|
182 |
+
$this_plugin = plugin_basename( $this->get_plugin_file() );
|
183 |
+
}
|
184 |
+
|
185 |
+
if ( $file === $this_plugin ) {
|
186 |
+
/**
|
187 |
+
* Filter plugin action links added by Bulk Move.
|
188 |
+
*
|
189 |
+
* @since 6.0.0
|
190 |
+
*
|
191 |
+
* @param array Plugin Links.
|
192 |
+
*/
|
193 |
+
$bm_action_links = apply_filters( 'bd_plugin_action_links', array() );
|
194 |
+
|
195 |
+
if ( ! empty( $bm_action_links ) ) {
|
196 |
+
$action_links = array_merge( $bm_action_links, $action_links );
|
197 |
+
}
|
198 |
+
}
|
199 |
+
|
200 |
+
return $action_links;
|
201 |
+
}
|
202 |
+
|
203 |
+
/**
|
204 |
+
* Log SQL query used by Bulk Delete.
|
205 |
+
*
|
206 |
+
* Query is logged only when `BD_DEBUG` is set.
|
207 |
+
*
|
208 |
+
* @since 5.6
|
209 |
+
* @since 6.0.0 Moved into Controller class.
|
210 |
+
*
|
211 |
+
* @param \WP_Query|\WP_Term_Query|\WP_User_Query $wp_query Query object.
|
212 |
+
*/
|
213 |
+
public function log_sql_query( $wp_query ) {
|
214 |
+
if ( ! property_exists( $wp_query, 'request' ) ) {
|
215 |
+
return;
|
216 |
+
}
|
217 |
+
|
218 |
+
$query = $wp_query->request;
|
219 |
+
|
220 |
+
/**
|
221 |
+
* Bulk Delete query is getting logged.
|
222 |
+
*
|
223 |
+
* @since 5.6
|
224 |
+
*
|
225 |
+
* @param string $query Bulk Delete SQL Query.
|
226 |
+
*/
|
227 |
+
do_action( 'bd_log_sql_query', $query );
|
228 |
+
|
229 |
+
error_log( 'Bulk Delete Query: ' . $query );
|
230 |
+
}
|
231 |
+
|
232 |
+
/**
|
233 |
+
* Temporary fix to get plugin file.
|
234 |
+
*
|
235 |
+
* TODO: Remove this method from this class.
|
236 |
+
*
|
237 |
+
* @since 6.0.0
|
238 |
+
*
|
239 |
+
* @return string
|
240 |
+
*/
|
241 |
+
private function get_plugin_file() {
|
242 |
+
$bd = BULK_DELETE();
|
243 |
+
|
244 |
+
return $bd->get_plugin_file();
|
245 |
+
}
|
246 |
+
|
247 |
+
/**
|
248 |
+
* Load Old hooks.
|
249 |
+
*
|
250 |
+
* TODO: Refactor these hooks into seperate classes.
|
251 |
+
*
|
252 |
+
* @since 6.0.0
|
253 |
+
*/
|
254 |
+
protected function load_old_hooks() {
|
255 |
+
// license related.
|
256 |
+
add_action( 'bd_license_form', array( 'BD_License', 'display_activate_license_form' ), 100 );
|
257 |
+
add_action( 'bd_deactivate_license', array( 'BD_License', 'deactivate_license' ) );
|
258 |
+
add_action( 'bd_delete_license', array( 'BD_License', 'delete_license' ) );
|
259 |
+
add_action( 'bd_validate_license', array( 'BD_License', 'validate_license' ), 10, 2 );
|
260 |
+
|
261 |
+
// Settings related.
|
262 |
+
add_action( 'bd_before_secondary_menus', array( 'BD_Settings_Page', 'add_menu' ) );
|
263 |
+
add_action( 'bd_admin_footer_settings_page', 'bd_modify_admin_footer' );
|
264 |
+
add_action( 'admin_init', array( 'BD_Settings', 'create_settings' ), 100 );
|
265 |
+
|
266 |
+
// Help tab related.
|
267 |
+
add_action( 'bd_add_contextual_help', array( 'Bulk_Delete_Help_Screen', 'add_contextual_help' ) );
|
268 |
+
|
269 |
+
// Misc page related.
|
270 |
+
add_action( 'bd_admin_footer_misc_page', 'bd_modify_admin_footer' );
|
271 |
+
}
|
272 |
+
}
|
include/Core/Cron/CronListPage.php
ADDED
@@ -0,0 +1,141 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Core\Cron;
|
4 |
+
|
5 |
+
use BulkWP\BulkDelete\Core\Base\BasePage;
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Page that lists bulk delete cron jobs.
|
11 |
+
*
|
12 |
+
* @since 6.0.0
|
13 |
+
*/
|
14 |
+
class CronListPage extends BasePage {
|
15 |
+
public function register() {
|
16 |
+
parent::register();
|
17 |
+
|
18 |
+
add_action( 'bd_delete_cron', array( $this, 'delete_cron_job' ) );
|
19 |
+
add_action( 'bd_run_cron', array( $this, 'run_cron_job' ) );
|
20 |
+
}
|
21 |
+
|
22 |
+
protected function initialize() {
|
23 |
+
$this->page_slug = \Bulk_Delete::CRON_PAGE_SLUG;
|
24 |
+
$this->capability = 'manage_options';
|
25 |
+
|
26 |
+
$this->label = array(
|
27 |
+
'page_title' => __( 'Bulk Delete Schedules', 'bulk-delete' ),
|
28 |
+
'menu_title' => __( 'Scheduled Jobs', 'bulk-delete' ),
|
29 |
+
);
|
30 |
+
}
|
31 |
+
|
32 |
+
protected function render_body() {
|
33 |
+
$cron_list_table = new CronListTable( $this->get_cron_schedules() );
|
34 |
+
$cron_list_table->prepare_items();
|
35 |
+
$cron_list_table->display();
|
36 |
+
|
37 |
+
// TODO: Move this to a seperate Add-on page.
|
38 |
+
bd_display_available_addon_list();
|
39 |
+
}
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Process run cron job request.
|
43 |
+
*
|
44 |
+
* @since 6.0
|
45 |
+
*/
|
46 |
+
public function run_cron_job() {
|
47 |
+
$cron_id = absint( $_GET['cron_id'] );
|
48 |
+
$cron_items = $this->get_cron_schedules();
|
49 |
+
|
50 |
+
if ( 0 === $cron_id ) {
|
51 |
+
return;
|
52 |
+
}
|
53 |
+
|
54 |
+
if ( ! isset( $cron_items[ $cron_id ] ) ) {
|
55 |
+
return;
|
56 |
+
}
|
57 |
+
|
58 |
+
wp_schedule_single_event( time(), $cron_items[ $cron_id ]['type'], $cron_items[ $cron_id ]['args'] );
|
59 |
+
|
60 |
+
$msg = __( 'The selected scheduled job was successfully run', 'bulk-delete' );
|
61 |
+
|
62 |
+
add_settings_error(
|
63 |
+
\Bulk_Delete::CRON_PAGE_SLUG, // TODO: Replace this constant.
|
64 |
+
'deleted-cron',
|
65 |
+
$msg,
|
66 |
+
'updated'
|
67 |
+
);
|
68 |
+
}
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Process delete cron job request.
|
72 |
+
*
|
73 |
+
* @since 5.0
|
74 |
+
* @since 6.0.0 Moved into CronListPage class
|
75 |
+
*/
|
76 |
+
public function delete_cron_job() {
|
77 |
+
$cron_id = absint( $_GET['cron_id'] );
|
78 |
+
$cron_items = $this->get_cron_schedules();
|
79 |
+
|
80 |
+
if ( 0 === $cron_id ) {
|
81 |
+
return;
|
82 |
+
}
|
83 |
+
|
84 |
+
if ( ! isset( $cron_items[ $cron_id ] ) ) {
|
85 |
+
return;
|
86 |
+
}
|
87 |
+
|
88 |
+
wp_unschedule_event( $cron_items[ $cron_id ]['timestamp'], $cron_items[ $cron_id ]['type'], $cron_items[ $cron_id ]['args'] );
|
89 |
+
|
90 |
+
$msg = __( 'The selected scheduled job was successfully deleted ', 'bulk-delete' );
|
91 |
+
|
92 |
+
add_settings_error(
|
93 |
+
\Bulk_Delete::CRON_PAGE_SLUG, // TODO: Replace this constant.
|
94 |
+
'deleted-cron',
|
95 |
+
$msg,
|
96 |
+
'updated'
|
97 |
+
);
|
98 |
+
}
|
99 |
+
|
100 |
+
/**
|
101 |
+
* Get the list of cron schedules.
|
102 |
+
*
|
103 |
+
* @since 6.0.0 Moved into CronListPage class
|
104 |
+
*
|
105 |
+
* @return array The list of cron schedules
|
106 |
+
*/
|
107 |
+
protected function get_cron_schedules() {
|
108 |
+
$cron_items = array();
|
109 |
+
$cron = _get_cron_array();
|
110 |
+
$date_format = _x( 'M j, Y @ G:i', 'Cron table date format', 'bulk-delete' );
|
111 |
+
$schedules = wp_get_schedules();
|
112 |
+
$i = 1;
|
113 |
+
|
114 |
+
foreach ( $cron as $timestamp => $cronhooks ) {
|
115 |
+
foreach ( (array) $cronhooks as $hook => $events ) {
|
116 |
+
if ( 'do-bulk-delete-' === substr( $hook, 0, 15 ) ) {
|
117 |
+
$cron_item = array();
|
118 |
+
|
119 |
+
foreach ( (array) $events as $key => $event ) {
|
120 |
+
$cron_item['timestamp'] = $timestamp;
|
121 |
+
$cron_item['due'] = date_i18n( $date_format, $timestamp + ( get_option( 'gmt_offset' ) * 60 * 60 ) );
|
122 |
+
$cron_item['type'] = $hook;
|
123 |
+
$cron_item['args'] = $event['args'];
|
124 |
+
$cron_item['id'] = $i;
|
125 |
+
|
126 |
+
if ( isset( $schedules[ $event['schedule'] ] ) ) {
|
127 |
+
$cron_item['schedule'] = $schedules[ $event['schedule'] ]['display'];
|
128 |
+
} else {
|
129 |
+
$cron_item['schedule'] = $event['schedule'];
|
130 |
+
}
|
131 |
+
}
|
132 |
+
|
133 |
+
$cron_items[ $i ] = $cron_item;
|
134 |
+
$i ++;
|
135 |
+
}
|
136 |
+
}
|
137 |
+
}
|
138 |
+
|
139 |
+
return $cron_items;
|
140 |
+
}
|
141 |
+
}
|
include/Core/Cron/CronListTable.php
ADDED
@@ -0,0 +1,172 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Core\Cron;
|
4 |
+
|
5 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
6 |
+
|
7 |
+
if ( ! class_exists( '\WP_List_Table' ) ) {
|
8 |
+
require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
|
9 |
+
}
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Table that lists bulk delete cron jobs.
|
13 |
+
*
|
14 |
+
* @since 6.0.0 Added namespace.
|
15 |
+
*/
|
16 |
+
class CronListTable extends \WP_List_Table {
|
17 |
+
/**
|
18 |
+
* Constructor for creating new CronListTable.
|
19 |
+
*
|
20 |
+
* @param array $cron_jobs List of cron jobs.
|
21 |
+
*/
|
22 |
+
public function __construct( $cron_jobs ) {
|
23 |
+
$this->items = $cron_jobs;
|
24 |
+
|
25 |
+
parent::__construct(
|
26 |
+
array(
|
27 |
+
'singular' => 'cron_list', // Singular label.
|
28 |
+
'plural' => 'cron_lists', // Plural label, also this well be one of the table css class.
|
29 |
+
'ajax' => false, // We won't support Ajax for this table.
|
30 |
+
)
|
31 |
+
);
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Add extra markup in the toolbars before or after the list.
|
36 |
+
*
|
37 |
+
* @param string $which Whether the markup should appear after (bottom) or before (top) the list.
|
38 |
+
*/
|
39 |
+
public function extra_tablenav( $which ) {
|
40 |
+
if ( 'top' === $which ) {
|
41 |
+
echo '<p>';
|
42 |
+
_e( 'This is the list of jobs that are currently scheduled for auto deleting posts in Bulk Delete Plugin.', 'bulk-delete' );
|
43 |
+
echo ' <strong>';
|
44 |
+
_e( 'Note: ', 'bulk-delete' );
|
45 |
+
echo '</strong>';
|
46 |
+
_e( 'Scheduling auto post or user deletion is available only when you buy pro addons.', 'bulk-delete' );
|
47 |
+
echo '</p>';
|
48 |
+
}
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Define the columns that are going to be used in the table.
|
53 |
+
*
|
54 |
+
* @return array Array of columns to use with the table
|
55 |
+
*/
|
56 |
+
public function get_columns() {
|
57 |
+
return array(
|
58 |
+
'col_cron_due' => __( 'Next Due', 'bulk-delete' ),
|
59 |
+
'col_cron_schedule' => __( 'Schedule', 'bulk-delete' ),
|
60 |
+
'col_cron_type' => __( 'Type', 'bulk-delete' ),
|
61 |
+
'col_cron_options' => __( 'Options', 'bulk-delete' ),
|
62 |
+
);
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Decide which columns to activate the sorting functionality on.
|
67 |
+
*
|
68 |
+
* @return array Array of columns that can be sorted by the user
|
69 |
+
*/
|
70 |
+
public function get_sortable_columns() {
|
71 |
+
return array(
|
72 |
+
'col_cron_type' => array( 'cron_type', true ),
|
73 |
+
);
|
74 |
+
}
|
75 |
+
|
76 |
+
/**
|
77 |
+
* Prepare the table with different parameters, pagination, columns and table elements.
|
78 |
+
*/
|
79 |
+
public function prepare_items() {
|
80 |
+
$total_items = count( $this->items );
|
81 |
+
$items_per_page = 50;
|
82 |
+
|
83 |
+
$this->set_pagination_args( array(
|
84 |
+
'total_items' => $total_items,
|
85 |
+
'total_pages' => ceil( $total_items / $items_per_page ),
|
86 |
+
'per_page' => $items_per_page,
|
87 |
+
) );
|
88 |
+
|
89 |
+
$columns = $this->get_columns();
|
90 |
+
$hidden = array();
|
91 |
+
$sortable = $this->get_sortable_columns();
|
92 |
+
$this->_column_headers = array( $columns, $hidden, $sortable );
|
93 |
+
}
|
94 |
+
|
95 |
+
/**
|
96 |
+
* Display cron due date column.
|
97 |
+
*
|
98 |
+
* @param array $item The item to be displayed in the row.
|
99 |
+
*
|
100 |
+
* @return string Column output.
|
101 |
+
*/
|
102 |
+
public function column_col_cron_due( $item ) {
|
103 |
+
$actions = array(
|
104 |
+
'delete' => sprintf( '<a href="?page=%s&bd_action=%s&cron_id=%s&%s=%s">%s</a>',
|
105 |
+
$_REQUEST['page'],
|
106 |
+
'delete_cron',
|
107 |
+
$item['id'],
|
108 |
+
'bd-delete_cron-nonce',
|
109 |
+
wp_create_nonce( 'bd-delete_cron' ),
|
110 |
+
__( 'Delete', 'bulk-delete' )
|
111 |
+
),
|
112 |
+
'run' => sprintf( '<a href="?page=%s&bd_action=%s&cron_id=%s&%s=%s" onclick="return confirm(%s)">%s</a>',
|
113 |
+
$_REQUEST['page'],
|
114 |
+
'run_cron',
|
115 |
+
$item['id'],
|
116 |
+
'bd-run_cron-nonce',
|
117 |
+
wp_create_nonce( 'bd-run_cron' ),
|
118 |
+
__( "'Are you sure you want to run the schedule job manually'", 'bulk-delete' ),
|
119 |
+
__( 'Run Now', 'bulk-delete' )
|
120 |
+
),
|
121 |
+
);
|
122 |
+
|
123 |
+
// Return the title contents.
|
124 |
+
return sprintf( '%1$s <span style="color:silver">(%2$s)</span>%3$s',
|
125 |
+
/*$1%s*/
|
126 |
+
$item['due'],
|
127 |
+
/*$2%s*/
|
128 |
+
( $item['timestamp'] + get_option( 'gmt_offset' ) * 60 * 60 ),
|
129 |
+
/*$3%s*/
|
130 |
+
$this->row_actions( $actions )
|
131 |
+
);
|
132 |
+
}
|
133 |
+
|
134 |
+
/**
|
135 |
+
* Display cron schedule column.
|
136 |
+
*
|
137 |
+
* @param array $item The item to be displayed in the row.
|
138 |
+
*/
|
139 |
+
public function column_col_cron_schedule( $item ) {
|
140 |
+
echo $item['schedule'];
|
141 |
+
}
|
142 |
+
|
143 |
+
/**
|
144 |
+
* Display cron type column.
|
145 |
+
*
|
146 |
+
* @param array $item The item to be displayed in the row.
|
147 |
+
*/
|
148 |
+
public function column_col_cron_type( $item ) {
|
149 |
+
if ( isset( $item['args'][0]['cron_label'] ) ) {
|
150 |
+
echo esc_html( $item['args'][0]['cron_label'] );
|
151 |
+
} else {
|
152 |
+
echo esc_html( $item['type'] );
|
153 |
+
}
|
154 |
+
}
|
155 |
+
|
156 |
+
/**
|
157 |
+
* Display cron options column.
|
158 |
+
*
|
159 |
+
* @param array $item The item to be displayed in the row.
|
160 |
+
*/
|
161 |
+
public function column_col_cron_options( $item ) {
|
162 |
+
// TODO: Make it pretty
|
163 |
+
print_r( $item['args'] );
|
164 |
+
}
|
165 |
+
|
166 |
+
/**
|
167 |
+
* Generates the message when no items are present.
|
168 |
+
*/
|
169 |
+
public function no_items() {
|
170 |
+
_e( 'You have not scheduled any bulk delete jobs.', 'bulk-delete' );
|
171 |
+
}
|
172 |
+
}
|
include/Core/Metas/DeleteMetasPage.php
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Core\Metas;
|
4 |
+
|
5 |
+
use BulkWP\BulkDelete\Core\Base\BaseDeletePage;
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Bulk Delete Metas Page.
|
11 |
+
*
|
12 |
+
* Shows the list of modules that allows you to delete metas.
|
13 |
+
*
|
14 |
+
* @since 6.0.0
|
15 |
+
*/
|
16 |
+
class DeleteMetasPage extends BaseDeletePage {
|
17 |
+
/**
|
18 |
+
* Initialize and setup variables.
|
19 |
+
*/
|
20 |
+
protected function initialize() {
|
21 |
+
$this->page_slug = 'bulk-delete-metas';
|
22 |
+
$this->item_type = 'metas';
|
23 |
+
$this->capability = 'edit_others_posts';
|
24 |
+
|
25 |
+
$this->label = array(
|
26 |
+
'page_title' => __( 'Bulk Delete Meta Fields', 'bulk-delete' ),
|
27 |
+
'menu_title' => __( 'Bulk Delete Meta Fields', 'bulk-delete' ),
|
28 |
+
);
|
29 |
+
|
30 |
+
$this->messages = array(
|
31 |
+
'warning_message' => __( 'WARNING: Meta Fields deleted once cannot be retrieved back. Use with caution.', 'bulk-delete' ),
|
32 |
+
);
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Add Help tabs.
|
37 |
+
*
|
38 |
+
* @param array $help_tabs Help tabs.
|
39 |
+
*
|
40 |
+
* @return array Modified list of Help tabs.
|
41 |
+
*/
|
42 |
+
protected function add_help_tab( $help_tabs ) {
|
43 |
+
$overview_tab = array(
|
44 |
+
'title' => __( 'Overview', 'bulk-delete' ),
|
45 |
+
'id' => 'overview_tab',
|
46 |
+
'content' => '<p>' . __( 'This screen contains different modules that allows you to delete meta fields or schedule them for deletion.', 'bulk-delete' ) . '</p>',
|
47 |
+
'callback' => false,
|
48 |
+
);
|
49 |
+
|
50 |
+
$help_tabs['overview_tab'] = $overview_tab;
|
51 |
+
|
52 |
+
return $help_tabs;
|
53 |
+
}
|
54 |
+
}
|
include/Core/Metas/MetasModule.php
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Core\Metas;
|
4 |
+
|
5 |
+
use BulkWP\BulkDelete\Core\Base\BaseModule;
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Module for Deleting Meta fields.
|
11 |
+
*
|
12 |
+
* @since 6.0.0
|
13 |
+
*/
|
14 |
+
abstract class MetasModule extends BaseModule {
|
15 |
+
protected $item_type = 'metas';
|
16 |
+
|
17 |
+
protected function render_restrict_settings( $item = 'posts' ) {
|
18 |
+
bd_render_restrict_settings( $this->field_slug, $item );
|
19 |
+
}
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Handle common filters.
|
23 |
+
*
|
24 |
+
* @param array $request Request array.
|
25 |
+
*
|
26 |
+
* @return array User options.
|
27 |
+
*/
|
28 |
+
protected function parse_common_filters( $request ) {
|
29 |
+
$options = array();
|
30 |
+
|
31 |
+
$options['restrict'] = bd_array_get_bool( $request, 'smbd_' . $this->field_slug . '_restrict', false );
|
32 |
+
$options['limit_to'] = absint( bd_array_get( $request, 'smbd_' . $this->field_slug . '_limit_to', 0 ) );
|
33 |
+
$options['force_delete'] = bd_array_get_bool( $request, 'smbd_' . $this->field_slug . '_force_delete', false );
|
34 |
+
|
35 |
+
$options['date_op'] = bd_array_get( $request, 'smbd_' . $this->field_slug . '_op' );
|
36 |
+
$options['days'] = absint( bd_array_get( $request, 'smbd_' . $this->field_slug . '_days' ) );
|
37 |
+
|
38 |
+
return $options;
|
39 |
+
}
|
40 |
+
}
|
include/Core/Metas/Modules/DeleteCommentMetaModule.php
ADDED
@@ -0,0 +1,277 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Core\Metas\Modules;
|
4 |
+
|
5 |
+
use BulkWP\BulkDelete\Core\Metas\MetasModule;
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Delete Comment Meta Module.
|
11 |
+
*
|
12 |
+
* @since 6.0.0
|
13 |
+
*/
|
14 |
+
class DeleteCommentMetaModule extends MetasModule {
|
15 |
+
protected function initialize() {
|
16 |
+
$this->field_slug = 'comment_meta';
|
17 |
+
$this->meta_box_slug = 'bd-comment-meta';
|
18 |
+
$this->action = 'delete_comment_meta';
|
19 |
+
$this->cron_hook = 'do-bulk-delete-comment-meta';
|
20 |
+
$this->messages = array(
|
21 |
+
'box_label' => __( 'Bulk Delete Comment Meta', 'bulk-delete' ),
|
22 |
+
'scheduled' => __( 'Comment meta fields from the comments with the selected criteria are scheduled for deletion.', 'bulk-delete' ),
|
23 |
+
'cron_label' => __( 'Delete Comment Meta', 'bulk-delete' ),
|
24 |
+
);
|
25 |
+
}
|
26 |
+
|
27 |
+
public function register( $hook_suffix, $page_slug ) {
|
28 |
+
parent::register( $hook_suffix, $page_slug );
|
29 |
+
|
30 |
+
add_action( 'bd_delete_comment_meta_form', array( $this, 'add_filtering_options' ) );
|
31 |
+
|
32 |
+
add_filter( 'bd_delete_comment_meta_options', array( $this, 'process_filtering_options' ), 10, 2 );
|
33 |
+
add_filter( 'bd_delete_comment_meta_query', array( $this, 'change_meta_query' ), 10, 2 );
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Render the Delete Comment Meta box.
|
38 |
+
*/
|
39 |
+
public function render() {
|
40 |
+
?>
|
41 |
+
<!-- Comment Meta box start-->
|
42 |
+
<fieldset class="options">
|
43 |
+
<h4><?php _e( 'Select the post type whose comment meta fields you want to delete', 'bulk-delete' ); ?></h4>
|
44 |
+
<table class="optiontable">
|
45 |
+
<?php $this->render_post_type_dropdown(); ?>
|
46 |
+
</table>
|
47 |
+
|
48 |
+
<h4><?php _e( 'Choose your comment meta field settings', 'bulk-delete' ); ?></h4>
|
49 |
+
<table class="optiontable">
|
50 |
+
<tr>
|
51 |
+
<td>
|
52 |
+
<input name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_use_value" value="false" type="radio" checked>
|
53 |
+
<label for="smbd_<?php echo esc_attr( $this->field_slug ); ?>_use_value"><?php echo __( 'Delete based on comment meta key name only', 'bulk-delete' ); ?></label>
|
54 |
+
</td>
|
55 |
+
</tr>
|
56 |
+
|
57 |
+
<tr>
|
58 |
+
<td>
|
59 |
+
<input type="radio" value="true" name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_use_value" id="smbd_<?php echo esc_attr( $this->field_slug ); ?>_use_value">
|
60 |
+
|
61 |
+
<label for="smbd_<?php echo esc_attr( $this->field_slug ); ?>_use_value"><?php echo __( 'Delete based on comment meta key name and value', 'bulk-delete' ); ?></label>
|
62 |
+
</td>
|
63 |
+
</tr>
|
64 |
+
|
65 |
+
<tr>
|
66 |
+
<td>
|
67 |
+
<label for="smbd_<?php echo esc_attr( $this->field_slug ); ?>_meta_key"><?php _e( 'Comment Meta Key ', 'bulk-delete' ); ?></label>
|
68 |
+
<input name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_meta_key" id="smbd_<?php echo esc_attr( $this->field_slug ); ?>_meta_key" placeholder="<?php _e( 'Meta Key', 'bulk-delete' ); ?>">
|
69 |
+
</td>
|
70 |
+
</tr>
|
71 |
+
</table>
|
72 |
+
|
73 |
+
<?php
|
74 |
+
/**
|
75 |
+
* Add more fields to the delete comment meta field form.
|
76 |
+
* This hook can be used to add more fields to the delete comment meta field form.
|
77 |
+
*
|
78 |
+
* @since 5.4
|
79 |
+
*/
|
80 |
+
do_action( 'bd_delete_comment_meta_form' );
|
81 |
+
?>
|
82 |
+
<table class="optiontable">
|
83 |
+
<tr>
|
84 |
+
<td colspan="2">
|
85 |
+
<h4><?php _e( 'Choose your deletion options', 'bulk-delete' ); ?></h4>
|
86 |
+
</td>
|
87 |
+
</tr>
|
88 |
+
|
89 |
+
<?php $this->render_restrict_settings( 'comments' ); ?>
|
90 |
+
<?php $this->render_limit_settings(); ?>
|
91 |
+
<?php $this->render_cron_settings(); ?>
|
92 |
+
|
93 |
+
</table>
|
94 |
+
</fieldset>
|
95 |
+
|
96 |
+
<?php $this->render_submit_button(); ?>
|
97 |
+
|
98 |
+
<!-- Comment Meta box end-->
|
99 |
+
<?php
|
100 |
+
}
|
101 |
+
|
102 |
+
protected function convert_user_input_to_options( $request, $options ) {
|
103 |
+
$options['post_type'] = esc_sql( bd_array_get( $request, 'smbd_' . $this->field_slug . '_post_type', 'post' ) );
|
104 |
+
|
105 |
+
$options['use_value'] = bd_array_get_bool( $request, 'smbd_' . $this->field_slug . '_use_value', false );
|
106 |
+
$options['meta_key'] = esc_sql( bd_array_get( $request, 'smbd_' . $this->field_slug . '_meta_key', '' ) );
|
107 |
+
|
108 |
+
/**
|
109 |
+
* Delete comment-meta delete options filter.
|
110 |
+
*
|
111 |
+
* This filter is for processing filtering options for deleting comment meta.
|
112 |
+
*
|
113 |
+
* @since 5.4
|
114 |
+
*/
|
115 |
+
return apply_filters( 'bd_delete_comment_meta_options', $options, $request );
|
116 |
+
}
|
117 |
+
|
118 |
+
protected function do_delete( $options ) {
|
119 |
+
$args = array(
|
120 |
+
'post_type' => $options['post_type'],
|
121 |
+
);
|
122 |
+
|
123 |
+
if ( $options['limit_to'] > 0 ) {
|
124 |
+
$args['number'] = $options['limit_to'];
|
125 |
+
}
|
126 |
+
|
127 |
+
$op = $options['date_op'];
|
128 |
+
$days = $options['days'];
|
129 |
+
|
130 |
+
if ( $options['restrict'] ) {
|
131 |
+
$args['date_query'] = array(
|
132 |
+
array(
|
133 |
+
'column' => 'comment_date',
|
134 |
+
$op => "{$days} day ago",
|
135 |
+
),
|
136 |
+
);
|
137 |
+
}
|
138 |
+
|
139 |
+
if ( $options['use_value'] ) {
|
140 |
+
$args['meta_query'] = apply_filters( 'bd_delete_comment_meta_query', array(), $options );
|
141 |
+
} else {
|
142 |
+
$args['meta_key'] = $options['meta_key'];
|
143 |
+
}
|
144 |
+
|
145 |
+
$meta_deleted = 0;
|
146 |
+
$comments = get_comments( $args );
|
147 |
+
|
148 |
+
foreach ( $comments as $comment ) {
|
149 |
+
// Todo: Don't delete all meta rows if there are duplicate meta keys.
|
150 |
+
// See https://github.com/sudar/bulk-delete/issues/515 for details.
|
151 |
+
if ( delete_comment_meta( $comment->comment_ID, $options['meta_key'] ) ) {
|
152 |
+
$meta_deleted ++;
|
153 |
+
}
|
154 |
+
}
|
155 |
+
|
156 |
+
return $meta_deleted;
|
157 |
+
}
|
158 |
+
|
159 |
+
protected function append_to_js_array( $js_array ) {
|
160 |
+
$js_array['validators'][ $this->action ] = 'noValidation';
|
161 |
+
|
162 |
+
$js_array['pre_action_msg'][ $this->action ] = 'deleteCMWarning';
|
163 |
+
$js_array['msg']['deleteCMWarning'] = __( 'Are you sure you want to delete all the comment meta fields that match the selected filters?', 'bulk-delete' );
|
164 |
+
|
165 |
+
return $js_array;
|
166 |
+
}
|
167 |
+
|
168 |
+
protected function get_success_message( $items_deleted ) {
|
169 |
+
/* translators: 1 Number of comment deleted */
|
170 |
+
return _n( 'Deleted comment meta field from %d comment', 'Deleted comment meta field from %d comments', $items_deleted, 'bulk-delete' );
|
171 |
+
}
|
172 |
+
|
173 |
+
/**
|
174 |
+
* Append filtering options to the delete comment meta form.
|
175 |
+
*
|
176 |
+
* This function was originally part of the Bulk Delete Comment Meta add-on.
|
177 |
+
*
|
178 |
+
* @since 0.1 of Bulk Delete Comment Meta add-on
|
179 |
+
*/
|
180 |
+
public function add_filtering_options() {
|
181 |
+
?>
|
182 |
+
<table class="optiontable" id="smbd_<?php echo esc_attr( $this->field_slug ); ?>_filters" style="display:none;">
|
183 |
+
<tr>
|
184 |
+
<td>
|
185 |
+
<?php _e( 'Comment Meta Value ', 'bulk-delete' ); ?>
|
186 |
+
<select name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_type" id="smbd_<?php echo esc_attr( $this->field_slug ); ?>_type">
|
187 |
+
<option value="CHAR"><?php _e( 'CHAR', 'bulk-delete' ); ?></option>
|
188 |
+
<option value="NUMERIC"><?php _e( 'NUMERIC', 'bulk-delete' ); ?></option>
|
189 |
+
<option value="DECIMAL"><?php _e( 'DECIMAL', 'bulk-delete' ); ?></option>
|
190 |
+
<option value="SIGNED"><?php _e( 'SIGNED', 'bulk-delete' ); ?></option>
|
191 |
+
<option value="UNSIGNED"><?php _e( 'UNSIGNED', 'bulk-delete' ); ?></option>
|
192 |
+
<option value="DATE"><?php _e( 'DATE', 'bulk-delete' ); ?></option>
|
193 |
+
<option value="TIME"><?php _e( 'TIME', 'bulk-delete' ); ?></option>
|
194 |
+
<option value="DATETIME"><?php _e( 'DATETIME', 'bulk-delete' ); ?></option>
|
195 |
+
<option value="BINARY"><?php _e( 'BINARY', 'bulk-delete' ); ?></option>
|
196 |
+
</select>
|
197 |
+
<select name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_meta_op" id="smbd_<?php echo esc_attr( $this->field_slug ); ?>_meta_op">
|
198 |
+
<option value="="><?php _e( 'equal to', 'bulk-delete' ); ?></option>
|
199 |
+
<option value="!="><?php _e( 'not equal to', 'bulk-delete' ); ?></option>
|
200 |
+
<option value="<"><?php _e( 'less than', 'bulk-delete' ); ?></option>
|
201 |
+
<option value="<="><?php _e( 'less than or equal to', 'bulk-delete' ); ?></option>
|
202 |
+
<option value=">"><?php _e( 'greater than', 'bulk-delete' ); ?></option>
|
203 |
+
<option value=">="><?php _e( 'greater than or equal to', 'bulk-delete' ); ?></option>
|
204 |
+
<option value="LIKE"><?php _e( 'like', 'bulk-delete' ); ?></option>
|
205 |
+
<option value="NOT LIKE"><?php _e( 'not like', 'bulk-delete' ); ?></option>
|
206 |
+
</select>
|
207 |
+
<input type="text" placeholder="<?php _e( 'Meta Value', 'bulk-delete' ); ?>"
|
208 |
+
name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_value"
|
209 |
+
id="smbd_<?php echo esc_attr( $this->field_slug ); ?>_value">
|
210 |
+
</td>
|
211 |
+
</tr>
|
212 |
+
</table>
|
213 |
+
<?php
|
214 |
+
}
|
215 |
+
|
216 |
+
/**
|
217 |
+
* Process additional delete options.
|
218 |
+
*
|
219 |
+
* This function was originally part of the Bulk Delete Comment Meta add-on.
|
220 |
+
*
|
221 |
+
* @since 0.1 of Bulk Delete Comment Meta add-on
|
222 |
+
*
|
223 |
+
* @param array $delete_options Delete options array.
|
224 |
+
* @param array $post The POST array.
|
225 |
+
*
|
226 |
+
* @return array Processed delete options array.
|
227 |
+
*/
|
228 |
+
public function process_filtering_options( $delete_options, $post ) {
|
229 |
+
if ( 'true' == bd_array_get( $post, 'smbd_' . $this->field_slug . '_use_value', 'false' ) ) {
|
230 |
+
$delete_options['meta_op'] = bd_array_get( $post, 'smbd_' . $this->field_slug . '_meta_op', '=' );
|
231 |
+
$delete_options['meta_type'] = bd_array_get( $post, 'smbd_' . $this->field_slug . '_type', 'CHAR' );
|
232 |
+
$delete_options['meta_value'] = bd_array_get( $post, 'smbd_' . $this->field_slug . '_value', '' );
|
233 |
+
}
|
234 |
+
|
235 |
+
return $delete_options;
|
236 |
+
}
|
237 |
+
|
238 |
+
/**
|
239 |
+
* Change the meta query.
|
240 |
+
*
|
241 |
+
* This function was originally part of the Bulk Delete Comment Meta add-on.
|
242 |
+
*
|
243 |
+
* @since 0.1 of Bulk Delete Comment Meta add-on
|
244 |
+
*
|
245 |
+
* @param array $meta_query Meta query.
|
246 |
+
* @param array $delete_options List of options chosen by the user.
|
247 |
+
*
|
248 |
+
* @return array Modified meta query.
|
249 |
+
*/
|
250 |
+
public function change_meta_query( $meta_query, $delete_options ) {
|
251 |
+
$meta_query = array(
|
252 |
+
array(
|
253 |
+
'key' => $delete_options['meta_key'],
|
254 |
+
'value' => $delete_options['meta_value'],
|
255 |
+
'compare' => $delete_options['meta_op'],
|
256 |
+
'type' => $delete_options['meta_type'],
|
257 |
+
),
|
258 |
+
);
|
259 |
+
|
260 |
+
return $meta_query;
|
261 |
+
}
|
262 |
+
|
263 |
+
/**
|
264 |
+
* Hook handler.
|
265 |
+
*
|
266 |
+
* This function was originally part of the Bulk Delete Comment Meta add-on.
|
267 |
+
*
|
268 |
+
* @since 0.1 of Bulk Delete Comment Meta add-on
|
269 |
+
*
|
270 |
+
* @param array $delete_options Delete options array.
|
271 |
+
*/
|
272 |
+
public function do_delete_comment_meta( $delete_options ) {
|
273 |
+
do_action( 'bd_before_scheduler', $this->messages['cron_label'] );
|
274 |
+
$count = $this->delete( $delete_options );
|
275 |
+
do_action( 'bd_after_scheduler', $this->messages['cron_label'], $count );
|
276 |
+
}
|
277 |
+
}
|
include/Core/Metas/Modules/DeletePostMetaModule.php
ADDED
@@ -0,0 +1,196 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace BulkWP\BulkDelete\Core\Metas\Modules;
|
3 |
+
|
4 |
+
use BulkWP\BulkDelete\Core\Metas\MetasModule;
|
5 |
+
|
6 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Delete Post Meta.
|
10 |
+
*
|
11 |
+
* @since 6.0.0
|
12 |
+
*/
|
13 |
+
class DeletePostMetaModule extends MetasModule {
|
14 |
+
protected function initialize() {
|
15 |
+
$this->field_slug = 'pm'; // Ideally it should be `meta_post`. But we are keeping it as pm for backward compatibility.
|
16 |
+
$this->meta_box_slug = 'bd-post-meta';
|
17 |
+
$this->action = 'delete_post_meta';
|
18 |
+
$this->cron_hook = 'do-bulk-delete-post-meta';
|
19 |
+
$this->scheduler_url = 'http://bulkwp.com/addons/bulk-delete-post-meta/?utm_source=wpadmin&utm_campaign=BulkDelete&utm_medium=buynow&utm_content=bd-m-p';
|
20 |
+
$this->messages = array(
|
21 |
+
'box_label' => __( 'Bulk Delete Post Meta', 'bulk-delete' ),
|
22 |
+
'scheduled' => __( 'Post meta fields from the posts with the selected criteria are scheduled for deletion.', 'bulk-delete' ),
|
23 |
+
'cron_label' => __( 'Delete Post Meta', 'bulk-delete' ),
|
24 |
+
);
|
25 |
+
}
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Render the Modules.
|
29 |
+
*
|
30 |
+
* @return void
|
31 |
+
*/
|
32 |
+
public function render() {
|
33 |
+
?>
|
34 |
+
<!-- Post Meta box start-->
|
35 |
+
<fieldset class="options">
|
36 |
+
<h4><?php _e( 'Select the post type whose post meta fields you want to delete', 'bulk-delete' ); ?></h4>
|
37 |
+
|
38 |
+
<table class="optiontable">
|
39 |
+
<?php $this->render_post_type_dropdown(); ?>
|
40 |
+
</table>
|
41 |
+
|
42 |
+
<h4><?php _e( 'Choose your post meta field settings', 'bulk-delete' ); ?></h4>
|
43 |
+
<table class="optiontable">
|
44 |
+
<tr>
|
45 |
+
<td>
|
46 |
+
<input name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_use_value" value="use_key" type="radio" checked>
|
47 |
+
<label for="smbd_<?php echo esc_attr( $this->field_slug ); ?>_use_value"><?php echo __( 'Delete based on post meta key name only', 'bulk-delete' ); ?></label>
|
48 |
+
</td>
|
49 |
+
</tr>
|
50 |
+
|
51 |
+
<tr>
|
52 |
+
<td>
|
53 |
+
<input name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_use_value" id="smdb_<?php echo esc_attr( $this->field_slug ); ?>_use_key_compare" value="use_key_compare" type="radio" disabled>
|
54 |
+
<label for="smbd_<?php echo esc_attr( $this->field_slug ); ?>_use_value"><?php echo __( 'Delete based on post meta key name prefix or postfix', 'bulk-delete' ); ?></label>
|
55 |
+
<span class="bd-pm-pro" style="color:red; vertical-align: middle;">
|
56 |
+
<?php _e( 'Only available in Pro Addon', 'bulk-delete' ); ?> <a href = "http://bulkwp.com/addons/bulk-delete-post-meta/?utm_source=wpadmin&utm_campaign=BulkDelete&utm_medium=buynow&utm_content=bd-m-p" target="_blank">Buy now</a>
|
57 |
+
</span>
|
58 |
+
</td>
|
59 |
+
</tr>
|
60 |
+
|
61 |
+
<tr>
|
62 |
+
<td>
|
63 |
+
<input name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_use_value" id="smbd_<?php echo esc_attr( $this->field_slug ); ?>_use_value" value="use_value" type="radio" disabled>
|
64 |
+
<label for="smbd_<?php echo esc_attr( $this->field_slug ); ?>_use_value"><?php echo __( 'Delete based on post meta key name and value', 'bulk-delete' ); ?></label>
|
65 |
+
<span class="bd-pm-pro" style="color:red; vertical-align: middle;">
|
66 |
+
<?php _e( 'Only available in Pro Addon', 'bulk-delete' ); ?> <a href = "http://bulkwp.com/addons/bulk-delete-post-meta/?utm_source=wpadmin&utm_campaign=BulkDelete&utm_medium=buynow&utm_content=bd-m-p" target="_blank">Buy now</a>
|
67 |
+
</span>
|
68 |
+
</td>
|
69 |
+
</tr>
|
70 |
+
|
71 |
+
<tr>
|
72 |
+
<td>
|
73 |
+
<label for="smbd_<?php echo esc_attr( $this->field_slug ); ?>_key"><?php _e( 'Post Meta Key ', 'bulk-delete' ); ?></label>
|
74 |
+
<select name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_key_prefix_postfix" id="smbd_<?php echo esc_attr( $this->field_slug ); ?>_key_prefix_postfix" style="display: none;">
|
75 |
+
<option value="starts_with">starts with</option>
|
76 |
+
<option value="contains">contains</option>
|
77 |
+
<option value="ends_with">ends with</option>
|
78 |
+
</select>
|
79 |
+
<input name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_key" id="smbd_<?php echo esc_attr( $this->field_slug ); ?>_key" placeholder="<?php _e( 'Meta Key', 'bulk-delete' ); ?>">
|
80 |
+
</td>
|
81 |
+
</tr>
|
82 |
+
</table>
|
83 |
+
|
84 |
+
<?php
|
85 |
+
/**
|
86 |
+
* Add more fields to the delete post meta field form.
|
87 |
+
* This hook can be used to add more fields to the delete post meta field form.
|
88 |
+
*
|
89 |
+
* @since 5.4
|
90 |
+
*/
|
91 |
+
do_action( 'bd_delete_post_meta_form' );
|
92 |
+
?>
|
93 |
+
|
94 |
+
<table class="optiontable">
|
95 |
+
<tr>
|
96 |
+
<td colspan="2">
|
97 |
+
<h4><?php _e( 'Choose your deletion options', 'bulk-delete' ); ?></h4>
|
98 |
+
</td>
|
99 |
+
</tr>
|
100 |
+
|
101 |
+
<?php $this->render_restrict_settings(); ?>
|
102 |
+
<?php $this->render_limit_settings(); ?>
|
103 |
+
<?php $this->render_cron_settings(); ?>
|
104 |
+
|
105 |
+
</table>
|
106 |
+
</fieldset>
|
107 |
+
|
108 |
+
<?php $this->render_submit_button(); ?>
|
109 |
+
|
110 |
+
<!-- Post Meta box end-->
|
111 |
+
<?php
|
112 |
+
}
|
113 |
+
|
114 |
+
protected function convert_user_input_to_options( $request, $options ) {
|
115 |
+
$options['post_type'] = esc_sql( bd_array_get( $request, 'smbd_' . $this->field_slug . '_post_type', 'post' ) );
|
116 |
+
|
117 |
+
$options['use_value'] = bd_array_get( $request, 'smbd_' . $this->field_slug . '_use_value', 'use_key' );
|
118 |
+
$options['meta_key'] = esc_sql( bd_array_get( $request, 'smbd_' . $this->field_slug . '_key', '' ) );
|
119 |
+
|
120 |
+
/**
|
121 |
+
* Delete post-meta delete options filter.
|
122 |
+
*
|
123 |
+
* This filter is for processing filtering options for deleting post meta.
|
124 |
+
*
|
125 |
+
* @since 5.4
|
126 |
+
*/
|
127 |
+
return apply_filters( 'bd_delete_post_meta_options', $options, $request );
|
128 |
+
}
|
129 |
+
|
130 |
+
protected function do_delete( $options ) {
|
131 |
+
$count = 0;
|
132 |
+
$args = array(
|
133 |
+
'post_type' => $options['post_type'],
|
134 |
+
);
|
135 |
+
|
136 |
+
if ( $options['limit_to'] > 0 ) {
|
137 |
+
$args['number'] = $options['limit_to'];
|
138 |
+
} else {
|
139 |
+
$args['nopaging'] = 'true';
|
140 |
+
}
|
141 |
+
|
142 |
+
$op = $options['date_op'];
|
143 |
+
$days = $options['days'];
|
144 |
+
|
145 |
+
if ( $options['restrict'] ) {
|
146 |
+
$args['date_query'] = array(
|
147 |
+
array(
|
148 |
+
'column' => 'post_date',
|
149 |
+
$op => "{$days} day ago",
|
150 |
+
),
|
151 |
+
);
|
152 |
+
}
|
153 |
+
|
154 |
+
if ( 'use_key' === $options['use_value'] ) {
|
155 |
+
$options['meta_key'] = $options['meta_key'];
|
156 |
+
} else {
|
157 |
+
$options['meta_query'] = apply_filters( 'bd_delete_post_meta_query', array(), $options );
|
158 |
+
}
|
159 |
+
|
160 |
+
$post_ids = bd_query( $args );
|
161 |
+
foreach ( $post_ids as $post_id ) {
|
162 |
+
if ( isset( $options['meta_key'] ) && is_array( $options['meta_key'] ) ) {
|
163 |
+
$is_post_id_counted = false;
|
164 |
+
foreach ( $options['meta_key'] as $meta_key ) {
|
165 |
+
if ( delete_post_meta( $post_id, $meta_key ) ) {
|
166 |
+
if ( $is_post_id_counted ) {
|
167 |
+
continue;
|
168 |
+
}
|
169 |
+
$count++;
|
170 |
+
$is_post_id_counted = true;
|
171 |
+
}
|
172 |
+
}
|
173 |
+
} else {
|
174 |
+
if ( delete_post_meta( $post_id, $options['meta_key'] ) ) {
|
175 |
+
$count++;
|
176 |
+
}
|
177 |
+
}
|
178 |
+
}
|
179 |
+
|
180 |
+
return $count;
|
181 |
+
}
|
182 |
+
|
183 |
+
protected function append_to_js_array( $js_array ) {
|
184 |
+
$js_array['validators'][ $this->action ] = 'noValidation';
|
185 |
+
|
186 |
+
$js_array['pre_action_msg'][ $this->action ] = 'deletePMWarning';
|
187 |
+
$js_array['msg']['deletePMWarning'] = __( 'Are you sure you want to delete all the post meta fields that match the selected filters?', 'bulk-delete' );
|
188 |
+
|
189 |
+
return $js_array;
|
190 |
+
}
|
191 |
+
|
192 |
+
protected function get_success_message( $items_deleted ) {
|
193 |
+
/* translators: 1 Number of posts deleted */
|
194 |
+
return _n( 'Deleted post meta field from %d post', 'Deleted post meta field from %d posts', $items_deleted, 'bulk-delete' );
|
195 |
+
}
|
196 |
+
}
|
include/Core/Metas/Modules/DeleteUserMetaModule.php
ADDED
@@ -0,0 +1,161 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace BulkWP\BulkDelete\Core\Metas\Modules;
|
3 |
+
|
4 |
+
use BulkWP\BulkDelete\Core\Metas\MetasModule;
|
5 |
+
|
6 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Delete User Meta.
|
10 |
+
*
|
11 |
+
* @since 6.0.0
|
12 |
+
*/
|
13 |
+
class DeleteUserMetaModule extends MetasModule {
|
14 |
+
protected function initialize() {
|
15 |
+
$this->field_slug = 'um'; // Ideally it should be `meta_user`. But we are keeping it as um for backward compatibility.
|
16 |
+
$this->meta_box_slug = 'bd-user-meta';
|
17 |
+
$this->action = 'delete_user_meta';
|
18 |
+
$this->cron_hook = 'do-bulk-delete-user-meta';
|
19 |
+
$this->scheduler_url = 'http://bulkwp.com/addons/bulk-delete-user-meta/?utm_source=wpadmin&utm_campaign=BulkDelete&utm_medium=buynow&utm_content=bd-m-u';
|
20 |
+
$this->messages = array(
|
21 |
+
'box_label' => __( 'Bulk Delete User Meta', 'bulk-delete' ),
|
22 |
+
'scheduled' => __( 'User meta fields from the users with the selected criteria are scheduled for deletion.', 'bulk-delete' ),
|
23 |
+
'cron_label' => __( 'Delete User Meta`', 'bulk-delete' ),
|
24 |
+
);
|
25 |
+
}
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Render the Modules.
|
29 |
+
*/
|
30 |
+
public function render() {
|
31 |
+
?>
|
32 |
+
<!-- User Meta box start-->
|
33 |
+
<fieldset class="options">
|
34 |
+
<h4><?php _e( 'Select the user role whose user meta fields you want to delete', 'bulk-delete' ); ?></h4>
|
35 |
+
|
36 |
+
<table class="optiontable">
|
37 |
+
<?php $this->render_user_role_dropdown(); ?>
|
38 |
+
</table>
|
39 |
+
|
40 |
+
<h4><?php _e( 'Choose your user meta field settings', 'bulk-delete' ); ?></h4>
|
41 |
+
<table class="optiontable">
|
42 |
+
<tr>
|
43 |
+
<td>
|
44 |
+
<input name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_use_value" value="false" type="radio" checked>
|
45 |
+
<label for="smbd_<?php echo esc_attr( $this->field_slug ); ?>_use_value"><?php echo __( 'Delete based on user meta key name only', 'bulk-delete' ); ?></label>
|
46 |
+
</td>
|
47 |
+
</tr>
|
48 |
+
|
49 |
+
<tr>
|
50 |
+
<td>
|
51 |
+
<input name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_use_value" id="smbd_<?php echo esc_attr( $this->field_slug ); ?>_use_value"
|
52 |
+
value="true" type="radio" disabled>
|
53 |
+
<label for="smbd_<?php echo esc_attr( $this->field_slug ); ?>_use_value"><?php echo __( 'Delete based on user meta key name and value', 'bulk-delete' ); ?></label>
|
54 |
+
<span class="bd-um-pro" style="color:red; vertical-align: middle;">
|
55 |
+
<?php _e( 'Only available in Pro Addon', 'bulk-delete' ); ?>
|
56 |
+
<a href="http://bulkwp.com/addons/bulk-delete-user-meta/?utm_source=wpadmin&utm_campaign=BulkDelete&utm_medium=buynow&utm_content=bd-m-u" target="_blank">Buy now</a>
|
57 |
+
</span>
|
58 |
+
</td>
|
59 |
+
</tr>
|
60 |
+
|
61 |
+
<tr>
|
62 |
+
<td>
|
63 |
+
<label for="smbd_<?php echo esc_attr( $this->field_slug ); ?>_key"><?php _e( 'User Meta Key ', 'bulk-delete' ); ?></label>
|
64 |
+
<input name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_key" id="smbd_<?php echo esc_attr( $this->field_slug ); ?>_key" placeholder="<?php _e( 'Meta Key', 'bulk-delete' ); ?>">
|
65 |
+
</td>
|
66 |
+
</tr>
|
67 |
+
</table>
|
68 |
+
<?php
|
69 |
+
/**
|
70 |
+
* Add more fields to the delete user meta field form.
|
71 |
+
* This hook can be used to add more fields to the delete user meta field form.
|
72 |
+
*
|
73 |
+
* @since 5.4
|
74 |
+
*/
|
75 |
+
do_action( 'bd_delete_user_meta_form' );
|
76 |
+
?>
|
77 |
+
<table class="optiontable">
|
78 |
+
<tr>
|
79 |
+
<td colspan="2">
|
80 |
+
<h4><?php _e( 'Choose your deletion options', 'bulk-delete' ); ?></h4>
|
81 |
+
</td>
|
82 |
+
</tr>
|
83 |
+
|
84 |
+
<?php $this->render_limit_settings(); ?>
|
85 |
+
<?php $this->render_cron_settings(); ?>
|
86 |
+
</table>
|
87 |
+
</fieldset>
|
88 |
+
|
89 |
+
<?php $this->render_submit_button(); ?>
|
90 |
+
<!-- User Meta box end-->
|
91 |
+
<?php
|
92 |
+
}
|
93 |
+
|
94 |
+
protected function convert_user_input_to_options( $request, $options ) {
|
95 |
+
$options['selected_roles'] = esc_sql( bd_array_get( $request, 'smbd_' . $this->field_slug . '_roles' ) );
|
96 |
+
$options['use_value'] = sanitize_text_field( bd_array_get_bool( $request, 'smbd_' . $this->field_slug . '_use_value', false ) );
|
97 |
+
$options['meta_key'] = esc_sql( bd_array_get( $request, 'smbd_' . $this->field_slug . '_key', '' ) );
|
98 |
+
$options['meta_value'] = esc_sql( bd_array_get( $request, 'smbd_' . $this->field_slug . '_value', '' ) );
|
99 |
+
|
100 |
+
/**
|
101 |
+
* Delete user-meta delete options filter.
|
102 |
+
*
|
103 |
+
* This filter is for processing filtering options for deleting user meta.
|
104 |
+
*
|
105 |
+
* @since 5.4
|
106 |
+
*/
|
107 |
+
return apply_filters( 'bd_delete_user_meta_options', $options, $request );
|
108 |
+
}
|
109 |
+
|
110 |
+
protected function do_delete( $options ) {
|
111 |
+
$count = 0;
|
112 |
+
$meta_key = $options['meta_key'];
|
113 |
+
$use_value = $options['use_value'];
|
114 |
+
$limit_to = $options['limit_to'];
|
115 |
+
|
116 |
+
$args = array(
|
117 |
+
'role__in' => $options['selected_roles'],
|
118 |
+
);
|
119 |
+
|
120 |
+
if ( $limit_to > 0 ) {
|
121 |
+
$args['number'] = $limit_to;
|
122 |
+
}
|
123 |
+
|
124 |
+
if ( $use_value ) {
|
125 |
+
$meta_value = $options['meta_value'];
|
126 |
+
$args['meta_query'] = apply_filters( 'bd_delete_user_meta_query', array(), $options );
|
127 |
+
} else {
|
128 |
+
$args['meta_key'] = $meta_key;
|
129 |
+
}
|
130 |
+
|
131 |
+
$users = get_users( $args );
|
132 |
+
|
133 |
+
foreach ( $users as $user ) {
|
134 |
+
if ( $use_value ) {
|
135 |
+
if ( delete_user_meta( $user->ID, $meta_key, $meta_value ) ) {
|
136 |
+
$count++;
|
137 |
+
}
|
138 |
+
} else {
|
139 |
+
if ( delete_user_meta( $user->ID, $meta_key ) ) {
|
140 |
+
$count++;
|
141 |
+
}
|
142 |
+
}
|
143 |
+
}
|
144 |
+
|
145 |
+
return $count;
|
146 |
+
}
|
147 |
+
|
148 |
+
protected function append_to_js_array( $js_array ) {
|
149 |
+
$js_array['validators']['delete_user_meta'] = 'noValidation';
|
150 |
+
|
151 |
+
$js_array['pre_action_msg']['delete_user_meta'] = 'deleteUMWarning';
|
152 |
+
$js_array['msg']['deleteUMWarning'] = __( 'Are you sure you want to delete all the user meta fields that match the selected filters?', 'bulk-delete' );
|
153 |
+
|
154 |
+
return $js_array;
|
155 |
+
}
|
156 |
+
|
157 |
+
protected function get_success_message( $items_deleted ) {
|
158 |
+
/* translators: 1 Number of posts deleted */
|
159 |
+
return _n( 'Deleted user meta field from %d user', 'Deleted user meta field from %d users', $items_deleted, 'bulk-delete' );
|
160 |
+
}
|
161 |
+
}
|
include/Core/Pages/DeletePagesPage.php
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Core\Pages;
|
4 |
+
|
5 |
+
use BulkWP\BulkDelete\Core\Base\BaseDeletePage;
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Bulk Delete Pages Page.
|
11 |
+
*
|
12 |
+
* Shows the list of modules that allows you to delete pages.
|
13 |
+
*
|
14 |
+
* @since 6.0.0
|
15 |
+
*/
|
16 |
+
class DeletePagesPage extends BaseDeletePage {
|
17 |
+
/**
|
18 |
+
* Initialize and setup variables.
|
19 |
+
*/
|
20 |
+
protected function initialize() {
|
21 |
+
$this->page_slug = 'bulk-delete-pages';
|
22 |
+
$this->item_type = 'pages';
|
23 |
+
$this->capability = 'delete_pages';
|
24 |
+
|
25 |
+
$this->label = array(
|
26 |
+
'page_title' => __( 'Bulk Delete Pages', 'bulk-delete' ),
|
27 |
+
'menu_title' => __( 'Bulk Delete Pages', 'bulk-delete' ),
|
28 |
+
);
|
29 |
+
|
30 |
+
$this->messages = array(
|
31 |
+
'warning_message' => __( 'WARNING: Pages deleted once cannot be retrieved back. Use with caution.', 'bulk-delete' ),
|
32 |
+
);
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Add Help tabs.
|
37 |
+
*
|
38 |
+
* @param array $help_tabs Help tabs.
|
39 |
+
*
|
40 |
+
* @return array Modified list of Help tabs.
|
41 |
+
*/
|
42 |
+
protected function add_help_tab( $help_tabs ) {
|
43 |
+
$overview_tab = array(
|
44 |
+
'title' => __( 'Overview', 'bulk-delete' ),
|
45 |
+
'id' => 'overview_tab',
|
46 |
+
'content' => '<p>' . __( 'This screen contains different modules that allows you to delete pages or schedule them for deletion.', 'bulk-delete' ) . '</p>',
|
47 |
+
'callback' => false,
|
48 |
+
);
|
49 |
+
|
50 |
+
$help_tabs['overview_tab'] = $overview_tab;
|
51 |
+
|
52 |
+
return $help_tabs;
|
53 |
+
}
|
54 |
+
}
|
include/Core/Pages/Modules/DeletePagesByStatusModule.php
ADDED
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Core\Pages\Modules;
|
4 |
+
|
5 |
+
use BulkWP\BulkDelete\Core\Pages\PagesModule;
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Delete Pages by Status Module.
|
11 |
+
*
|
12 |
+
* @since 6.0.0
|
13 |
+
*/
|
14 |
+
class DeletePagesByStatusModule extends PagesModule {
|
15 |
+
protected function initialize() {
|
16 |
+
$this->item_type = 'pages';
|
17 |
+
$this->field_slug = 'page_status';
|
18 |
+
$this->meta_box_slug = 'bd_pages_by_status';
|
19 |
+
$this->action = 'delete_pages_by_status';
|
20 |
+
$this->cron_hook = 'do-bulk-delete-pages-by-status';
|
21 |
+
$this->scheduler_url = 'http://bulkwp.com/addons/scheduler-for-deleting-pages-by-status/?utm_source=wpadmin&utm_campaign=BulkDelete&utm_medium=buynow&utm_content=bd-sp';
|
22 |
+
$this->messages = array(
|
23 |
+
'box_label' => __( 'By Page Status', 'bulk-delete' ),
|
24 |
+
'scheduled' => __( 'The selected pages are scheduled for deletion', 'bulk-delete' ),
|
25 |
+
'cron_label' => __( 'Delete Pages By status', 'bulk-delete' ),
|
26 |
+
);
|
27 |
+
}
|
28 |
+
|
29 |
+
public function render() {
|
30 |
+
?>
|
31 |
+
<!-- Pages start-->
|
32 |
+
<h4><?php _e( 'Select the post statuses from which you want to delete pages', 'bulk-delete' ); ?></h4>
|
33 |
+
|
34 |
+
<fieldset class="options">
|
35 |
+
<table class="optiontable">
|
36 |
+
<?php $this->render_post_status( 'page' ); ?>
|
37 |
+
</table>
|
38 |
+
|
39 |
+
<table class="optiontable">
|
40 |
+
<?php
|
41 |
+
$this->render_filtering_table_header();
|
42 |
+
$this->render_restrict_settings();
|
43 |
+
$this->render_delete_settings();
|
44 |
+
$this->render_limit_settings();
|
45 |
+
$this->render_cron_settings();
|
46 |
+
?>
|
47 |
+
</table>
|
48 |
+
</fieldset>
|
49 |
+
|
50 |
+
<?php
|
51 |
+
$this->render_submit_button();
|
52 |
+
}
|
53 |
+
|
54 |
+
// phpcs:ignore Squiz.Commenting.FunctionComment.Missing
|
55 |
+
protected function append_to_js_array( $js_array ) {
|
56 |
+
$js_array['error_msg'][ $this->action ] = 'selectPagePostStatus';
|
57 |
+
$js_array['pre_action_msg'][ $this->action ] = 'pagePostStatusWarning';
|
58 |
+
|
59 |
+
$js_array['msg']['selectPagePostStatus'] = __( 'Please select at least one post status from which pages should be deleted', 'bulk-delete' );
|
60 |
+
$js_array['msg']['pagePostStatusWarning'] = __( 'Are you sure you want to delete all the pages from the selected post status?', 'bulk-delete' );
|
61 |
+
|
62 |
+
return $js_array;
|
63 |
+
}
|
64 |
+
|
65 |
+
protected function convert_user_input_to_options( $request, $options ) {
|
66 |
+
$options['post_status'] = array_map( 'sanitize_text_field', bd_array_get( $request, 'smbd_page_status', array() ) );
|
67 |
+
|
68 |
+
return $options;
|
69 |
+
}
|
70 |
+
|
71 |
+
protected function build_query( $options ) {
|
72 |
+
if ( empty( $options['post_status'] ) ) {
|
73 |
+
return array();
|
74 |
+
}
|
75 |
+
|
76 |
+
$query = array(
|
77 |
+
'post_type' => 'page',
|
78 |
+
'post_status' => $options['post_status'],
|
79 |
+
);
|
80 |
+
|
81 |
+
return $query;
|
82 |
+
}
|
83 |
+
|
84 |
+
protected function get_success_message( $items_deleted ) {
|
85 |
+
/* translators: 1 Number of pages deleted */
|
86 |
+
return _n( 'Deleted %d page from the selected post status', 'Deleted %d pages from the selected post status', $items_deleted, 'bulk-delete' );
|
87 |
+
}
|
88 |
+
}
|
include/Core/Pages/PagesModule.php
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Core\Pages;
|
4 |
+
|
5 |
+
use BulkWP\BulkDelete\Core\Posts\PostsModule;
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Module for deleting pages.
|
11 |
+
*
|
12 |
+
* This class extends PostsModule since Page is a type of Post.
|
13 |
+
*
|
14 |
+
* @since 6.0.0
|
15 |
+
*/
|
16 |
+
abstract class PagesModule extends PostsModule {
|
17 |
+
protected $item_type = 'pages';
|
18 |
+
}
|
include/Core/Posts/DeletePostsPage.php
ADDED
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Core\Posts;
|
4 |
+
|
5 |
+
use BulkWP\BulkDelete\Core\Base\BaseDeletePage;
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Bulk Delete Posts Page.
|
11 |
+
*
|
12 |
+
* Shows the list of modules that allows you to delete posts.
|
13 |
+
*
|
14 |
+
* @since 6.0.0
|
15 |
+
*/
|
16 |
+
class DeletePostsPage extends BaseDeletePage {
|
17 |
+
/**
|
18 |
+
* Position in which the Bulk WP menu should appear.
|
19 |
+
*/
|
20 |
+
const MENU_POSITION = '26';
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Initialize and setup variables.
|
24 |
+
*/
|
25 |
+
protected function initialize() {
|
26 |
+
$this->page_slug = 'bulk-delete-posts';
|
27 |
+
$this->item_type = 'posts';
|
28 |
+
$this->capability = 'delete_posts';
|
29 |
+
|
30 |
+
$this->label = array(
|
31 |
+
'page_title' => __( 'Bulk Delete Posts', 'bulk-delete' ),
|
32 |
+
'menu_title' => __( 'Bulk Delete Posts', 'bulk-delete' ),
|
33 |
+
);
|
34 |
+
|
35 |
+
$this->messages = array(
|
36 |
+
'warning_message' => __( 'WARNING: Posts deleted once cannot be retrieved back. Use with caution.', 'bulk-delete' ),
|
37 |
+
);
|
38 |
+
|
39 |
+
$this->show_link_in_plugin_list = true;
|
40 |
+
}
|
41 |
+
|
42 |
+
public function register() {
|
43 |
+
add_menu_page(
|
44 |
+
__( 'Bulk WP', 'bulk-delete' ),
|
45 |
+
__( 'Bulk WP', 'bulk-delete' ),
|
46 |
+
$this->capability,
|
47 |
+
$this->page_slug,
|
48 |
+
array( $this, 'render_page' ),
|
49 |
+
'dashicons-trash',
|
50 |
+
$this->get_bulkwp_menu_position()
|
51 |
+
);
|
52 |
+
|
53 |
+
parent::register();
|
54 |
+
}
|
55 |
+
|
56 |
+
/**
|
57 |
+
* Get the Menu position of BulkWP menu.
|
58 |
+
*
|
59 |
+
* @return int Menu position.
|
60 |
+
*/
|
61 |
+
protected function get_bulkwp_menu_position() {
|
62 |
+
/**
|
63 |
+
* Bulk WP Menu position.
|
64 |
+
*
|
65 |
+
* @since 6.0.0
|
66 |
+
*
|
67 |
+
* @param int Menu Position.
|
68 |
+
*/
|
69 |
+
return apply_filters( 'bd_bulkwp_menu_position', self::MENU_POSITION );
|
70 |
+
}
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Add Help tabs.
|
74 |
+
*
|
75 |
+
* @param array $help_tabs Help tabs.
|
76 |
+
*
|
77 |
+
* @return array Modified list of tabs.
|
78 |
+
*/
|
79 |
+
protected function add_help_tab( $help_tabs ) {
|
80 |
+
$overview_tab = array(
|
81 |
+
'title' => __( 'Overview', 'bulk-delete' ),
|
82 |
+
'id' => 'overview_tab',
|
83 |
+
'content' => '<p>' . __( 'This screen contains different modules that allows you to delete posts or schedule them for deletion.', 'bulk-delete' ) . '</p>',
|
84 |
+
'callback' => false,
|
85 |
+
);
|
86 |
+
|
87 |
+
$help_tabs['overview_tab'] = $overview_tab;
|
88 |
+
|
89 |
+
return $help_tabs;
|
90 |
+
}
|
91 |
+
}
|
include/Core/Posts/Modules/DeletePostsByCategoryModule.php
ADDED
@@ -0,0 +1,125 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Core\Posts\Modules;
|
4 |
+
|
5 |
+
use BulkWP\BulkDelete\Core\Posts\PostsModule;
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Delete Posts by Category Module.
|
11 |
+
*
|
12 |
+
* @since 6.0.0
|
13 |
+
*/
|
14 |
+
class DeletePostsByCategoryModule extends PostsModule {
|
15 |
+
protected function initialize() {
|
16 |
+
$this->item_type = 'posts';
|
17 |
+
$this->field_slug = 'cats';
|
18 |
+
$this->meta_box_slug = 'bd_by_category';
|
19 |
+
$this->action = 'delete_posts_by_category';
|
20 |
+
$this->cron_hook = 'do-bulk-delete-cat';
|
21 |
+
$this->scheduler_url = 'http://bulkwp.com/addons/scheduler-for-deleting-posts-by-category/?utm_source=wpadmin&utm_campaign=BulkDelete&utm_medium=buynow&utm_content=bd-sc';
|
22 |
+
$this->messages = array(
|
23 |
+
'box_label' => __( 'By Post Category', 'bulk-delete' ),
|
24 |
+
'scheduled' => __( 'The selected posts are scheduled for deletion', 'bulk-delete' ),
|
25 |
+
'cron_label' => __( 'Delete Post By Category', 'bulk-delete' ),
|
26 |
+
);
|
27 |
+
}
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Render Delete posts by category box.
|
31 |
+
*/
|
32 |
+
public function render() {
|
33 |
+
?>
|
34 |
+
<!-- Category Start-->
|
35 |
+
<h4><?php _e( 'Select the post type from which you want to delete posts by category', 'bulk-delete' ); ?></h4>
|
36 |
+
<fieldset class="options">
|
37 |
+
<table class="optiontable">
|
38 |
+
<?php $this->render_post_type_dropdown(); ?>
|
39 |
+
</table>
|
40 |
+
|
41 |
+
<h4><?php _e( 'Select the categories from which you want to delete posts', 'bulk-delete' ); ?></h4>
|
42 |
+
<p>
|
43 |
+
<?php _e( 'Note: The post count below for each category is the total number of posts in that category, irrespective of post type.', 'bulk-delete' ); ?>
|
44 |
+
</p>
|
45 |
+
|
46 |
+
<table class="optiontable">
|
47 |
+
<tr>
|
48 |
+
<td scope="row">
|
49 |
+
<?php $this->render_category_dropdown(); ?>
|
50 |
+
</td>
|
51 |
+
</tr>
|
52 |
+
</table>
|
53 |
+
|
54 |
+
<table class="optiontable">
|
55 |
+
<?php
|
56 |
+
$this->render_filtering_table_header();
|
57 |
+
$this->render_restrict_settings();
|
58 |
+
$this->render_exclude_sticky_settings();
|
59 |
+
$this->render_delete_settings();
|
60 |
+
$this->render_private_post_settings();
|
61 |
+
$this->render_limit_settings();
|
62 |
+
$this->render_cron_settings();
|
63 |
+
?>
|
64 |
+
</table>
|
65 |
+
|
66 |
+
</fieldset>
|
67 |
+
<?php
|
68 |
+
$this->render_submit_button();
|
69 |
+
}
|
70 |
+
|
71 |
+
protected function append_to_js_array( $js_array ) {
|
72 |
+
$js_array['validators']['delete_posts_by_category'] = 'validateSelect2';
|
73 |
+
$js_array['error_msg']['delete_posts_by_category'] = 'selectCategory';
|
74 |
+
$js_array['msg']['selectCategory'] = __( 'Please select at least one category', 'bulk-delete' );
|
75 |
+
|
76 |
+
return $js_array;
|
77 |
+
}
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Process delete posts user inputs by category.
|
81 |
+
*
|
82 |
+
* @param array $request Request array.
|
83 |
+
* @param array $options Options for deleting posts.
|
84 |
+
*
|
85 |
+
* @return array $options Inputs from user for posts that were need to delete
|
86 |
+
*/
|
87 |
+
protected function convert_user_input_to_options( $request, $options ) {
|
88 |
+
$options['post_type'] = bd_array_get( $request, 'smbd_' . $this->field_slug . '_post_type', 'post' );
|
89 |
+
$options['selected_cats'] = bd_array_get( $request, 'smbd_' . $this->field_slug . '_category' );
|
90 |
+
$options['private'] = bd_array_get_bool( $request, 'smbd_' . $this->field_slug . '_private', false );
|
91 |
+
|
92 |
+
return $options;
|
93 |
+
}
|
94 |
+
|
95 |
+
/**
|
96 |
+
* Build query from delete options.
|
97 |
+
*
|
98 |
+
* @param array $options Delete options.
|
99 |
+
*
|
100 |
+
* @return array Query.
|
101 |
+
*/
|
102 |
+
protected function build_query( $options ) {
|
103 |
+
$query = array();
|
104 |
+
|
105 |
+
if ( in_array( 'all', $options['selected_cats'], true ) ) {
|
106 |
+
$query['category__not__in'] = array( 0 );
|
107 |
+
} else {
|
108 |
+
$query['category__in'] = $options['selected_cats'];
|
109 |
+
}
|
110 |
+
|
111 |
+
return $query;
|
112 |
+
}
|
113 |
+
|
114 |
+
/**
|
115 |
+
* Response message for deleting posts.
|
116 |
+
*
|
117 |
+
* @param int $items_deleted Total number of posts deleted.
|
118 |
+
*
|
119 |
+
* @return string Response message
|
120 |
+
*/
|
121 |
+
protected function get_success_message( $items_deleted ) {
|
122 |
+
/* translators: 1 Number of posts deleted */
|
123 |
+
return _n( 'Deleted %d post with the selected post category', 'Deleted %d posts with the selected post category', $items_deleted, 'bulk-delete' );
|
124 |
+
}
|
125 |
+
}
|
include/Core/Posts/Modules/DeletePostsByCommentsModule.php
ADDED
@@ -0,0 +1,126 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Core\Posts\Modules;
|
4 |
+
|
5 |
+
use BulkWP\BulkDelete\Core\Posts\PostsModule;
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Delete Posts by Comments Module.
|
11 |
+
*
|
12 |
+
* @since 6.0.0
|
13 |
+
*/
|
14 |
+
class DeletePostsByCommentsModule extends PostsModule {
|
15 |
+
/**
|
16 |
+
* Base parameters setup.
|
17 |
+
*/
|
18 |
+
protected function initialize() {
|
19 |
+
$this->item_type = 'posts';
|
20 |
+
$this->field_slug = 'comments';
|
21 |
+
$this->meta_box_slug = 'bd_by_comments';
|
22 |
+
$this->action = 'delete_posts_by_comments';
|
23 |
+
$this->cron_hook = 'do-bulk-delete-posts-by-comments';
|
24 |
+
$this->scheduler_url = 'https://bulkwp.com/addons/scheduler-for-deleting-posts-by-comments/?utm_source=wpadmin&utm_campaign=BulkDelete&utm_medium=buynow&utm_content=bds-p-c';
|
25 |
+
$this->messages = array(
|
26 |
+
'box_label' => __( 'By Comment count', 'bulk-delete' ),
|
27 |
+
'scheduled' => __( 'The selected posts are scheduled for deletion', 'bulk-delete' ),
|
28 |
+
'cron_label' => __( 'Delete Post By Comments', 'bulk-delete' ),
|
29 |
+
);
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Render Delete posts by comments box.
|
34 |
+
*/
|
35 |
+
public function render() {
|
36 |
+
?>
|
37 |
+
<h4><?php _e( 'Delete Posts based on the number of comments', 'bulk-delete' ); ?></h4>
|
38 |
+
|
39 |
+
<!-- Comments start-->
|
40 |
+
<fieldset class="options">
|
41 |
+
<table class="optiontable">
|
42 |
+
<tr>
|
43 |
+
<td scope="row" colspan="2">
|
44 |
+
<?php _e( 'Delete posts that have comments', 'bulk-delete' ); ?>
|
45 |
+
</td>
|
46 |
+
<td>
|
47 |
+
<?php $this->render_number_comparison_operators(); ?>
|
48 |
+
</td>
|
49 |
+
<td>
|
50 |
+
<input type="number" name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_count_value"
|
51 |
+
id="smbd_<?php echo esc_attr( $this->field_slug ); ?>_count_value" placeholder="Comments Count" min="0" class="comments_count_num">
|
52 |
+
</td>
|
53 |
+
</tr>
|
54 |
+
</table>
|
55 |
+
|
56 |
+
<table class="optiontable">
|
57 |
+
<?php
|
58 |
+
$this->render_filtering_table_header();
|
59 |
+
$this->render_restrict_settings();
|
60 |
+
$this->render_delete_settings();
|
61 |
+
$this->render_private_post_settings();
|
62 |
+
$this->render_limit_settings();
|
63 |
+
$this->render_cron_settings();
|
64 |
+
?>
|
65 |
+
</table>
|
66 |
+
</fieldset>
|
67 |
+
<?php
|
68 |
+
$this->render_submit_button();
|
69 |
+
}
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Process delete posts, user inputs by comments count.
|
73 |
+
*
|
74 |
+
* @param array $request Request array.
|
75 |
+
* @param array $options Options for deleting posts.
|
76 |
+
*
|
77 |
+
* @return array $options Inputs from user for posts that were need to be deleted.
|
78 |
+
*/
|
79 |
+
protected function convert_user_input_to_options( $request, $options ) {
|
80 |
+
$options['operator'] = bd_array_get( $request, 'smbd_' . $this->field_slug . '_operator' );
|
81 |
+
$options['comment_count'] = absint( bd_array_get( $request, 'smbd_' . $this->field_slug . '_count_value' ) );
|
82 |
+
|
83 |
+
return $options;
|
84 |
+
}
|
85 |
+
|
86 |
+
/**
|
87 |
+
* Build the Query from user input.
|
88 |
+
*
|
89 |
+
* @param array $options User Input.
|
90 |
+
*
|
91 |
+
* @return array $query Query Params.
|
92 |
+
*/
|
93 |
+
protected function build_query( $options ) {
|
94 |
+
$query = array();
|
95 |
+
|
96 |
+
$query['comment_count'] = array(
|
97 |
+
'compare' => $options['operator'],
|
98 |
+
'value' => $options['comment_count'],
|
99 |
+
);
|
100 |
+
|
101 |
+
return $query;
|
102 |
+
}
|
103 |
+
|
104 |
+
protected function append_to_js_array( $js_array ) {
|
105 |
+
$js_array['validators'][ $this->action ] = 'validateCommentsCount';
|
106 |
+
$js_array['error_msg'][ $this->action ] = 'validCommentsCount';
|
107 |
+
$js_array['msg']['validCommentsCount'] = __( 'Please enter the comments count based on which posts should be deleted. A valid comment count will be greater than or equal to zero', 'bulk-delete' );
|
108 |
+
|
109 |
+
$js_array['pre_action_msg'][ $this->action ] = 'deletePostsWarning';
|
110 |
+
$js_array['msg']['deletePostsWarning'] = __( 'Are you sure you want to delete all the posts based on the selected comment count?', 'bulk-delete' );
|
111 |
+
|
112 |
+
return $js_array;
|
113 |
+
}
|
114 |
+
|
115 |
+
/**
|
116 |
+
* Response message for deleting posts.
|
117 |
+
*
|
118 |
+
* @param int $items_deleted count of items deleted.
|
119 |
+
*
|
120 |
+
* @return string Response message
|
121 |
+
*/
|
122 |
+
protected function get_success_message( $items_deleted ) {
|
123 |
+
/* translators: 1 Number of posts deleted */
|
124 |
+
return _n( 'Deleted %d post with the selected comments count', 'Deleted %d posts with the selected comments count', $items_deleted, 'bulk-delete' );
|
125 |
+
}
|
126 |
+
}
|
include/Core/Posts/Modules/DeletePostsByPostTypeModule.php
ADDED
@@ -0,0 +1,119 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Core\Posts\Modules;
|
4 |
+
|
5 |
+
use BulkWP\BulkDelete\Core\Posts\PostsModule;
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Delete Posts by Post Type Module.
|
11 |
+
*
|
12 |
+
* @since 6.0.0
|
13 |
+
*/
|
14 |
+
class DeletePostsByPostTypeModule extends PostsModule {
|
15 |
+
protected function initialize() {
|
16 |
+
$this->item_type = 'posts';
|
17 |
+
$this->field_slug = 'types';
|
18 |
+
$this->meta_box_slug = 'bd_posts_by_types';
|
19 |
+
$this->action = 'delete_posts_by_post_type';
|
20 |
+
$this->cron_hook = 'do-bulk-delete-post-type';
|
21 |
+
$this->scheduler_url = 'http://bulkwp.com/addons/scheduler-for-deleting-posts-by-post-type/?utm_source=wpadmin&utm_campaign=BulkDelete&utm_medium=buynow&utm_content=bd-spt';
|
22 |
+
$this->messages = array(
|
23 |
+
'box_label' => __( 'By Post Type', 'bulk-delete' ),
|
24 |
+
'scheduled' => __( 'The selected posts are scheduled for deletion', 'bulk-delete' ),
|
25 |
+
'cron_label' => __( 'Delete Post By Post Type', 'bulk-delete' ),
|
26 |
+
'confirm_deletion' => __( 'Are you sure you want to delete the posts from the selected post type?', 'bulk-delete' ),
|
27 |
+
'validation_error' => __( 'Please select at least one post type', 'bulk-delete' ),
|
28 |
+
/* translators: 1 Number of posts deleted */
|
29 |
+
'deleted_one' => __( 'Deleted %d post from the selected post type', 'bulk-delete' ),
|
30 |
+
/* translators: 1 Number of posts deleted */
|
31 |
+
'deleted_multiple' => __( 'Deleted %d posts from the selected post type', 'bulk-delete' ),
|
32 |
+
);
|
33 |
+
}
|
34 |
+
|
35 |
+
public function render() {
|
36 |
+
?>
|
37 |
+
|
38 |
+
<h4>
|
39 |
+
<?php _e( 'Select the post type and the status from which you want to delete posts', 'bulk-delete' ); ?>
|
40 |
+
</h4>
|
41 |
+
|
42 |
+
<fieldset class="options">
|
43 |
+
<table class="optiontable">
|
44 |
+
|
45 |
+
<?php
|
46 |
+
$this->render_post_type_with_status();
|
47 |
+
$this->render_filtering_table_header();
|
48 |
+
$this->render_restrict_settings();
|
49 |
+
$this->render_exclude_sticky_settings();
|
50 |
+
$this->render_delete_settings();
|
51 |
+
$this->render_limit_settings();
|
52 |
+
$this->render_cron_settings();
|
53 |
+
?>
|
54 |
+
|
55 |
+
</table>
|
56 |
+
</fieldset>
|
57 |
+
|
58 |
+
<?php
|
59 |
+
$this->render_submit_button();
|
60 |
+
}
|
61 |
+
|
62 |
+
protected function append_to_js_array( $js_array ) {
|
63 |
+
$js_array['validators'][ $this->action ] = 'validatePostTypeSelect2';
|
64 |
+
|
65 |
+
return $js_array;
|
66 |
+
}
|
67 |
+
|
68 |
+
protected function convert_user_input_to_options( $request, $options ) {
|
69 |
+
$options['selected_types'] = bd_array_get( $request, 'smbd_' . $this->field_slug );
|
70 |
+
|
71 |
+
return $options;
|
72 |
+
}
|
73 |
+
|
74 |
+
public function delete( $options ) {
|
75 |
+
/**
|
76 |
+
* Filter delete options before deleting posts.
|
77 |
+
*
|
78 |
+
* @since 6.0.0 Added `Modules` parameter.
|
79 |
+
*
|
80 |
+
* @param array $options Delete options.
|
81 |
+
* @param \BulkWP\BulkDelete\Core\Base\BaseModule Modules that is triggering deletion.
|
82 |
+
*/
|
83 |
+
$options = apply_filters( 'bd_delete_options', $options, $this );
|
84 |
+
|
85 |
+
$posts_deleted = 0;
|
86 |
+
$selected_types = $options['selected_types'];
|
87 |
+
|
88 |
+
foreach ( $selected_types as $selected_type ) {
|
89 |
+
$query = $this->build_query( $selected_type );
|
90 |
+
|
91 |
+
$posts_deleted += $this->delete_posts_from_query( $query, $options );
|
92 |
+
}
|
93 |
+
|
94 |
+
return $posts_deleted;
|
95 |
+
}
|
96 |
+
|
97 |
+
/**
|
98 |
+
* Build the query from the selected type.
|
99 |
+
*
|
100 |
+
* In this Module, this function accepts a string and not an array.
|
101 |
+
*
|
102 |
+
* @param string $selected_type Post type.
|
103 |
+
*
|
104 |
+
* @return array Query params.
|
105 |
+
*/
|
106 |
+
protected function build_query( $selected_type ) {
|
107 |
+
$type_status = $this->split_post_type_and_status( $selected_type );
|
108 |
+
|
109 |
+
$type = $type_status['type'];
|
110 |
+
$status = $type_status['status'];
|
111 |
+
|
112 |
+
$query = array(
|
113 |
+
'post_status' => $status,
|
114 |
+
'post_type' => $type,
|
115 |
+
);
|
116 |
+
|
117 |
+
return $query;
|
118 |
+
}
|
119 |
+
}
|
include/Core/Posts/Modules/DeletePostsByRevisionModule.php
ADDED
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Core\Posts\Modules;
|
4 |
+
|
5 |
+
use BulkWP\BulkDelete\Core\Posts\PostsModule;
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Delete Posts by Revision Module.
|
11 |
+
*
|
12 |
+
* @since 6.0.0
|
13 |
+
*/
|
14 |
+
class DeletePostsByRevisionModule extends PostsModule {
|
15 |
+
protected function initialize() {
|
16 |
+
$this->item_type = 'posts';
|
17 |
+
$this->field_slug = 'revisions';
|
18 |
+
$this->meta_box_slug = 'bd_posts_by_revision';
|
19 |
+
$this->action = 'delete_posts_by_revision';
|
20 |
+
$this->messages = array(
|
21 |
+
'box_label' => __( 'By Post Revisions', 'bulk-delete' ),
|
22 |
+
);
|
23 |
+
}
|
24 |
+
|
25 |
+
public function render() {
|
26 |
+
global $wpdb;
|
27 |
+
$revisions = $wpdb->get_var( "select count(*) from $wpdb->posts where post_type = 'revision'" );
|
28 |
+
?>
|
29 |
+
<!-- Post Revisions start-->
|
30 |
+
<h4><?php _e( 'Select the posts which you want to delete', 'bulk-delete' ); ?></h4>
|
31 |
+
|
32 |
+
<fieldset class="options">
|
33 |
+
<table class="optiontable">
|
34 |
+
<tr>
|
35 |
+
<td>
|
36 |
+
<input name="smbd_revisions" id ="smbd_revisions" value="revisions" type="checkbox">
|
37 |
+
<label for="smbd_revisions"><?php _e( 'All Revisions', 'bulk-delete' ); ?> (<?php echo $revisions . ' '; _e( 'Revisions', 'bulk-delete' ); ?>)</label>
|
38 |
+
</td>
|
39 |
+
</tr>
|
40 |
+
|
41 |
+
</table>
|
42 |
+
</fieldset>
|
43 |
+
<?php
|
44 |
+
$this->render_submit_button();
|
45 |
+
}
|
46 |
+
|
47 |
+
protected function convert_user_input_to_options( $request, $options ) {
|
48 |
+
$options = array( 'revisions' => bd_array_get( $request, 'smbd_revisions' ) );
|
49 |
+
|
50 |
+
return $options;
|
51 |
+
}
|
52 |
+
|
53 |
+
protected function do_delete( $delete_options ) {
|
54 |
+
global $wpdb;
|
55 |
+
|
56 |
+
// Revisions
|
57 |
+
if ( 'revisions' == $delete_options['revisions'] ) {
|
58 |
+
$revisions = $wpdb->get_results( "select ID from $wpdb->posts where post_type = 'revision'" );
|
59 |
+
|
60 |
+
foreach ( $revisions as $revision ) {
|
61 |
+
wp_delete_post( $revision->ID );
|
62 |
+
}
|
63 |
+
|
64 |
+
return count( $revisions );
|
65 |
+
}
|
66 |
+
|
67 |
+
return 0;
|
68 |
+
}
|
69 |
+
|
70 |
+
protected function get_success_message( $items_deleted ) {
|
71 |
+
/* translators: 1 Number of pages deleted */
|
72 |
+
return _n( 'Deleted %d post with the selected post status', 'Deleted %d posts with the selected post status', $items_deleted, 'bulk-delete' );
|
73 |
+
}
|
74 |
+
|
75 |
+
protected function build_query( $options ) {
|
76 |
+
// Left empty on purpose.
|
77 |
+
}
|
78 |
+
}
|
include/Core/Posts/Modules/DeletePostsByStatusModule.php
ADDED
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Core\Posts\Modules;
|
4 |
+
|
5 |
+
use BulkWP\BulkDelete\Core\Posts\PostsModule;
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Delete Posts by Status Module.
|
11 |
+
*
|
12 |
+
* @since 6.0.0
|
13 |
+
*/
|
14 |
+
class DeletePostsByStatusModule extends PostsModule {
|
15 |
+
protected function initialize() {
|
16 |
+
$this->item_type = 'posts';
|
17 |
+
$this->field_slug = 'post_status';
|
18 |
+
$this->meta_box_slug = 'bd_posts_by_status';
|
19 |
+
$this->action = 'delete_posts_by_status';
|
20 |
+
$this->cron_hook = 'do-bulk-delete-post-status';
|
21 |
+
$this->scheduler_url = 'http://bulkwp.com/addons/scheduler-for-deleting-posts-by-status/?utm_source=wpadmin&utm_campaign=BulkDelete&utm_medium=buynow&utm_content=bd-sps';
|
22 |
+
$this->messages = array(
|
23 |
+
'box_label' => __( 'By Post Status', 'bulk-delete' ),
|
24 |
+
'scheduled' => __( 'The selected posts are scheduled for deletion', 'bulk-delete' ),
|
25 |
+
'cron_label' => __( 'Delete Post By Status', 'bulk-delete' ),
|
26 |
+
'validation_error' => __( 'Please select at least one post status from which posts should be deleted', 'bulk-delete' ),
|
27 |
+
'confirm_deletion' => __( 'Are you sure you want to delete all the posts from the selected post status?', 'bulk-delete' ),
|
28 |
+
/* translators: 1 Number of posts deleted */
|
29 |
+
'deleted_one' => __( 'Deleted %d post from the selected post status', 'bulk-delete' ),
|
30 |
+
/* translators: 1 Number of posts deleted */
|
31 |
+
'deleted_multiple' => __( 'Deleted %d posts from the selected post status', 'bulk-delete' ),
|
32 |
+
);
|
33 |
+
}
|
34 |
+
|
35 |
+
public function render() {
|
36 |
+
?>
|
37 |
+
<h4><?php _e( 'Select the post statuses from which you want to delete posts', 'bulk-delete' ); ?></h4>
|
38 |
+
|
39 |
+
<fieldset class="options">
|
40 |
+
|
41 |
+
<table class="optiontable">
|
42 |
+
<?php $this->render_post_status(); ?>
|
43 |
+
</table>
|
44 |
+
|
45 |
+
<table class="optiontable">
|
46 |
+
<?php
|
47 |
+
$this->render_filtering_table_header();
|
48 |
+
$this->render_restrict_settings();
|
49 |
+
$this->render_exclude_sticky_settings();
|
50 |
+
$this->render_delete_settings();
|
51 |
+
$this->render_limit_settings();
|
52 |
+
$this->render_cron_settings();
|
53 |
+
?>
|
54 |
+
</table>
|
55 |
+
|
56 |
+
</fieldset>
|
57 |
+
|
58 |
+
<?php
|
59 |
+
$this->render_submit_button();
|
60 |
+
}
|
61 |
+
|
62 |
+
protected function convert_user_input_to_options( $request, $options ) {
|
63 |
+
$options['post_status'] = array_map( 'sanitize_text_field', bd_array_get( $request, 'smbd_' . $this->field_slug, array() ) );
|
64 |
+
|
65 |
+
return $options;
|
66 |
+
}
|
67 |
+
|
68 |
+
protected function build_query( $options ) {
|
69 |
+
if ( empty( $options['post_status'] ) ) {
|
70 |
+
return array();
|
71 |
+
}
|
72 |
+
|
73 |
+
$query = array(
|
74 |
+
'post_status' => $options['post_status'],
|
75 |
+
);
|
76 |
+
|
77 |
+
return $query;
|
78 |
+
}
|
79 |
+
}
|
include/Core/Posts/Modules/DeletePostsByStickyPostModule.php
ADDED
@@ -0,0 +1,151 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Core\Posts\Modules;
|
4 |
+
|
5 |
+
use BulkWP\BulkDelete\Core\Posts\PostsModule;
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Delete Posts by Sticky Post.
|
11 |
+
*
|
12 |
+
* @since 6.0.0
|
13 |
+
*/
|
14 |
+
class DeletePostsByStickyPostModule extends PostsModule {
|
15 |
+
/**
|
16 |
+
* Did the user requested for unsticking posts instead of deleting them?
|
17 |
+
*
|
18 |
+
* @var bool
|
19 |
+
*/
|
20 |
+
protected $did_unsticky_post_instead_of_delete = false;
|
21 |
+
|
22 |
+
// phpcs:ignore Squiz.Commenting.FunctionComment.Missing
|
23 |
+
protected function initialize() {
|
24 |
+
$this->item_type = 'posts';
|
25 |
+
$this->field_slug = 'sticky_post';
|
26 |
+
$this->meta_box_slug = 'delete_posts_by_sticky_post';
|
27 |
+
$this->action = 'delete_posts_by_sticky_post';
|
28 |
+
$this->messages = array(
|
29 |
+
'box_label' => __( 'By Sticky Post', 'bulk-delete' ),
|
30 |
+
);
|
31 |
+
}
|
32 |
+
|
33 |
+
// phpcs:ignore Squiz.Commenting.FunctionComment.Missing
|
34 |
+
public function render() {
|
35 |
+
if ( ! $this->are_sticky_posts_present() ) : ?>
|
36 |
+
<h4>
|
37 |
+
<?php _e( 'There are no sticky post present in this WordPress installation.', 'bulk-delete' ); ?>
|
38 |
+
</h4>
|
39 |
+
<?php return; ?>
|
40 |
+
<?php endif; // phpcs:ignore?>
|
41 |
+
|
42 |
+
<h4><?php _e( 'Select the sticky post that you want to delete', 'bulk-delete' ); ?></h4>
|
43 |
+
|
44 |
+
<fieldset class="options">
|
45 |
+
<table class="optiontable">
|
46 |
+
<tr>
|
47 |
+
<td scope="row" colspan="2">
|
48 |
+
<?php $this->render_sticky_posts_dropdown(); ?>
|
49 |
+
</td>
|
50 |
+
</tr>
|
51 |
+
</table>
|
52 |
+
|
53 |
+
<table class="optiontable">
|
54 |
+
<?php
|
55 |
+
$this->render_filtering_table_header();
|
56 |
+
$this->render_sticky_action_settings();
|
57 |
+
$this->render_delete_settings();
|
58 |
+
?>
|
59 |
+
</table>
|
60 |
+
</fieldset>
|
61 |
+
|
62 |
+
<?php
|
63 |
+
$this->render_submit_button();
|
64 |
+
}
|
65 |
+
|
66 |
+
public function filter_js_array( $js_array ) {
|
67 |
+
$js_array['msg']['unstickyPostsWarning'] = __( 'Are you sure you want to remove the selected posts from being sticky?', 'bulk-delete' );
|
68 |
+
$js_array['msg']['deletePostsWarning'] = __( 'Are you sure you want to delete all the selected posts?', 'bulk-delete' );
|
69 |
+
$js_array['msg']['selectStickyPost'] = __( 'Select at least one sticky post', 'bulk-delete' );
|
70 |
+
|
71 |
+
$js_array['validators'][ $this->action ] = 'validateStickyPost';
|
72 |
+
$js_array['error_msg'][ $this->action ] = 'selectStickyPost';
|
73 |
+
|
74 |
+
$js_array['pre_action_msg'][ $this->action ] = 'DeletePostsByStickyPostPreAction';
|
75 |
+
|
76 |
+
return $js_array;
|
77 |
+
}
|
78 |
+
|
79 |
+
// phpcs:ignore Squiz.Commenting.FunctionComment.Missing
|
80 |
+
protected function convert_user_input_to_options( $request, $options ) {
|
81 |
+
$options['selected_posts'] = bd_array_get( $request, 'smbd_' . $this->field_slug );
|
82 |
+
$options['sticky_action'] = bd_array_get( $request, 'smbd_' . $this->field_slug . '_sticky_action' );
|
83 |
+
|
84 |
+
return $options;
|
85 |
+
}
|
86 |
+
|
87 |
+
/**
|
88 |
+
* Override the `do_delete` function to handle unsticking posts.
|
89 |
+
*
|
90 |
+
* @inheritdoc
|
91 |
+
*
|
92 |
+
* @param array $options Array of Delete options.
|
93 |
+
*
|
94 |
+
* @return int Number of posts deleted or unsticked.
|
95 |
+
*/
|
96 |
+
protected function do_delete( $options ) {
|
97 |
+
if ( 'unsticky' === $options['sticky_action'] ) {
|
98 |
+
$posts_unsticked = 0;
|
99 |
+
|
100 |
+
if ( in_array( 'all', $options['selected_posts'], true ) ) {
|
101 |
+
$options['selected_posts'] = get_option( 'sticky_posts' );
|
102 |
+
}
|
103 |
+
|
104 |
+
foreach ( $options['selected_posts'] as $post_id ) {
|
105 |
+
unstick_post( $post_id );
|
106 |
+
$posts_unsticked ++;
|
107 |
+
}
|
108 |
+
|
109 |
+
$this->did_unsticky_post_instead_of_delete = true;
|
110 |
+
|
111 |
+
return $posts_unsticked;
|
112 |
+
}
|
113 |
+
|
114 |
+
if ( 'delete' === $options['sticky_action'] ) {
|
115 |
+
$query = $this->build_query( $options );
|
116 |
+
|
117 |
+
if ( empty( $query ) ) {
|
118 |
+
// Short circuit deletion, if nothing needs to be deleted.
|
119 |
+
return 0;
|
120 |
+
}
|
121 |
+
|
122 |
+
return $this->delete_posts_from_query( $query, $options );
|
123 |
+
}
|
124 |
+
|
125 |
+
return 0;
|
126 |
+
}
|
127 |
+
|
128 |
+
// phpcs:ignore Squiz.Commenting.FunctionComment.Missing
|
129 |
+
protected function build_query( $options ) {
|
130 |
+
$query = array();
|
131 |
+
|
132 |
+
if ( in_array( 'all', $options['selected_posts'], true ) ) {
|
133 |
+
$query['post__in'] = get_option( 'sticky_posts' );
|
134 |
+
} else {
|
135 |
+
$query['post__in'] = $options['selected_posts'];
|
136 |
+
}
|
137 |
+
|
138 |
+
return $query;
|
139 |
+
}
|
140 |
+
|
141 |
+
// phpcs:ignore Squiz.Commenting.FunctionComment.Missing
|
142 |
+
protected function get_success_message( $items_deleted ) {
|
143 |
+
if ( $this->did_unsticky_post_instead_of_delete ) {
|
144 |
+
/* translators: 1 Number of posts unsticked */
|
145 |
+
return _n( '%d sticky post was made into normal post', '%d sticky posts were made into normal posts', $items_deleted, 'bulk-delete' );
|
146 |
+
}
|
147 |
+
|
148 |
+
/* translators: 1 Number of posts deleted */
|
149 |
+
return _n( 'Deleted %d sticky post', 'Deleted %d sticky posts', $items_deleted, 'bulk-delete' );
|
150 |
+
}
|
151 |
+
}
|
include/Core/Posts/Modules/DeletePostsByTagModule.php
ADDED
@@ -0,0 +1,117 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Core\Posts\Modules;
|
4 |
+
|
5 |
+
use BulkWP\BulkDelete\Core\Posts\PostsModule;
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Delete Posts by Tag Module.
|
11 |
+
*
|
12 |
+
* @since 6.0.0
|
13 |
+
*/
|
14 |
+
class DeletePostsByTagModule extends PostsModule {
|
15 |
+
/**
|
16 |
+
* Base parameters setup.
|
17 |
+
*/
|
18 |
+
protected function initialize() {
|
19 |
+
$this->item_type = 'posts';
|
20 |
+
$this->field_slug = 'tags';
|
21 |
+
$this->meta_box_slug = 'bd_by_tag';
|
22 |
+
$this->action = 'delete_posts_by_tag';
|
23 |
+
$this->cron_hook = 'do-bulk-delete-tag';
|
24 |
+
$this->scheduler_url = 'http://bulkwp.com/addons/scheduler-for-deleting-posts-by-tag/?utm_source=wpadmin&utm_campaign=BulkDelete&utm_medium=buynow&utm_content=bd-st';
|
25 |
+
$this->messages = array(
|
26 |
+
'box_label' => __( 'By Post Tag', 'bulk-delete' ),
|
27 |
+
'scheduled' => __( 'The selected posts are scheduled for deletion', 'bulk-delete' ),
|
28 |
+
'cron_label' => __( 'Delete Post By Tag', 'bulk-delete' ),
|
29 |
+
);
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Render Delete posts by tag box.
|
34 |
+
*/
|
35 |
+
public function render() {
|
36 |
+
if ( ! $this->are_tags_present() ) : ?>
|
37 |
+
<h4>
|
38 |
+
<?php _e( 'There are no tags present in this WordPress installation.', 'bulk-delete' ); ?>
|
39 |
+
</h4>
|
40 |
+
<?php return; ?>
|
41 |
+
<?php endif; ?>
|
42 |
+
|
43 |
+
<h4><?php _e( 'Select the tags from which you want to delete posts', 'bulk-delete' ); ?></h4>
|
44 |
+
|
45 |
+
<!-- Tags start-->
|
46 |
+
<fieldset class="options">
|
47 |
+
<table class="optiontable">
|
48 |
+
<tr>
|
49 |
+
<td scope="row" colspan="2">
|
50 |
+
<?php $this->render_tags_dropdown(); ?>
|
51 |
+
</td>
|
52 |
+
</tr>
|
53 |
+
</table>
|
54 |
+
|
55 |
+
<table class="optiontable">
|
56 |
+
<?php
|
57 |
+
$this->render_filtering_table_header();
|
58 |
+
$this->render_restrict_settings();
|
59 |
+
$this->render_exclude_sticky_settings();
|
60 |
+
$this->render_delete_settings();
|
61 |
+
$this->render_private_post_settings();
|
62 |
+
$this->render_limit_settings();
|
63 |
+
$this->render_cron_settings();
|
64 |
+
?>
|
65 |
+
</table>
|
66 |
+
</fieldset>
|
67 |
+
<?php
|
68 |
+
$this->render_submit_button();
|
69 |
+
}
|
70 |
+
|
71 |
+
protected function append_to_js_array( $js_array ) {
|
72 |
+
$js_array['validators'][ $this->action ] = 'validateSelect2';
|
73 |
+
$js_array['error_msg'][ $this->action ] = 'selectTag';
|
74 |
+
$js_array['msg']['selectTag'] = __( 'Please select at least one tag', 'bulk-delete' );
|
75 |
+
|
76 |
+
return $js_array;
|
77 |
+
}
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Process delete posts user inputs by tag.
|
81 |
+
*
|
82 |
+
* @param array $request Request array.
|
83 |
+
* @param array $options Options for deleting posts.
|
84 |
+
*
|
85 |
+
* @return array $options Inputs from user for posts that were need to delete
|
86 |
+
*/
|
87 |
+
protected function convert_user_input_to_options( $request, $options ) {
|
88 |
+
$options['selected_tags'] = bd_array_get( $request, 'smbd_tags', array() );
|
89 |
+
$options['private'] = bd_array_get( $request, 'smbd_tags_private', false );
|
90 |
+
|
91 |
+
return $options;
|
92 |
+
}
|
93 |
+
|
94 |
+
protected function build_query( $options ) {
|
95 |
+
$query = array();
|
96 |
+
|
97 |
+
if ( in_array( 'all', $options['selected_tags'], true ) ) {
|
98 |
+
$query['tag__not__in'] = array( 0 );
|
99 |
+
} else {
|
100 |
+
$query['tag__in'] = $options['selected_tags'];
|
101 |
+
}
|
102 |
+
|
103 |
+
return $query;
|
104 |
+
}
|
105 |
+
|
106 |
+
/**
|
107 |
+
* Response message for deleting posts.
|
108 |
+
*
|
109 |
+
* @param int $items_deleted count of items deleted.
|
110 |
+
*
|
111 |
+
* @return string Response message
|
112 |
+
*/
|
113 |
+
protected function get_success_message( $items_deleted ) {
|
114 |
+
/* translators: 1 Number of posts deleted */
|
115 |
+
return _n( 'Deleted %d post with the selected post tag', 'Deleted %d posts with the selected post tag', $items_deleted, 'bulk-delete' );
|
116 |
+
}
|
117 |
+
}
|
include/Core/Posts/Modules/DeletePostsByTaxonomyModule.php
ADDED
@@ -0,0 +1,161 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Core\Posts\Modules;
|
4 |
+
|
5 |
+
use BulkWP\BulkDelete\Core\Posts\PostsModule;
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Delete Posts by Taxonomy Module.
|
11 |
+
*
|
12 |
+
* @since 6.0.0
|
13 |
+
*/
|
14 |
+
class DeletePostsByTaxonomyModule extends PostsModule {
|
15 |
+
protected function initialize() {
|
16 |
+
$this->item_type = 'posts';
|
17 |
+
$this->field_slug = 'taxs';
|
18 |
+
$this->meta_box_slug = 'bd_posts_by_taxonomy';
|
19 |
+
$this->action = 'bd_delete_posts_by_taxonomy';
|
20 |
+
$this->cron_hook = 'do-bulk-delete-taxonomy';
|
21 |
+
$this->scheduler_url = 'http://bulkwp.com/addons/scheduler-for-deleting-posts-by-taxonomy/?utm_source=wpadmin&utm_campaign=BulkDelete&utm_medium=addonlist&utm_content=bd-stx';
|
22 |
+
$this->messages = array(
|
23 |
+
'box_label' => __( 'By Taxonomy', 'bulk-delete' ),
|
24 |
+
'scheduled' => __( 'The selected posts are scheduled for deletion', 'bulk-delete' ),
|
25 |
+
'cron_label' => __( 'Delete Post By Taxonomy', 'bulk-delete' ),
|
26 |
+
);
|
27 |
+
}
|
28 |
+
|
29 |
+
public function render() {
|
30 |
+
$taxs = get_taxonomies( array(), 'objects'
|
31 |
+
);
|
32 |
+
|
33 |
+
$terms_array = array();
|
34 |
+
if ( count( $taxs ) > 0 ) {
|
35 |
+
foreach ( $taxs as $tax ) {
|
36 |
+
$terms = get_terms( $tax->name );
|
37 |
+
if ( count( $terms ) > 0 ) {
|
38 |
+
$terms_array[ $tax->name ] = $terms;
|
39 |
+
}
|
40 |
+
}
|
41 |
+
}
|
42 |
+
|
43 |
+
if ( count( $terms_array ) > 0 ) {
|
44 |
+
?>
|
45 |
+
<h4><?php _e( 'Select the post type from which you want to delete posts by taxonomy', 'bulk-delete' ); ?></h4>
|
46 |
+
|
47 |
+
<fieldset class="options">
|
48 |
+
<table class="optiontable">
|
49 |
+
<?php $this->render_post_type_dropdown(); ?>
|
50 |
+
</table>
|
51 |
+
|
52 |
+
<h4>
|
53 |
+
<?php _e( 'Select the taxonomies from which you want to delete posts', 'bulk-delete' ); ?>
|
54 |
+
</h4>
|
55 |
+
|
56 |
+
<table class="optiontable">
|
57 |
+
<?php
|
58 |
+
foreach ( $terms_array as $tax => $terms ) {
|
59 |
+
?>
|
60 |
+
<tr>
|
61 |
+
<td scope="row">
|
62 |
+
<input name="smbd_taxs" value="<?php echo esc_attr( $tax ); ?>" type="radio" class="custom-tax">
|
63 |
+
</td>
|
64 |
+
<td>
|
65 |
+
<label for="smbd_taxs"><?php echo esc_attr( $taxs[ $tax ]->labels->name ); ?></label>
|
66 |
+
</td>
|
67 |
+
</tr>
|
68 |
+
<?php
|
69 |
+
}
|
70 |
+
?>
|
71 |
+
</table>
|
72 |
+
|
73 |
+
<h4>
|
74 |
+
<?php _e( 'The selected taxonomy has the following terms. Select the terms from which you want to delete posts', 'bulk-delete' ); ?>
|
75 |
+
</h4>
|
76 |
+
|
77 |
+
<p>
|
78 |
+
<?php _e( 'Note: The post count below for each term is the total number of posts in that term, irrespective of post type', 'bulk-delete' ); ?>.
|
79 |
+
</p>
|
80 |
+
|
81 |
+
<?php
|
82 |
+
foreach ( $terms_array as $tax => $terms ) {
|
83 |
+
?>
|
84 |
+
<table class="optiontable terms_<?php echo $tax; ?> terms">
|
85 |
+
<?php
|
86 |
+
foreach ( $terms as $term ) {
|
87 |
+
?>
|
88 |
+
<tr>
|
89 |
+
<td scope="row">
|
90 |
+
<input name="smbd_taxs_terms[]" value="<?php echo $term->slug; ?>" type="checkbox"
|
91 |
+
class="terms">
|
92 |
+
</td>
|
93 |
+
<td>
|
94 |
+
<label for="smbd_taxs_terms"><?php echo $term->name; ?>
|
95 |
+
(<?php echo $term->count . ' ';
|
96 |
+
_e( 'Posts', 'bulk-delete' ); ?>)</label>
|
97 |
+
</td>
|
98 |
+
</tr>
|
99 |
+
<?php
|
100 |
+
}
|
101 |
+
?>
|
102 |
+
</table>
|
103 |
+
<?php
|
104 |
+
}
|
105 |
+
?>
|
106 |
+
<table class="optiontable">
|
107 |
+
<?php
|
108 |
+
$this->render_filtering_table_header();
|
109 |
+
$this->render_restrict_settings();
|
110 |
+
$this->render_exclude_sticky_settings();
|
111 |
+
$this->render_delete_settings();
|
112 |
+
$this->render_limit_settings();
|
113 |
+
$this->render_cron_settings();
|
114 |
+
?>
|
115 |
+
</table>
|
116 |
+
|
117 |
+
</fieldset>
|
118 |
+
<?php
|
119 |
+
$this->render_submit_button();
|
120 |
+
} else {
|
121 |
+
?>
|
122 |
+
<h4><?php _e( "This WordPress installation doesn't have any non-empty taxonomies defined", 'bulk-delete' ) ?></h4>
|
123 |
+
<?php
|
124 |
+
}
|
125 |
+
}
|
126 |
+
|
127 |
+
protected function convert_user_input_to_options( $request, $options ) {
|
128 |
+
$options['post_type'] = bd_array_get( $request, 'smbd_' . $this->field_slug . '_post_type', 'post' );
|
129 |
+
$options['selected_taxs'] = bd_array_get( $request, 'smbd_' . $this->field_slug );
|
130 |
+
$options['selected_tax_terms'] = bd_array_get( $request, 'smbd_' . $this->field_slug . '_terms' );
|
131 |
+
|
132 |
+
return $options;
|
133 |
+
}
|
134 |
+
|
135 |
+
protected function build_query( $delete_options ) {
|
136 |
+
// For compatibility reasons set default post type to 'post'
|
137 |
+
$post_type = bd_array_get( $delete_options, 'post_type', 'post' );
|
138 |
+
|
139 |
+
$taxonomy = $delete_options['selected_taxs'];
|
140 |
+
$terms = $delete_options['selected_tax_terms'];
|
141 |
+
|
142 |
+
$options = array(
|
143 |
+
'post_status' => 'publish',
|
144 |
+
'post_type' => $post_type,
|
145 |
+
'tax_query' => array(
|
146 |
+
array(
|
147 |
+
'taxonomy' => $taxonomy,
|
148 |
+
'terms' => $terms,
|
149 |
+
'field' => 'slug',
|
150 |
+
),
|
151 |
+
),
|
152 |
+
);
|
153 |
+
|
154 |
+
return $options;
|
155 |
+
}
|
156 |
+
|
157 |
+
protected function get_success_message( $items_deleted ) {
|
158 |
+
/* translators: 1 Number of pages deleted */
|
159 |
+
return _n( 'Deleted %d post with the selected taxonomy', 'Deleted %d posts with the selected post taxonomy', $items_deleted, 'bulk-delete' );
|
160 |
+
}
|
161 |
+
}
|
include/Core/Posts/Modules/DeletePostsByURLModule.php
ADDED
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Core\Posts\Modules;
|
4 |
+
|
5 |
+
use BulkWP\BulkDelete\Core\Posts\PostsModule;
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Delete Posts by URL Module.
|
11 |
+
*
|
12 |
+
* @since 6.0.0
|
13 |
+
*/
|
14 |
+
class DeletePostsByURLModule extends PostsModule {
|
15 |
+
protected function initialize() {
|
16 |
+
$this->item_type = 'posts';
|
17 |
+
$this->field_slug = 'specific';
|
18 |
+
$this->meta_box_slug = 'bd_posts_by_url';
|
19 |
+
$this->action = 'delete_posts_by_url';
|
20 |
+
$this->messages = array(
|
21 |
+
'box_label' => __( 'By URL', 'bulk-delete' ),
|
22 |
+
);
|
23 |
+
}
|
24 |
+
|
25 |
+
public function render() { ?>
|
26 |
+
<!-- URLs start-->
|
27 |
+
<h4><?php _e( 'Delete posts and pages that have the following Permalink', 'bulk-delete' ); ?></h4>
|
28 |
+
|
29 |
+
<fieldset class="options">
|
30 |
+
<table class="optiontable">
|
31 |
+
<tr>
|
32 |
+
<td scope="row" colspan="2">
|
33 |
+
<label for="smdb_specific_pages"><?php _e( 'Enter one post url (not post ids) per line', 'bulk-delete' ); ?></label>
|
34 |
+
<br>
|
35 |
+
<textarea id="smdb_specific_pages_urls" name="smdb_specific_pages_urls" rows="5" columns="80"></textarea>
|
36 |
+
</td>
|
37 |
+
</tr>
|
38 |
+
|
39 |
+
<?php $this->render_filtering_table_header(); ?>
|
40 |
+
<?php $this->render_delete_settings(); ?>
|
41 |
+
|
42 |
+
</table>
|
43 |
+
</fieldset>
|
44 |
+
<?php
|
45 |
+
$this->render_submit_button();
|
46 |
+
}
|
47 |
+
|
48 |
+
public function filter_js_array( $js_array ) {
|
49 |
+
$js_array['validators'][ $this->action ] = 'validateUrl';
|
50 |
+
$js_array['error_msg'][ $this->action ] = 'enterUrl';
|
51 |
+
$js_array['pre_action_msg'][ $this->action ] = 'deletePostsByURLWarning';
|
52 |
+
|
53 |
+
$js_array['msg']['enterUrl'] = __( 'Please enter at least one post url', 'bulk-delete' );
|
54 |
+
$js_array['msg']['deletePostsByURLWarning'] = __( 'Are you sure you want to delete all the posts based on the entered url?', 'bulk-delete' );
|
55 |
+
|
56 |
+
return $js_array;
|
57 |
+
}
|
58 |
+
|
59 |
+
protected function convert_user_input_to_options( $request, $options ) {
|
60 |
+
$options['force_delete'] = bd_array_get_bool( $request, 'smbd_specific_force_delete', false );
|
61 |
+
|
62 |
+
$options['urls'] = preg_split( '/\r\n|\r|\n/', bd_array_get( $request, 'smdb_specific_pages_urls' ) );
|
63 |
+
|
64 |
+
return $options;
|
65 |
+
}
|
66 |
+
|
67 |
+
protected function do_delete( $delete_options ) {
|
68 |
+
$post_ids = array();
|
69 |
+
|
70 |
+
foreach ( $delete_options['urls'] as $url ) {
|
71 |
+
if ( substr( $url, 0, 1 ) === '/' ) {
|
72 |
+
$url = get_site_url() . $url;
|
73 |
+
}
|
74 |
+
|
75 |
+
$post_id = url_to_postid( $url );
|
76 |
+
|
77 |
+
if ( $post_id > 0 ) {
|
78 |
+
$post_ids[] = $post_id;
|
79 |
+
}
|
80 |
+
}
|
81 |
+
|
82 |
+
return $this->delete_posts_by_id( $post_ids, $delete_options['force_delete'] );
|
83 |
+
}
|
84 |
+
|
85 |
+
protected function get_success_message( $items_deleted ) {
|
86 |
+
/* translators: 1 Number of pages deleted */
|
87 |
+
return _n( 'Deleted %d post with the selected post status', 'Deleted %d posts with the selected post status', $items_deleted, 'bulk-delete' );
|
88 |
+
}
|
89 |
+
|
90 |
+
protected function build_query( $options ) {
|
91 |
+
// Left empty on purpose.
|
92 |
+
}
|
93 |
+
}
|
include/Core/Posts/PostsModule.php
ADDED
@@ -0,0 +1,179 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace BulkWP\BulkDelete\Core\Posts;
|
3 |
+
|
4 |
+
use BulkWP\BulkDelete\Core\Base\BaseModule;
|
5 |
+
|
6 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Module for deleting posts.
|
10 |
+
*
|
11 |
+
* @since 6.0.0
|
12 |
+
*/
|
13 |
+
abstract class PostsModule extends BaseModule {
|
14 |
+
/**
|
15 |
+
* Build query params for WP_Query by using delete options.
|
16 |
+
*
|
17 |
+
* Return an empty query array to short-circuit deletion.
|
18 |
+
*
|
19 |
+
* @param array $options Delete options.
|
20 |
+
*
|
21 |
+
* @return array Query.
|
22 |
+
*/
|
23 |
+
abstract protected function build_query( $options );
|
24 |
+
|
25 |
+
protected $item_type = 'posts';
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Handle common filters.
|
29 |
+
*
|
30 |
+
* @param array $request Request array.
|
31 |
+
*
|
32 |
+
* @return array User options.
|
33 |
+
*/
|
34 |
+
protected function parse_common_filters( $request ) {
|
35 |
+
$options = array();
|
36 |
+
|
37 |
+
$options['restrict'] = bd_array_get_bool( $request, 'smbd_' . $this->field_slug . '_restrict', false );
|
38 |
+
$options['limit_to'] = absint( bd_array_get( $request, 'smbd_' . $this->field_slug . '_limit_to', 0 ) );
|
39 |
+
$options['exclude_sticky'] = bd_array_get_bool( $request, 'smbd_' . $this->field_slug . '_exclude_sticky', false );
|
40 |
+
$options['force_delete'] = bd_array_get_bool( $request, 'smbd_' . $this->field_slug . '_force_delete', false );
|
41 |
+
|
42 |
+
$options['date_op'] = bd_array_get( $request, 'smbd_' . $this->field_slug . '_op' );
|
43 |
+
$options['days'] = absint( bd_array_get( $request, 'smbd_' . $this->field_slug . '_days' ) );
|
44 |
+
|
45 |
+
return $options;
|
46 |
+
}
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Helper function to build the query params.
|
50 |
+
*
|
51 |
+
* @param array $options Delete Options.
|
52 |
+
* @param array $query Params for WP Query.
|
53 |
+
*
|
54 |
+
* @return array Delete options array
|
55 |
+
*/
|
56 |
+
protected function build_query_options( $options, $query ) {
|
57 |
+
return bd_build_query_options( $options, $query );
|
58 |
+
}
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Helper function for bd_query which runs query.
|
62 |
+
*
|
63 |
+
* @param array $query Params for WP Query.
|
64 |
+
*
|
65 |
+
* @return array Deleted Post IDs array
|
66 |
+
*/
|
67 |
+
protected function query( $query ) {
|
68 |
+
return bd_query( $query );
|
69 |
+
}
|
70 |
+
|
71 |
+
protected function do_delete( $options ) {
|
72 |
+
$query = $this->build_query( $options );
|
73 |
+
|
74 |
+
if ( empty( $query ) ) {
|
75 |
+
// Short circuit deletion, if nothing needs to be deleted.
|
76 |
+
return 0;
|
77 |
+
}
|
78 |
+
|
79 |
+
return $this->delete_posts_from_query( $query, $options );
|
80 |
+
}
|
81 |
+
|
82 |
+
/**
|
83 |
+
* Build the query using query params and then Delete posts.
|
84 |
+
*
|
85 |
+
* @param array $query Params for WP Query.
|
86 |
+
* @param array $options Delete Options.
|
87 |
+
*
|
88 |
+
* @return int Number of posts deleted.
|
89 |
+
*/
|
90 |
+
protected function delete_posts_from_query( $query, $options ) {
|
91 |
+
$query = $this->build_query_options( $options, $query );
|
92 |
+
$post_ids = $this->query( $query );
|
93 |
+
|
94 |
+
/**
|
95 |
+
* Triggered before the posts deletion, to get IDs of attachments associated with
|
96 |
+
* posts that are going to be deleted.
|
97 |
+
*
|
98 |
+
* @since 6.0.0
|
99 |
+
*
|
100 |
+
* @param array $post_ids List of post ids that are going to be deleted.
|
101 |
+
* @param array $options List of Delete Options.
|
102 |
+
*/
|
103 |
+
do_action( 'bd_before_deleting_posts', $post_ids, $options );
|
104 |
+
|
105 |
+
$delete_post_count = $this->delete_posts_by_id( $post_ids, $options['force_delete'] );
|
106 |
+
|
107 |
+
/**
|
108 |
+
* Triggered after the posts are deleted.
|
109 |
+
*
|
110 |
+
* @since 6.0.0
|
111 |
+
*
|
112 |
+
* @param array $options Delete Options.
|
113 |
+
*/
|
114 |
+
do_action( 'bd_after_deleting_posts', $options );
|
115 |
+
|
116 |
+
return $delete_post_count;
|
117 |
+
}
|
118 |
+
|
119 |
+
/**
|
120 |
+
* Render the "private post" setting fields.
|
121 |
+
*/
|
122 |
+
protected function render_private_post_settings() {
|
123 |
+
if( $this->are_private_posts_present() ){
|
124 |
+
bd_render_private_post_settings( $this->field_slug );
|
125 |
+
}
|
126 |
+
}
|
127 |
+
|
128 |
+
/**
|
129 |
+
* Delete sticky posts.
|
130 |
+
*
|
131 |
+
* @param bool $force_delete Whether to bypass trash and force deletion.
|
132 |
+
*
|
133 |
+
* @return int Number of posts deleted.
|
134 |
+
*/
|
135 |
+
protected function delete_sticky_posts( $force_delete ) {
|
136 |
+
$sticky_post_ids = get_option( 'sticky_posts' );
|
137 |
+
|
138 |
+
if ( ! is_array( $sticky_post_ids ) ) {
|
139 |
+
return 0;
|
140 |
+
}
|
141 |
+
|
142 |
+
return $this->delete_posts_by_id( $sticky_post_ids, $force_delete );
|
143 |
+
}
|
144 |
+
|
145 |
+
/**
|
146 |
+
* Delete posts by ids.
|
147 |
+
*
|
148 |
+
* @param int[] $post_ids List of post ids to delete.
|
149 |
+
* @param bool $force_delete True to force delete posts, False otherwise.
|
150 |
+
*
|
151 |
+
* @return int Number of posts deleted.
|
152 |
+
*/
|
153 |
+
protected function delete_posts_by_id( $post_ids, $force_delete ) {
|
154 |
+
/**
|
155 |
+
* Filter the list of post ids that will be excluded from deletion.
|
156 |
+
*
|
157 |
+
* @since 6.0.0
|
158 |
+
*
|
159 |
+
* @param array $excluded_ids Post IDs to be excluded.
|
160 |
+
*/
|
161 |
+
$excluded_post_ids = apply_filters( 'bd_excluded_post_ids', array() );
|
162 |
+
|
163 |
+
if ( is_array( $excluded_post_ids ) && ! empty( $excluded_post_ids ) ) {
|
164 |
+
$post_ids = array_diff( $post_ids, $excluded_post_ids );
|
165 |
+
}
|
166 |
+
|
167 |
+
foreach ( $post_ids as $post_id ) {
|
168 |
+
// `$force_delete` parameter to `wp_delete_post` won't work for custom post types.
|
169 |
+
// See https://core.trac.wordpress.org/ticket/43672
|
170 |
+
if ( $force_delete ) {
|
171 |
+
wp_delete_post( $post_id, true );
|
172 |
+
} else {
|
173 |
+
wp_trash_post( $post_id );
|
174 |
+
}
|
175 |
+
}
|
176 |
+
|
177 |
+
return count( $post_ids );
|
178 |
+
}
|
179 |
+
}
|
include/Core/SystemInfo/BulkDeleteSystemInfo.php
ADDED
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Core\SystemInfo;
|
4 |
+
|
5 |
+
use BulkWP\BulkDelete\Core\BulkDelete;
|
6 |
+
use Sudar\WPSystemInfo\SystemInfo;
|
7 |
+
|
8 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Bulk Delete System Info.
|
12 |
+
*
|
13 |
+
* Uses the WPSystemInfo library.
|
14 |
+
*
|
15 |
+
* @since 6.0.0
|
16 |
+
* @link https://github.com/sudar/wp-system-info
|
17 |
+
*/
|
18 |
+
class BulkDeleteSystemInfo extends SystemInfo {
|
19 |
+
/**
|
20 |
+
* Setup hooks and filters.
|
21 |
+
*/
|
22 |
+
public function load() {
|
23 |
+
add_action( 'before_system_info_for_bulk-delete', array( $this, 'print_bulk_delete_details' ) );
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Print details about Bulk Delete.
|
28 |
+
*
|
29 |
+
* PHPCS is disabled for this function since alignment will mess up the system info output.
|
30 |
+
* phpcs:disable
|
31 |
+
*/
|
32 |
+
public function print_bulk_delete_details() {
|
33 |
+
echo '-- Bulk Delete Configuration --', "\n";
|
34 |
+
echo 'Bulk Delete Version: ', BulkDelete::VERSION, "\n";
|
35 |
+
|
36 |
+
$this->print_license_details();
|
37 |
+
$this->print_schedule_jobs();
|
38 |
+
}
|
39 |
+
// phpcs:enable
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Print License details.
|
43 |
+
*/
|
44 |
+
protected function print_license_details() {
|
45 |
+
$keys = \BD_License::get_licenses();
|
46 |
+
if ( ! empty( $keys ) ) {
|
47 |
+
echo 'BULKWP-LICENSE: ', "\n";
|
48 |
+
|
49 |
+
foreach ( $keys as $key ) {
|
50 |
+
echo $key['addon-name'];
|
51 |
+
echo ' | ';
|
52 |
+
echo $key['license'];
|
53 |
+
echo ' | ';
|
54 |
+
echo $key['expires'];
|
55 |
+
echo ' | ';
|
56 |
+
echo $key['validity'];
|
57 |
+
echo ' | ';
|
58 |
+
echo $key['addon-code'];
|
59 |
+
}
|
60 |
+
}
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Print all schedule jobs.
|
65 |
+
*/
|
66 |
+
protected function print_schedule_jobs() {
|
67 |
+
$cron = _get_cron_array();
|
68 |
+
|
69 |
+
if ( ! empty( $cron ) ) {
|
70 |
+
echo "\n", 'SCHEDULED JOBS: ', "\n";
|
71 |
+
|
72 |
+
$date_format = _x( 'M j, Y @ G:i', 'Cron table date format', 'bulk-delete' );
|
73 |
+
|
74 |
+
foreach ( $cron as $timestamp => $cronhooks ) {
|
75 |
+
foreach ( (array) $cronhooks as $hook => $events ) {
|
76 |
+
if ( 'do-bulk-delete-' === substr( $hook, 0, 15 ) ) {
|
77 |
+
foreach ( (array) $events as $key => $event ) {
|
78 |
+
echo date_i18n( $date_format, $timestamp + ( get_option( 'gmt_offset' ) * 60 * 60 ) ) . ' (' . $timestamp . ')';
|
79 |
+
echo ' | ';
|
80 |
+
echo $event['schedule'];
|
81 |
+
echo ' | ';
|
82 |
+
echo $hook;
|
83 |
+
echo "\n";
|
84 |
+
}
|
85 |
+
}
|
86 |
+
}
|
87 |
+
}
|
88 |
+
|
89 |
+
echo "\n";
|
90 |
+
}
|
91 |
+
}
|
92 |
+
}
|
include/Core/SystemInfo/SystemInfoPage.php
ADDED
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php namespace BulkWP\BulkDelete\Core\SystemInfo;
|
2 |
+
|
3 |
+
use BulkWP\BulkDelete\Core\Base\BasePage;
|
4 |
+
|
5 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
6 |
+
|
7 |
+
/**
|
8 |
+
* System Info Page.
|
9 |
+
*
|
10 |
+
* This page displays information about the current WordPress install that can be used in support requests.
|
11 |
+
*
|
12 |
+
* @since 6.0.0
|
13 |
+
*/
|
14 |
+
class SystemInfoPage extends BasePage {
|
15 |
+
/**
|
16 |
+
* SystemInfo class.
|
17 |
+
*
|
18 |
+
* @var BulkDeleteSystemInfo
|
19 |
+
*/
|
20 |
+
protected $system_info;
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Action.
|
24 |
+
*
|
25 |
+
* Use for nonce verification.
|
26 |
+
*
|
27 |
+
* @var string
|
28 |
+
*/
|
29 |
+
protected $action = 'download-system-info';
|
30 |
+
|
31 |
+
protected function initialize() {
|
32 |
+
$this->page_slug = 'bulk-delete-system-info';
|
33 |
+
$this->capability = 'manage_options';
|
34 |
+
$this->actions[] = $this->action;
|
35 |
+
|
36 |
+
$this->label = array(
|
37 |
+
'page_title' => __( 'Bulk Delete - System Info', 'bulk-delete' ),
|
38 |
+
'menu_title' => __( 'System Info', 'bulk-delete' ),
|
39 |
+
);
|
40 |
+
}
|
41 |
+
|
42 |
+
public function register() {
|
43 |
+
parent::register();
|
44 |
+
|
45 |
+
add_action( 'bd_' . $this->action, array( $this, 'download_system_info' ) );
|
46 |
+
|
47 |
+
$this->system_info = new BulkDeleteSystemInfo( 'bulk-delete' );
|
48 |
+
$this->system_info->load();
|
49 |
+
}
|
50 |
+
|
51 |
+
protected function render_header() {
|
52 |
+
?>
|
53 |
+
<div class="updated">
|
54 |
+
<p>
|
55 |
+
<strong>
|
56 |
+
<?php _e( 'Please include this information when posting support requests.', 'bulk-delete' ); ?>
|
57 |
+
</strong>
|
58 |
+
</p>
|
59 |
+
</div>
|
60 |
+
|
61 |
+
<?php if ( defined( 'SAVEQUERIES' ) && SAVEQUERIES ) : ?>
|
62 |
+
<div class="notice notice-warning">
|
63 |
+
<p>
|
64 |
+
<strong>
|
65 |
+
<?php
|
66 |
+
printf(
|
67 |
+
/* translators: 1 Codex URL */
|
68 |
+
__( 'SAVEQUERIES is <a href="%s" target="_blank">enabled</a>. This puts additional load on the memory and will restrict the number of items that can be deleted.', 'bulk-delete' ),
|
69 |
+
'https://codex.wordpress.org/Editing_wp-config.php#Save_queries_for_analysis'
|
70 |
+
);
|
71 |
+
?>
|
72 |
+
</strong>
|
73 |
+
</p>
|
74 |
+
</div>
|
75 |
+
<?php endif; ?>
|
76 |
+
|
77 |
+
<?php if ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) : ?>
|
78 |
+
<div class="notice notice-warning">
|
79 |
+
<p>
|
80 |
+
<strong>
|
81 |
+
<?php
|
82 |
+
printf(
|
83 |
+
/* translators: 1 Codex URL. */
|
84 |
+
__( 'DISABLE_WP_CRON is <a href="%s" rel="noopener" target="_blank">enabled</a>. Scheduled deletion will not work if WP Cron is disabled. Please disable it to enable scheduled deletion.', 'bulk-delete' ),
|
85 |
+
'https://codex.wordpress.org/Editing_wp-config.php#Disable_Cron_and_Cron_Timeout'
|
86 |
+
);
|
87 |
+
?>
|
88 |
+
</strong>
|
89 |
+
</p>
|
90 |
+
</div>
|
91 |
+
<?php endif; ?>
|
92 |
+
<?php
|
93 |
+
}
|
94 |
+
|
95 |
+
public function render_body() {
|
96 |
+
$this->system_info->render();
|
97 |
+
?>
|
98 |
+
<p class="submit">
|
99 |
+
<input type="hidden" name="bd_action" value="<?php echo esc_attr( $this->action ); ?>">
|
100 |
+
<?php
|
101 |
+
submit_button( __( 'Download System Info File', 'bulk-delete' ), 'primary', 'bd-download-system-info', false );
|
102 |
+
?>
|
103 |
+
</p>
|
104 |
+
<?php
|
105 |
+
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
* Download System info file.
|
109 |
+
*/
|
110 |
+
public function download_system_info() {
|
111 |
+
$this->system_info->download_as_file();
|
112 |
+
}
|
113 |
+
}
|
include/Core/Terms/DeleteTermsPage.php
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Core\Terms;
|
4 |
+
|
5 |
+
use BulkWP\BulkDelete\Core\Base\BaseDeletePage;
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Bulk Delete Terms Page.
|
11 |
+
*
|
12 |
+
* Shows the list of modules that allows you to delete terms.
|
13 |
+
*
|
14 |
+
* @since 6.0.0
|
15 |
+
*/
|
16 |
+
class DeleteTermsPage extends BaseDeletePage {
|
17 |
+
protected function initialize() {
|
18 |
+
$this->page_slug = 'bulk-delete-terms';
|
19 |
+
$this->item_type = 'terms';
|
20 |
+
$this->capability = 'delete_posts';
|
21 |
+
|
22 |
+
$this->label = array(
|
23 |
+
'page_title' => __( 'Bulk Delete Taxonomy Terms', 'bulk-delete' ),
|
24 |
+
'menu_title' => __( 'Bulk Delete Terms', 'bulk-delete' ),
|
25 |
+
);
|
26 |
+
|
27 |
+
$this->messages = array(
|
28 |
+
'warning_message' => __( 'WARNING: Once deleted, terms cannot be retrieved back. Use with caution.', 'bulk-delete' ),
|
29 |
+
);
|
30 |
+
|
31 |
+
$this->show_link_in_plugin_list = true;
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Add Help tabs.
|
36 |
+
*
|
37 |
+
* @param array $help_tabs Help tabs.
|
38 |
+
*
|
39 |
+
* @return array Modified list of tabs.
|
40 |
+
*/
|
41 |
+
protected function add_help_tab( $help_tabs ) {
|
42 |
+
$overview_tab = array(
|
43 |
+
'title' => __( 'Overview', 'bulk-delete' ),
|
44 |
+
'id' => 'overview_tab',
|
45 |
+
'content' => '<p>' . __( 'This screen contains different modules that allows you to delete terms from taxonomies', 'bulk-delete' ) . '</p>',
|
46 |
+
'callback' => false,
|
47 |
+
);
|
48 |
+
|
49 |
+
$help_tabs['overview_tab'] = $overview_tab;
|
50 |
+
|
51 |
+
return $help_tabs;
|
52 |
+
}
|
53 |
+
}
|
include/Core/Terms/Modules/DeleteTermsByNameModule.php
ADDED
@@ -0,0 +1,222 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Core\Terms\Modules;
|
4 |
+
|
5 |
+
use BulkWP\BulkDelete\Core\Terms\TermsModule;
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Delete Terms by Name.
|
11 |
+
*
|
12 |
+
* @since 6.0.0
|
13 |
+
*/
|
14 |
+
class DeleteTermsByNameModule extends TermsModule {
|
15 |
+
protected function initialize() {
|
16 |
+
$this->item_type = 'terms';
|
17 |
+
$this->field_slug = 'terms_by_name';
|
18 |
+
$this->meta_box_slug = 'bd_delete_terms_by_name';
|
19 |
+
$this->action = 'delete_terms_by_name';
|
20 |
+
$this->messages = array(
|
21 |
+
'box_label' => __( 'Delete Terms by Name', 'bulk-delete' ),
|
22 |
+
'scheduled' => __( 'The selected terms are scheduled for deletion', 'bulk-delete' ),
|
23 |
+
);
|
24 |
+
}
|
25 |
+
|
26 |
+
public function render() {
|
27 |
+
?>
|
28 |
+
|
29 |
+
<fieldset class="options">
|
30 |
+
<h4><?php _e( 'Select the taxonomy from which you want to delete terms', 'bulk-delete' ); ?></h4>
|
31 |
+
|
32 |
+
<?php $this->render_taxonomy_dropdown(); ?>
|
33 |
+
|
34 |
+
<h4><?php _e( 'Choose your filtering options', 'bulk-delete' ); ?></h4>
|
35 |
+
|
36 |
+
<?php _e( 'Delete Terms if the name ', 'bulk-delete' ); ?>
|
37 |
+
<?php $this->render_string_comparison_operators(); ?>
|
38 |
+
<input type="text" name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_value" placeholder="<?php _e( 'Term Name', 'bulk-delete' ); ?>">
|
39 |
+
</fieldset>
|
40 |
+
|
41 |
+
<?php
|
42 |
+
$this->render_submit_button();
|
43 |
+
}
|
44 |
+
|
45 |
+
protected function append_to_js_array( $js_array ) {
|
46 |
+
$js_array['validators'][ $this->action ] = 'validateTermName';
|
47 |
+
$js_array['error_msg'][ $this->action ] = 'enterTermName';
|
48 |
+
$js_array['msg']['enterTermName'] = __( 'Please enter the term name that should be deleted', 'bulk-delete' );
|
49 |
+
|
50 |
+
$js_array['pre_action_msg'][ $this->action ] = 'deleteTermsWarning';
|
51 |
+
$js_array['msg']['deleteTermsWarning'] = __( 'Are you sure you want to delete all the terms based on the selected option?', 'bulk-delete' );
|
52 |
+
|
53 |
+
return $js_array;
|
54 |
+
}
|
55 |
+
|
56 |
+
protected function convert_user_input_to_options( $request, $options ) {
|
57 |
+
$options['operator'] = sanitize_text_field( bd_array_get( $request, 'smbd_' . $this->field_slug . '_operator' ) );
|
58 |
+
$options['value'] = sanitize_text_field( bd_array_get( $request, 'smbd_' . $this->field_slug . '_value' ) );
|
59 |
+
|
60 |
+
return $options;
|
61 |
+
}
|
62 |
+
|
63 |
+
protected function get_term_ids_to_delete( $options ) {
|
64 |
+
$term_ids = array();
|
65 |
+
$value = $options['value'];
|
66 |
+
$operator = $options['operator'];
|
67 |
+
if ( empty( $value ) ) {
|
68 |
+
return $term_ids;
|
69 |
+
}
|
70 |
+
|
71 |
+
switch ( $operator ) {
|
72 |
+
case 'equal_to':
|
73 |
+
$term_ids = $this->get_terms_that_are_equal_to( $value, $options );
|
74 |
+
break;
|
75 |
+
|
76 |
+
case 'not_equal_to':
|
77 |
+
$term_ids = $this->get_terms_that_are_not_equal_to( $value, $options );
|
78 |
+
break;
|
79 |
+
|
80 |
+
case 'starts_with':
|
81 |
+
$term_ids = $this->get_terms_that_starts_with( $value, $options );
|
82 |
+
break;
|
83 |
+
|
84 |
+
case 'ends_with':
|
85 |
+
$term_ids = $this->get_terms_that_ends_with( $value, $options );
|
86 |
+
break;
|
87 |
+
|
88 |
+
case 'contains':
|
89 |
+
$term_ids = $this->get_terms_that_contains( $value, $options );
|
90 |
+
break;
|
91 |
+
|
92 |
+
case 'not_contains':
|
93 |
+
$term_ids = $this->get_terms_that_not_contains( $value, $options );
|
94 |
+
break;
|
95 |
+
}
|
96 |
+
|
97 |
+
return $term_ids;
|
98 |
+
}
|
99 |
+
|
100 |
+
/**
|
101 |
+
* Get terms with name that are equal to a specific string.
|
102 |
+
*
|
103 |
+
* @param string $value Value to compare.
|
104 |
+
* @param array $options User options.
|
105 |
+
*
|
106 |
+
* @return int[] Term ids.
|
107 |
+
*/
|
108 |
+
protected function get_terms_that_are_equal_to( $value, $options ) {
|
109 |
+
$query = array(
|
110 |
+
'taxonomy' => $options['taxonomy'],
|
111 |
+
'name' => $value,
|
112 |
+
);
|
113 |
+
|
114 |
+
return $this->query_terms( $query );
|
115 |
+
}
|
116 |
+
|
117 |
+
/**
|
118 |
+
* Get terms with that name that is not equal to a specific string.
|
119 |
+
*
|
120 |
+
* @param string $value Value to compare.
|
121 |
+
* @param array $options User options.
|
122 |
+
*
|
123 |
+
* @return int[] Term ids.
|
124 |
+
*/
|
125 |
+
protected function get_terms_that_are_not_equal_to( $value, $options ) {
|
126 |
+
$name_like_args = array(
|
127 |
+
'name' => $value,
|
128 |
+
'taxonomy' => $options['taxonomy'],
|
129 |
+
);
|
130 |
+
|
131 |
+
$query = array(
|
132 |
+
'taxonomy' => $options['taxonomy'],
|
133 |
+
'exclude' => $this->query_terms( $name_like_args ),
|
134 |
+
);
|
135 |
+
|
136 |
+
return $this->query_terms( $query );
|
137 |
+
}
|
138 |
+
|
139 |
+
/**
|
140 |
+
* Get terms with name that start with a specific string.
|
141 |
+
*
|
142 |
+
* @param string $starts_with Substring to search.
|
143 |
+
* @param array $options User options.
|
144 |
+
*
|
145 |
+
* @return int[] Term ids.
|
146 |
+
*/
|
147 |
+
protected function get_terms_that_starts_with( $starts_with, $options ) {
|
148 |
+
$term_ids = array();
|
149 |
+
$terms = $this->get_all_terms( $options['taxonomy'] );
|
150 |
+
|
151 |
+
foreach ( $terms as $term ) {
|
152 |
+
if ( bd_starts_with( $term->name, $starts_with ) ) {
|
153 |
+
$term_ids[] = $term->term_id;
|
154 |
+
}
|
155 |
+
}
|
156 |
+
|
157 |
+
return $term_ids;
|
158 |
+
}
|
159 |
+
|
160 |
+
/**
|
161 |
+
* Get terms with name that ends with a specific string.
|
162 |
+
*
|
163 |
+
* @param string $ends_with Substring to search.
|
164 |
+
* @param array $options User options.
|
165 |
+
*
|
166 |
+
* @return int[] Term ids.
|
167 |
+
*/
|
168 |
+
protected function get_terms_that_ends_with( $ends_with, $options ) {
|
169 |
+
$term_ids = array();
|
170 |
+
$terms = $this->get_all_terms( $options['taxonomy'] );
|
171 |
+
|
172 |
+
foreach ( $terms as $term ) {
|
173 |
+
if ( bd_ends_with( $term->name, $ends_with ) ) {
|
174 |
+
$term_ids[] = $term->term_id;
|
175 |
+
}
|
176 |
+
}
|
177 |
+
|
178 |
+
return $term_ids;
|
179 |
+
}
|
180 |
+
|
181 |
+
/**
|
182 |
+
* Get terms with name that contains a specific string.
|
183 |
+
*
|
184 |
+
* @param string $contains Substring to search.
|
185 |
+
* @param array $options User options.
|
186 |
+
*
|
187 |
+
* @return int[] Term ids.
|
188 |
+
*/
|
189 |
+
protected function get_terms_that_contains( $contains, $options ) {
|
190 |
+
$term_ids = array();
|
191 |
+
$terms = $this->get_all_terms( $options['taxonomy'] );
|
192 |
+
|
193 |
+
foreach ( $terms as $term ) {
|
194 |
+
if ( bd_contains( $term->name, $contains ) ) {
|
195 |
+
$term_ids[] = $term->term_id;
|
196 |
+
}
|
197 |
+
}
|
198 |
+
|
199 |
+
return $term_ids;
|
200 |
+
}
|
201 |
+
|
202 |
+
/**
|
203 |
+
* Get terms with name that doesn't contain a specific string.
|
204 |
+
*
|
205 |
+
* @param string $contains Substring to search.
|
206 |
+
* @param array $options User options.
|
207 |
+
*
|
208 |
+
* @return int[] Term ids.
|
209 |
+
*/
|
210 |
+
protected function get_terms_that_not_contains( $contains, $options ) {
|
211 |
+
$term_ids = array();
|
212 |
+
$terms = $this->get_all_terms( $options['taxonomy'] );
|
213 |
+
|
214 |
+
foreach ( $terms as $term ) {
|
215 |
+
if ( ! bd_contains( $term->name, $contains ) ) {
|
216 |
+
$term_ids[] = $term->term_id;
|
217 |
+
}
|
218 |
+
}
|
219 |
+
|
220 |
+
return $term_ids;
|
221 |
+
}
|
222 |
+
}
|
include/Core/Terms/Modules/DeleteTermsByPostCountModule.php
ADDED
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Core\Terms\Modules;
|
4 |
+
|
5 |
+
use BulkWP\BulkDelete\Core\Terms\TermsModule;
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Delete Terms by Post Count.
|
11 |
+
*
|
12 |
+
* @since 6.0.0
|
13 |
+
*/
|
14 |
+
class DeleteTermsByPostCountModule extends TermsModule {
|
15 |
+
protected function initialize() {
|
16 |
+
$this->item_type = 'terms';
|
17 |
+
$this->field_slug = 'terms_by_post_count';
|
18 |
+
$this->meta_box_slug = 'bd_delete_terms_by_post_count';
|
19 |
+
$this->action = 'delete_terms_by_post_count';
|
20 |
+
$this->messages = array(
|
21 |
+
'box_label' => __( 'Delete Terms by Post Count', 'bulk-delete' ),
|
22 |
+
'scheduled' => __( 'The selected terms are scheduled for deletion', 'bulk-delete' ),
|
23 |
+
);
|
24 |
+
}
|
25 |
+
|
26 |
+
public function render() {
|
27 |
+
?>
|
28 |
+
|
29 |
+
<fieldset class="options">
|
30 |
+
<h4><?php _e( 'Select the taxonomy from which you want to delete terms', 'bulk-delete' ); ?></h4>
|
31 |
+
|
32 |
+
<?php $this->render_taxonomy_dropdown(); ?>
|
33 |
+
|
34 |
+
<h4><?php _e( 'Choose your filtering options', 'bulk-delete' ); ?></h4>
|
35 |
+
|
36 |
+
<?php _e( 'Delete Terms if the post count is ', 'bulk-delete' ); ?>
|
37 |
+
<?php $this->render_number_comparison_operators(); ?>
|
38 |
+
<input type="number" name="smbd_<?php echo esc_attr( $this->field_slug ); ?>" placeholder="Post count" min="0">
|
39 |
+
<?php
|
40 |
+
$markup = '';
|
41 |
+
$content = __( 'Post count is the number of posts that are assigned to a term.', 'bulk-delete' );
|
42 |
+
echo ' ' . bd_generate_help_tooltip( $markup, $content );
|
43 |
+
?>
|
44 |
+
</fieldset>
|
45 |
+
|
46 |
+
<?php
|
47 |
+
$this->render_submit_button();
|
48 |
+
}
|
49 |
+
|
50 |
+
protected function append_to_js_array( $js_array ) {
|
51 |
+
$js_array['validators'][ $this->action ] = 'validatePostCount';
|
52 |
+
$js_array['error_msg'][ $this->action ] = 'validPostCount';
|
53 |
+
$js_array['msg']['validPostCount'] = __( 'Please enter the post count based on which terms should be deleted. A valid post count will be greater than or equal to zero', 'bulk-delete' );
|
54 |
+
|
55 |
+
$js_array['pre_action_msg'][ $this->action ] = 'deleteTermsWarning';
|
56 |
+
$js_array['msg']['deleteTermsWarning'] = __( 'Are you sure you want to delete all the terms based on the selected option?', 'bulk-delete' );
|
57 |
+
|
58 |
+
return $js_array;
|
59 |
+
}
|
60 |
+
|
61 |
+
protected function convert_user_input_to_options( $request, $options ) {
|
62 |
+
$options['operator'] = sanitize_text_field( bd_array_get( $request, 'smbd_' . $this->field_slug . '_operator' ) );
|
63 |
+
$options['post_count'] = absint( bd_array_get( $request, 'smbd_' . $this->field_slug ) );
|
64 |
+
|
65 |
+
return $options;
|
66 |
+
}
|
67 |
+
|
68 |
+
protected function get_term_ids_to_delete( $options ) {
|
69 |
+
$term_ids = array();
|
70 |
+
|
71 |
+
$terms = $this->get_all_terms( $options['taxonomy'] );
|
72 |
+
foreach ( $terms as $term ) {
|
73 |
+
if ( $this->should_delete_term_based_on_post_count( $term->count, $options['operator'], $options['post_count'] ) ) {
|
74 |
+
$term_ids[] = $term->term_id;
|
75 |
+
}
|
76 |
+
}
|
77 |
+
|
78 |
+
return $term_ids;
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Determine if a term should be deleted based on post count.
|
83 |
+
*
|
84 |
+
* @param int $term_post_count Number of posts associated with a term.
|
85 |
+
* @param string $operator Operator.
|
86 |
+
* @param int $compared_to The user entered value to which the comparison should be made.
|
87 |
+
*
|
88 |
+
* @return int term id.
|
89 |
+
*/
|
90 |
+
protected function should_delete_term_based_on_post_count( $term_post_count, $operator, $compared_to ) {
|
91 |
+
switch ( $operator ) {
|
92 |
+
case '=':
|
93 |
+
return $term_post_count === $compared_to;
|
94 |
+
case '!=':
|
95 |
+
return $term_post_count !== $compared_to;
|
96 |
+
case '<':
|
97 |
+
return $term_post_count < $compared_to;
|
98 |
+
case '>':
|
99 |
+
return $term_post_count > $compared_to;
|
100 |
+
}
|
101 |
+
}
|
102 |
+
}
|
include/Core/Terms/TermsModule.php
ADDED
@@ -0,0 +1,142 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace BulkWP\BulkDelete\Core\Terms;
|
3 |
+
|
4 |
+
use BulkWP\BulkDelete\Core\Base\BaseModule;
|
5 |
+
|
6 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Module for deleting terms.
|
10 |
+
*
|
11 |
+
* @since 6.0.0
|
12 |
+
*/
|
13 |
+
abstract class TermsModule extends BaseModule {
|
14 |
+
/**
|
15 |
+
* Get the list of terms ids that need to be deleted.
|
16 |
+
*
|
17 |
+
* Return an empty query array to short-circuit deletion.
|
18 |
+
*
|
19 |
+
* @param array $options Delete options.
|
20 |
+
*
|
21 |
+
* @return int[] List of term ids to delete.
|
22 |
+
*/
|
23 |
+
abstract protected function get_term_ids_to_delete( $options );
|
24 |
+
|
25 |
+
protected $item_type = 'terms';
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Handle common filters.
|
29 |
+
*
|
30 |
+
* @param array $request Request array.
|
31 |
+
*
|
32 |
+
* @return array User options.
|
33 |
+
*/
|
34 |
+
protected function parse_common_filters( $request ) {
|
35 |
+
$options = array();
|
36 |
+
|
37 |
+
$options['taxonomy'] = sanitize_text_field( bd_array_get( $request, 'smbd_' . $this->field_slug . '_taxonomy' ) );
|
38 |
+
|
39 |
+
return $options;
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Perform the deletion.
|
44 |
+
*
|
45 |
+
* @param array $options Array of Delete options.
|
46 |
+
*
|
47 |
+
* @return int Number of items that were deleted.
|
48 |
+
*/
|
49 |
+
protected function do_delete( $options ) {
|
50 |
+
$term_ids_to_delete = $this->get_term_ids_to_delete( $options );
|
51 |
+
|
52 |
+
if ( $term_ids_to_delete <= 0 ) {
|
53 |
+
// Short circuit deletion, if nothing needs to be deleted.
|
54 |
+
return 0;
|
55 |
+
}
|
56 |
+
|
57 |
+
return $this->delete_terms_by_id( $term_ids_to_delete, $options );
|
58 |
+
}
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Delete terms by ids.
|
62 |
+
*
|
63 |
+
* @param int[] $term_ids List of term ids to delete.
|
64 |
+
* @param array $options User options.
|
65 |
+
*
|
66 |
+
* @return int Number of terms deleted.
|
67 |
+
*/
|
68 |
+
protected function delete_terms_by_id( $term_ids, $options ) {
|
69 |
+
$count = 0;
|
70 |
+
|
71 |
+
foreach ( $term_ids as $term_id ) {
|
72 |
+
if ( wp_delete_term( $term_id, $options['taxonomy'] ) ) {
|
73 |
+
$count ++;
|
74 |
+
}
|
75 |
+
}
|
76 |
+
|
77 |
+
return $count;
|
78 |
+
}
|
79 |
+
|
80 |
+
/**
|
81 |
+
* Get all terms from a taxonomy.
|
82 |
+
*
|
83 |
+
* @param string $taxonomy Taxonomy name.
|
84 |
+
*
|
85 |
+
* @return \WP_Term[] List of terms.
|
86 |
+
*/
|
87 |
+
protected function get_all_terms( $taxonomy ) {
|
88 |
+
$args = array(
|
89 |
+
'taxonomy' => $taxonomy,
|
90 |
+
'fields' => 'all',
|
91 |
+
);
|
92 |
+
|
93 |
+
return $this->query_terms( $args );
|
94 |
+
}
|
95 |
+
|
96 |
+
/**
|
97 |
+
* Query terms using WP_Term_Query.
|
98 |
+
*
|
99 |
+
* @param array $query Query args.
|
100 |
+
*
|
101 |
+
* @return array List of terms.
|
102 |
+
*/
|
103 |
+
protected function query_terms( $query ) {
|
104 |
+
$defaults = array(
|
105 |
+
'fields' => 'ids', // retrieve only ids.
|
106 |
+
'hide_empty' => false,
|
107 |
+
'count' => false,
|
108 |
+
'update_term_meta_cache' => false,
|
109 |
+
);
|
110 |
+
|
111 |
+
$query = wp_parse_args( $query, $defaults );
|
112 |
+
|
113 |
+
$term_query = new \WP_Term_Query();
|
114 |
+
|
115 |
+
/**
|
116 |
+
* This action runs before the query happens.
|
117 |
+
*
|
118 |
+
* @since 6.0.0
|
119 |
+
*
|
120 |
+
* @param \WP_Term_Query $term_query Query object.
|
121 |
+
*/
|
122 |
+
do_action( 'bd_before_query', $term_query );
|
123 |
+
|
124 |
+
$terms = $term_query->query( $query );
|
125 |
+
|
126 |
+
/**
|
127 |
+
* This action runs after the query happens.
|
128 |
+
*
|
129 |
+
* @since 6.0.0
|
130 |
+
*
|
131 |
+
* @param \WP_Term_Query $term_query Query object.
|
132 |
+
*/
|
133 |
+
do_action( 'bd_after_query', $term_query );
|
134 |
+
|
135 |
+
return $terms;
|
136 |
+
}
|
137 |
+
|
138 |
+
protected function get_success_message( $items_deleted ) {
|
139 |
+
/* translators: 1 Number of terms deleted */
|
140 |
+
return _n( 'Deleted %d term with the selected options', 'Deleted %d terms with the selected options', $items_deleted, 'bulk-delete' );
|
141 |
+
}
|
142 |
+
}
|
include/Core/Users/DeleteUsersPage.php
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Core\Users;
|
4 |
+
|
5 |
+
use BulkWP\BulkDelete\Core\Base\BaseDeletePage;
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Bulk Delete Users Page.
|
11 |
+
*
|
12 |
+
* Shows the list of modules that provides the ability to delete users.
|
13 |
+
*
|
14 |
+
* @since 5.5
|
15 |
+
* @since 6.0.0 Renamed to DeleteUsersPage
|
16 |
+
*/
|
17 |
+
class DeleteUsersPage extends BaseDeletePage {
|
18 |
+
/**
|
19 |
+
* Initialize and setup variables.
|
20 |
+
*
|
21 |
+
* @since 5.5
|
22 |
+
*/
|
23 |
+
protected function initialize() {
|
24 |
+
$this->page_slug = 'bulk-delete-users';
|
25 |
+
$this->item_type = 'users';
|
26 |
+
$this->capability = 'delete_users';
|
27 |
+
|
28 |
+
$this->label = array(
|
29 |
+
'page_title' => __( 'Bulk Delete Users', 'bulk-delete' ),
|
30 |
+
'menu_title' => __( 'Bulk Delete Users', 'bulk-delete' ),
|
31 |
+
);
|
32 |
+
|
33 |
+
$this->messages = array(
|
34 |
+
'warning_message' => __( 'WARNING: Users deleted once cannot be retrieved back. Use with caution.', 'bulk-delete' ),
|
35 |
+
);
|
36 |
+
|
37 |
+
$this->show_link_in_plugin_list = true;
|
38 |
+
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Add Help tabs.
|
42 |
+
*
|
43 |
+
* @since 5.5
|
44 |
+
*
|
45 |
+
* @param array $help_tabs List of help tabs.
|
46 |
+
*
|
47 |
+
* @return array Modified list of help tabs.
|
48 |
+
*/
|
49 |
+
protected function add_help_tab( $help_tabs ) {
|
50 |
+
$overview_tab = array(
|
51 |
+
'title' => __( 'Overview', 'bulk-delete' ),
|
52 |
+
'id' => 'overview_tab',
|
53 |
+
'content' => '<p>' . __( 'This screen contains different modules that allows you to delete users or schedule them for deletion.', 'bulk-delete' ) . '</p>',
|
54 |
+
'callback' => false,
|
55 |
+
);
|
56 |
+
|
57 |
+
$help_tabs['overview_tab'] = $overview_tab;
|
58 |
+
|
59 |
+
return $help_tabs;
|
60 |
+
}
|
61 |
+
}
|
include/Core/Users/Modules/DeleteUsersByUserMetaModule.php
ADDED
@@ -0,0 +1,160 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Core\Users\Modules;
|
4 |
+
|
5 |
+
use BulkWP\BulkDelete\Core\Users\UsersModule;
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Bulk Delete Users by User Meta.
|
11 |
+
*
|
12 |
+
* @since 5.5
|
13 |
+
* @since 6.0.0 Renamed to DeleteUsersByUserMetaModule.
|
14 |
+
*/
|
15 |
+
class DeleteUsersByUserMetaModule extends UsersModule {
|
16 |
+
/**
|
17 |
+
* Initialize and setup variables.
|
18 |
+
*
|
19 |
+
* @since 5.5
|
20 |
+
*/
|
21 |
+
protected function initialize() {
|
22 |
+
$this->item_type = 'users';
|
23 |
+
$this->field_slug = 'u_meta';
|
24 |
+
$this->meta_box_slug = 'bd_users_by_meta';
|
25 |
+
$this->action = 'delete_users_by_meta';
|
26 |
+
$this->cron_hook = 'do-bulk-delete-users-by-meta';
|
27 |
+
$this->scheduler_url = 'https://bulkwp.com/addons/scheduler-for-deleting-users-by-meta/?utm_source=wpadmin&utm_campaign=BulkDelete&utm_medium=buynow&utm_content=bd-u-ma';
|
28 |
+
$this->messages = array(
|
29 |
+
'box_label' => __( 'By User Meta', 'bulk-delete' ),
|
30 |
+
'scheduled' => __( 'Users from with the selected user meta are scheduled for deletion.', 'bulk-delete' ),
|
31 |
+
'cron_label' => __( 'Delete Users by User Meta', 'bulk-delete' ),
|
32 |
+
);
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Render delete users box.
|
37 |
+
*
|
38 |
+
* @since 5.5
|
39 |
+
*/
|
40 |
+
public function render() {
|
41 |
+
?>
|
42 |
+
<!-- Users Start-->
|
43 |
+
<h4><?php _e( 'Select the user meta from which you want to delete users', 'bulk-delete' ); ?></h4>
|
44 |
+
|
45 |
+
<fieldset class="options">
|
46 |
+
<table class="optiontable">
|
47 |
+
<select name="smbd_u_meta_key" class="enhanced-dropdown">
|
48 |
+
<?php
|
49 |
+
$meta_keys = $this->get_unique_user_meta_keys();
|
50 |
+
foreach ( $meta_keys as $meta_key ) {
|
51 |
+
printf( '<option value="%s">%s</option>', esc_attr( $meta_key ), esc_html( $meta_key ) );
|
52 |
+
}
|
53 |
+
?>
|
54 |
+
</select>
|
55 |
+
|
56 |
+
<select name="smbd_u_meta_compare">
|
57 |
+
<option value="=">Equals to</option>
|
58 |
+
<option value="!=">Not Equals to</option>
|
59 |
+
<option value=">">Greater than</option>
|
60 |
+
<option value=">=">Greater than or equals to</option>
|
61 |
+
<option value="<">Less than</option>
|
62 |
+
<option value="<=">Less than or equals to</option>
|
63 |
+
<option value="LIKE">Contains</option>
|
64 |
+
<option value="NOT LIKE">Not Contains</option>
|
65 |
+
<option value="STARTS WITH">Starts with</option>
|
66 |
+
<option value="ENDS WITH">Ends with</option>
|
67 |
+
</select>
|
68 |
+
<input type="text" name="smbd_u_meta_value" id="smbd_u_meta_value" placeholder="<?php _e( 'Meta Value', 'bulk-delete' ); ?>">
|
69 |
+
|
70 |
+
</table>
|
71 |
+
|
72 |
+
<p>
|
73 |
+
<?php _e( 'If you want to check for null values, then leave the value column blank', 'bulk-delete' ); ?>
|
74 |
+
</p>
|
75 |
+
|
76 |
+
<table class="optiontable">
|
77 |
+
<?php
|
78 |
+
$this->render_filtering_table_header();
|
79 |
+
$this->render_user_login_restrict_settings();
|
80 |
+
$this->render_user_with_no_posts_settings();
|
81 |
+
$this->render_limit_settings();
|
82 |
+
$this->render_post_reassign_settings();
|
83 |
+
$this->render_cron_settings();
|
84 |
+
?>
|
85 |
+
</table>
|
86 |
+
</fieldset>
|
87 |
+
<!-- Users end-->
|
88 |
+
|
89 |
+
<?php
|
90 |
+
$this->render_submit_button();
|
91 |
+
}
|
92 |
+
|
93 |
+
/**
|
94 |
+
* Process user input and create metabox options.
|
95 |
+
*
|
96 |
+
* @param array $request Request array.
|
97 |
+
* @param array $options User options.
|
98 |
+
*
|
99 |
+
* @return array User options.
|
100 |
+
*/
|
101 |
+
protected function convert_user_input_to_options( $request, $options ) {
|
102 |
+
$options['meta_key'] = bd_array_get( $request, 'smbd_u_meta_key' );
|
103 |
+
$options['meta_compare'] = bd_array_get( $request, 'smbd_u_meta_compare', '=' );
|
104 |
+
$options['meta_value'] = bd_array_get( $request, 'smbd_u_meta_value' );
|
105 |
+
|
106 |
+
switch ( strtolower( trim( $options['meta_compare'] ) ) ) {
|
107 |
+
case 'starts with':
|
108 |
+
$options['meta_compare'] = 'REGEXP';
|
109 |
+
$options['meta_value'] = '^' . $options['meta_value'];
|
110 |
+
break;
|
111 |
+
case 'ends with':
|
112 |
+
$options['meta_compare'] = 'REGEXP';
|
113 |
+
$options['meta_value'] = $options['meta_value'] . '$';
|
114 |
+
break;
|
115 |
+
}
|
116 |
+
|
117 |
+
return $options;
|
118 |
+
}
|
119 |
+
|
120 |
+
protected function build_query( $options ) {
|
121 |
+
$query = array(
|
122 |
+
'meta_query' => array(
|
123 |
+
array(
|
124 |
+
'key' => $options['meta_key'],
|
125 |
+
'value' => $options['meta_value'],
|
126 |
+
'compare' => $options['meta_compare'],
|
127 |
+
),
|
128 |
+
),
|
129 |
+
);
|
130 |
+
|
131 |
+
if ( $options['limit_to'] > 0 ) {
|
132 |
+
$query['number'] = $options['limit_to'];
|
133 |
+
}
|
134 |
+
|
135 |
+
$date_query = $this->get_date_query( $options );
|
136 |
+
|
137 |
+
if ( ! empty( $date_query ) ) {
|
138 |
+
$query['date_query'] = $date_query;
|
139 |
+
}
|
140 |
+
|
141 |
+
return $query;
|
142 |
+
}
|
143 |
+
|
144 |
+
protected function append_to_js_array( $js_array ) {
|
145 |
+
$js_array['validators'][ $this->action ] = 'noValidation';
|
146 |
+
|
147 |
+
$js_array['pre_action_msg'][ $this->action ] = 'deleteUsersByMetaWarning';
|
148 |
+
$js_array['msg']['deleteUsersByMetaWarning'] = __( 'Are you sure you want to delete all the users from the selected user meta?', 'bulk-delete' );
|
149 |
+
|
150 |
+
$js_array['error_msg'][ $this->action ] = 'enterUserMetaValue';
|
151 |
+
$js_array['msg']['enterUserMetaValue'] = __( 'Please enter the value for the user meta field based on which you want to delete users', 'bulk-delete' );
|
152 |
+
|
153 |
+
return $js_array;
|
154 |
+
}
|
155 |
+
|
156 |
+
protected function get_success_message( $items_deleted ) {
|
157 |
+
/* translators: 1 Number of users deleted */
|
158 |
+
return _n( 'Deleted %d user with the selected user meta', 'Deleted %d users with the selected user meta', $items_deleted, 'bulk-delete' );
|
159 |
+
}
|
160 |
+
}
|
include/Core/Users/Modules/DeleteUsersByUserRoleModule.php
ADDED
@@ -0,0 +1,201 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Core\Users\Modules;
|
4 |
+
|
5 |
+
use BulkWP\BulkDelete\Core\Users\UsersModule;
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Bulk Delete Users by User Role Module.
|
11 |
+
*
|
12 |
+
* @since 5.5
|
13 |
+
* @since 6.0.0 Renamed to DeleteUsersByUserRoleModule
|
14 |
+
*/
|
15 |
+
class DeleteUsersByUserRoleModule extends UsersModule {
|
16 |
+
/**
|
17 |
+
* Initialize and setup variables.
|
18 |
+
*
|
19 |
+
* @since 5.5
|
20 |
+
*/
|
21 |
+
protected function initialize() {
|
22 |
+
$this->item_type = 'users';
|
23 |
+
$this->field_slug = 'u_role';
|
24 |
+
$this->meta_box_slug = 'bd_users_by_role';
|
25 |
+
$this->action = 'delete_users_by_role';
|
26 |
+
$this->cron_hook = 'do-bulk-delete-users-by-role';
|
27 |
+
$this->scheduler_url = 'https://bulkwp.com/addons/scheduler-for-deleting-users-by-role/?utm_source=wpadmin&utm_campaign=BulkDelete&utm_medium=buynow&utm_content=bd-u-ur';
|
28 |
+
$this->messages = array(
|
29 |
+
'box_label' => __( 'By User Role', 'bulk-delete' ),
|
30 |
+
'scheduled' => __( 'Users from the selected user role are scheduled for deletion.', 'bulk-delete' ),
|
31 |
+
'cron_label' => __( 'Delete Users by User Role', 'bulk-delete' ),
|
32 |
+
);
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Render delete users box.
|
37 |
+
*
|
38 |
+
* @since 5.5
|
39 |
+
*/
|
40 |
+
public function render() {
|
41 |
+
?>
|
42 |
+
<h4><?php _e( 'Select the user roles from which you want to delete users', 'bulk-delete' ); ?></h4>
|
43 |
+
|
44 |
+
<fieldset class="options">
|
45 |
+
<table class="optiontable">
|
46 |
+
<?php $this->render_user_role_dropdown( true ); ?>
|
47 |
+
</table>
|
48 |
+
|
49 |
+
<table class="optiontable">
|
50 |
+
<?php
|
51 |
+
$this->render_filtering_table_header();
|
52 |
+
$this->render_user_login_restrict_settings();
|
53 |
+
$this->render_user_with_no_posts_settings();
|
54 |
+
$this->render_limit_settings();
|
55 |
+
$this->render_post_reassign_settings();
|
56 |
+
$this->render_cron_settings();
|
57 |
+
?>
|
58 |
+
</table>
|
59 |
+
</fieldset>
|
60 |
+
<?php
|
61 |
+
$this->render_submit_button();
|
62 |
+
}
|
63 |
+
|
64 |
+
protected function convert_user_input_to_options( $request, $options ) {
|
65 |
+
$selected_roles = bd_array_get( $request, 'smbd_' . $this->field_slug . '_roles', array() );
|
66 |
+
|
67 |
+
$key = array_search( 'none', $selected_roles, true );
|
68 |
+
if ( false !== $key ) {
|
69 |
+
unset( $selected_roles[ $key ] );
|
70 |
+
$options['delete_users_with_no_role'] = true;
|
71 |
+
}
|
72 |
+
|
73 |
+
$options['selected_roles'] = $selected_roles;
|
74 |
+
|
75 |
+
return $options;
|
76 |
+
}
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Handle both users with roles and without roles.
|
80 |
+
*
|
81 |
+
* {@inheritdoc}
|
82 |
+
*
|
83 |
+
* @param array $options Array of Delete options.
|
84 |
+
*
|
85 |
+
* @return int Number of items that were deleted.
|
86 |
+
*/
|
87 |
+
protected function do_delete( $options ) {
|
88 |
+
$users_with_roles_deleted = parent::do_delete( $options );
|
89 |
+
|
90 |
+
if ( ! isset( $options['delete_users_with_no_role'] ) ) {
|
91 |
+
return $users_with_roles_deleted;
|
92 |
+
}
|
93 |
+
|
94 |
+
return $users_with_roles_deleted + $this->delete_users_with_no_roles( $options );
|
95 |
+
}
|
96 |
+
|
97 |
+
/**
|
98 |
+
* Delete users with no roles.
|
99 |
+
*
|
100 |
+
* @since 6.0.0
|
101 |
+
*
|
102 |
+
* @param array $options User options.
|
103 |
+
*
|
104 |
+
* @return int Number of users that were deleted.
|
105 |
+
*/
|
106 |
+
protected function delete_users_with_no_roles( $options ) {
|
107 |
+
$query = $this->build_query_for_deleting_users_with_no_roles( $options );
|
108 |
+
|
109 |
+
if ( empty( $query ) ) {
|
110 |
+
// Short circuit deletion, if nothing needs to be deleted.
|
111 |
+
return 0;
|
112 |
+
}
|
113 |
+
|
114 |
+
$query = $this->exclude_users_from_deletion( $query );
|
115 |
+
$query = $this->exclude_current_user( $query );
|
116 |
+
|
117 |
+
return $this->delete_users_from_query( $query, $options );
|
118 |
+
}
|
119 |
+
|
120 |
+
/**
|
121 |
+
* Build query params for WP_User_Query by using delete options for deleting users with no roles.
|
122 |
+
*
|
123 |
+
* Return an empty query array to short-circuit deletion.
|
124 |
+
*
|
125 |
+
* @since 6.0.0
|
126 |
+
*
|
127 |
+
* @param array $options Delete options.
|
128 |
+
*
|
129 |
+
* @return array Query.
|
130 |
+
*/
|
131 |
+
protected function build_query_for_deleting_users_with_no_roles( $options ) {
|
132 |
+
// Users with no role is not selected.
|
133 |
+
if ( ! isset( $options['delete_users_with_no_role'] ) || ! $options['delete_users_with_no_role'] ) {
|
134 |
+
return array();
|
135 |
+
}
|
136 |
+
|
137 |
+
$roles = get_editable_roles();
|
138 |
+
$role_names = array_keys( $roles );
|
139 |
+
|
140 |
+
$query = array(
|
141 |
+
'role__not_in' => $role_names,
|
142 |
+
'number' => $options['limit_to'],
|
143 |
+
);
|
144 |
+
|
145 |
+
$date_query = $this->get_date_query( $options );
|
146 |
+
|
147 |
+
if ( ! empty( $date_query ) ) {
|
148 |
+
$query['date_query'] = $date_query;
|
149 |
+
}
|
150 |
+
|
151 |
+
return $query;
|
152 |
+
}
|
153 |
+
|
154 |
+
/**
|
155 |
+
* Build query params for WP_User_Query by using delete options.
|
156 |
+
*
|
157 |
+
* Return an empty query array to short-circuit deletion.
|
158 |
+
*
|
159 |
+
* @since 6.0.0
|
160 |
+
*
|
161 |
+
* @param array $options Delete options.
|
162 |
+
*
|
163 |
+
* @return array Query.
|
164 |
+
*/
|
165 |
+
protected function build_query( $options ) {
|
166 |
+
// No role is selected.
|
167 |
+
if ( empty( $options['selected_roles'] ) ) {
|
168 |
+
return array();
|
169 |
+
}
|
170 |
+
|
171 |
+
$query = array(
|
172 |
+
'role__in' => $options['selected_roles'],
|
173 |
+
'number' => $options['limit_to'],
|
174 |
+
);
|
175 |
+
|
176 |
+
$date_query = $this->get_date_query( $options );
|
177 |
+
|
178 |
+
if ( ! empty( $date_query ) ) {
|
179 |
+
$query['date_query'] = $date_query;
|
180 |
+
}
|
181 |
+
|
182 |
+
return $query;
|
183 |
+
}
|
184 |
+
|
185 |
+
protected function append_to_js_array( $js_array ) {
|
186 |
+
$js_array['validators'][ $this->action ] = 'validateUserRole';
|
187 |
+
|
188 |
+
$js_array['pre_action_msg'][ $this->action ] = 'deleteUsersWarning';
|
189 |
+
$js_array['msg']['deleteUsersWarning'] = __( 'Are you sure you want to delete all the users from the selected user role?', 'bulk-delete' );
|
190 |
+
|
191 |
+
$js_array['error_msg'][ $this->action ] = 'selectOneUserRole';
|
192 |
+
$js_array['msg']['selectOneUserRole'] = __( 'Select at least one user role from which users should be deleted', 'bulk-delete' );
|
193 |
+
|
194 |
+
return $js_array;
|
195 |
+
}
|
196 |
+
|
197 |
+
protected function get_success_message( $items_deleted ) {
|
198 |
+
/* translators: 1 Number of users deleted */
|
199 |
+
return _n( 'Deleted %d user from the selected roles', 'Deleted %d users from the selected roles', $items_deleted, 'bulk-delete' );
|
200 |
+
}
|
201 |
+
}
|
include/Core/Users/UsersModule.php
ADDED
@@ -0,0 +1,398 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Core\Users;
|
4 |
+
|
5 |
+
use BulkWP\BulkDelete\Core\Base\BaseModule;
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Encapsulates the Bulk Delete User Meta box Module Logic.
|
11 |
+
* All Bulk Delete User Meta box Modules should extend this class.
|
12 |
+
*
|
13 |
+
* @see BaseModule
|
14 |
+
* @since 5.5.2
|
15 |
+
* @since 6.0.0 Renamed to UsersModule.
|
16 |
+
*/
|
17 |
+
abstract class UsersModule extends BaseModule {
|
18 |
+
/**
|
19 |
+
* Build query params for WP_User_Query by using delete options.
|
20 |
+
*
|
21 |
+
* Return an empty query array to short-circuit deletion.
|
22 |
+
*
|
23 |
+
* @since 6.0.0
|
24 |
+
*
|
25 |
+
* @param array $options Delete options.
|
26 |
+
*
|
27 |
+
* @return array Query.
|
28 |
+
*/
|
29 |
+
abstract protected function build_query( $options );
|
30 |
+
|
31 |
+
protected function parse_common_filters( $request ) {
|
32 |
+
$options = array();
|
33 |
+
|
34 |
+
$options['login_restrict'] = bd_array_get_bool( $request, "smbd_{$this->field_slug}_login_restrict", false );
|
35 |
+
$options['login_days'] = absint( bd_array_get( $request, "smbd_{$this->field_slug}_login_days", 0 ) );
|
36 |
+
|
37 |
+
$options['registered_restrict'] = bd_array_get_bool( $request, "smbd_{$this->field_slug}_registered_restrict", false );
|
38 |
+
$options['registered_date_op'] = bd_array_get( $request, 'smbd_' . $this->field_slug . '_op' );
|
39 |
+
$options['registered_days'] = absint( bd_array_get( $request, "smbd_{$this->field_slug}_registered_days", 0 ) );
|
40 |
+
|
41 |
+
$options['no_posts'] = bd_array_get_bool( $request, "smbd_{$this->field_slug}_no_posts", false );
|
42 |
+
$options['no_posts_post_types'] = bd_array_get( $request, "smbd_{$this->field_slug}_no_post_post_types", array() );
|
43 |
+
|
44 |
+
$options['reassign_user'] = bd_array_get_bool( $request, "smbd_{$this->field_slug}_post_reassign", false );
|
45 |
+
$options['reassign_user_id'] = absint( bd_array_get( $request, "smbd_{$this->field_slug}_reassign_user_id", 0 ) );
|
46 |
+
$options['limit_to'] = absint( bd_array_get( $request, "smbd_{$this->field_slug}_limit_to", 0 ) );
|
47 |
+
|
48 |
+
return $options;
|
49 |
+
}
|
50 |
+
|
51 |
+
protected function do_delete( $options ) {
|
52 |
+
$query = $this->build_query( $options );
|
53 |
+
|
54 |
+
if ( empty( $query ) ) {
|
55 |
+
// Short circuit deletion, if nothing needs to be deleted.
|
56 |
+
return 0;
|
57 |
+
}
|
58 |
+
|
59 |
+
$query = $this->exclude_users_from_deletion( $query );
|
60 |
+
$query = $this->exclude_current_user( $query );
|
61 |
+
|
62 |
+
return $this->delete_users_from_query( $query, $options );
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Query and Delete users.
|
67 |
+
*
|
68 |
+
* @since 5.5.2
|
69 |
+
* @access protected
|
70 |
+
*
|
71 |
+
* @param array $query Options to query users.
|
72 |
+
* @param array $options Delete options.
|
73 |
+
*
|
74 |
+
* @return int Number of users who were deleted.
|
75 |
+
*/
|
76 |
+
protected function delete_users_from_query( $query, $options ) {
|
77 |
+
$count = 0;
|
78 |
+
$users = $this->query_users( $query );
|
79 |
+
|
80 |
+
if ( ! function_exists( 'wp_delete_user' ) ) {
|
81 |
+
require_once ABSPATH . 'wp-admin/includes/user.php';
|
82 |
+
}
|
83 |
+
|
84 |
+
foreach ( $users as $user ) {
|
85 |
+
if ( ! $this->can_delete_by_logged_date( $options, $user ) ) {
|
86 |
+
continue;
|
87 |
+
}
|
88 |
+
|
89 |
+
if ( ! $this->can_delete_by_post_count( $options, $user ) ) {
|
90 |
+
continue;
|
91 |
+
}
|
92 |
+
|
93 |
+
/**
|
94 |
+
* Can a user be deleted.
|
95 |
+
*
|
96 |
+
* @since 6.0.0
|
97 |
+
*
|
98 |
+
* @param bool Can Delete the User. (Default true)
|
99 |
+
* @param \WP_User $user User Object of the user who is about to be deleted.
|
100 |
+
* @param array $options Delete options.
|
101 |
+
* @param \BulkWP\BulkDelete\Core\Base\BaseModule $this Module that is triggering deletion.
|
102 |
+
*/
|
103 |
+
if ( ! apply_filters( 'bd_can_delete_user', true, $user, $options, $this ) ) {
|
104 |
+
continue;
|
105 |
+
}
|
106 |
+
|
107 |
+
if ( isset( $options['reassign_user'] ) && $options['reassign_user'] ) {
|
108 |
+
$deleted = wp_delete_user( $user->ID, $options['reassign_user_id'] );
|
109 |
+
} else {
|
110 |
+
$deleted = wp_delete_user( $user->ID );
|
111 |
+
}
|
112 |
+
|
113 |
+
if ( $deleted ) {
|
114 |
+
$count ++;
|
115 |
+
}
|
116 |
+
}
|
117 |
+
|
118 |
+
return $count;
|
119 |
+
}
|
120 |
+
|
121 |
+
/**
|
122 |
+
* Query users using options.
|
123 |
+
*
|
124 |
+
* @param array $options Query options.
|
125 |
+
*
|
126 |
+
* @return \WP_User[] List of users.
|
127 |
+
*/
|
128 |
+
protected function query_users( $options ) {
|
129 |
+
$defaults = array(
|
130 |
+
'count_total' => false,
|
131 |
+
);
|
132 |
+
|
133 |
+
$options = wp_parse_args( $options, $defaults );
|
134 |
+
|
135 |
+
$wp_user_query = new \WP_User_Query( $options );
|
136 |
+
|
137 |
+
/**
|
138 |
+
* This action before the query happens.
|
139 |
+
*
|
140 |
+
* @since 6.0.0
|
141 |
+
*
|
142 |
+
* @param \WP_User_Query $wp_user_query Query object.
|
143 |
+
*/
|
144 |
+
do_action( 'bd_before_query', $wp_user_query );
|
145 |
+
|
146 |
+
$users = (array) $wp_user_query->get_results();
|
147 |
+
|
148 |
+
/**
|
149 |
+
* This action runs after the query happens.
|
150 |
+
*
|
151 |
+
* @since 6.0.0
|
152 |
+
*
|
153 |
+
* @param \WP_User_Query $wp_user_query Query object.
|
154 |
+
*/
|
155 |
+
do_action( 'bd_after_query', $wp_user_query );
|
156 |
+
|
157 |
+
return $users;
|
158 |
+
}
|
159 |
+
|
160 |
+
/**
|
161 |
+
* Can the user be deleted based on the 'post count' option?
|
162 |
+
*
|
163 |
+
* This doesn't work well in batches.
|
164 |
+
*
|
165 |
+
* @link https://github.com/sudar/bulk-delete/issues/511 Github issue.
|
166 |
+
* @since 5.5.2
|
167 |
+
* @access protected
|
168 |
+
*
|
169 |
+
* @param array $delete_options Delete Options.
|
170 |
+
* @param \WP_User $user User object that needs to be deleted.
|
171 |
+
*
|
172 |
+
* @return bool True if the user can be deleted, false otherwise.
|
173 |
+
*/
|
174 |
+
protected function can_delete_by_post_count( $delete_options, $user ) {
|
175 |
+
return ! (
|
176 |
+
$delete_options['no_posts'] &&
|
177 |
+
count_user_posts( $user->ID, $delete_options['no_posts_post_types'] ) > 0
|
178 |
+
);
|
179 |
+
}
|
180 |
+
|
181 |
+
/**
|
182 |
+
* Get the date query part for WP_User_Query.
|
183 |
+
*
|
184 |
+
* Date query corresponds to user registered date.
|
185 |
+
*
|
186 |
+
* @since 6.0.0
|
187 |
+
*
|
188 |
+
* @param array $options Delete options.
|
189 |
+
*
|
190 |
+
* @return array Date Query.
|
191 |
+
*/
|
192 |
+
protected function get_date_query( $options ) {
|
193 |
+
if ( ! $options['registered_restrict'] ) {
|
194 |
+
return array();
|
195 |
+
}
|
196 |
+
|
197 |
+
if ( $options['registered_days'] <= 0 ) {
|
198 |
+
return array();
|
199 |
+
}
|
200 |
+
|
201 |
+
if ( ! isset( $options['registered_date_op'] ) ) {
|
202 |
+
return array(
|
203 |
+
'before' => $options['registered_days'] . ' days ago',
|
204 |
+
);
|
205 |
+
}
|
206 |
+
|
207 |
+
if ( 'before' === $options['registered_date_op'] || 'after' === $options['registered_date_op'] ) {
|
208 |
+
return array(
|
209 |
+
$options['registered_date_op'] => $options['registered_days'] . ' days ago',
|
210 |
+
);
|
211 |
+
}
|
212 |
+
|
213 |
+
return array();
|
214 |
+
}
|
215 |
+
|
216 |
+
/**
|
217 |
+
* Can the user be deleted based on the 'logged in date' option?
|
218 |
+
*
|
219 |
+
* This doesn't work well in batches.
|
220 |
+
*
|
221 |
+
* @link https://github.com/sudar/bulk-delete/issues/511 Github issue.
|
222 |
+
* @since 5.5.2
|
223 |
+
* @access protected
|
224 |
+
*
|
225 |
+
* @param array $delete_options Delete Options.
|
226 |
+
* @param \WP_User $user User object that needs to be deleted.
|
227 |
+
*
|
228 |
+
* @return bool True if the user can be deleted, false otherwise.
|
229 |
+
*/
|
230 |
+
protected function can_delete_by_logged_date( $delete_options, $user ) {
|
231 |
+
if ( $delete_options['login_restrict'] ) {
|
232 |
+
$login_days = $delete_options['login_days'];
|
233 |
+
$last_login = bd_get_last_login( $user->ID );
|
234 |
+
|
235 |
+
if ( null !== $last_login ) {
|
236 |
+
// we have a logged-in entry for the user in simple login log plugin.
|
237 |
+
if ( strtotime( $last_login ) > strtotime( '-' . $login_days . 'days' ) ) {
|
238 |
+
return false;
|
239 |
+
}
|
240 |
+
} else {
|
241 |
+
// we don't have a logged-in entry for the user in simple login log plugin.
|
242 |
+
if ( $login_days > 0 ) {
|
243 |
+
// non-zero value for login date. So don't delete this user.
|
244 |
+
return false;
|
245 |
+
}
|
246 |
+
}
|
247 |
+
}
|
248 |
+
|
249 |
+
return true;
|
250 |
+
}
|
251 |
+
|
252 |
+
/**
|
253 |
+
* Render User Login restrict settings.
|
254 |
+
*
|
255 |
+
* @since 5.5
|
256 |
+
*/
|
257 |
+
protected function render_user_login_restrict_settings() {
|
258 |
+
?>
|
259 |
+
<tr>
|
260 |
+
<td scope="row" colspan="2">
|
261 |
+
<label for="smbd_<?php echo esc_attr( $this->field_slug ); ?>_registered_restrict">
|
262 |
+
<input name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_registered_restrict" id="smbd_<?php echo esc_attr( $this->field_slug ); ?>_registered_restrict" value="true" type="checkbox">
|
263 |
+
<?php _e( 'Restrict to users who are registered in the site ', 'bulk-delete' ); ?>
|
264 |
+
</label>
|
265 |
+
<select name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_op" id="smbd_<?php echo esc_attr( $this->field_slug ); ?>_op" disabled>
|
266 |
+
<option value="before"><?php _e( 'for at least', 'bulk-delete' ); ?></option>
|
267 |
+
<option value="after"><?php _e( 'in the last', 'bulk-delete' ); ?></option>
|
268 |
+
</select>
|
269 |
+
<input type="number" name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_registered_days" id="smbd_<?php echo esc_attr( $this->field_slug ); ?>_registered_days" class="screen-per-page" disabled value="0" min="0"><?php _e( ' days.', 'bulk-delete' ); ?>
|
270 |
+
</td>
|
271 |
+
</tr>
|
272 |
+
<tr>
|
273 |
+
<td scope="row" colspan="2">
|
274 |
+
<label>
|
275 |
+
<input name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_login_restrict" id="smbd_<?php echo esc_attr( $this->field_slug ); ?>_login_restrict"
|
276 |
+
value="true" type="checkbox" <?php disabled( false, bd_is_simple_login_log_present() ); ?>>
|
277 |
+
<?php _e( 'Restrict to users who have not logged in the last ', 'bulk-delete' ); ?>
|
278 |
+
</label>
|
279 |
+
<input type="number" name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_login_days" id="smbd_<?php echo esc_attr( $this->field_slug ); ?>_login_days" class="screen-per-page" value="0" min="0" disabled> <?php _e( 'days', 'bulk-delete' ); ?>.
|
280 |
+
|
281 |
+
<?php if ( ! bd_is_simple_login_log_present() ) : ?>
|
282 |
+
<span style = "color:red">
|
283 |
+
<?php _e( 'Need the free "Simple Login Log" Plugin', 'bulk-delete' ); ?> <a href = "https://wordpress.org/plugins/simple-login-log/">Install now</a>
|
284 |
+
</span>
|
285 |
+
<?php endif; ?>
|
286 |
+
</td>
|
287 |
+
</tr>
|
288 |
+
|
289 |
+
<?php if ( bd_is_simple_login_log_present() ) : ?>
|
290 |
+
<tr>
|
291 |
+
<td scope="row" colspan="2">
|
292 |
+
<?php _e( 'Enter "0 days" to delete users who have never logged in after the "Simple Login Log" plugin has been installed.', 'bulk-delete' ); ?>
|
293 |
+
</tr>
|
294 |
+
<?php endif; ?>
|
295 |
+
<?php
|
296 |
+
}
|
297 |
+
|
298 |
+
/**
|
299 |
+
* Render delete user with no posts settings.
|
300 |
+
*
|
301 |
+
* @since 5.5
|
302 |
+
*/
|
303 |
+
protected function render_user_with_no_posts_settings() {
|
304 |
+
?>
|
305 |
+
<tr>
|
306 |
+
<td scope="row" colspan="2">
|
307 |
+
<input type="checkbox" value="true"
|
308 |
+
name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_no_posts"
|
309 |
+
id="smbd_<?php echo esc_attr( $this->field_slug ); ?>_no_posts" class="user_restrict_to_no_posts_filter">
|
310 |
+
<label for="smbd_<?php echo esc_attr( $this->field_slug ); ?>_no_posts">
|
311 |
+
<?php _e( "Restrict to users who don't have any posts.", 'bulk-delete' ); ?>
|
312 |
+
</label>
|
313 |
+
</td>
|
314 |
+
</tr>
|
315 |
+
|
316 |
+
<tr class="user_restrict_to_no_posts_filter_items visually-hidden">
|
317 |
+
<td scope="row" colspan="2">
|
318 |
+
<table class="filter-items">
|
319 |
+
<tr>
|
320 |
+
<td scope="row">
|
321 |
+
<?php _e( 'Select the post types. By default all post types are considered.', 'bulk-delete' ); ?>
|
322 |
+
</td>
|
323 |
+
</tr>
|
324 |
+
|
325 |
+
<?php $this->render_post_type_checkboxes( "smbd_{$this->field_slug}_no_post_post_types" ); ?>
|
326 |
+
</table>
|
327 |
+
</td>
|
328 |
+
</tr>
|
329 |
+
|
330 |
+
<?php
|
331 |
+
}
|
332 |
+
|
333 |
+
/**
|
334 |
+
* Get unique user meta keys.
|
335 |
+
*
|
336 |
+
* @since 5.5
|
337 |
+
*
|
338 |
+
* @return array List of unique meta keys.
|
339 |
+
*/
|
340 |
+
protected function get_unique_user_meta_keys() {
|
341 |
+
global $wpdb;
|
342 |
+
|
343 |
+
return $wpdb->get_col( "SELECT DISTINCT(meta_key) FROM {$wpdb->prefix}usermeta ORDER BY meta_key" );
|
344 |
+
}
|
345 |
+
|
346 |
+
/**
|
347 |
+
* Exclude current user from being deleted.
|
348 |
+
*
|
349 |
+
* @param array $query WP_User_Query args.
|
350 |
+
*
|
351 |
+
* @return array Modified query args.
|
352 |
+
*/
|
353 |
+
protected function exclude_current_user( $query ) {
|
354 |
+
$current_user_id = get_current_user_id();
|
355 |
+
|
356 |
+
if ( $current_user_id <= 0 ) {
|
357 |
+
return $query;
|
358 |
+
}
|
359 |
+
|
360 |
+
if ( isset( $query['exclude'] ) ) {
|
361 |
+
$query['exclude'] = array_merge( $query['exclude'], array( $current_user_id ) );
|
362 |
+
} else {
|
363 |
+
$query['exclude'] = array( $current_user_id );
|
364 |
+
}
|
365 |
+
|
366 |
+
return $query;
|
367 |
+
}
|
368 |
+
|
369 |
+
/**
|
370 |
+
* Exclude users from deletion.
|
371 |
+
*
|
372 |
+
* @since 6.0.0
|
373 |
+
*
|
374 |
+
* @param array $query Pre-built query.
|
375 |
+
*
|
376 |
+
* @return array Modified query.
|
377 |
+
*/
|
378 |
+
protected function exclude_users_from_deletion( array $query ) {
|
379 |
+
/**
|
380 |
+
* Filter the list of user ids that will be excluded from deletion.
|
381 |
+
*
|
382 |
+
* @since 6.0.0
|
383 |
+
*
|
384 |
+
* @param array $excluded_ids User IDs to be excluded during deletion.
|
385 |
+
*/
|
386 |
+
$excluded_user_ids = apply_filters( 'bd_excluded_user_ids', array() );
|
387 |
+
|
388 |
+
if ( is_array( $excluded_user_ids ) && ! empty( $excluded_user_ids ) ) {
|
389 |
+
if ( isset( $query['exclude'] ) ) {
|
390 |
+
$query['exclude'] = array_merge( $query['exclude'], $excluded_user_ids );
|
391 |
+
} else {
|
392 |
+
$query['exclude'] = $excluded_user_ids;
|
393 |
+
}
|
394 |
+
}
|
395 |
+
|
396 |
+
return $query;
|
397 |
+
}
|
398 |
+
}
|
include/Deprecated/Addons/DeleteFromTrashModule.php
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Deprecated\Addons;
|
4 |
+
|
5 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Adds backward compatibility for Bulk Delete From Trash add-on v0.3 or below.
|
9 |
+
*
|
10 |
+
* This module will eventually be removed once the add-on is updated.
|
11 |
+
*
|
12 |
+
* @since 6.0.0
|
13 |
+
*/
|
14 |
+
class DeleteFromTrashModule extends DeprecatedModule {
|
15 |
+
protected function initialize() {
|
16 |
+
$this->addon_class_name = 'Bulk_Delete_From_Trash';
|
17 |
+
$this->addon_slug = 'bulk-delete-from-trash';
|
18 |
+
|
19 |
+
$this->item_type = 'posts';
|
20 |
+
$this->field_slug = 'trash';
|
21 |
+
$this->meta_box_slug = 'bd_posts_from_trash';
|
22 |
+
$this->action = 'delete_pages_from_trash';
|
23 |
+
$this->cron_hook = '';
|
24 |
+
$this->scheduler_url = '';
|
25 |
+
$this->messages = array(
|
26 |
+
'box_label' => __( 'Delete Posts from Trash', 'bulk-delete' ),
|
27 |
+
'scheduled' => '',
|
28 |
+
'cron_label' => '',
|
29 |
+
);
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Set the item type of the module.
|
34 |
+
* The item type determines in which page the module will be displayed.
|
35 |
+
*
|
36 |
+
* @param string $item_type Item type. Possible vales are posts or pages.
|
37 |
+
*/
|
38 |
+
public function set_item_type( $item_type ) {
|
39 |
+
$this->item_type = $item_type;
|
40 |
+
$this->action = "delete_{$item_type}_from_trash";
|
41 |
+
$this->meta_box_slug = "bd_{$item_type}_from_trash";
|
42 |
+
|
43 |
+
if ( 'pages' === $item_type ) {
|
44 |
+
$this->messages['box_label'] = __( 'Delete Pages from Trash', 'bulk-delete' );
|
45 |
+
}
|
46 |
+
}
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Call the appropriate action to render the add-on.
|
50 |
+
*/
|
51 |
+
public function render() {
|
52 |
+
if ( 'posts' === $this->item_type ) {
|
53 |
+
/**
|
54 |
+
* Render delete posts from trash box.
|
55 |
+
*
|
56 |
+
* @since 5.4
|
57 |
+
*/
|
58 |
+
do_action( 'bd_render_delete_posts_from_trash' );
|
59 |
+
} elseif ( 'pages' === $this->item_type ) {
|
60 |
+
/**
|
61 |
+
* Render delete pages from trash box.
|
62 |
+
*
|
63 |
+
* @since 5.4
|
64 |
+
*/
|
65 |
+
do_action( 'bd_render_delete_pages_from_trash' );
|
66 |
+
}
|
67 |
+
}
|
68 |
+
}
|
include/Deprecated/Addons/DeletePostsByAttachmentModule.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Deprecated\Addons;
|
4 |
+
|
5 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Adds backward compatibility for Bulk Delete Posts By Attachment add-on v0.1 or below.
|
9 |
+
*
|
10 |
+
* This module will eventually be removed once the add-on is updated.
|
11 |
+
*
|
12 |
+
* @since 6.0.0
|
13 |
+
*/
|
14 |
+
class DeletePostsByAttachmentModule extends DeprecatedModule {
|
15 |
+
protected function initialize() {
|
16 |
+
$this->addon_class_name = 'Bulk_Delete_Posts_By_Attachment';
|
17 |
+
$this->addon_slug = 'bulk-delete-posts-by-attachment';
|
18 |
+
|
19 |
+
$this->item_type = 'posts';
|
20 |
+
$this->field_slug = '';
|
21 |
+
$this->meta_box_slug = 'bd-posts-by-attachment';
|
22 |
+
$this->action = 'bd_delete_posts_by_attachment';
|
23 |
+
$this->cron_hook = '';
|
24 |
+
$this->scheduler_url = '';
|
25 |
+
$this->messages = array(
|
26 |
+
'box_label' => __( 'Delete Posts By Attachment', 'bulk-delete' ),
|
27 |
+
'scheduled' => '',
|
28 |
+
'cron_label' => '',
|
29 |
+
);
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Call the render method of the add-on.
|
34 |
+
*/
|
35 |
+
public function render() {
|
36 |
+
\Bulk_Delete_Posts_By_Attachment::render_meta_box();
|
37 |
+
}
|
38 |
+
}
|
include/Deprecated/Addons/DeletePostsByContentModule.php
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Deprecated\Addons;
|
4 |
+
|
5 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Adds backward compatibility for Bulk Delete Posts By Content add-on v1.0.0 or below.
|
9 |
+
*
|
10 |
+
* This module will eventually be removed once the add-on is updated.
|
11 |
+
*
|
12 |
+
* @since 6.0.0
|
13 |
+
*/
|
14 |
+
class DeletePostsByContentModule extends DeprecatedModule {
|
15 |
+
protected function initialize() {
|
16 |
+
$this->addon_class_name = 'Bulk_Delete_Posts_By_Content';
|
17 |
+
$this->addon_slug = 'bulk-delete-posts-by-content';
|
18 |
+
|
19 |
+
$this->item_type = 'posts';
|
20 |
+
$this->field_slug = '';
|
21 |
+
$this->meta_box_slug = 'bd-posts-by-content';
|
22 |
+
$this->action = 'bd_delete_posts_by_content';
|
23 |
+
$this->cron_hook = '';
|
24 |
+
$this->scheduler_url = '';
|
25 |
+
$this->messages = array(
|
26 |
+
'box_label' => __( 'Delete Posts By Content', 'bulk-delete' ),
|
27 |
+
'scheduled' => '',
|
28 |
+
'cron_label' => '',
|
29 |
+
);
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Call the render method of the add-on.
|
34 |
+
*/
|
35 |
+
public function render() {
|
36 |
+
$module = new \Bulk_Delete_Posts_By_Content();
|
37 |
+
$module->render_meta_box();
|
38 |
+
}
|
39 |
+
}
|
include/Deprecated/Addons/DeletePostsByCustomFieldModule.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Deprecated\Addons;
|
4 |
+
|
5 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Adds backward compatibility for Bulk Delete Posts By Custom Field add-on v1.0 or below.
|
9 |
+
*
|
10 |
+
* This module will eventually be removed once the add-on is updated.
|
11 |
+
*
|
12 |
+
* @since 6.0.0
|
13 |
+
*/
|
14 |
+
class DeletePostsByCustomFieldModule extends DeprecatedModule {
|
15 |
+
protected function initialize() {
|
16 |
+
$this->addon_class_name = 'Bulk_Delete_Posts_By_Custom_Field';
|
17 |
+
$this->addon_slug = 'bulk-delete-posts-by-custom-field';
|
18 |
+
|
19 |
+
$this->item_type = 'posts';
|
20 |
+
$this->field_slug = 'custom-field';
|
21 |
+
$this->meta_box_slug = 'bd_by_custom_field';
|
22 |
+
$this->action = 'delete_posts_by_custom_field';
|
23 |
+
$this->cron_hook = '';
|
24 |
+
$this->scheduler_url = '';
|
25 |
+
$this->messages = array(
|
26 |
+
'box_label' => __( 'Delete Posts By Custom Field', 'bulk-delete' ),
|
27 |
+
'scheduled' => '',
|
28 |
+
'cron_label' => '',
|
29 |
+
);
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Call the render method of the add-on.
|
34 |
+
*/
|
35 |
+
public function render() {
|
36 |
+
\Bulk_Delete_Posts_By_Custom_Field::render_delete_posts_by_custom_field_box();
|
37 |
+
}
|
38 |
+
}
|
include/Deprecated/Addons/DeletePostsByDuplicateTitleModule.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Deprecated\Addons;
|
4 |
+
|
5 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Adds backward compatibility for Bulk Delete Posts By Duplicate Title add-on v0.7 or below.
|
9 |
+
*
|
10 |
+
* This module will eventually be removed once the add-on is updated.
|
11 |
+
*
|
12 |
+
* @since 6.0.0
|
13 |
+
*/
|
14 |
+
class DeletePostsByDuplicateTitleModule extends DeprecatedModule {
|
15 |
+
protected function initialize() {
|
16 |
+
$this->addon_class_name = 'Bulk_Delete_Posts_By_Duplicate_Title';
|
17 |
+
$this->addon_slug = 'bulk-delete-posts-by-duplicate-title';
|
18 |
+
|
19 |
+
$this->item_type = 'posts';
|
20 |
+
$this->field_slug = '';
|
21 |
+
$this->meta_box_slug = 'bd_by_duplicate_title';
|
22 |
+
$this->action = 'delete_posts_by_duplicate_title';
|
23 |
+
$this->cron_hook = '';
|
24 |
+
$this->scheduler_url = '';
|
25 |
+
$this->messages = array(
|
26 |
+
'box_label' => __( 'Delete Posts By Duplicate Title', 'bulk-delete' ),
|
27 |
+
'scheduled' => '',
|
28 |
+
'cron_label' => '',
|
29 |
+
);
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Call the render method of the add-on.
|
34 |
+
*/
|
35 |
+
public function render() {
|
36 |
+
\Bulk_Delete_Posts_By_Duplicate_Title::render_delete_posts_by_duplicate_title_box();
|
37 |
+
}
|
38 |
+
}
|
include/Deprecated/Addons/DeletePostsByTitleModule.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Deprecated\Addons;
|
4 |
+
|
5 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Adds backward compatibility for Bulk Delete Posts By Title add-on v1.0 or below.
|
9 |
+
*
|
10 |
+
* This module will eventually be removed once the add-on is updated.
|
11 |
+
*
|
12 |
+
* @since 6.0.0
|
13 |
+
*/
|
14 |
+
class DeletePostsByTitleModule extends DeprecatedModule {
|
15 |
+
protected function initialize() {
|
16 |
+
$this->addon_class_name = 'Bulk_Delete_Posts_By_Title';
|
17 |
+
$this->addon_slug = 'bulk-delete-posts-by-title';
|
18 |
+
|
19 |
+
$this->item_type = 'posts';
|
20 |
+
$this->field_slug = '';
|
21 |
+
$this->meta_box_slug = 'bd_by_title';
|
22 |
+
$this->action = 'delete_posts_by_title';
|
23 |
+
$this->cron_hook = '';
|
24 |
+
$this->scheduler_url = '';
|
25 |
+
$this->messages = array(
|
26 |
+
'box_label' => __( 'Delete Posts By Title', 'bulk-delete' ),
|
27 |
+
'scheduled' => '',
|
28 |
+
'cron_label' => '',
|
29 |
+
);
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Call the render method of the add-on.
|
34 |
+
*/
|
35 |
+
public function render() {
|
36 |
+
\Bulk_Delete_Posts_By_Title::render_delete_posts_by_title_box();
|
37 |
+
}
|
38 |
+
}
|
include/Deprecated/Addons/DeletePostsByUserModule.php
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Deprecated\Addons;
|
4 |
+
|
5 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Adds backward compatibility for Bulk Delete Posts By User add-on v0.1 or below.
|
9 |
+
*
|
10 |
+
* This module will eventually be removed once the add-on is updated.
|
11 |
+
*
|
12 |
+
* @since 6.0.0
|
13 |
+
*/
|
14 |
+
class DeletePostsByUserModule extends DeprecatedModule {
|
15 |
+
protected function initialize() {
|
16 |
+
$this->addon_class_name = 'Bulk_Delete_Posts_By_User';
|
17 |
+
$this->addon_slug = 'bulk-delete-posts-by-user';
|
18 |
+
|
19 |
+
$this->item_type = 'posts';
|
20 |
+
$this->field_slug = '';
|
21 |
+
$this->meta_box_slug = 'bd-posts-by-user';
|
22 |
+
$this->action = 'bd_delete_posts_by_user';
|
23 |
+
$this->cron_hook = '';
|
24 |
+
$this->scheduler_url = '';
|
25 |
+
$this->messages = array(
|
26 |
+
'box_label' => __( 'Delete Posts By User', 'bulk-delete' ),
|
27 |
+
'scheduled' => '',
|
28 |
+
'cron_label' => '',
|
29 |
+
);
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Call the render method of the add-on.
|
34 |
+
*/
|
35 |
+
public function render() {
|
36 |
+
$module = \Bulk_Delete_Posts_By_User::factory();
|
37 |
+
$module->render_meta_box();
|
38 |
+
}
|
39 |
+
}
|
include/Deprecated/Addons/DeletePostsByUserRoleModule.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Deprecated\Addons;
|
4 |
+
|
5 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Adds backward compatibility for Bulk Delete Posts By User Role add-on v0.5 or below.
|
9 |
+
*
|
10 |
+
* This module will eventually be removed once the add-on is updated.
|
11 |
+
*
|
12 |
+
* @since 6.0.0
|
13 |
+
*/
|
14 |
+
class DeletePostsByUserRoleModule extends DeprecatedModule {
|
15 |
+
protected function initialize() {
|
16 |
+
$this->addon_class_name = 'Bulk_Delete_Posts_By_User_Role';
|
17 |
+
$this->addon_slug = 'bulk-delete-posts-by-user';
|
18 |
+
|
19 |
+
$this->item_type = 'posts';
|
20 |
+
$this->field_slug = '';
|
21 |
+
$this->meta_box_slug = 'bd_post_by_user_role';
|
22 |
+
$this->action = 'delete_posts_by_user_role';
|
23 |
+
$this->cron_hook = '';
|
24 |
+
$this->scheduler_url = '';
|
25 |
+
$this->messages = array(
|
26 |
+
'box_label' => __( 'Delete Posts By User Role', 'bulk-delete' ),
|
27 |
+
'scheduled' => '',
|
28 |
+
'cron_label' => '',
|
29 |
+
);
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Call the render method of the add-on.
|
34 |
+
*/
|
35 |
+
public function render() {
|
36 |
+
\Bulk_Delete_Posts_By_User_Role::render_delete_posts_by_user_role_box();
|
37 |
+
}
|
38 |
+
}
|
include/Deprecated/Addons/DeprecatedModule.php
ADDED
@@ -0,0 +1,106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace BulkWP\BulkDelete\Deprecated\Addons;
|
4 |
+
|
5 |
+
use BulkWP\BulkDelete\Core\Base\BaseModule;
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Base class for all Deprecated Modules.
|
11 |
+
*
|
12 |
+
* This class just extends all the abstract methods with an empty implementation.
|
13 |
+
*
|
14 |
+
* @since 6.0.0
|
15 |
+
*/
|
16 |
+
abstract class DeprecatedModule extends BaseModule {
|
17 |
+
/**
|
18 |
+
* Addon class name of the old add-on that is used to find out whether the old add-on is active or not.
|
19 |
+
*
|
20 |
+
* @var string
|
21 |
+
*/
|
22 |
+
protected $addon_class_name = '';
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Slug of the old add-on.
|
26 |
+
*
|
27 |
+
* @var string
|
28 |
+
*/
|
29 |
+
protected $addon_slug = '';
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Load the deprecated module if the old add-on is active.
|
33 |
+
*
|
34 |
+
* @param \BulkWP\BulkDelete\Core\Base\BaseDeletePage $page Page object.
|
35 |
+
*/
|
36 |
+
public function load_if_needed( $page ) {
|
37 |
+
if ( ! class_exists( $this->addon_class_name ) ) {
|
38 |
+
return;
|
39 |
+
}
|
40 |
+
|
41 |
+
add_filter( 'bd_upsell_addons', array( $this, 'hide_upsell_module' ), 10, 2 );
|
42 |
+
|
43 |
+
$page->add_module( $this );
|
44 |
+
}
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Hide the upsell message if the add-on is active.
|
48 |
+
*
|
49 |
+
* @param array $addon_details Addon Details.
|
50 |
+
* @param string $item_type Item type.
|
51 |
+
*
|
52 |
+
* @return array Modified list of Addon Details.
|
53 |
+
*/
|
54 |
+
public function hide_upsell_module( $addon_details, $item_type ) {
|
55 |
+
if ( ! class_exists( $this->addon_class_name ) ) {
|
56 |
+
return $addon_details;
|
57 |
+
}
|
58 |
+
|
59 |
+
if ( $this->item_type !== $item_type ) {
|
60 |
+
return $addon_details;
|
61 |
+
}
|
62 |
+
|
63 |
+
$modified_addon_details = array();
|
64 |
+
|
65 |
+
foreach ( $addon_details as $addon_detail ) {
|
66 |
+
if ( ! array_key_exists( 'slug', $addon_detail ) ) {
|
67 |
+
continue;
|
68 |
+
}
|
69 |
+
|
70 |
+
if ( $this->addon_slug === $addon_detail['slug'] ) {
|
71 |
+
continue;
|
72 |
+
}
|
73 |
+
|
74 |
+
$modified_addon_details[] = $addon_detail;
|
75 |
+
}
|
76 |
+
|
77 |
+
return $modified_addon_details;
|
78 |
+
}
|
79 |
+
|
80 |
+
/**
|
81 |
+
* Don't do any processing here.
|
82 |
+
*
|
83 |
+
* It is currently handled in the add-on.
|
84 |
+
*
|
85 |
+
* @param array $request Request object.
|
86 |
+
*/
|
87 |
+
public function process( $request ) {
|
88 |
+
// Empty by design. Processing of data happens in the add-on.
|
89 |
+
}
|
90 |
+
|
91 |
+
protected function parse_common_filters( $request ) {
|
92 |
+
return array();
|
93 |
+
}
|
94 |
+
|
95 |
+
protected function convert_user_input_to_options( $request, $options ) {
|
96 |
+
return $options;
|
97 |
+
}
|
98 |
+
|
99 |
+
protected function do_delete( $options ) {
|
100 |
+
// Empty by design.
|
101 |
+
}
|
102 |
+
|
103 |
+
protected function get_success_message( $items_deleted ) {
|
104 |
+
// Empty by design.
|
105 |
+
}
|
106 |
+
}
|
include/Deprecated/Bulk_Delete_Users_By_User_Meta.php
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
use BulkWP\BulkDelete\Core\Users\Modules\DeleteUsersByUserMetaModule;
|
4 |
+
|
5 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Adds backward compatibility for Scheduler for Deleting Users By User Meta add-on v1.0 or below.
|
9 |
+
*
|
10 |
+
* This class will eventually be removed once the add-on is updated.
|
11 |
+
*
|
12 |
+
* @since 6.0.0
|
13 |
+
*/
|
14 |
+
class Bulk_Delete_Users_By_User_Meta {
|
15 |
+
private static $module;
|
16 |
+
|
17 |
+
public static function factory() {
|
18 |
+
self::$module = new DeleteUsersByUserMetaModule();
|
19 |
+
|
20 |
+
return self::$module;
|
21 |
+
}
|
22 |
+
}
|
include/Deprecated/class-bd-addon.php
ADDED
@@ -0,0 +1,145 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Base class for all BD Addons.
|
4 |
+
*
|
5 |
+
* @since 5.5
|
6 |
+
* @deprecated 6.0.0 Use \BulkWP\BulkDelete\Core\Addon\BaseAddon instead.
|
7 |
+
*
|
8 |
+
* @author Sudar
|
9 |
+
*
|
10 |
+
* @package BulkDelete\Addons\Base
|
11 |
+
*/
|
12 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Base class for BD Addons.
|
16 |
+
*
|
17 |
+
* @abstract
|
18 |
+
*
|
19 |
+
* @since 5.5
|
20 |
+
*/
|
21 |
+
abstract class BD_Addon {
|
22 |
+
/**
|
23 |
+
* @var string Addon Name.
|
24 |
+
*/
|
25 |
+
protected $addon_name;
|
26 |
+
|
27 |
+
/**
|
28 |
+
* @var string Addon Code.
|
29 |
+
*/
|
30 |
+
protected $addon_code;
|
31 |
+
|
32 |
+
/**
|
33 |
+
* @var string Addon File.
|
34 |
+
*/
|
35 |
+
protected $addon_file;
|
36 |
+
|
37 |
+
/**
|
38 |
+
* @var string Addon Version.
|
39 |
+
*/
|
40 |
+
protected $addon_version;
|
41 |
+
|
42 |
+
/**
|
43 |
+
* @var string Addon Author.
|
44 |
+
*/
|
45 |
+
protected $addon_author = 'Sudar Muthu';
|
46 |
+
|
47 |
+
/**
|
48 |
+
* @var Module Name.
|
49 |
+
*/
|
50 |
+
protected $module;
|
51 |
+
|
52 |
+
/**
|
53 |
+
* @var object License Handler.
|
54 |
+
*/
|
55 |
+
protected $license_handler;
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Initialize and setup variables.
|
59 |
+
*
|
60 |
+
* @since 5.5
|
61 |
+
* @abstract
|
62 |
+
*
|
63 |
+
* @return void
|
64 |
+
*/
|
65 |
+
abstract protected function initialize();
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Use `factory()` method to create instance of this class.
|
69 |
+
* Don't create instances directly.
|
70 |
+
*
|
71 |
+
* @since 5.5
|
72 |
+
* @see factory()
|
73 |
+
*/
|
74 |
+
public function __construct() {
|
75 |
+
$this->setup();
|
76 |
+
}
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Setup the module.
|
80 |
+
*
|
81 |
+
* @access protected
|
82 |
+
*
|
83 |
+
* @since 5.5
|
84 |
+
*/
|
85 |
+
protected function setup() {
|
86 |
+
$this->initialize();
|
87 |
+
$this->setup_translation();
|
88 |
+
if ( $this->dependencies_met() ) {
|
89 |
+
$this->setup_hooks();
|
90 |
+
}
|
91 |
+
}
|
92 |
+
|
93 |
+
/**
|
94 |
+
* Check if all dependencies are met.
|
95 |
+
* To check for dependencies overload this method in the child class.
|
96 |
+
*
|
97 |
+
* @return bool True if dependencies met, False otherwise.
|
98 |
+
*/
|
99 |
+
protected function dependencies_met() {
|
100 |
+
return true;
|
101 |
+
}
|
102 |
+
|
103 |
+
/**
|
104 |
+
* Setup translation.
|
105 |
+
*
|
106 |
+
* @access protected
|
107 |
+
*
|
108 |
+
* @since 5.5
|
109 |
+
*/
|
110 |
+
protected function setup_translation() {
|
111 |
+
$bd = BULK_DELETE();
|
112 |
+
|
113 |
+
// Load translation files from Bulk Delete language folder
|
114 |
+
load_plugin_textdomain( 'bulk-delete', false, $bd->translations );
|
115 |
+
}
|
116 |
+
|
117 |
+
/**
|
118 |
+
* Setup license handler.
|
119 |
+
*
|
120 |
+
* @since 5.5
|
121 |
+
*
|
122 |
+
* @param string $plugin_file Addon file name relative to plugin directory.
|
123 |
+
*/
|
124 |
+
public function setup_license_handler( $plugin_file ) {
|
125 |
+
$this->addon_file = $plugin_file;
|
126 |
+
$this->license_handler = new BD_License_Handler(
|
127 |
+
$this->addon_name,
|
128 |
+
$this->addon_code,
|
129 |
+
$this->addon_version,
|
130 |
+
$this->addon_file,
|
131 |
+
$this->addon_author
|
132 |
+
);
|
133 |
+
}
|
134 |
+
|
135 |
+
/**
|
136 |
+
* Get addon class name.
|
137 |
+
*
|
138 |
+
* @since 5.5
|
139 |
+
*
|
140 |
+
* @return string Addon class name
|
141 |
+
*/
|
142 |
+
protected function get_addon_class_name() {
|
143 |
+
return bd_get_addon_class_name( $this->addon_name );
|
144 |
+
}
|
145 |
+
}
|
include/Deprecated/class-bd-base-addon.php
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Base class for all Base Addons.
|
4 |
+
*
|
5 |
+
* @since 5.5
|
6 |
+
* @deprecated 6.0.0 Use \BulkWP\BulkDelete\Core\Addon\BaseAddon instead.
|
7 |
+
*
|
8 |
+
* @author Sudar
|
9 |
+
*
|
10 |
+
* @package BulkDelete\Addons\Base
|
11 |
+
*/
|
12 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Base class for Base Addons.
|
16 |
+
*
|
17 |
+
* @abstract
|
18 |
+
*
|
19 |
+
* @since 5.5
|
20 |
+
*/
|
21 |
+
abstract class BD_Base_Addon extends BD_Addon {
|
22 |
+
/**
|
23 |
+
* Use `factory()` method to create instance of this class.
|
24 |
+
* Don't create instances directly.
|
25 |
+
*
|
26 |
+
* @since 5.5
|
27 |
+
* @see factory()
|
28 |
+
*/
|
29 |
+
public function __construct() {
|
30 |
+
parent::__construct();
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Setup hooks.
|
35 |
+
* This can be overridden by the child class.
|
36 |
+
*
|
37 |
+
* @since 5.5
|
38 |
+
*/
|
39 |
+
protected function setup_hooks() {
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Getter for cron hook.
|
44 |
+
*
|
45 |
+
* @since 5.5
|
46 |
+
*
|
47 |
+
* @return string Cron hook.
|
48 |
+
*/
|
49 |
+
public function get_cron_hook() {
|
50 |
+
return $this->module->get_cron_hook();
|
51 |
+
}
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Return reference to the module.
|
55 |
+
*
|
56 |
+
* @since 5.5
|
57 |
+
*
|
58 |
+
* @return Module Reference to Module Object
|
59 |
+
*/
|
60 |
+
public function get_module() {
|
61 |
+
return $this->module;
|
62 |
+
}
|
63 |
+
}
|
include/Deprecated/class-bd-scheduler-addon.php
ADDED
@@ -0,0 +1,192 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Base class for all Scheduler Addons.
|
4 |
+
*
|
5 |
+
* @since 5.5
|
6 |
+
* @deprecated 6.0.0 Use \BulkWP\BulkDelete\Core\Addon\SchedulerAddon instead.
|
7 |
+
*
|
8 |
+
* @author Sudar
|
9 |
+
*
|
10 |
+
* @package BulkDelete\Addons\Base
|
11 |
+
*/
|
12 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Base class for Base Addons.
|
16 |
+
*
|
17 |
+
* @abstract
|
18 |
+
*
|
19 |
+
* @since 5.5
|
20 |
+
*/
|
21 |
+
abstract class BD_Scheduler_Addon extends BD_Addon {
|
22 |
+
/**
|
23 |
+
* @var No base addon for this scheduler addon.
|
24 |
+
*/
|
25 |
+
protected $no_base_addon = false;
|
26 |
+
|
27 |
+
/**
|
28 |
+
* @var Base addon name.
|
29 |
+
*/
|
30 |
+
protected $base_addon;
|
31 |
+
|
32 |
+
/**
|
33 |
+
* @var Base addon version.
|
34 |
+
*/
|
35 |
+
protected $base_addon_version;
|
36 |
+
|
37 |
+
/**
|
38 |
+
* @var Base addon class name.
|
39 |
+
*/
|
40 |
+
protected $base_addon_class_name;
|
41 |
+
|
42 |
+
/**
|
43 |
+
* @var Base addon object.
|
44 |
+
*/
|
45 |
+
protected $base_addon_obj;
|
46 |
+
|
47 |
+
/**
|
48 |
+
* @var Cron Hook to run the scheduler on.
|
49 |
+
*/
|
50 |
+
protected $cron_hook;
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Use `factory()` method to create instance of this class.
|
54 |
+
* Don't create instances directly.
|
55 |
+
*
|
56 |
+
* @since 5.5
|
57 |
+
* @see factory()
|
58 |
+
*/
|
59 |
+
public function __construct() {
|
60 |
+
parent::__construct();
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Check if the base addon is available.
|
65 |
+
*
|
66 |
+
* @access protected
|
67 |
+
*
|
68 |
+
* @since 5.5
|
69 |
+
*
|
70 |
+
* @todo check for version as well
|
71 |
+
*
|
72 |
+
* @param string Base Addon class name. Default null. If not specified then it is auto calculated based on addon name.
|
73 |
+
* @param mixed|null $addon_class_name
|
74 |
+
*
|
75 |
+
* @return bool True if base addon is found, False other wise
|
76 |
+
*/
|
77 |
+
protected function check_base_addon( $addon_class_name = null ) {
|
78 |
+
if ( null == $addon_class_name ) {
|
79 |
+
$this->base_addon_class_name = bd_get_addon_class_name( $this->base_addon );
|
80 |
+
} else {
|
81 |
+
$this->base_addon_class_name = $addon_class_name;
|
82 |
+
}
|
83 |
+
|
84 |
+
if ( class_exists( $this->base_addon_class_name ) ) {
|
85 |
+
// Ugly workaround, since we need to support PHP 5.2
|
86 |
+
$this->base_addon_obj = call_user_func( array( $this->base_addon_class_name, 'factory' ) );
|
87 |
+
|
88 |
+
return true;
|
89 |
+
} else {
|
90 |
+
add_action( 'admin_notices', array( $this, 'addon_missing_notice' ) );
|
91 |
+
|
92 |
+
return false;
|
93 |
+
}
|
94 |
+
}
|
95 |
+
|
96 |
+
/**
|
97 |
+
* Show a notice if the base addon is not available.
|
98 |
+
*
|
99 |
+
* @since 5.5
|
100 |
+
*/
|
101 |
+
public function addon_missing_notice() {
|
102 |
+
$campaign_args = array(
|
103 |
+
'utm_source' => 'wpadmin',
|
104 |
+
'utm_campaign' => 'BulkDelete',
|
105 |
+
'utm_medium' => 'header-notice',
|
106 |
+
'utm_content' => $this->addon_code,
|
107 |
+
);
|
108 |
+
$addon_url = bd_get_addon_url( $this->base_addon, $campaign_args );
|
109 |
+
|
110 |
+
printf(
|
111 |
+
'<div class="error"><p>%s</p></div>',
|
112 |
+
sprintf( __( '"%s" addon requires "<a href="%s" target="_blank">%s</a>" addon to be installed and activated!', 'bulk-delete' ), $this->addon_name, $addon_url , $this->base_addon )
|
113 |
+
);
|
114 |
+
}
|
115 |
+
|
116 |
+
/**
|
117 |
+
* Setup hooks.
|
118 |
+
*
|
119 |
+
* @since 5.5
|
120 |
+
*/
|
121 |
+
protected function setup_hooks() {
|
122 |
+
add_filter( 'bd_javascript_array', array( $this, 'filter_js_array' ) );
|
123 |
+
|
124 |
+
$cron_hook = $this->get_cron_hook();
|
125 |
+
if ( ! empty( $cron_hook ) ) {
|
126 |
+
add_action( $cron_hook, array( $this, 'do_delete' ), 10, 1 );
|
127 |
+
}
|
128 |
+
}
|
129 |
+
|
130 |
+
/**
|
131 |
+
* Filter JS Array and add pro hooks.
|
132 |
+
*
|
133 |
+
* @since 5.5
|
134 |
+
*
|
135 |
+
* @param array $js_array JavaScript Array
|
136 |
+
*
|
137 |
+
* @return array Modified JavaScript Array
|
138 |
+
*/
|
139 |
+
public function filter_js_array( $js_array ) {
|
140 |
+
$js_array['pro_iterators'][] = $this->get_module()->get_field_slug();
|
141 |
+
|
142 |
+
return $js_array;
|
143 |
+
}
|
144 |
+
|
145 |
+
/**
|
146 |
+
* Hook handler.
|
147 |
+
*
|
148 |
+
* @since 5.5
|
149 |
+
*
|
150 |
+
* @param array $delete_options
|
151 |
+
*/
|
152 |
+
public function do_delete( $delete_options ) {
|
153 |
+
do_action( 'bd_before_scheduler', $this->addon_name );
|
154 |
+
$count = $this->get_module()->delete( $delete_options );
|
155 |
+
do_action( 'bd_after_scheduler', $this->addon_name, $count );
|
156 |
+
}
|
157 |
+
|
158 |
+
/**
|
159 |
+
* Get the cron hook.
|
160 |
+
*
|
161 |
+
* @access protected
|
162 |
+
*
|
163 |
+
* @since 5.5
|
164 |
+
*
|
165 |
+
* @return string Cron hook.
|
166 |
+
*/
|
167 |
+
protected function get_cron_hook() {
|
168 |
+
$cron_hook = '';
|
169 |
+
if ( null != $this->base_addon_obj ) {
|
170 |
+
$cron_hook = $this->base_addon_obj->get_cron_hook();
|
171 |
+
}
|
172 |
+
|
173 |
+
return $cron_hook;
|
174 |
+
}
|
175 |
+
|
176 |
+
/**
|
177 |
+
* Get base module.
|
178 |
+
*
|
179 |
+
* @access protected
|
180 |
+
*
|
181 |
+
* @since 5.5
|
182 |
+
*
|
183 |
+
* @return object Base module object
|
184 |
+
*/
|
185 |
+
protected function get_module() {
|
186 |
+
if ( $this->no_base_addon ) {
|
187 |
+
return $this->base_addon_obj;
|
188 |
+
} else {
|
189 |
+
return $this->base_addon_obj->get_module();
|
190 |
+
}
|
191 |
+
}
|
192 |
+
}
|
include/Deprecated/class-bulk-delete-pages.php
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
use BulkWP\BulkDelete\Core\Pages\Modules\DeletePagesByStatusModule;
|
4 |
+
|
5 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Utility class for deleting pages.
|
9 |
+
*
|
10 |
+
* All the methods from this class has been migrated to individual metabox module classes.
|
11 |
+
* This class is still present for backward compatibility purpose, since some of the old add-ons still depend on this class.
|
12 |
+
*
|
13 |
+
* @since 6.0.0 Deprecated.
|
14 |
+
*/
|
15 |
+
class Bulk_Delete_Pages {
|
16 |
+
/**
|
17 |
+
* Delete Pages by post status - drafts, pending posts, scheduled posts etc.
|
18 |
+
*
|
19 |
+
* @since 5.0
|
20 |
+
* @since 6.0.0 Deprecated.
|
21 |
+
* @static
|
22 |
+
*
|
23 |
+
* @param array $delete_options Options for deleting posts.
|
24 |
+
*
|
25 |
+
* @return int $posts_deleted Number of posts that were deleted
|
26 |
+
*/
|
27 |
+
public static function delete_pages_by_status( $delete_options ) {
|
28 |
+
$metabox = new DeletePagesByStatusModule();
|
29 |
+
|
30 |
+
return $metabox->delete( $delete_options );
|
31 |
+
}
|
32 |
+
}
|
include/Deprecated/class-bulk-delete-post-meta.php
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
use BulkWP\BulkDelete\Core\Metas\Modules\DeletePostMetaModule;
|
4 |
+
|
5 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Utility class for deleting Post Meta.
|
9 |
+
*
|
10 |
+
* All the methods from this class has been migrated to `DeletePostMetaModule` class.
|
11 |
+
* This class is still present for backward compatibility purpose, since some of the old add-ons still depend on this class.
|
12 |
+
*
|
13 |
+
* @since 5.4
|
14 |
+
* @since 6.0.0 Deprecated.
|
15 |
+
*/
|
16 |
+
class Bulk_Delete_Post_Meta {
|
17 |
+
/**
|
18 |
+
* Cron Hook.
|
19 |
+
*
|
20 |
+
* @since 5.4
|
21 |
+
*/
|
22 |
+
const CRON_HOOK = 'do-bulk-delete-post-meta';
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Delete Post Meta.
|
26 |
+
*
|
27 |
+
* @static
|
28 |
+
*
|
29 |
+
* @since 5.4
|
30 |
+
* @since 6.0.0 Deprecated.
|
31 |
+
*
|
32 |
+
* @param array $delete_options Options for deleting.
|
33 |
+
*
|
34 |
+
* @return int Number of posts that were deleted
|
35 |
+
*/
|
36 |
+
public static function delete_post_meta( $delete_options ) {
|
37 |
+
$module = new DeletePostMetaModule();
|
38 |
+
|
39 |
+
return $module->delete( $delete_options );
|
40 |
+
}
|
41 |
+
}
|
include/Deprecated/class-bulk-delete-posts.php
ADDED
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
use BulkWP\BulkDelete\Core\Posts\Modules\DeletePostsByCategoryModule;
|
4 |
+
use BulkWP\BulkDelete\Core\Posts\Modules\DeletePostsByPostTypeModule;
|
5 |
+
use BulkWP\BulkDelete\Core\Posts\Modules\DeletePostsByStatusModule;
|
6 |
+
use BulkWP\BulkDelete\Core\Posts\Modules\DeletePostsByTagModule;
|
7 |
+
use BulkWP\BulkDelete\Core\Posts\Modules\DeletePostsByTaxonomyModule;
|
8 |
+
|
9 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Utility class for deleting posts.
|
13 |
+
*
|
14 |
+
* All the methods from this class has been migrated to individual metabox module classes.
|
15 |
+
* This class is still present for backward compatibility purpose, since some of the old add-ons still depend on this class.
|
16 |
+
*
|
17 |
+
* @since 6.0.0 Deprecated.
|
18 |
+
*/
|
19 |
+
class Bulk_Delete_Posts {
|
20 |
+
/**
|
21 |
+
* Delete posts by post status - drafts, pending posts, scheduled posts etc.
|
22 |
+
*
|
23 |
+
* @since 5.0
|
24 |
+
* @since 6.0.0 Deprecated.
|
25 |
+
* @static
|
26 |
+
*
|
27 |
+
* @param array $delete_options Options for deleting posts.
|
28 |
+
*
|
29 |
+
* @return int $posts_deleted Number of posts that were deleted
|
30 |
+
*/
|
31 |
+
public static function delete_posts_by_status( $delete_options ) {
|
32 |
+
$metabox = new DeletePostsByStatusModule();
|
33 |
+
|
34 |
+
return $metabox->delete( $delete_options );
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Delete posts by category.
|
39 |
+
*
|
40 |
+
* @since 5.0
|
41 |
+
* @since 6.0.0 Deprecated.
|
42 |
+
* @static
|
43 |
+
*
|
44 |
+
* @param array $delete_options Options for deleting posts.
|
45 |
+
*
|
46 |
+
* @return int $posts_deleted Number of posts that were deleted
|
47 |
+
*/
|
48 |
+
public static function delete_posts_by_category( $delete_options ) {
|
49 |
+
$metabox = new DeletePostsByCategoryModule();
|
50 |
+
|
51 |
+
return $metabox->delete( $delete_options );
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Delete posts by tag.
|
56 |
+
*
|
57 |
+
* @since 5.0
|
58 |
+
* @since 6.0.0 Deprecated.
|
59 |
+
* @static
|
60 |
+
*
|
61 |
+
* @param array $delete_options Options for deleting posts.
|
62 |
+
*
|
63 |
+
* @return int $posts_deleted Number of posts that were deleted
|
64 |
+
*/
|
65 |
+
public static function delete_posts_by_tag( $delete_options ) {
|
66 |
+
$metabox = new DeletePostsByTagModule();
|
67 |
+
|
68 |
+
return $metabox->delete( $delete_options );
|
69 |
+
}
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Delete posts by taxonomy.
|
73 |
+
*
|
74 |
+
* @since 5.0
|
75 |
+
* @since 6.0.0 Deprecated.
|
76 |
+
* @static
|
77 |
+
*
|
78 |
+
* @param array $delete_options Options for deleting posts.
|
79 |
+
*
|
80 |
+
* @return int $posts_deleted Number of posts that were deleted
|
81 |
+
*/
|
82 |
+
public static function delete_posts_by_taxonomy( $delete_options ) {
|
83 |
+
$metabox = new DeletePostsByTaxonomyModule();
|
84 |
+
|
85 |
+
return $metabox->delete( $delete_options );
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* Delete posts by post type.
|
90 |
+
*
|
91 |
+
* @since 5.0
|
92 |
+
* @since 6.0.0 Deprecated.
|
93 |
+
* @static
|
94 |
+
*
|
95 |
+
* @param array $delete_options Options for deleting posts.
|
96 |
+
*
|
97 |
+
* @return int $posts_deleted Number of posts that were deleted
|
98 |
+
*/
|
99 |
+
public static function delete_posts_by_post_type( $delete_options ) {
|
100 |
+
$metabox = new DeletePostsByPostTypeModule();
|
101 |
+
|
102 |
+
return $metabox->delete( $delete_options );
|
103 |
+
}
|
104 |
+
}
|
include/Deprecated/class-bulk-delete-user-meta.php
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
use BulkWP\BulkDelete\Core\Metas\Modules\DeleteUserMetaModule;
|
4 |
+
|
5 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Utility class for deleting User Meta.
|
9 |
+
*
|
10 |
+
* All the methods from this class has been migrated to `DeleteUserMetaModule` class.
|
11 |
+
* This class is still present for backward compatibility purpose, since some of the old add-ons still depend on this class.
|
12 |
+
*
|
13 |
+
* @since 5.4
|
14 |
+
* @since 6.0.0 Deprecated.
|
15 |
+
*/
|
16 |
+
class Bulk_Delete_User_Meta {
|
17 |
+
/**
|
18 |
+
* Cron Hook.
|
19 |
+
*
|
20 |
+
* @since 5.4
|
21 |
+
*/
|
22 |
+
const CRON_HOOK = 'do-bulk-delete-user-meta';
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Delete User Meta.
|
26 |
+
*
|
27 |
+
* @static
|
28 |
+
*
|
29 |
+
* @since 5.4
|
30 |
+
* @since 6.0.0 Deprecated.
|
31 |
+
*
|
32 |
+
* @param array $delete_options Options for deleting.
|
33 |
+
*
|
34 |
+
* @return int Number of users that were deleted
|
35 |
+
*/
|
36 |
+
public static function delete_user_meta( $delete_options ) {
|
37 |
+
$module = new DeleteUserMetaModule();
|
38 |
+
|
39 |
+
return $module->delete( $delete_options );
|
40 |
+
}
|
41 |
+
}
|
include/Deprecated/class-bulk-delete-users.php
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
use BulkWP\BulkDelete\Core\Users\Modules\DeleteUsersByUserRoleModule;
|
3 |
+
|
4 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Deprecated Class.
|
8 |
+
*
|
9 |
+
* It is still here for compatibility reasons and will be removed eventually.
|
10 |
+
*
|
11 |
+
* Currently used by Bulk Delete Scheduler for Deleting Users by Role add-on - v0.6
|
12 |
+
*
|
13 |
+
* @author Sudar
|
14 |
+
*
|
15 |
+
* @package BulkDelete\Deprecated
|
16 |
+
*/
|
17 |
+
class Bulk_Delete_Users {
|
18 |
+
/**
|
19 |
+
* Wire up proper class for backward compatibility.
|
20 |
+
*
|
21 |
+
* @since 5.5
|
22 |
+
*
|
23 |
+
* @param array $delete_options Delete options.
|
24 |
+
*
|
25 |
+
* @return int
|
26 |
+
*/
|
27 |
+
public static function delete_users_by_role( $delete_options ) {
|
28 |
+
$module = new DeleteUsersByUserRoleModule();
|
29 |
+
|
30 |
+
return $module->delete( $delete_options );
|
31 |
+
}
|
32 |
+
}
|
include/Deprecated/deprecated.php
ADDED
@@ -0,0 +1,303 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Deprecated and backward compatibility code.
|
4 |
+
* Don't depend on the code in this file. It would be removed in future versions of the plugin.
|
5 |
+
*
|
6 |
+
* @author Sudar
|
7 |
+
*
|
8 |
+
* @package BulkDelete\Util\Deprecated
|
9 |
+
*
|
10 |
+
* @since 5.5
|
11 |
+
*/
|
12 |
+
use BulkWP\BulkDelete\Core\Base\BaseModule;
|
13 |
+
|
14 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Backward compatibility for delete options.
|
18 |
+
*
|
19 |
+
* @since 5.5
|
20 |
+
*
|
21 |
+
* @param array $options Old options.
|
22 |
+
* @param \BulkWP\BulkDelete\Core\Base\BaseModule $module Modules.
|
23 |
+
*
|
24 |
+
* @return array New options.
|
25 |
+
*/
|
26 |
+
function bd_delete_options_compatibility( $options, $module = null ) {
|
27 |
+
if ( $module instanceof BaseModule && 'delete_pages_by_status' === $module->get_action() ) {
|
28 |
+
return $options;
|
29 |
+
}
|
30 |
+
|
31 |
+
// Convert bool keys to boolean
|
32 |
+
$bool_keys = array( 'restrict', 'force_delete', 'private' );
|
33 |
+
foreach ( $bool_keys as $key ) {
|
34 |
+
if ( array_key_exists( $key, $options ) ) {
|
35 |
+
$options[ $key ] = bd_to_bool( $options[ $key ] );
|
36 |
+
}
|
37 |
+
}
|
38 |
+
|
39 |
+
// convert old date comparison operators
|
40 |
+
if ( array_key_exists( 'date_op', $options ) && array_key_exists( 'days', $options ) ) {
|
41 |
+
if ( '<' == $options['date_op'] ) {
|
42 |
+
$options['date_op'] = 'before';
|
43 |
+
} elseif ( '>' == $options['date_op'] ) {
|
44 |
+
$options['date_op'] = 'after';
|
45 |
+
}
|
46 |
+
}
|
47 |
+
|
48 |
+
return $options;
|
49 |
+
}
|
50 |
+
add_filter( 'bd_delete_options', 'bd_delete_options_compatibility', 10, 2 );
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Handle backward compatibility for Delete Pages by status delete options.
|
54 |
+
*
|
55 |
+
* Backward compatibility code. Will eventually be removed.
|
56 |
+
*
|
57 |
+
* @since 6.0.0
|
58 |
+
*
|
59 |
+
* @param array $options Delete Options.
|
60 |
+
* @param \BulkWP\BulkDelete\Core\Base\BaseModule $module Modules.
|
61 |
+
*
|
62 |
+
* @return array Processed delete options.
|
63 |
+
*/
|
64 |
+
function bd_convert_old_options_for_delete_pages( $options, $module = null ) {
|
65 |
+
if ( $module instanceof BaseModule && 'delete_pages_by_status' !== $module->get_action() ) {
|
66 |
+
return $options;
|
67 |
+
}
|
68 |
+
|
69 |
+
if ( array_key_exists( 'page_op', $options ) ) {
|
70 |
+
$options['date_op'] = $options['page_op'];
|
71 |
+
$options['days'] = $options['page_days'];
|
72 |
+
}
|
73 |
+
|
74 |
+
if ( ! array_key_exists( 'post_status', $options ) ) {
|
75 |
+
$options['post_status'] = array();
|
76 |
+
}
|
77 |
+
|
78 |
+
if ( array_key_exists( 'publish', $options ) && 'published_pages' === $options['publish'] ) {
|
79 |
+
$options['post_status'][] = 'publish';
|
80 |
+
}
|
81 |
+
|
82 |
+
if ( array_key_exists( 'drafts', $options ) && 'draft_pages' === $options['drafts'] ) {
|
83 |
+
$options['post_status'][] = 'draft';
|
84 |
+
}
|
85 |
+
|
86 |
+
if ( array_key_exists( 'pending', $options ) && 'pending_pages' === $options['pending'] ) {
|
87 |
+
$options['post_status'][] = 'pending';
|
88 |
+
}
|
89 |
+
|
90 |
+
if ( array_key_exists( 'future', $options ) && 'future_pages' === $options['future'] ) {
|
91 |
+
$options['post_status'][] = 'future';
|
92 |
+
}
|
93 |
+
|
94 |
+
if ( array_key_exists( 'private', $options ) && 'private_pages' === $options['private'] ) {
|
95 |
+
$options['post_status'][] = 'private';
|
96 |
+
}
|
97 |
+
|
98 |
+
return $options;
|
99 |
+
}
|
100 |
+
add_filter( 'bd_delete_options', 'bd_convert_old_options_for_delete_pages', 10, 2 );
|
101 |
+
|
102 |
+
/**
|
103 |
+
* Handle backward compatibility for Delete Posts by category delete options.
|
104 |
+
*
|
105 |
+
* Backward compatibility code. Will be removed in future Bulk Delete releases.
|
106 |
+
*
|
107 |
+
* @since 6.0.0
|
108 |
+
*
|
109 |
+
* @param array $options Delete Options.
|
110 |
+
*
|
111 |
+
* @return array Processed delete options.
|
112 |
+
*/
|
113 |
+
function bd_convert_old_options_for_delete_posts_by_category( $options ) {
|
114 |
+
if ( array_key_exists( 'cats_op', $options ) ) {
|
115 |
+
$options['date_op'] = $options['cats_op'];
|
116 |
+
$options['days'] = $options['cats_days'];
|
117 |
+
}
|
118 |
+
|
119 |
+
return $options;
|
120 |
+
}
|
121 |
+
add_filter( 'bd_delete_options', 'bd_convert_old_options_for_delete_posts_by_category' );
|
122 |
+
|
123 |
+
/**
|
124 |
+
* Handle backward compatibility for Delete Posts by tag delete options.
|
125 |
+
*
|
126 |
+
* Backward compatibility code. Will be removed in future Bulk Delete releases.
|
127 |
+
*
|
128 |
+
* @since 6.0.0
|
129 |
+
*
|
130 |
+
* @param array $options Delete Options.
|
131 |
+
* @param \BulkWP\BulkDelete\Core\Base\BaseModule $module Modules.
|
132 |
+
*
|
133 |
+
* @return array Processed delete options.
|
134 |
+
*/
|
135 |
+
function bd_convert_old_options_for_delete_posts_by_tag( $options, $module = null ) {
|
136 |
+
if ( $module instanceof BaseModule && 'delete_posts_by_tag' !== $module->get_action() ) {
|
137 |
+
return $options;
|
138 |
+
}
|
139 |
+
|
140 |
+
if ( array_key_exists( 'tags_op', $options ) ) {
|
141 |
+
$options['date_op'] = $options['tags_op'];
|
142 |
+
$options['days'] = $options['tags_days'];
|
143 |
+
}
|
144 |
+
|
145 |
+
return $options;
|
146 |
+
}
|
147 |
+
add_filter( 'bd_delete_options', 'bd_convert_old_options_for_delete_posts_by_tag', 10, 2 );
|
148 |
+
|
149 |
+
/**
|
150 |
+
* Handle backward compatibility for Delete Posts by status delete options.
|
151 |
+
*
|
152 |
+
* Backward compatibility code. Will be removed in Bulk Delete v6.0.
|
153 |
+
*
|
154 |
+
* @since 5.6.0
|
155 |
+
* @since 6.0.0 Added Modules parameter.
|
156 |
+
*
|
157 |
+
* @param array $delete_options Delete Options.
|
158 |
+
* @param \BulkWP\BulkDelete\Core\Base\BaseModule $module Modules.
|
159 |
+
*
|
160 |
+
* @return array Processed delete options.
|
161 |
+
*/
|
162 |
+
function bd_convert_old_options_for_delete_post_by_status( $delete_options, $module = null ) {
|
163 |
+
if ( $module instanceof BaseModule && 'delete_posts_by_status' !== $module->get_action() ) {
|
164 |
+
return $delete_options;
|
165 |
+
}
|
166 |
+
|
167 |
+
// Format changed in 5.5.0.
|
168 |
+
if ( array_key_exists( 'post_status_op', $delete_options ) ) {
|
169 |
+
$delete_options['date_op'] = $delete_options['post_status_op'];
|
170 |
+
$delete_options['days'] = $delete_options['post_status_days'];
|
171 |
+
}
|
172 |
+
|
173 |
+
// Format changed in 5.6.0.
|
174 |
+
if ( isset( $delete_options['sticky'] ) ) {
|
175 |
+
if ( 'sticky' === $delete_options['sticky'] ) {
|
176 |
+
$delete_options['delete-sticky-posts'] = true;
|
177 |
+
} else {
|
178 |
+
$delete_options['delete-sticky-posts'] = false;
|
179 |
+
}
|
180 |
+
}
|
181 |
+
|
182 |
+
if ( ! isset( $delete_options['post_status'] ) ) {
|
183 |
+
$delete_options['post_status'] = array();
|
184 |
+
}
|
185 |
+
|
186 |
+
$old_statuses = array( 'publish', 'draft', 'pending', 'future', 'private' );
|
187 |
+
|
188 |
+
foreach ( $old_statuses as $old_status ) {
|
189 |
+
if ( isset( $delete_options[ $old_status ] ) ) {
|
190 |
+
$delete_options['post_status'][] = $old_status;
|
191 |
+
}
|
192 |
+
}
|
193 |
+
|
194 |
+
if ( isset( $delete_options['drafts'] ) && 'drafts' === $delete_options['drafts'] ) {
|
195 |
+
$delete_options['post_status'][] = 'draft';
|
196 |
+
}
|
197 |
+
|
198 |
+
return $delete_options;
|
199 |
+
}
|
200 |
+
add_filter( 'bd_delete_options', 'bd_convert_old_options_for_delete_post_by_status', 10, 2 );
|
201 |
+
|
202 |
+
/**
|
203 |
+
* Handle backward compatibility for Delete Posts by Taxonomy delete options.
|
204 |
+
*
|
205 |
+
* Backward compatibility code. Will be removed in Bulk Delete v6.0.
|
206 |
+
*
|
207 |
+
* @since 6.0.0
|
208 |
+
*
|
209 |
+
* @param array $delete_options Delete Options.
|
210 |
+
* @param \BulkWP\BulkDelete\Core\Base\BaseModule $module Modules.
|
211 |
+
*
|
212 |
+
* @return array Processed delete options.
|
213 |
+
*/
|
214 |
+
function bd_convert_old_options_for_delete_post_by_taxonomy( $delete_options, $module = null ) {
|
215 |
+
if ( $module instanceof BaseModule && 'bd_delete_posts_by_taxonomy' !== $module->get_action() ) {
|
216 |
+
return $delete_options;
|
217 |
+
}
|
218 |
+
|
219 |
+
if ( array_key_exists( 'taxs_op', $delete_options ) ) {
|
220 |
+
$delete_options['date_op'] = $delete_options['taxs_op'];
|
221 |
+
$delete_options['days'] = $delete_options['taxs_days'];
|
222 |
+
}
|
223 |
+
|
224 |
+
return $delete_options;
|
225 |
+
}
|
226 |
+
add_filter( 'bd_delete_options', 'bd_convert_old_options_for_delete_post_by_taxonomy', 10, 2 );
|
227 |
+
|
228 |
+
/**
|
229 |
+
* Handle backward compatibility for Delete Posts by Post type delete options.
|
230 |
+
*
|
231 |
+
* Backward compatibility code. Will be removed in Bulk Delete v6.0.
|
232 |
+
*
|
233 |
+
* @since 6.0.0
|
234 |
+
*
|
235 |
+
* @param array $delete_options Delete Options.
|
236 |
+
* @param \BulkWP\BulkDelete\Core\Base\BaseModule $module Modules.
|
237 |
+
*
|
238 |
+
* @return array Processed delete options.
|
239 |
+
*/
|
240 |
+
function bd_convert_old_options_for_delete_post_by_post_type( $delete_options, $module = null ) {
|
241 |
+
if ( $module instanceof BaseModule && 'delete_posts_by_post_type' !== $module->get_action() ) {
|
242 |
+
return $delete_options;
|
243 |
+
}
|
244 |
+
|
245 |
+
if ( array_key_exists( 'types_op', $delete_options ) ) {
|
246 |
+
$delete_options['date_op'] = $delete_options['types_op'];
|
247 |
+
$delete_options['days'] = $delete_options['types_days'];
|
248 |
+
}
|
249 |
+
|
250 |
+
return $delete_options;
|
251 |
+
}
|
252 |
+
add_filter( 'bd_delete_options', 'bd_convert_old_options_for_delete_post_by_post_type', 10, 2 );
|
253 |
+
|
254 |
+
/**
|
255 |
+
* Enable cron for old pro addons that required separate JavaScript.
|
256 |
+
* This will be removed in v6.0.
|
257 |
+
*
|
258 |
+
* @since 5.5
|
259 |
+
*
|
260 |
+
* @param array $js_array JavaScript Array
|
261 |
+
*
|
262 |
+
* @return array Modified JavaScript Array
|
263 |
+
*/
|
264 |
+
function bd_enable_cron_for_old_addons( $js_array ) {
|
265 |
+
if ( ! function_exists( 'is_plugin_active' ) ) {
|
266 |
+
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
267 |
+
}
|
268 |
+
|
269 |
+
if ( is_plugin_active( 'bulk-delete-scheduler-for-deleting-users-by-role/bulk-delete-scheduler-for-deleting-users-by-role.php' ) ) {
|
270 |
+
$js_array['pro_iterators'][] = 'u_role';
|
271 |
+
}
|
272 |
+
|
273 |
+
return $js_array;
|
274 |
+
}
|
275 |
+
add_filter( 'bd_javascript_array', 'bd_enable_cron_for_old_addons' );
|
276 |
+
|
277 |
+
// Deprecated functions.
|
278 |
+
|
279 |
+
if ( ! function_exists( 'array_get' ) ) {
|
280 |
+
/**
|
281 |
+
* Deprecated. Use `bd_array_get`.
|
282 |
+
*
|
283 |
+
* @param mixed $array
|
284 |
+
* @param mixed $key
|
285 |
+
* @param mixed|null $default
|
286 |
+
*/
|
287 |
+
function array_get( $array, $key, $default = null ) {
|
288 |
+
return bd_array_get( $array, $key, $default );
|
289 |
+
}
|
290 |
+
}
|
291 |
+
|
292 |
+
if ( ! function_exists( 'array_get_bool' ) ) {
|
293 |
+
/**
|
294 |
+
* Deprecated. Use `bd_array_get_bool`.
|
295 |
+
*
|
296 |
+
* @param mixed $array
|
297 |
+
* @param mixed $key
|
298 |
+
* @param mixed $default
|
299 |
+
*/
|
300 |
+
function array_get_bool( $array, $key, $default = false ) {
|
301 |
+
return bd_array_get_bool( $array, $key, $default );
|
302 |
+
}
|
303 |
+
}
|
include/Deprecated/old-bulk-delete.php
ADDED
@@ -0,0 +1,245 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Old version of Bulk_Delete.
|
4 |
+
*
|
5 |
+
* This class is deprecated since 6.0.0. But included here for backward compatibility.
|
6 |
+
* Don't depend on functionality from this class.
|
7 |
+
*/
|
8 |
+
use BulkWP\BulkDelete\Core\BulkDelete;
|
9 |
+
|
10 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Main Bulk_Delete class.
|
14 |
+
*
|
15 |
+
* @property string|null translations
|
16 |
+
* @property string|null posts_page
|
17 |
+
* @property string|null pages_page
|
18 |
+
* @property string|null users_page
|
19 |
+
* @property string|null metas_page
|
20 |
+
*
|
21 |
+
* @since 5.0 Singleton
|
22 |
+
* @since 6.0.0 Deprecated.
|
23 |
+
*/
|
24 |
+
final class Bulk_Delete {
|
25 |
+
/**
|
26 |
+
* The one true Bulk_Delete instance.
|
27 |
+
*
|
28 |
+
* @var Bulk_Delete
|
29 |
+
*
|
30 |
+
* @since 5.0
|
31 |
+
*/
|
32 |
+
private static $instance;
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Path to the main plugin file.
|
36 |
+
*
|
37 |
+
* @var string
|
38 |
+
*/
|
39 |
+
private $plugin_file;
|
40 |
+
|
41 |
+
// Deprecated constants. They are defined here for backward compatibility.
|
42 |
+
const VERSION = '6.0.0';
|
43 |
+
|
44 |
+
const JS_HANDLE = 'bulk-delete';
|
45 |
+
|
46 |
+
// Cron hooks.
|
47 |
+
const CRON_HOOK_PAGES_STATUS = 'do-bulk-delete-pages-by-status'; // used in Scheduler For Deleting Pages by Post status add-on v0.6.
|
48 |
+
|
49 |
+
const CRON_HOOK_POST_STATUS = 'do-bulk-delete-post-status'; // used in Scheduler For Deleting Posts by Post status add-on v0.6.
|
50 |
+
const CRON_HOOK_CATEGORY = 'do-bulk-delete-cat'; // used in Scheduler For Deleting Posts by Category add-on v0.6.
|
51 |
+
const CRON_HOOK_TAG = 'do-bulk-delete-tag'; // used in Scheduler For Deleting Posts by Tag add-on v0.6.
|
52 |
+
const CRON_HOOK_TAXONOMY = 'do-bulk-delete-taxonomy'; // used in Scheduler For Deleting Posts by Taxonomy add-on v0.6.
|
53 |
+
const CRON_HOOK_POST_TYPE = 'do-bulk-delete-post-type'; // used in Scheduler For Deleting Posts by Post Type add-on v0.6.
|
54 |
+
const CRON_HOOK_USER_ROLE = 'do-bulk-delete-users-by-role'; // used in Scheduler for Deleting Users by User Role add-on v0.6.
|
55 |
+
|
56 |
+
const CRON_HOOK_CUSTOM_FIELD = 'do-bulk-delete-custom-field'; // used in Bulk Delete Posts by Custom Field add-on v1.0.
|
57 |
+
const CRON_HOOK_TITLE = 'do-bulk-delete-by-title'; // used in Bulk Delete Posts by Title add-on v1.0.
|
58 |
+
const CRON_HOOK_DUPLICATE_TITLE = 'do-bulk-delete-by-duplicate-title'; // used in Bulk Delete Posts by Duplicate Title add-on v0.7.
|
59 |
+
const CRON_HOOK_POST_BY_ROLE = 'do-bulk-delete-posts-by-role'; // used in Bulk Delete Posts by User Role add-on v0.5.
|
60 |
+
|
61 |
+
// Page slugs. Page slugs are still used in lot of add-ons.
|
62 |
+
const POSTS_PAGE_SLUG = 'bulk-delete-posts';
|
63 |
+
const PAGES_PAGE_SLUG = 'bulk-delete-pages'; // used in Bulk Delete From Trash add-on v0.3.
|
64 |
+
const CRON_PAGE_SLUG = 'bulk-delete-cron';
|
65 |
+
const ADDON_PAGE_SLUG = 'bulk-delete-addon';
|
66 |
+
|
67 |
+
// Settings constants
|
68 |
+
const SETTING_OPTION_GROUP = 'bd_settings';
|
69 |
+
const SETTING_OPTION_NAME = 'bd_licenses';
|
70 |
+
const SETTING_SECTION_ID = 'bd_license_section';
|
71 |
+
|
72 |
+
// Transient keys
|
73 |
+
const LICENSE_CACHE_KEY_PREFIX = 'bd-license_';
|
74 |
+
|
75 |
+
// path variables
|
76 |
+
// Ideally these should be constants, but because of PHP's limitations, these are static variables
|
77 |
+
public static $PLUGIN_DIR;
|
78 |
+
public static $PLUGIN_FILE;
|
79 |
+
|
80 |
+
// Instance variables
|
81 |
+
public $settings_page;
|
82 |
+
public $misc_page;
|
83 |
+
public $display_activate_license_form = false;
|
84 |
+
|
85 |
+
/**
|
86 |
+
* Main Bulk_Delete Instance.
|
87 |
+
*
|
88 |
+
* Insures that only one instance of Bulk_Delete exists in memory at any one
|
89 |
+
* time. Also prevents needing to define globals all over the place.
|
90 |
+
*
|
91 |
+
* @since 5.0
|
92 |
+
* @static
|
93 |
+
* @staticvar array $instance
|
94 |
+
*
|
95 |
+
* @see BULK_DELETE()
|
96 |
+
*
|
97 |
+
* @return Bulk_Delete The one true instance of Bulk_Delete
|
98 |
+
*/
|
99 |
+
public static function get_instance() {
|
100 |
+
if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Bulk_Delete ) ) {
|
101 |
+
self::$instance = new Bulk_Delete();
|
102 |
+
}
|
103 |
+
|
104 |
+
return self::$instance;
|
105 |
+
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
* Throw error on object clone.
|
109 |
+
*
|
110 |
+
* The whole idea of the singleton design pattern is that there is a single
|
111 |
+
* object therefore, we don't want the object to be cloned.
|
112 |
+
*
|
113 |
+
* @since 5.0
|
114 |
+
* @access protected
|
115 |
+
*
|
116 |
+
* @return void
|
117 |
+
*/
|
118 |
+
public function __clone() {
|
119 |
+
_doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'bulk-delete' ), '5.0' );
|
120 |
+
}
|
121 |
+
|
122 |
+
/**
|
123 |
+
* Disable unserializing of the class.
|
124 |
+
*
|
125 |
+
* @since 5.0
|
126 |
+
* @access protected
|
127 |
+
*
|
128 |
+
* @return void
|
129 |
+
*/
|
130 |
+
public function __wakeup() {
|
131 |
+
_doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'bulk-delete' ), '5.0' );
|
132 |
+
}
|
133 |
+
|
134 |
+
/**
|
135 |
+
* Set path to main plugin file.
|
136 |
+
*
|
137 |
+
* @param string $plugin_file Path to main plugin file.
|
138 |
+
*/
|
139 |
+
public function set_plugin_file( $plugin_file ) {
|
140 |
+
$this->plugin_file = $plugin_file;
|
141 |
+
|
142 |
+
self::$PLUGIN_DIR = plugin_dir_path( $plugin_file );
|
143 |
+
self::$PLUGIN_FILE = $plugin_file;
|
144 |
+
}
|
145 |
+
|
146 |
+
/**
|
147 |
+
* Get path to main plugin file.
|
148 |
+
*
|
149 |
+
* @return string Plugin file.
|
150 |
+
*/
|
151 |
+
public function get_plugin_file() {
|
152 |
+
return $this->plugin_file;
|
153 |
+
}
|
154 |
+
|
155 |
+
/**
|
156 |
+
* Monkey patch the old `add_script` method.
|
157 |
+
*
|
158 |
+
* @since 6.0.0
|
159 |
+
*/
|
160 |
+
public function add_script() {
|
161 |
+
$bd = BulkDelete::get_instance();
|
162 |
+
|
163 |
+
$post_page = $bd->get_page( self::POSTS_PAGE_SLUG );
|
164 |
+
|
165 |
+
if ( is_null( $post_page ) ) {
|
166 |
+
return;
|
167 |
+
}
|
168 |
+
|
169 |
+
$post_page->enqueue_assets();
|
170 |
+
}
|
171 |
+
|
172 |
+
/**
|
173 |
+
* Provide access to old public fields through Magic method.
|
174 |
+
*
|
175 |
+
* This function is added to provide backward compatibility and will be eventually removed from future versions.
|
176 |
+
*
|
177 |
+
* @since 6.0.0
|
178 |
+
*
|
179 |
+
* @param string $name Field.
|
180 |
+
*
|
181 |
+
* @return string|null
|
182 |
+
*/
|
183 |
+
public function __get( $name ) {
|
184 |
+
$new_bd = BulkDelete::get_instance();
|
185 |
+
|
186 |
+
switch ( $name ) {
|
187 |
+
case 'translations':
|
188 |
+
return $new_bd->get_translations_path();
|
189 |
+
break;
|
190 |
+
|
191 |
+
case 'posts_page':
|
192 |
+
return $new_bd->get_page_hook_suffix( 'bulk-delete-posts' );
|
193 |
+
break;
|
194 |
+
|
195 |
+
case 'pages_page':
|
196 |
+
return $new_bd->get_page_hook_suffix( 'bulk-delete-pages' );
|
197 |
+
break;
|
198 |
+
|
199 |
+
case 'users_page':
|
200 |
+
return $new_bd->get_page_hook_suffix( 'bulk-delete-users' );
|
201 |
+
break;
|
202 |
+
|
203 |
+
case 'meta_page':
|
204 |
+
return $new_bd->get_page_hook_suffix( 'bulk-delete-metas' );
|
205 |
+
break;
|
206 |
+
}
|
207 |
+
|
208 |
+
$trace = debug_backtrace();
|
209 |
+
trigger_error( 'Undefined property via __get(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . $trace[0]['line'], E_USER_NOTICE );
|
210 |
+
|
211 |
+
return null;
|
212 |
+
}
|
213 |
+
}
|
214 |
+
|
215 |
+
/**
|
216 |
+
* The main function responsible for returning the one true Bulk_Delete
|
217 |
+
* Instance to functions everywhere.
|
218 |
+
*
|
219 |
+
* Use this function like you would a global variable, except without needing
|
220 |
+
* to declare the global.
|
221 |
+
*
|
222 |
+
* Example: `<?php $bulk_delete = BULK_DELETE(); ?>`
|
223 |
+
*
|
224 |
+
* @since 5.0
|
225 |
+
*
|
226 |
+
* @return Bulk_Delete The one true Bulk_Delete Instance
|
227 |
+
*/
|
228 |
+
function BULK_DELETE() {
|
229 |
+
return Bulk_Delete::get_instance();
|
230 |
+
}
|
231 |
+
|
232 |
+
/**
|
233 |
+
* Setup old Bulk_Delete class for backward compatibility reasons.
|
234 |
+
*
|
235 |
+
* Eventually this will be removed.
|
236 |
+
*
|
237 |
+
* @since 6.0.0
|
238 |
+
*
|
239 |
+
* @param string $plugin_file Main plugin file.
|
240 |
+
*/
|
241 |
+
function bd_setup_backward_compatibility( $plugin_file ) {
|
242 |
+
$bd = BULK_DELETE();
|
243 |
+
$bd->set_plugin_file( $plugin_file );
|
244 |
+
}
|
245 |
+
add_action( 'bd_loaded', 'bd_setup_backward_compatibility' );
|
include/Deprecated/support-old-addons.php
ADDED
@@ -0,0 +1,150 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Support Old add-ons.
|
4 |
+
*
|
5 |
+
* V6.0.0 changed the way add-ons and modules are handled.
|
6 |
+
* This file contains code to add the backward compatibility layer for old add-ons.
|
7 |
+
* This compatibility code would be eventually removed once all the add-ons have got upgraded.
|
8 |
+
*
|
9 |
+
* @since 6.0.0
|
10 |
+
*/
|
11 |
+
use BulkWP\BulkDelete\Deprecated\Addons\DeleteFromTrashModule;
|
12 |
+
use BulkWP\BulkDelete\Deprecated\Addons\DeletePostsByAttachmentModule;
|
13 |
+
use BulkWP\BulkDelete\Deprecated\Addons\DeletePostsByContentModule;
|
14 |
+
use BulkWP\BulkDelete\Deprecated\Addons\DeletePostsByCustomFieldModule;
|
15 |
+
use BulkWP\BulkDelete\Deprecated\Addons\DeletePostsByDuplicateTitleModule;
|
16 |
+
use BulkWP\BulkDelete\Deprecated\Addons\DeletePostsByTitleModule;
|
17 |
+
use BulkWP\BulkDelete\Deprecated\Addons\DeletePostsByUserModule;
|
18 |
+
use BulkWP\BulkDelete\Deprecated\Addons\DeletePostsByUserRoleModule;
|
19 |
+
|
20 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Load deprecated post modules.
|
24 |
+
*
|
25 |
+
* Older version of some add-ons require this compatibility code to work properly.
|
26 |
+
* This compatibility code will be eventually removed.
|
27 |
+
*
|
28 |
+
* @since 6.0.0
|
29 |
+
*
|
30 |
+
* @param \BulkWP\BulkDelete\Core\Base\BaseDeletePage $page Page object.
|
31 |
+
*/
|
32 |
+
function bd_load_deprecated_post_modules( $page ) {
|
33 |
+
$trash_module = new DeleteFromTrashModule();
|
34 |
+
$trash_module->set_item_type( 'posts' );
|
35 |
+
$trash_module->load_if_needed( $page );
|
36 |
+
|
37 |
+
$custom_fields_module = new DeletePostsByCustomFieldModule();
|
38 |
+
$custom_fields_module->load_if_needed( $page );
|
39 |
+
|
40 |
+
$title_module = new DeletePostsByTitleModule();
|
41 |
+
$title_module->load_if_needed( $page );
|
42 |
+
|
43 |
+
$duplicate_title_module = new DeletePostsByDuplicateTitleModule();
|
44 |
+
$duplicate_title_module->load_if_needed( $page );
|
45 |
+
|
46 |
+
$content_module = new DeletePostsByContentModule();
|
47 |
+
$content_module->load_if_needed( $page );
|
48 |
+
|
49 |
+
$attachment_module = new DeletePostsByAttachmentModule();
|
50 |
+
$attachment_module->load_if_needed( $page );
|
51 |
+
|
52 |
+
$user_role_module = new DeletePostsByUserRoleModule();
|
53 |
+
$user_role_module->load_if_needed( $page );
|
54 |
+
|
55 |
+
$user_module = new DeletePostsByUserModule();
|
56 |
+
$user_module->load_if_needed( $page );
|
57 |
+
}
|
58 |
+
add_action( 'bd_after_modules_bulk-delete-posts', 'bd_load_deprecated_post_modules' );
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Load deprecated page modules.
|
62 |
+
*
|
63 |
+
* Older version of some add-ons require this compatibility code to work properly.
|
64 |
+
* This compatibility code will be eventually removed.
|
65 |
+
*
|
66 |
+
* @since 6.0.0
|
67 |
+
*
|
68 |
+
* @param \BulkWP\BulkDelete\Core\Base\BaseDeletePage $page Page object.
|
69 |
+
*/
|
70 |
+
function bd_load_deprecated_page_modules( $page ) {
|
71 |
+
$trash_module = new DeleteFromTrashModule();
|
72 |
+
$trash_module->set_item_type( 'pages' );
|
73 |
+
$trash_module->load_if_needed( $page );
|
74 |
+
}
|
75 |
+
add_action( 'bd_after_modules_bulk-delete-pages', 'bd_load_deprecated_page_modules' );
|
76 |
+
|
77 |
+
/**
|
78 |
+
* Enable nonce checks for old post add-ons.
|
79 |
+
*
|
80 |
+
* This is needed only to do automatic nonce checks for old add-ons and will be eventually removed.
|
81 |
+
*
|
82 |
+
* @since 6.0.0
|
83 |
+
*
|
84 |
+
* @param array $actions Actions.
|
85 |
+
* @param \BulkWP\BulkDelete\Core\Base\BasePage $page Page to which actions might be added.
|
86 |
+
*
|
87 |
+
* @return array List of modified actions.
|
88 |
+
*/
|
89 |
+
function bd_enable_nonce_check_for_old_post_addons( $actions, $page ) {
|
90 |
+
if ( 'bulk-delete-posts' !== $page->get_page_slug() ) {
|
91 |
+
return $actions;
|
92 |
+
}
|
93 |
+
|
94 |
+
if ( class_exists( '\Bulk_Delete_Posts_By_User' ) ) {
|
95 |
+
$actions[] = 'delete_posts_by_user';
|
96 |
+
}
|
97 |
+
|
98 |
+
if ( class_exists( '\Bulk_Delete_Posts_By_Attachment' ) ) {
|
99 |
+
$actions[] = 'delete_posts_by_attachment';
|
100 |
+
}
|
101 |
+
|
102 |
+
if ( class_exists( '\Bulk_Delete_Posts_By_Content' ) ) {
|
103 |
+
$actions[] = 'delete_posts_by_content';
|
104 |
+
}
|
105 |
+
|
106 |
+
return $actions;
|
107 |
+
}
|
108 |
+
add_filter( 'bd_page_actions', 'bd_enable_nonce_check_for_old_post_addons', 10, 2 );
|
109 |
+
|
110 |
+
/**
|
111 |
+
* Enable support for v0.6 or older version of Bulk Delete Scheduler for Deleting Pages by Status add-on.
|
112 |
+
*
|
113 |
+
* @since 6.0.0
|
114 |
+
*
|
115 |
+
* @param string $pro_class Pro CSS class.
|
116 |
+
* @param string $field_slug Field slug.
|
117 |
+
*
|
118 |
+
* @return string Modified pro class.
|
119 |
+
*/
|
120 |
+
function bd_change_pro_class_for_old_deleting_pages_by_status_addon( $pro_class, $field_slug ) {
|
121 |
+
if ( 'page_status' !== $field_slug ) {
|
122 |
+
return $pro_class;
|
123 |
+
}
|
124 |
+
|
125 |
+
if ( ! class_exists( 'BD_Scheduler_For_Deleting_Pages_By_Status' ) ) {
|
126 |
+
return $pro_class;
|
127 |
+
}
|
128 |
+
|
129 |
+
return 'bd-pages-pro';
|
130 |
+
}
|
131 |
+
add_filter( 'bd_pro_only_feature_class', 'bd_change_pro_class_for_old_deleting_pages_by_status_addon', 10, 2 );
|
132 |
+
|
133 |
+
/**
|
134 |
+
* Modify Pro iterators for old add-ons.
|
135 |
+
*
|
136 |
+
* @since 6.0.0
|
137 |
+
*
|
138 |
+
* @param array $js_array JS Array.
|
139 |
+
*
|
140 |
+
* @return array Modified JS array.
|
141 |
+
*/
|
142 |
+
function bd_change_pro_iterators_for_old_addons( $js_array ) {
|
143 |
+
// v0.6 or older of Bulk Delete Scheduler for Deleting Pages by Status add-on.
|
144 |
+
if ( class_exists( 'BD_Scheduler_For_Deleting_Pages_By_Status' ) ) {
|
145 |
+
$js_array['pro_iterators'][] = 'page_status';
|
146 |
+
}
|
147 |
+
|
148 |
+
return $js_array;
|
149 |
+
}
|
150 |
+
add_filter( 'bd_javascript_array', 'bd_change_pro_iterators_for_old_addons' );
|
include/base/class-bd-meta-box-module.php
CHANGED
@@ -279,7 +279,7 @@ abstract class BD_Meta_Box_Module {
|
|
279 |
* @param mixed $delete_options
|
280 |
*/
|
281 |
protected function process_delete( $delete_options ) {
|
282 |
-
if (
|
283 |
$freq = $_POST[ 'smbd_' . $this->field_slug . '_cron_freq' ];
|
284 |
$time = strtotime( $_POST[ 'smbd_' . $this->field_slug . '_cron_start' ] ) - ( get_option( 'gmt_offset' ) * 60 * 60 );
|
285 |
|
279 |
* @param mixed $delete_options
|
280 |
*/
|
281 |
protected function process_delete( $delete_options ) {
|
282 |
+
if ( bd_array_get_bool( $_POST, 'smbd_' . $this->field_slug . '_cron', false ) ) {
|
283 |
$freq = $_POST[ 'smbd_' . $this->field_slug . '_cron_freq' ];
|
284 |
$time = strtotime( $_POST[ 'smbd_' . $this->field_slug . '_cron_start' ] ) - ( get_option( 'gmt_offset' ) * 60 * 60 );
|
285 |
|
include/base/class-bd-page.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Base class for all
|
4 |
*
|
5 |
* @since 5.5
|
6 |
*
|
@@ -11,7 +11,7 @@
|
|
11 |
defined( 'ABSPATH' ) || exit; // Exit if accessed directly
|
12 |
|
13 |
/**
|
14 |
-
* Base class for
|
15 |
*
|
16 |
* @abstract
|
17 |
*
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Base class for all Modules Pages.
|
4 |
*
|
5 |
* @since 5.5
|
6 |
*
|
11 |
defined( 'ABSPATH' ) || exit; // Exit if accessed directly
|
12 |
|
13 |
/**
|
14 |
+
* Base class for Modules Pages.
|
15 |
*
|
16 |
* @abstract
|
17 |
*
|
include/deprecated/class-bulk-delete-users.php
DELETED
@@ -1,25 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Deprecated Class.
|
4 |
-
* It is still hear for compatibility reasons and most probably will be removed in v6.0.
|
5 |
-
*
|
6 |
-
* @author Sudar
|
7 |
-
*
|
8 |
-
* @package BulkDelete\Deprecated
|
9 |
-
*/
|
10 |
-
defined( 'ABSPATH' ) || exit; // Exit if accessed directly
|
11 |
-
|
12 |
-
class Bulk_Delete_Users {
|
13 |
-
/**
|
14 |
-
* Wire up proper class for backward compatibility.
|
15 |
-
*
|
16 |
-
* @since 5.5
|
17 |
-
*
|
18 |
-
* @param mixed $delete_options
|
19 |
-
*/
|
20 |
-
public static function delete_users_by_role( $delete_options ) {
|
21 |
-
$factory = Bulk_Delete_Users_By_User_Role::factory();
|
22 |
-
|
23 |
-
return $factory->delete( $delete_options );
|
24 |
-
}
|
25 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
include/deprecated/deprecated.php
DELETED
@@ -1,140 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Deprecated and backward compatibility code.
|
4 |
-
* Don't depend on the code in this file. It would be removed in future versions of the plugin.
|
5 |
-
*
|
6 |
-
* @author Sudar
|
7 |
-
*
|
8 |
-
* @package BulkDelete\Util\Deprecated
|
9 |
-
*
|
10 |
-
* @since 5.5
|
11 |
-
*/
|
12 |
-
defined( 'ABSPATH' ) || exit; // Exit if accessed directly
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Backward compatibility for delete options.
|
16 |
-
*
|
17 |
-
* @since 5.5
|
18 |
-
*
|
19 |
-
* @param array $options Old options.
|
20 |
-
*
|
21 |
-
* @return array New options.
|
22 |
-
*/
|
23 |
-
function bd_delete_options_compatibility( $options ) {
|
24 |
-
// Convert bool keys to boolean
|
25 |
-
$bool_keys = array( 'restrict', 'force_delete', 'private' );
|
26 |
-
foreach ( $bool_keys as $key ) {
|
27 |
-
if ( array_key_exists( $key, $options ) ) {
|
28 |
-
$options[ $key ] = bd_to_bool( $options[ $key ] );
|
29 |
-
}
|
30 |
-
}
|
31 |
-
|
32 |
-
// convert old date comparison operators
|
33 |
-
if ( array_key_exists( 'date_op', $options ) && array_key_exists( 'days', $options ) ) {
|
34 |
-
if ( '<' == $options['date_op'] ) {
|
35 |
-
$options['date_op'] = 'before';
|
36 |
-
} elseif ( '>' == $options['date_op'] ) {
|
37 |
-
$options['date_op'] = 'after';
|
38 |
-
}
|
39 |
-
}
|
40 |
-
|
41 |
-
return $options;
|
42 |
-
}
|
43 |
-
add_filter( 'bd_delete_options', 'bd_delete_options_compatibility' );
|
44 |
-
|
45 |
-
/**
|
46 |
-
* Handle backward compatibility for Delete Posts by status delete options.
|
47 |
-
*
|
48 |
-
* Backward compatibility code. Will be removed in Bulk Delete v6.0.
|
49 |
-
*
|
50 |
-
* @since 5.6.0
|
51 |
-
*
|
52 |
-
* @param array $delete_options Delete Options.
|
53 |
-
*
|
54 |
-
* @return array Processed delete options.
|
55 |
-
*/
|
56 |
-
function bd_convert_old_options_for_delete_post_by_status( $delete_options ) {
|
57 |
-
// Format changed in 5.5.0.
|
58 |
-
if ( array_key_exists( 'post_status_op', $delete_options ) ) {
|
59 |
-
$delete_options['date_op'] = $delete_options['post_status_op'];
|
60 |
-
$delete_options['days'] = $delete_options['post_status_days'];
|
61 |
-
}
|
62 |
-
|
63 |
-
// Format changed in 5.6.0.
|
64 |
-
if ( isset( $delete_options['sticky'] ) ) {
|
65 |
-
if ( 'sticky' === $delete_options['sticky'] ) {
|
66 |
-
$delete_options['delete-sticky-posts'] = true;
|
67 |
-
} else {
|
68 |
-
$delete_options['delete-sticky-posts'] = false;
|
69 |
-
}
|
70 |
-
}
|
71 |
-
|
72 |
-
if ( ! isset( $delete_options['post_status'] ) ) {
|
73 |
-
$delete_options['post_status'] = array();
|
74 |
-
}
|
75 |
-
|
76 |
-
$old_statuses = array( 'publish', 'draft', 'pending', 'future', 'private' );
|
77 |
-
|
78 |
-
foreach ( $old_statuses as $old_status ) {
|
79 |
-
if ( isset( $delete_options[ $old_status ] ) ) {
|
80 |
-
$delete_options['post_status'][] = $old_status;
|
81 |
-
}
|
82 |
-
}
|
83 |
-
|
84 |
-
if ( isset( $delete_options['drafts'] ) && 'drafts' === $delete_options['drafts'] ) {
|
85 |
-
$delete_options['post_status'][] = 'draft';
|
86 |
-
}
|
87 |
-
|
88 |
-
return $delete_options;
|
89 |
-
}
|
90 |
-
|
91 |
-
/**
|
92 |
-
* Enable cron for old pro addons that required separate JavaScript.
|
93 |
-
* This will be removed in v6.0.
|
94 |
-
*
|
95 |
-
* @since 5.5
|
96 |
-
*
|
97 |
-
* @param array $js_array JavaScript Array
|
98 |
-
*
|
99 |
-
* @return array Modified JavaScript Array
|
100 |
-
*/
|
101 |
-
function bd_enable_cron_for_old_addons( $js_array ) {
|
102 |
-
if ( ! function_exists( 'is_plugin_active' ) ) {
|
103 |
-
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
104 |
-
}
|
105 |
-
|
106 |
-
if ( is_plugin_active( 'bulk-delete-scheduler-for-deleting-users-by-role/bulk-delete-scheduler-for-deleting-users-by-role.php' ) ) {
|
107 |
-
$js_array['pro_iterators'][] = 'u_role';
|
108 |
-
}
|
109 |
-
|
110 |
-
return $js_array;
|
111 |
-
}
|
112 |
-
add_filter( 'bd_javascript_array', 'bd_enable_cron_for_old_addons' );
|
113 |
-
|
114 |
-
// Deprecated functions.
|
115 |
-
|
116 |
-
if ( ! function_exists( 'array_get' ) ) {
|
117 |
-
/**
|
118 |
-
* Deprecated. Use `bd_array_get`.
|
119 |
-
*
|
120 |
-
* @param mixed $array
|
121 |
-
* @param mixed $key
|
122 |
-
* @param mixed|null $default
|
123 |
-
*/
|
124 |
-
function array_get( $array, $key, $default = null ) {
|
125 |
-
return bd_array_get( $array, $key, $default );
|
126 |
-
}
|
127 |
-
}
|
128 |
-
|
129 |
-
if ( ! function_exists( 'array_get_bool' ) ) {
|
130 |
-
/**
|
131 |
-
* Deprecated. Use `bd_array_get_bool`.
|
132 |
-
*
|
133 |
-
* @param mixed $array
|
134 |
-
* @param mixed $key
|
135 |
-
* @param mixed $default
|
136 |
-
*/
|
137 |
-
function array_get_bool( $array, $key, $default = false ) {
|
138 |
-
return bd_array_get_bool( $array, $key, $default );
|
139 |
-
}
|
140 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
include/helpers/addon.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Add-on helper functions.
|
4 |
+
*
|
5 |
+
* These functions are not using namespace since they may be used from a PHP 5.2 file.
|
6 |
+
*
|
7 |
+
* @since 6.0.0
|
8 |
+
*/
|
9 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Load an Bulk Delete add-on.
|
13 |
+
*
|
14 |
+
* @since 6.0.0
|
15 |
+
*
|
16 |
+
* @param string $addon_class Add-on class name.
|
17 |
+
* @param array $addon_details Add-on Details.
|
18 |
+
*
|
19 |
+
* @return \BulkWP\BulkDelete\Addon\BulkDeleteAddon Instance of the add-on.
|
20 |
+
*/
|
21 |
+
function load_bulk_delete_addon( $addon_class, $addon_details ) {
|
22 |
+
$addon_info = new \BulkWP\BulkDelete\Core\Addon\AddonInfo( $addon_details );
|
23 |
+
|
24 |
+
$bulk_delete = \BulkWP\BulkDelete\Core\BulkDelete::get_instance();
|
25 |
+
$bulk_delete->register_addon_namespace( $addon_info );
|
26 |
+
|
27 |
+
$addon = new $addon_class( $addon_info );
|
28 |
+
add_action( 'bd_loaded', array( $addon, 'register' ) );
|
29 |
+
|
30 |
+
return $addon;
|
31 |
+
}
|
include/helpers/common.php
ADDED
@@ -0,0 +1,177 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Contains the helper functions.
|
4 |
+
*
|
5 |
+
* Some of the functions where created before dropping support for PHP 5.2 and that's the reason why they are not namespaced.
|
6 |
+
*
|
7 |
+
* @since 6.0.0 File created.
|
8 |
+
*/
|
9 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Get a value from an array based on key.
|
13 |
+
*
|
14 |
+
* If key is present returns the value, else returns the default value.
|
15 |
+
*
|
16 |
+
* @since 5.6.0 added `bd` prefix.
|
17 |
+
*
|
18 |
+
* @param array $array Array from which value has to be retrieved.
|
19 |
+
* @param string $key Key, whose value to be retrieved.
|
20 |
+
* @param mixed $default Optional. Default value to be returned, if the key is not found.
|
21 |
+
*
|
22 |
+
* @return mixed Value if key is present, else the default value.
|
23 |
+
*/
|
24 |
+
function bd_array_get( $array, $key, $default = null ) {
|
25 |
+
return isset( $array[ $key ] ) ? $array[ $key ] : $default;
|
26 |
+
}
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Get a value from an array based on key and convert it into bool.
|
30 |
+
*
|
31 |
+
* @since 5.6.0 added `bd` prefix.
|
32 |
+
*
|
33 |
+
* @param array $array Array from which value has to be retrieved.
|
34 |
+
* @param string $key Key, whose value to be retrieved.
|
35 |
+
* @param bool $default (Optional) Default value to be returned, if the key is not found.
|
36 |
+
*
|
37 |
+
* @return bool Boolean converted Value if key is present, else the default value.
|
38 |
+
*/
|
39 |
+
function bd_array_get_bool( $array, $key, $default = false ) {
|
40 |
+
return bd_to_bool( bd_array_get( $array, $key, $default ) );
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Convert a string value into boolean, based on whether the value "True" or "False" is present.
|
45 |
+
*
|
46 |
+
* @since 5.5
|
47 |
+
*
|
48 |
+
* @param string $string String value to compare.
|
49 |
+
*
|
50 |
+
* @return bool True if string is "True", False otherwise.
|
51 |
+
*/
|
52 |
+
function bd_to_bool( $string ) {
|
53 |
+
return filter_var( $string, FILTER_VALIDATE_BOOLEAN );
|
54 |
+
}
|
55 |
+
|
56 |
+
/**
|
57 |
+
* Check if a string starts with a sub string.
|
58 |
+
*
|
59 |
+
* Copied from StackOverFlow.
|
60 |
+
*
|
61 |
+
* @see https://stackoverflow.com/a/834355/24949.
|
62 |
+
* @since 6.0.0
|
63 |
+
*
|
64 |
+
* @param string $haystack Haystack.
|
65 |
+
* @param string $needle Needle.
|
66 |
+
*
|
67 |
+
* @return bool True if Haystack starts with Needle, False otherwise.
|
68 |
+
*/
|
69 |
+
function bd_starts_with( $haystack, $needle ) {
|
70 |
+
return ( substr( $haystack, 0, strlen( $needle ) ) === $needle );
|
71 |
+
}
|
72 |
+
|
73 |
+
/**
|
74 |
+
* Check if a string ends with a sub string.
|
75 |
+
*
|
76 |
+
* Copied from StackOverFlow.
|
77 |
+
*
|
78 |
+
* @see https://stackoverflow.com/a/51491517/24949
|
79 |
+
* @since 6.0.0
|
80 |
+
*
|
81 |
+
* @param string $haystack Haystack.
|
82 |
+
* @param string $needle Needle.
|
83 |
+
*
|
84 |
+
* @return bool True if Haystack ends with Needle, False otherwise.
|
85 |
+
*/
|
86 |
+
function bd_ends_with( $haystack, $needle ) {
|
87 |
+
return substr( $haystack, - strlen( $needle ) ) === $needle;
|
88 |
+
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Check if a string contains another sub string.
|
92 |
+
*
|
93 |
+
* Copied from StackOverFlow.
|
94 |
+
*
|
95 |
+
* @see https://stackoverflow.com/a/4366748/24949
|
96 |
+
* @since 6.0.0
|
97 |
+
*
|
98 |
+
* @param string $haystack Haystack.
|
99 |
+
* @param string $needle Needle.
|
100 |
+
*
|
101 |
+
* @return bool True if Haystack ends with Needle, False otherwise.
|
102 |
+
*/
|
103 |
+
function bd_contains( $haystack, $needle ) {
|
104 |
+
return strpos( $haystack, $needle ) !== false;
|
105 |
+
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
* Get the short class name of an object.
|
109 |
+
*
|
110 |
+
* Short class name is the name of the class without namespace.
|
111 |
+
*
|
112 |
+
* @since 6.0.0
|
113 |
+
*
|
114 |
+
* @param object|string $class_name_or_object Object or Class name.
|
115 |
+
*
|
116 |
+
* @return string Short class name.
|
117 |
+
*/
|
118 |
+
function bd_get_short_class_name( $class_name_or_object ) {
|
119 |
+
$class_name = $class_name_or_object;
|
120 |
+
|
121 |
+
if ( is_object( $class_name_or_object ) ) {
|
122 |
+
$class_name = get_class( $class_name_or_object );
|
123 |
+
}
|
124 |
+
|
125 |
+
$pos = strrpos( $class_name, '\\' );
|
126 |
+
if ( false === $pos ) {
|
127 |
+
return $class_name;
|
128 |
+
}
|
129 |
+
|
130 |
+
return substr( $class_name, $pos + 1 );
|
131 |
+
}
|
132 |
+
|
133 |
+
/**
|
134 |
+
* Get GMT Offseted time in Unix Timestamp format.
|
135 |
+
*
|
136 |
+
* @since 6.0.0
|
137 |
+
*
|
138 |
+
* @param string $time_string Time string.
|
139 |
+
*
|
140 |
+
* @return int GMT Offseted time.in Unix Timestamp.
|
141 |
+
*/
|
142 |
+
function bd_get_gmt_offseted_time( $time_string ) {
|
143 |
+
$gmt_offset = sanitize_text_field( get_option( 'gmt_offset' ) );
|
144 |
+
|
145 |
+
return strtotime( $time_string ) - ( $gmt_offset * HOUR_IN_SECONDS );
|
146 |
+
}
|
147 |
+
|
148 |
+
/**
|
149 |
+
* Get the formatted list of allowed mime types.
|
150 |
+
* This function was originally defined in the Bulk Delete Attachment addon.
|
151 |
+
*
|
152 |
+
* @since 5.5
|
153 |
+
*
|
154 |
+
* @return array List of allowed mime types after formatting
|
155 |
+
*/
|
156 |
+
function bd_get_allowed_mime_types() {
|
157 |
+
$mime_types = get_allowed_mime_types();
|
158 |
+
sort( $mime_types );
|
159 |
+
|
160 |
+
$processed_mime_types = array();
|
161 |
+
$processed_mime_types['all'] = __( 'All mime types', 'bulk-delete' );
|
162 |
+
|
163 |
+
$last_value = '';
|
164 |
+
foreach ( $mime_types as $key => $value ) {
|
165 |
+
$splitted = explode( '/', $value, 2 );
|
166 |
+
$prefix = $splitted[0];
|
167 |
+
|
168 |
+
if ( '' == $last_value || $prefix != $last_value ) {
|
169 |
+
$processed_mime_types[ $prefix ] = __( 'All', 'bulk-delete' ) . ' ' . $prefix;
|
170 |
+
$last_value = $prefix;
|
171 |
+
}
|
172 |
+
|
173 |
+
$processed_mime_types[ $value ] = $value;
|
174 |
+
}
|
175 |
+
|
176 |
+
return $processed_mime_types;
|
177 |
+
}
|
include/license/class-bd-license-handler.php
CHANGED
@@ -170,8 +170,15 @@ class BD_License_Handler {
|
|
170 |
* @since 5.5
|
171 |
*/
|
172 |
public function show_admin_notices() {
|
173 |
-
|
174 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
175 |
}
|
176 |
}
|
177 |
|
170 |
* @since 5.5
|
171 |
*/
|
172 |
public function show_admin_notices() {
|
173 |
+
/**
|
174 |
+
* Check if user have admin rights.
|
175 |
+
*
|
176 |
+
* @since 6.0
|
177 |
+
*/
|
178 |
+
if ( current_user_can( 'manage_options' ) ) {
|
179 |
+
if ( '' != $this->notice_msg ) {
|
180 |
+
printf( '<div class="error"><p><strong>%s</strong></p></div>', $this->notice_msg );
|
181 |
+
}
|
182 |
}
|
183 |
}
|
184 |
|
include/license/class-bd-license.php
CHANGED
@@ -330,6 +330,8 @@ class BD_License {
|
|
330 |
public static function validate_license( $addon_code, $addon_name ) {
|
331 |
$key = Bulk_Delete::LICENSE_CACHE_KEY_PREFIX . $addon_code;
|
332 |
|
|
|
|
|
333 |
$licenses = get_option( Bulk_Delete::SETTING_OPTION_NAME );
|
334 |
if ( is_array( $licenses ) && key_exists( $addon_code, $licenses ) ) {
|
335 |
$license_data = BD_EDD_API_Wrapper::check_license( $addon_name, $licenses[ $addon_code ] );
|
@@ -352,10 +354,3 @@ class BD_License {
|
|
352 |
}
|
353 |
}
|
354 |
}
|
355 |
-
|
356 |
-
// hooks
|
357 |
-
add_action( 'bd_license_form' , array( 'BD_License', 'display_activate_license_form' ), 100 );
|
358 |
-
add_action( 'bd_deactivate_license', array( 'BD_License', 'deactivate_license' ) );
|
359 |
-
add_action( 'bd_delete_license' , array( 'BD_License', 'delete_license' ) );
|
360 |
-
add_action( 'bd_validate_license' , array( 'BD_License', 'validate_license' ), 10, 2 );
|
361 |
-
?>
|
330 |
public static function validate_license( $addon_code, $addon_name ) {
|
331 |
$key = Bulk_Delete::LICENSE_CACHE_KEY_PREFIX . $addon_code;
|
332 |
|
333 |
+
$license_data = false;
|
334 |
+
|
335 |
$licenses = get_option( Bulk_Delete::SETTING_OPTION_NAME );
|
336 |
if ( is_array( $licenses ) && key_exists( $addon_code, $licenses ) ) {
|
337 |
$license_data = BD_EDD_API_Wrapper::check_license( $addon_name, $licenses[ $addon_code ] );
|
354 |
}
|
355 |
}
|
356 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
include/misc/class-bulk-delete-jetpack-contact-form-messages.php
CHANGED
@@ -105,12 +105,12 @@ class Bulk_Delete_Jetpack_Contact_Form_Message {
|
|
105 |
<input name="smbd_feedback_restrict" id ="smbd_feedback_restrict" value = "true" type = "checkbox">
|
106 |
</td>
|
107 |
<td>
|
108 |
-
<?php _e( 'Only restrict to posts which are ', 'bulk-delete' )
|
109 |
<select name="smbd_feedback_op" id="smbd_feedback_op" disabled>
|
110 |
<option value ="<"><?php _e( 'older than', 'bulk-delete' );?></option>
|
111 |
<option value =">"><?php _e( 'posted within last', 'bulk-delete' );?></option>
|
112 |
</select>
|
113 |
-
<input type ="
|
114 |
</td>
|
115 |
</tr>
|
116 |
|
@@ -119,8 +119,8 @@ class Bulk_Delete_Jetpack_Contact_Form_Message {
|
|
119 |
<input name="smbd_feedback_limit" id="smbd_feedback_limit" value = "true" type = "checkbox">
|
120 |
</td>
|
121 |
<td>
|
122 |
-
|
123 |
-
<input type ="
|
124 |
<?php _e( 'Use this option if there are more than 1000 posts and the script times out.', 'bulk-delete' ) ?>
|
125 |
</td>
|
126 |
</tr>
|
@@ -133,16 +133,28 @@ class Bulk_Delete_Jetpack_Contact_Form_Message {
|
|
133 |
|
134 |
<tr>
|
135 |
<td scope="row" colspan="2">
|
136 |
-
|
137 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
138 |
</td>
|
139 |
</tr>
|
140 |
|
141 |
<tr>
|
142 |
<td scope="row" colspan="2">
|
143 |
-
<
|
144 |
-
|
145 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
<select name = "smbd_feedback_cron_freq" id = "smbd_feedback_cron_freq" disabled>
|
147 |
<option value = "-1"><?php _e( "Don't repeat", 'bulk-delete' ); ?></option>
|
148 |
<?php
|
@@ -198,14 +210,14 @@ class Bulk_Delete_Jetpack_Contact_Form_Message {
|
|
198 |
public static function do_delete_jetpack_messages() {
|
199 |
$delete_options = array();
|
200 |
|
201 |
-
$delete_options['use_filter'] =
|
202 |
|
203 |
-
$delete_options['restrict'] =
|
204 |
-
$delete_options['limit_to'] = absint(
|
205 |
-
$delete_options['force_delete'] =
|
206 |
|
207 |
-
$delete_options['feedback_op'] =
|
208 |
-
$delete_options['feedback_days'] =
|
209 |
|
210 |
/**
|
211 |
* Delete jetpack feedback delete options filter
|
@@ -215,7 +227,7 @@ class Bulk_Delete_Jetpack_Contact_Form_Message {
|
|
215 |
*/
|
216 |
$delete_options = apply_filters( 'bd_delete_jetpack_messages_delete_options', $delete_options, $_POST );
|
217 |
|
218 |
-
if ( 'true' ==
|
219 |
$freq = $_POST['smbd_feedback_cron_freq'];
|
220 |
$time = strtotime( $_POST['smbd_feedback_cron_start'] ) - ( get_option( 'gmt_offset' ) * 60 * 60 );
|
221 |
|
@@ -349,12 +361,12 @@ class Bulk_Delete_Jetpack_Contact_Form_Message {
|
|
349 |
<input name="smbd_feedback_author_name_filter" id ="smbd_feedback_author_name_filter" value = "true" type = "checkbox">
|
350 |
</td>
|
351 |
<td>
|
352 |
-
|
353 |
<select name="smbd_feedback_author_name_op" id="smbd_feedback_author_name_op" disabled>
|
354 |
<option value ="is"><?php _e( 'is', 'bulk-delete' );?></option>
|
355 |
<option value ="is-not"><?php _e( 'is not', 'bulk-delete' );?></option>
|
356 |
</select>
|
357 |
-
<input type ="
|
358 |
</td>
|
359 |
</tr>
|
360 |
|
@@ -363,12 +375,12 @@ class Bulk_Delete_Jetpack_Contact_Form_Message {
|
|
363 |
<input name="smbd_feedback_author_email_filter" id ="smbd_feedback_author_email_filter" value = "true" type = "checkbox">
|
364 |
</td>
|
365 |
<td>
|
366 |
-
|
367 |
<select name="smbd_feedback_author_email_op" id="smbd_feedback_author_email_op" disabled>
|
368 |
<option value ="is"><?php _e( 'is', 'bulk-delete' );?></option>
|
369 |
<option value ="is-not"><?php _e( 'is not', 'bulk-delete' );?></option>
|
370 |
</select>
|
371 |
-
<input type ="
|
372 |
</td>
|
373 |
</tr>
|
374 |
|
@@ -377,12 +389,12 @@ class Bulk_Delete_Jetpack_Contact_Form_Message {
|
|
377 |
<input name="smbd_feedback_author_ip_filter" id ="smbd_feedback_author_ip_filter" value = "true" type = "checkbox">
|
378 |
</td>
|
379 |
<td>
|
380 |
-
|
381 |
<select name="smbd_feedback_author_ip_op" id="smbd_feedback_author_ip_op" disabled>
|
382 |
<option value ="is"><?php _e( 'is', 'bulk-delete' );?></option>
|
383 |
<option value ="is-not"><?php _e( 'is not', 'bulk-delete' );?></option>
|
384 |
</select>
|
385 |
-
<input type ="
|
386 |
</td>
|
387 |
</tr>
|
388 |
</table>
|
@@ -403,12 +415,12 @@ class Bulk_Delete_Jetpack_Contact_Form_Message {
|
|
403 |
public static function process_filtering_options( $delete_options, $post ) {
|
404 |
$filters = array();
|
405 |
|
406 |
-
if ( 'true' ==
|
407 |
foreach ( array( 'name', 'email', 'ip' ) as $filter_name ) {
|
408 |
-
if( 'true' ==
|
409 |
$filters[$filter_name] = array(
|
410 |
-
'op' =>
|
411 |
-
'value' =>
|
412 |
);
|
413 |
}
|
414 |
}
|
@@ -434,7 +446,7 @@ class Bulk_Delete_Jetpack_Contact_Form_Message {
|
|
434 |
public static function can_delete( $delete_options, $post_id ) {
|
435 |
$can_delete = false;
|
436 |
|
437 |
-
if (
|
438 |
$content_fields = Grunion_Contact_Form_Plugin::parse_fields_from_content( $post_id );
|
439 |
|
440 |
$author_name = $content_fields['_feedback_author'];
|
@@ -473,17 +485,3 @@ class Bulk_Delete_Jetpack_Contact_Form_Message {
|
|
473 |
do_action( 'bd_after_scheduler', self::CRON_NAME, $count );
|
474 |
}
|
475 |
}
|
476 |
-
|
477 |
-
// hooks
|
478 |
-
add_action( 'bd_add_meta_box_for_misc' , array( 'Bulk_Delete_Jetpack_Contact_Form_Message', 'add_delete_jetpack_messages_meta_box' ) );
|
479 |
-
add_action( 'bd_delete_jetpack_messages', array( 'Bulk_Delete_Jetpack_Contact_Form_Message', 'do_delete_jetpack_messages' ) );
|
480 |
-
|
481 |
-
add_filter( 'bd_javascript_array', array( 'Bulk_Delete_Jetpack_Contact_Form_Message', 'filter_js_array' ) );
|
482 |
-
add_action( 'bd_delete_jetpack_messages_form', array( 'Bulk_Delete_Jetpack_Contact_Form_Message', 'add_filtering_options' ) );
|
483 |
-
|
484 |
-
add_filter( 'bd_delete_jetpack_messages_delete_options', array( 'Bulk_Delete_Jetpack_Contact_Form_Message', 'process_filtering_options' ), 10, 2 );
|
485 |
-
add_filter( 'bd_delete_jetpack_messages_can_delete', array( 'Bulk_Delete_Jetpack_Contact_Form_Message', 'can_delete' ), 10, 2 );
|
486 |
-
|
487 |
-
// cron hooks
|
488 |
-
add_action( Bulk_Delete_Jetpack_Contact_Form_Message::CRON_HOOK, array( 'Bulk_Delete_Jetpack_Contact_Form_Message', 'do_delete_jetpack_messages_cron' ), 10, 1 );
|
489 |
-
?>
|
105 |
<input name="smbd_feedback_restrict" id ="smbd_feedback_restrict" value = "true" type = "checkbox">
|
106 |
</td>
|
107 |
<td>
|
108 |
+
<label for="smbd_feedback_restrict"> <?php _e( 'Only restrict to posts which are ', 'bulk-delete' ); ?></label>
|
109 |
<select name="smbd_feedback_op" id="smbd_feedback_op" disabled>
|
110 |
<option value ="<"><?php _e( 'older than', 'bulk-delete' );?></option>
|
111 |
<option value =">"><?php _e( 'posted within last', 'bulk-delete' );?></option>
|
112 |
</select>
|
113 |
+
<input type ="text" name="smbd_feedback_days" id ="smbd_feedback_days" value ="0" maxlength="4" size="4" disabled><?php _e( 'days', 'bulk-delete' );?>
|
114 |
</td>
|
115 |
</tr>
|
116 |
|
119 |
<input name="smbd_feedback_limit" id="smbd_feedback_limit" value = "true" type = "checkbox">
|
120 |
</td>
|
121 |
<td>
|
122 |
+
<label for="smbd_feedback_limit"><?php _e( 'Only delete first ', 'bulk-delete' ); ?></label>
|
123 |
+
<input type ="text" name="smbd_feedback_limit_to" id="smbd_feedback_limit_to" disabled value ="0" maxlength="4" size="4"><?php _e( 'posts.', 'bulk-delete' );?>
|
124 |
<?php _e( 'Use this option if there are more than 1000 posts and the script times out.', 'bulk-delete' ) ?>
|
125 |
</td>
|
126 |
</tr>
|
133 |
|
134 |
<tr>
|
135 |
<td scope="row" colspan="2">
|
136 |
+
<label>
|
137 |
+
<input name="smbd_feedback_force_delete" value = "false" type = "radio" checked="checked">
|
138 |
+
<?php _e( 'Move to Trash', 'bulk-delete' ); ?>
|
139 |
+
</label>
|
140 |
+
<label>
|
141 |
+
<input name="smbd_feedback_force_delete" value = "true" type = "radio">
|
142 |
+
<?php _e( 'Delete permanently', 'bulk-delete' ); ?>
|
143 |
+
</label>
|
144 |
</td>
|
145 |
</tr>
|
146 |
|
147 |
<tr>
|
148 |
<td scope="row" colspan="2">
|
149 |
+
<label>
|
150 |
+
<input name="smbd_feedback_cron" value = "false" type = "radio" checked="checked" >
|
151 |
+
<?php _e( 'Delete now', 'bulk-delete' ); ?>
|
152 |
+
</label>
|
153 |
+
<label>
|
154 |
+
<input name="smbd_feedback_cron" value = "true" type = "radio" id = "smbd_feedback_cron" disabled >
|
155 |
+
<?php _e( 'Schedule', 'bulk-delete' ); ?>
|
156 |
+
</label>
|
157 |
+
<input name="smbd_feedback_cron_start" id = "smbd_feedback_cron_start" value = "now" type = "text" disabled autocomplete ="off" ><?php _e( 'repeat ', 'bulk-delete' );?>
|
158 |
<select name = "smbd_feedback_cron_freq" id = "smbd_feedback_cron_freq" disabled>
|
159 |
<option value = "-1"><?php _e( "Don't repeat", 'bulk-delete' ); ?></option>
|
160 |
<?php
|
210 |
public static function do_delete_jetpack_messages() {
|
211 |
$delete_options = array();
|
212 |
|
213 |
+
$delete_options['use_filter'] = bd_array_get( $_POST, 'smbd_feedback_use_filter', 'false' );
|
214 |
|
215 |
+
$delete_options['restrict'] = bd_array_get( $_POST, 'smbd_feedback_restrict', false );
|
216 |
+
$delete_options['limit_to'] = absint( bd_array_get( $_POST, 'smbd_feedback_limit_to', 0 ) );
|
217 |
+
$delete_options['force_delete'] = bd_array_get( $_POST, 'smbd_feedback_force_delete', 'false' );
|
218 |
|
219 |
+
$delete_options['feedback_op'] = bd_array_get( $_POST, 'smbd_feedback_op' );
|
220 |
+
$delete_options['feedback_days'] = bd_array_get( $_POST, 'smbd_feedback_days' );
|
221 |
|
222 |
/**
|
223 |
* Delete jetpack feedback delete options filter
|
227 |
*/
|
228 |
$delete_options = apply_filters( 'bd_delete_jetpack_messages_delete_options', $delete_options, $_POST );
|
229 |
|
230 |
+
if ( 'true' == bd_array_get( $_POST, 'smbd_feedback_cron', 'false' ) ) {
|
231 |
$freq = $_POST['smbd_feedback_cron_freq'];
|
232 |
$time = strtotime( $_POST['smbd_feedback_cron_start'] ) - ( get_option( 'gmt_offset' ) * 60 * 60 );
|
233 |
|
361 |
<input name="smbd_feedback_author_name_filter" id ="smbd_feedback_author_name_filter" value = "true" type = "checkbox">
|
362 |
</td>
|
363 |
<td>
|
364 |
+
<label for="smbd_feedback_author_name_filter"><?php _e( 'Only if author name ', 'bulk-delete' ); ?></label>
|
365 |
<select name="smbd_feedback_author_name_op" id="smbd_feedback_author_name_op" disabled>
|
366 |
<option value ="is"><?php _e( 'is', 'bulk-delete' );?></option>
|
367 |
<option value ="is-not"><?php _e( 'is not', 'bulk-delete' );?></option>
|
368 |
</select>
|
369 |
+
<input type ="text" name="smbd_feedback_author_name_value" id ="smbd_feedback_author_name_value" disabled placeholder="<?php _e( 'Author Name', 'bulk-delete' ); ?>">
|
370 |
</td>
|
371 |
</tr>
|
372 |
|
375 |
<input name="smbd_feedback_author_email_filter" id ="smbd_feedback_author_email_filter" value = "true" type = "checkbox">
|
376 |
</td>
|
377 |
<td>
|
378 |
+
<label for="smbd_feedback_author_email_filter"><?php _e( 'Only if author email ', 'bulk-delete' ); ?></label>
|
379 |
<select name="smbd_feedback_author_email_op" id="smbd_feedback_author_email_op" disabled>
|
380 |
<option value ="is"><?php _e( 'is', 'bulk-delete' );?></option>
|
381 |
<option value ="is-not"><?php _e( 'is not', 'bulk-delete' );?></option>
|
382 |
</select>
|
383 |
+
<input type ="text" name="smbd_feedback_author_email_value" id ="smbd_feedback_author_email_value" disabled placeholder="<?php _e( 'Author Email', 'bulk-delete' ); ?>">
|
384 |
</td>
|
385 |
</tr>
|
386 |
|
389 |
<input name="smbd_feedback_author_ip_filter" id ="smbd_feedback_author_ip_filter" value = "true" type = "checkbox">
|
390 |
</td>
|
391 |
<td>
|
392 |
+
<label for="smbd_feedback_author_ip_filter"><?php _e( 'Only if author ip ', 'bulk-delete' ); ?></label>
|
393 |
<select name="smbd_feedback_author_ip_op" id="smbd_feedback_author_ip_op" disabled>
|
394 |
<option value ="is"><?php _e( 'is', 'bulk-delete' );?></option>
|
395 |
<option value ="is-not"><?php _e( 'is not', 'bulk-delete' );?></option>
|
396 |
</select>
|
397 |
+
<input type ="text" name="smbd_feedback_author_ip_value" id ="smbd_feedback_author_ip_value" disabled placeholder="<?php _e( 'Author ip', 'bulk-delete' ); ?>">
|
398 |
</td>
|
399 |
</tr>
|
400 |
</table>
|
415 |
public static function process_filtering_options( $delete_options, $post ) {
|
416 |
$filters = array();
|
417 |
|
418 |
+
if ( 'true' == bd_array_get( $post, 'smbd_feedback_use_filter', 'false' ) ) {
|
419 |
foreach ( array( 'name', 'email', 'ip' ) as $filter_name ) {
|
420 |
+
if( 'true' == bd_array_get( $post, "smbd_feedback_author_{$filter_name}_filter", 'false' ) ) {
|
421 |
$filters[$filter_name] = array(
|
422 |
+
'op' => bd_array_get( $post, "smbd_feedback_author_{$filter_name}_op", 'is' ),
|
423 |
+
'value' => bd_array_get( $post, "smbd_feedback_author_{$filter_name}_value", '' ),
|
424 |
);
|
425 |
}
|
426 |
}
|
446 |
public static function can_delete( $delete_options, $post_id ) {
|
447 |
$can_delete = false;
|
448 |
|
449 |
+
if ( self::is_jetpack_contact_active() ) {
|
450 |
$content_fields = Grunion_Contact_Form_Plugin::parse_fields_from_content( $post_id );
|
451 |
|
452 |
$author_name = $content_fields['_feedback_author'];
|
485 |
do_action( 'bd_after_scheduler', self::CRON_NAME, $count );
|
486 |
}
|
487 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
include/misc/class-bulk-delete-misc.php
CHANGED
@@ -45,6 +45,19 @@ class Bulk_Delete_Misc {
|
|
45 |
// delete menus page
|
46 |
add_action( "load-{$bd->misc_page}", array( __CLASS__, 'add_delete_misc_settings_panel' ) );
|
47 |
add_action( "add_meta_boxes_{$bd->misc_page}", array( __CLASS__, 'add_delete_misc_meta_boxes' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
}
|
49 |
|
50 |
/**
|
@@ -171,10 +184,3 @@ class Bulk_Delete_Misc {
|
|
171 |
return get_user_meta( $current_user->ID, self::VISIBLE_MISC_BOXES, true );
|
172 |
}
|
173 |
}
|
174 |
-
|
175 |
-
// Add menu
|
176 |
-
add_action( 'bd_after_primary_menus', array( 'Bulk_Delete_Misc', 'add_menu' ) );
|
177 |
-
|
178 |
-
// Modify admin footer
|
179 |
-
add_action( 'bd_admin_footer_misc_page', 'bd_modify_admin_footer' );
|
180 |
-
?>
|
45 |
// delete menus page
|
46 |
add_action( "load-{$bd->misc_page}", array( __CLASS__, 'add_delete_misc_settings_panel' ) );
|
47 |
add_action( "add_meta_boxes_{$bd->misc_page}", array( __CLASS__, 'add_delete_misc_meta_boxes' ) );
|
48 |
+
|
49 |
+
// hooks
|
50 |
+
add_action( 'bd_add_meta_box_for_misc' , array( 'Bulk_Delete_Jetpack_Contact_Form_Message', 'add_delete_jetpack_messages_meta_box' ) );
|
51 |
+
add_action( 'bd_delete_jetpack_messages', array( 'Bulk_Delete_Jetpack_Contact_Form_Message', 'do_delete_jetpack_messages' ) );
|
52 |
+
|
53 |
+
add_filter( 'bd_javascript_array', array( 'Bulk_Delete_Jetpack_Contact_Form_Message', 'filter_js_array' ) );
|
54 |
+
add_action( 'bd_delete_jetpack_messages_form', array( 'Bulk_Delete_Jetpack_Contact_Form_Message', 'add_filtering_options' ) );
|
55 |
+
|
56 |
+
add_filter( 'bd_delete_jetpack_messages_delete_options', array( 'Bulk_Delete_Jetpack_Contact_Form_Message', 'process_filtering_options' ), 10, 2 );
|
57 |
+
add_filter( 'bd_delete_jetpack_messages_can_delete', array( 'Bulk_Delete_Jetpack_Contact_Form_Message', 'can_delete' ), 10, 2 );
|
58 |
+
|
59 |
+
// cron hooks
|
60 |
+
add_action( Bulk_Delete_Jetpack_Contact_Form_Message::CRON_HOOK, array( 'Bulk_Delete_Jetpack_Contact_Form_Message', 'do_delete_jetpack_messages_cron' ), 10, 1 );
|
61 |
}
|
62 |
|
63 |
/**
|
184 |
return get_user_meta( $current_user->ID, self::VISIBLE_MISC_BOXES, true );
|
185 |
}
|
186 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
include/settings/class-bd-settings-page.php
CHANGED
@@ -130,10 +130,3 @@ class BD_Settings_Page {
|
|
130 |
do_action( 'bd_admin_footer_settings_page' );
|
131 |
}
|
132 |
}
|
133 |
-
|
134 |
-
// Add menu
|
135 |
-
add_action( 'bd_before_secondary_menus', array( 'BD_Settings_Page', 'add_menu' ) );
|
136 |
-
|
137 |
-
// Modify admin footer
|
138 |
-
add_action( 'bd_admin_footer_settings_page', 'bd_modify_admin_footer' );
|
139 |
-
?>
|
130 |
do_action( 'bd_admin_footer_settings_page' );
|
131 |
}
|
132 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
include/settings/class-bd-settings.php
CHANGED
@@ -60,6 +60,3 @@ class BD_Settings {
|
|
60 |
return apply_filters( 'bd_license_input', $input );
|
61 |
}
|
62 |
}
|
63 |
-
|
64 |
-
// hooks
|
65 |
-
add_action( 'admin_init', array( 'BD_Settings', 'create_settings' ), 100 );
|
60 |
return apply_filters( 'bd_license_input', $input );
|
61 |
}
|
62 |
}
|
|
|
|
|
|
include/ui/admin-ui.php
CHANGED
@@ -39,26 +39,6 @@ function bd_modify_admin_footer() {
|
|
39 |
add_filter( 'admin_footer_text', 'bd_add_rating_link' );
|
40 |
}
|
41 |
|
42 |
-
/**
|
43 |
-
* Adds setting links in plugin listing page.
|
44 |
-
* Based on http://striderweb.com/nerdaphernalia/2008/06/wp-use-action-links/.
|
45 |
-
*
|
46 |
-
* @param array $links List of current links
|
47 |
-
* @param string $file Plugin filename
|
48 |
-
*
|
49 |
-
* @return array $links Modified list of links
|
50 |
-
*/
|
51 |
-
function bd_add_plugin_action_links( $links, $file ) {
|
52 |
-
$this_plugin = plugin_basename( Bulk_Delete::$PLUGIN_FILE );
|
53 |
-
|
54 |
-
if ( $file == $this_plugin ) {
|
55 |
-
$delete_posts_link = '<a href="admin.php?page=' . Bulk_Delete::POSTS_PAGE_SLUG . '">' . __( 'Bulk Delete Posts', 'bulk-delete' ) . '</a>';
|
56 |
-
array_unshift( $links, $delete_posts_link ); // before other links
|
57 |
-
}
|
58 |
-
|
59 |
-
return $links;
|
60 |
-
}
|
61 |
-
|
62 |
/**
|
63 |
* Add additional links in the Plugin listing page.
|
64 |
* Based on http://zourbuth.com/archives/751/creating-additional-wordpress-plugin-links-row-meta/.
|
@@ -88,5 +68,4 @@ add_action( 'bd_admin_footer_addon_page', 'bd_modify_admin_footer' );
|
|
88 |
add_action( 'bd_admin_footer_info_page' , 'bd_modify_admin_footer' );
|
89 |
|
90 |
// Change plugin listing page
|
91 |
-
add_filter( 'plugin_action_links', 'bd_add_plugin_action_links', 10, 2 );
|
92 |
add_filter( 'plugin_row_meta', 'bd_add_links_in_plugin_listing', 10, 2 );
|
39 |
add_filter( 'admin_footer_text', 'bd_add_rating_link' );
|
40 |
}
|
41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
/**
|
43 |
* Add additional links in the Plugin listing page.
|
44 |
* Based on http://zourbuth.com/archives/751/creating-additional-wordpress-plugin-links-row-meta/.
|
68 |
add_action( 'bd_admin_footer_info_page' , 'bd_modify_admin_footer' );
|
69 |
|
70 |
// Change plugin listing page
|
|
|
71 |
add_filter( 'plugin_row_meta', 'bd_add_links_in_plugin_listing', 10, 2 );
|
include/ui/class-bulk-delete-help-screen.php
CHANGED
@@ -107,6 +107,3 @@ class Bulk_Delete_Help_Screen {
|
|
107 |
echo '<p>' . __( 'This plugin can be used to delete the posts, pages or users using various filters and conditions.', 'bulk-delete' ) . '</p>';
|
108 |
}
|
109 |
}
|
110 |
-
|
111 |
-
// hooks
|
112 |
-
add_action( 'bd_add_contextual_help', array( 'Bulk_Delete_Help_Screen', 'add_contextual_help' ) );
|
107 |
echo '<p>' . __( 'This plugin can be used to delete the posts, pages or users using various filters and conditions.', 'bulk-delete' ) . '</p>';
|
108 |
}
|
109 |
}
|
|
|
|
|
|
include/ui/form.php
CHANGED
@@ -40,7 +40,7 @@ function bd_render_restrict_settings( $slug, $item = 'posts' ) {
|
|
40 |
<input name="smbd_<?php echo $slug; ?>_restrict" id="smbd_<?php echo $slug; ?>_restrict" value="true" type="checkbox">
|
41 |
</td>
|
42 |
<td>
|
43 |
-
<?php printf( __( 'Only restrict to %s which are ', 'bulk-delete' ), $item )
|
44 |
<select name="smbd_<?php echo $slug; ?>_op" id="smbd_<?php echo $slug; ?>_op" disabled>
|
45 |
<option value="before"><?php _e( 'older than', 'bulk-delete' );?></option>
|
46 |
<option value="after"><?php _e( 'posted within last', 'bulk-delete' );?></option>
|
@@ -62,8 +62,8 @@ function bd_render_delete_settings( $slug ) {
|
|
62 |
?>
|
63 |
<tr>
|
64 |
<td scope="row" colspan="2">
|
65 |
-
<input name="smbd_<?php echo $slug; ?>_force_delete" value="false" type="radio" checked
|
66 |
-
<input name="smbd_<?php echo $slug; ?>_force_delete" value="true" type="radio"
|
67 |
</td>
|
68 |
</tr>
|
69 |
<?php
|
@@ -77,14 +77,14 @@ function bd_render_delete_settings( $slug ) {
|
|
77 |
* @param string $slug The slug to be used in field names.
|
78 |
*/
|
79 |
function bd_render_private_post_settings( $slug ) {
|
80 |
-
?>
|
81 |
<tr>
|
82 |
<td scope="row" colspan="2">
|
83 |
-
<input name="smbd_<?php echo $slug; ?>_private" value="false" type="radio" checked> <?php _e( 'Public posts', 'bulk-delete' );
|
84 |
-
<input name="smbd_<?php echo $slug; ?>_private" value="true" type="radio"> <?php _e( 'Private Posts', 'bulk-delete' );
|
85 |
</td>
|
86 |
</tr>
|
87 |
-
<?php
|
88 |
}
|
89 |
|
90 |
/**
|
@@ -102,7 +102,7 @@ function bd_render_limit_settings( $slug, $item = 'posts' ) {
|
|
102 |
<input name="smbd_<?php echo $slug; ?>_limit" id="smbd_<?php echo $slug; ?>_limit" value="true" type="checkbox">
|
103 |
</td>
|
104 |
<td>
|
105 |
-
<?php _e( 'Only delete first ', 'bulk-delete' )
|
106 |
<input type="number" name="smbd_<?php echo $slug; ?>_limit_to" id="smbd_<?php echo $slug; ?>_limit_to" class="screen-per-page" disabled value="0" min="0"> <?php echo $item;?>.
|
107 |
<?php printf( __( 'Use this option if there are more than 1000 %s and the script times out.', 'bulk-delete' ), $item ); ?>
|
108 |
</td>
|
@@ -123,9 +123,9 @@ function bd_render_cron_settings( $slug, $addon_url ) {
|
|
123 |
?>
|
124 |
<tr>
|
125 |
<td scope="row" colspan="2">
|
126 |
-
<input name="smbd_<?php echo $slug; ?>_cron" value="false" type="radio" checked="checked"> <?php _e( 'Delete now', 'bulk-delete' );
|
127 |
-
<input name="smbd_<?php echo $slug; ?>_cron" value="true" type="radio" id="smbd_<?php echo $slug; ?>_cron" disabled > <?php _e( 'Schedule', 'bulk-delete' );
|
128 |
-
<input name="smbd_<?php echo $slug; ?>_cron_start" id="smbd_<?php echo $slug; ?>_cron_start" value="now" type="text" disabled><?php _e( 'repeat ', 'bulk-delete' );?>
|
129 |
<select name="smbd_<?php echo $slug; ?>_cron_freq" id="smbd_<?php echo $slug; ?>_cron_freq" disabled>
|
130 |
<option value="-1"><?php _e( "Don't repeat", 'bulk-delete' ); ?></option>
|
131 |
<?php
|
@@ -163,57 +163,81 @@ function bd_render_submit_button( $action ) {
|
|
163 |
}
|
164 |
|
165 |
/**
|
166 |
-
*
|
167 |
*
|
168 |
-
* @since 5.
|
169 |
*
|
170 |
-
* @
|
171 |
*/
|
172 |
-
function
|
173 |
-
$
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
<?php foreach ( $types as $type ) { ?>
|
179 |
-
<option value="<?php echo esc_attr( $type ); ?>"><?php echo esc_html( $type ); ?></option>
|
180 |
-
<?php } ?>
|
181 |
-
</select>
|
182 |
-
</td>
|
183 |
-
</tr>
|
184 |
-
<?php
|
185 |
}
|
186 |
|
187 |
/**
|
188 |
-
* Get the list of
|
189 |
*
|
190 |
-
* @since
|
191 |
*
|
192 |
-
* @return
|
193 |
*/
|
194 |
-
function
|
195 |
-
$
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
|
200 |
-
return $
|
201 |
}
|
202 |
|
203 |
/**
|
204 |
-
* Get the list of post
|
205 |
*
|
206 |
-
* @since
|
207 |
*
|
208 |
-
* @return \WP_Post_Type[] List of post
|
209 |
*/
|
210 |
-
function
|
211 |
-
$
|
212 |
|
213 |
-
$
|
214 |
-
|
215 |
|
216 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
217 |
}
|
218 |
|
219 |
/**
|
@@ -255,15 +279,7 @@ function bd_render_post_status_filter( $slug, $selected = 'publish' ) {
|
|
255 |
function bd_get_post_statuses() {
|
256 |
$post_statuses = get_post_stati( array(), 'object' );
|
257 |
|
258 |
-
|
259 |
-
* List of post statuses that should be excluded from post status filter.
|
260 |
-
*
|
261 |
-
* @since 5.6.0
|
262 |
-
*
|
263 |
-
* @param array $post_statuses List of post statuses.
|
264 |
-
*/
|
265 |
-
$exclude_post_statuses = apply_filters( 'bd_exclude_post_statuses', array( 'inherit', 'trash', 'auto-draft' ) );
|
266 |
-
|
267 |
foreach ( $exclude_post_statuses as $key ) {
|
268 |
unset( $post_statuses[ $key ] );
|
269 |
}
|
@@ -278,6 +294,35 @@ function bd_get_post_statuses() {
|
|
278 |
return apply_filters( 'bd_post_statuses', $post_statuses );
|
279 |
}
|
280 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
281 |
/**
|
282 |
* Generate help tooltip and append it to existing markup.
|
283 |
*
|
40 |
<input name="smbd_<?php echo $slug; ?>_restrict" id="smbd_<?php echo $slug; ?>_restrict" value="true" type="checkbox">
|
41 |
</td>
|
42 |
<td>
|
43 |
+
<label for="smbd_<?php echo $slug; ?>_restrict"><?php printf( __( 'Only restrict to %s which are ', 'bulk-delete' ), $item ); ?></label>
|
44 |
<select name="smbd_<?php echo $slug; ?>_op" id="smbd_<?php echo $slug; ?>_op" disabled>
|
45 |
<option value="before"><?php _e( 'older than', 'bulk-delete' );?></option>
|
46 |
<option value="after"><?php _e( 'posted within last', 'bulk-delete' );?></option>
|
62 |
?>
|
63 |
<tr>
|
64 |
<td scope="row" colspan="2">
|
65 |
+
<label><input name="smbd_<?php echo $slug; ?>_force_delete" value="false" type="radio" checked><?php _e( 'Move to Trash', 'bulk-delete' ); ?></label>
|
66 |
+
<label><input name="smbd_<?php echo $slug; ?>_force_delete" value="true" type="radio"><?php _e( 'Delete permanently', 'bulk-delete' ); ?></label>
|
67 |
</td>
|
68 |
</tr>
|
69 |
<?php
|
77 |
* @param string $slug The slug to be used in field names.
|
78 |
*/
|
79 |
function bd_render_private_post_settings( $slug ) {
|
80 |
+
?>
|
81 |
<tr>
|
82 |
<td scope="row" colspan="2">
|
83 |
+
<label><input name="smbd_<?php echo $slug; ?>_private" value="false" type="radio" checked> <?php _e( 'Public posts', 'bulk-delete' ); ?></label>
|
84 |
+
<label><input name="smbd_<?php echo $slug; ?>_private" value="true" type="radio"> <?php _e( 'Private Posts', 'bulk-delete' ); ?></label>
|
85 |
</td>
|
86 |
</tr>
|
87 |
+
<?php
|
88 |
}
|
89 |
|
90 |
/**
|
102 |
<input name="smbd_<?php echo $slug; ?>_limit" id="smbd_<?php echo $slug; ?>_limit" value="true" type="checkbox">
|
103 |
</td>
|
104 |
<td>
|
105 |
+
<label for="smbd_<?php echo $slug; ?>_limit"><?php _e( 'Only delete first ', 'bulk-delete' ); ?></label>
|
106 |
<input type="number" name="smbd_<?php echo $slug; ?>_limit_to" id="smbd_<?php echo $slug; ?>_limit_to" class="screen-per-page" disabled value="0" min="0"> <?php echo $item;?>.
|
107 |
<?php printf( __( 'Use this option if there are more than 1000 %s and the script times out.', 'bulk-delete' ), $item ); ?>
|
108 |
</td>
|
123 |
?>
|
124 |
<tr>
|
125 |
<td scope="row" colspan="2">
|
126 |
+
<label><input name="smbd_<?php echo $slug; ?>_cron" value="false" type="radio" checked="checked"> <?php _e( 'Delete now', 'bulk-delete' ); ?></label>
|
127 |
+
<label><input name="smbd_<?php echo $slug; ?>_cron" value="true" type="radio" id="smbd_<?php echo $slug; ?>_cron" disabled > <?php _e( 'Schedule', 'bulk-delete' ); ?></label>
|
128 |
+
<input name="smbd_<?php echo $slug; ?>_cron_start" id="smbd_<?php echo $slug; ?>_cron_start" value="now" type="text" disabled autocomplete="off"><?php _e( 'repeat ', 'bulk-delete' );?>
|
129 |
<select name="smbd_<?php echo $slug; ?>_cron_freq" id="smbd_<?php echo $slug; ?>_cron_freq" disabled>
|
130 |
<option value="-1"><?php _e( "Don't repeat", 'bulk-delete' ); ?></option>
|
131 |
<?php
|
163 |
}
|
164 |
|
165 |
/**
|
166 |
+
* Get the list of post type objects that will be used in filters.
|
167 |
*
|
168 |
+
* @since 5.6.0
|
169 |
*
|
170 |
+
* @return \WP_Post_Type[] List of post type objects.
|
171 |
*/
|
172 |
+
function bd_get_post_types() {
|
173 |
+
$custom_types = bd_get_custom_post_types();
|
174 |
+
|
175 |
+
$builtin_types = bd_get_builtin_public_post_types();
|
176 |
+
|
177 |
+
return array_merge( $builtin_types, $custom_types );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
178 |
}
|
179 |
|
180 |
/**
|
181 |
+
* Get the list of built-in public post types.
|
182 |
*
|
183 |
+
* @since 6.0.0
|
184 |
*
|
185 |
+
* @return \WP_Post_Type[] List of public built-in post types.
|
186 |
*/
|
187 |
+
function bd_get_builtin_public_post_types() {
|
188 |
+
$builtin_types = array(
|
189 |
+
'post' => get_post_type_object( 'post' ),
|
190 |
+
'page' => get_post_type_object( 'page' ),
|
191 |
+
);
|
192 |
|
193 |
+
return $builtin_types;
|
194 |
}
|
195 |
|
196 |
/**
|
197 |
+
* Get the list of custom post types.
|
198 |
*
|
199 |
+
* @since 6.0.0
|
200 |
*
|
201 |
+
* @return \WP_Post_Type[] List of custom post types.
|
202 |
*/
|
203 |
+
function bd_get_custom_post_types() {
|
204 |
+
$custom_types = get_post_types( array( '_builtin' => false ), 'objects' );
|
205 |
|
206 |
+
return $custom_types;
|
207 |
+
}
|
208 |
|
209 |
+
/**
|
210 |
+
* Render Post type dropdown.
|
211 |
+
*
|
212 |
+
* @param string $field_slug Field slug.
|
213 |
+
*/
|
214 |
+
function bd_render_post_type_dropdown( $field_slug ) {
|
215 |
+
$builtin_post_types = bd_get_builtin_public_post_types();
|
216 |
+
$custom_post_types = bd_get_custom_post_types();
|
217 |
+
?>
|
218 |
+
|
219 |
+
<tr>
|
220 |
+
<td scope="row">
|
221 |
+
<select class="enhanced-dropdown" name="smbd_<?php echo esc_attr( $field_slug ); ?>_post_type">
|
222 |
+
<optgroup label="<?php esc_attr_e( 'Built-in Post Types', 'bulk-delete' ); ?>">
|
223 |
+
<?php foreach ( $builtin_post_types as $type ) : ?>
|
224 |
+
<option value="<?php echo esc_attr( $type->name ); ?>">
|
225 |
+
<?php echo esc_html( $type->labels->singular_name . ' (' . $type->name . ')' ); ?>
|
226 |
+
</option>
|
227 |
+
<?php endforeach; ?>
|
228 |
+
</optgroup>
|
229 |
+
|
230 |
+
<optgroup label="<?php esc_attr_e( 'Custom Post Types', 'bulk-delete' ); ?>">
|
231 |
+
<?php foreach ( $custom_post_types as $type ) : ?>
|
232 |
+
<option value="<?php echo esc_attr( $type->name ); ?>">
|
233 |
+
<?php echo esc_html( $type->labels->singular_name . ' (' . $type->name . ')' ); ?>
|
234 |
+
</option>
|
235 |
+
<?php endforeach; ?>
|
236 |
+
</optgroup>
|
237 |
+
</select>
|
238 |
+
</td>
|
239 |
+
</tr>
|
240 |
+
<?php
|
241 |
}
|
242 |
|
243 |
/**
|
279 |
function bd_get_post_statuses() {
|
280 |
$post_statuses = get_post_stati( array(), 'object' );
|
281 |
|
282 |
+
$exclude_post_statuses = bd_get_excluded_post_statuses();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
283 |
foreach ( $exclude_post_statuses as $key ) {
|
284 |
unset( $post_statuses[ $key ] );
|
285 |
}
|
294 |
return apply_filters( 'bd_post_statuses', $post_statuses );
|
295 |
}
|
296 |
|
297 |
+
/**
|
298 |
+
* Get the list of excluded post statuses.
|
299 |
+
*
|
300 |
+
* @since 6.0.0
|
301 |
+
*
|
302 |
+
* @return array List of excluded post statuses.
|
303 |
+
*/
|
304 |
+
function bd_get_excluded_post_statuses() {
|
305 |
+
/**
|
306 |
+
* List of post statuses that should be excluded from post status filter.
|
307 |
+
*
|
308 |
+
* @since 5.6.0
|
309 |
+
*
|
310 |
+
* @param array $post_statuses List of post statuses to exclude.
|
311 |
+
*/
|
312 |
+
return apply_filters(
|
313 |
+
'bd_excluded_post_statuses',
|
314 |
+
array(
|
315 |
+
'inherit',
|
316 |
+
'trash',
|
317 |
+
'auto-draft',
|
318 |
+
'request-pending',
|
319 |
+
'request-confirmed',
|
320 |
+
'request-failed',
|
321 |
+
'request-completed',
|
322 |
+
)
|
323 |
+
);
|
324 |
+
}
|
325 |
+
|
326 |
/**
|
327 |
* Generate help tooltip and append it to existing markup.
|
328 |
*
|
include/util/query.php
CHANGED
@@ -2,22 +2,20 @@
|
|
2 |
/**
|
3 |
* Utility and wrapper functions for WP_Query.
|
4 |
*
|
5 |
-
* @since
|
6 |
-
*
|
7 |
-
* @author Sudar
|
8 |
-
*
|
9 |
-
* @package BulkDelete\Util
|
10 |
*/
|
11 |
-
defined( 'ABSPATH' ) || exit; // Exit if accessed directly
|
12 |
|
13 |
/**
|
14 |
* Process delete options array and build query.
|
15 |
*
|
16 |
-
* @param array $delete_options Delete Options
|
17 |
-
* @param array $options (optional) Options query
|
|
|
|
|
18 |
*/
|
19 |
function bd_build_query_options( $delete_options, $options = array() ) {
|
20 |
-
// private posts
|
21 |
if ( isset( $delete_options['private'] ) ) {
|
22 |
if ( $delete_options['private'] ) {
|
23 |
$options['post_status'] = 'private';
|
@@ -28,19 +26,24 @@ function bd_build_query_options( $delete_options, $options = array() ) {
|
|
28 |
}
|
29 |
}
|
30 |
|
31 |
-
// limit to query
|
32 |
if ( $delete_options['limit_to'] > 0 ) {
|
33 |
$options['showposts'] = $delete_options['limit_to'];
|
34 |
} else {
|
35 |
-
$options['nopaging']
|
36 |
}
|
37 |
|
38 |
-
// post type
|
39 |
if ( isset( $delete_options['post_type'] ) ) {
|
40 |
$options['post_type'] = $delete_options['post_type'];
|
41 |
}
|
42 |
|
43 |
-
//
|
|
|
|
|
|
|
|
|
|
|
44 |
if ( $delete_options['restrict'] ) {
|
45 |
if ( 'before' === $delete_options['date_op'] || 'after' === $delete_options['date_op'] ) {
|
46 |
$options['date_query'] = array(
|
@@ -62,18 +65,19 @@ function bd_build_query_options( $delete_options, $options = array() ) {
|
|
62 |
*
|
63 |
* @since 5.5
|
64 |
*
|
65 |
-
* @param array $options List of options
|
66 |
*
|
67 |
* @return array Result array
|
68 |
*/
|
69 |
function bd_query( $options ) {
|
70 |
$defaults = array(
|
71 |
-
'cache_results' => false, // don't cache results
|
72 |
-
'update_post_meta_cache' => false, // No need to fetch post meta fields
|
73 |
-
'update_post_term_cache' => false, // No need to fetch taxonomy fields
|
74 |
-
'no_found_rows' => true, // No need for pagination
|
75 |
-
'fields' => 'ids', // retrieve only ids
|
76 |
);
|
|
|
77 |
$options = wp_parse_args( $options, $defaults );
|
78 |
|
79 |
$wp_query = new WP_Query();
|
2 |
/**
|
3 |
* Utility and wrapper functions for WP_Query.
|
4 |
*
|
5 |
+
* @since 5.5
|
|
|
|
|
|
|
|
|
6 |
*/
|
7 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
8 |
|
9 |
/**
|
10 |
* Process delete options array and build query.
|
11 |
*
|
12 |
+
* @param array $delete_options Delete Options.
|
13 |
+
* @param array $options (optional) Options query.
|
14 |
+
*
|
15 |
+
* @return array
|
16 |
*/
|
17 |
function bd_build_query_options( $delete_options, $options = array() ) {
|
18 |
+
// private posts.
|
19 |
if ( isset( $delete_options['private'] ) ) {
|
20 |
if ( $delete_options['private'] ) {
|
21 |
$options['post_status'] = 'private';
|
26 |
}
|
27 |
}
|
28 |
|
29 |
+
// limit to query.
|
30 |
if ( $delete_options['limit_to'] > 0 ) {
|
31 |
$options['showposts'] = $delete_options['limit_to'];
|
32 |
} else {
|
33 |
+
$options['nopaging'] = 'true';
|
34 |
}
|
35 |
|
36 |
+
// post type.
|
37 |
if ( isset( $delete_options['post_type'] ) ) {
|
38 |
$options['post_type'] = $delete_options['post_type'];
|
39 |
}
|
40 |
|
41 |
+
// exclude sticky posts.
|
42 |
+
if ( isset( $delete_options['exclude_sticky'] ) && ( true === $delete_options['exclude_sticky'] ) ) {
|
43 |
+
$options['post__not_in'] = get_option( 'sticky_posts' );
|
44 |
+
}
|
45 |
+
|
46 |
+
// date query.
|
47 |
if ( $delete_options['restrict'] ) {
|
48 |
if ( 'before' === $delete_options['date_op'] || 'after' === $delete_options['date_op'] ) {
|
49 |
$options['date_query'] = array(
|
65 |
*
|
66 |
* @since 5.5
|
67 |
*
|
68 |
+
* @param array $options List of options.
|
69 |
*
|
70 |
* @return array Result array
|
71 |
*/
|
72 |
function bd_query( $options ) {
|
73 |
$defaults = array(
|
74 |
+
'cache_results' => false, // don't cache results.
|
75 |
+
'update_post_meta_cache' => false, // No need to fetch post meta fields.
|
76 |
+
'update_post_term_cache' => false, // No need to fetch taxonomy fields.
|
77 |
+
'no_found_rows' => true, // No need for pagination.
|
78 |
+
'fields' => 'ids', // retrieve only ids.
|
79 |
);
|
80 |
+
|
81 |
$options = wp_parse_args( $options, $defaults );
|
82 |
|
83 |
$wp_query = new WP_Query();
|
languages/bulk-delete.pot
CHANGED
@@ -1,2782 +1,1772 @@
|
|
1 |
-
# Copyright (C)
|
2 |
# This file is distributed under the same license as the Bulk Delete package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Bulk Delete
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/bulk-delete\n"
|
7 |
-
"POT-Creation-Date:
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
11 |
-
"PO-Revision-Date:
|
12 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
13 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
14 |
|
15 |
-
#: bulk-delete.php:
|
16 |
-
|
17 |
-
|
|
|
18 |
msgstr ""
|
19 |
|
20 |
-
#:
|
21 |
-
msgid "
|
22 |
msgstr ""
|
23 |
|
24 |
-
|
25 |
-
#:
|
26 |
-
#: include/
|
27 |
-
|
|
|
|
|
|
|
28 |
msgstr ""
|
29 |
|
30 |
-
#:
|
31 |
-
|
32 |
-
|
33 |
msgstr ""
|
34 |
|
35 |
-
#:
|
36 |
-
|
37 |
-
msgid "Bulk Delete Schedules"
|
38 |
msgstr ""
|
39 |
|
40 |
-
|
41 |
-
|
|
|
|
|
|
|
42 |
msgstr ""
|
43 |
|
44 |
-
#:
|
45 |
-
#:
|
46 |
-
#: include/
|
47 |
-
|
|
|
|
|
|
|
|
|
48 |
msgstr ""
|
49 |
|
50 |
-
#:
|
51 |
-
msgid "
|
52 |
msgstr ""
|
53 |
|
54 |
-
#:
|
55 |
-
msgid "
|
56 |
msgstr ""
|
57 |
|
58 |
-
#:
|
59 |
-
msgid "
|
60 |
msgstr ""
|
61 |
|
62 |
-
#:
|
63 |
-
msgid "
|
64 |
msgstr ""
|
65 |
|
66 |
-
#:
|
67 |
-
|
|
|
68 |
msgstr ""
|
69 |
|
70 |
-
#:
|
71 |
-
msgid "
|
72 |
msgstr ""
|
73 |
|
74 |
-
#:
|
75 |
-
msgid "
|
76 |
msgstr ""
|
77 |
|
78 |
-
#:
|
79 |
-
msgid "
|
80 |
msgstr ""
|
81 |
|
82 |
-
#:
|
83 |
-
|
84 |
-
#: include/misc/class-bulk-delete-misc.php:117
|
85 |
-
msgid "WARNING: Posts deleted once cannot be retrieved back. Use with caution."
|
86 |
msgstr ""
|
87 |
|
88 |
-
#:
|
89 |
-
|
|
|
|
|
90 |
msgstr ""
|
91 |
|
92 |
-
#:
|
93 |
-
|
94 |
-
|
95 |
-
"
|
96 |
msgstr ""
|
97 |
|
98 |
-
#:
|
99 |
-
msgid "
|
100 |
msgstr ""
|
101 |
|
102 |
-
#:
|
103 |
-
msgid "
|
104 |
msgstr ""
|
105 |
|
106 |
-
#:
|
107 |
-
|
108 |
-
#: dist/include/addons/addon-list.php:52 dist/include/addons/addon-list.php:58
|
109 |
-
#: dist/include/addons/addon-list.php:64 dist/include/addons/addon-list.php:70
|
110 |
-
#: dist/include/addons/addon-list.php:76 dist/include/addons/addon-list.php:82
|
111 |
-
#: dist/include/addons/addon-list.php:88 dist/include/addons/addon-list.php:94
|
112 |
-
#: dist/include/addons/addon-list.php:100
|
113 |
-
#: dist/include/addons/addon-list.php:106
|
114 |
-
#: dist/include/addons/addon-list.php:112
|
115 |
-
#: dist/include/addons/addon-list.php:118
|
116 |
-
#: dist/include/addons/addon-list.php:124
|
117 |
-
#: dist/include/addons/addon-list.php:130
|
118 |
-
#: dist/include/addons/addon-list.php:136
|
119 |
-
#: dist/include/addons/addon-list.php:142 include/addons/addon-list.php:28
|
120 |
-
#: include/addons/addon-list.php:34 include/addons/addon-list.php:40
|
121 |
-
#: include/addons/addon-list.php:46 include/addons/addon-list.php:52
|
122 |
-
#: include/addons/addon-list.php:58 include/addons/addon-list.php:64
|
123 |
-
#: include/addons/addon-list.php:70 include/addons/addon-list.php:76
|
124 |
-
#: include/addons/addon-list.php:82 include/addons/addon-list.php:88
|
125 |
-
#: include/addons/addon-list.php:94 include/addons/addon-list.php:100
|
126 |
-
#: include/addons/addon-list.php:106 include/addons/addon-list.php:112
|
127 |
-
#: include/addons/addon-list.php:118 include/addons/addon-list.php:124
|
128 |
-
#: include/addons/addon-list.php:130 include/addons/addon-list.php:136
|
129 |
-
#: include/addons/addon-list.php:142
|
130 |
-
msgid "More Info"
|
131 |
msgstr ""
|
132 |
|
133 |
-
#:
|
134 |
-
msgid "
|
135 |
msgstr ""
|
136 |
|
137 |
-
#:
|
138 |
-
|
|
|
139 |
msgstr ""
|
140 |
|
141 |
-
#:
|
142 |
-
|
|
|
143 |
msgstr ""
|
144 |
|
145 |
-
#:
|
146 |
-
msgid "
|
147 |
msgstr ""
|
148 |
|
149 |
-
#:
|
150 |
-
msgid "
|
151 |
msgstr ""
|
152 |
|
153 |
-
#:
|
154 |
-
msgid ""
|
155 |
-
"Adds the ability to delete posts based on whether it contains attachment or "
|
156 |
-
"not"
|
157 |
msgstr ""
|
158 |
|
159 |
-
#:
|
160 |
-
msgid "
|
161 |
msgstr ""
|
162 |
|
163 |
-
#:
|
164 |
-
msgid "
|
165 |
msgstr ""
|
166 |
|
167 |
-
#:
|
168 |
-
msgid "
|
169 |
msgstr ""
|
170 |
|
171 |
-
#:
|
172 |
-
msgid "
|
173 |
msgstr ""
|
174 |
|
175 |
-
#:
|
176 |
-
msgid "
|
177 |
msgstr ""
|
178 |
|
179 |
-
#:
|
180 |
-
msgid "
|
181 |
msgstr ""
|
182 |
|
183 |
-
#:
|
184 |
-
msgid "
|
185 |
msgstr ""
|
186 |
|
187 |
-
#:
|
188 |
-
msgid "
|
189 |
msgstr ""
|
190 |
|
191 |
-
#:
|
192 |
-
|
|
|
|
|
193 |
msgstr ""
|
194 |
|
195 |
-
#:
|
196 |
-
|
|
|
|
|
|
|
197 |
msgstr ""
|
198 |
|
199 |
-
#:
|
200 |
-
|
|
|
|
|
201 |
msgstr ""
|
202 |
|
203 |
-
#:
|
204 |
-
|
205 |
-
|
|
|
206 |
msgstr ""
|
207 |
|
208 |
-
#:
|
209 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
210 |
msgstr ""
|
211 |
|
212 |
-
#:
|
213 |
msgid ""
|
214 |
-
"
|
215 |
-
|
216 |
-
|
217 |
-
#: dist/include/addons/addon-list.php:92 include/addons/addon-list.php:92
|
218 |
-
msgid "Scheduler for deleting Posts by Post Status"
|
219 |
msgstr ""
|
220 |
|
221 |
-
#:
|
222 |
-
msgid ""
|
223 |
-
"Adds the ability to schedule auto delete of posts based on post status like "
|
224 |
-
"drafts, pending posts, scheduled posts etc."
|
225 |
msgstr ""
|
226 |
|
227 |
-
#:
|
228 |
-
msgid "
|
229 |
msgstr ""
|
230 |
|
231 |
-
#:
|
232 |
-
msgid "
|
233 |
msgstr ""
|
234 |
|
235 |
-
#:
|
236 |
-
msgid "
|
|
|
237 |
msgstr ""
|
238 |
|
239 |
-
#:
|
240 |
-
msgid "
|
|
|
|
|
241 |
msgstr ""
|
242 |
|
243 |
-
#:
|
244 |
-
|
|
|
245 |
msgstr ""
|
246 |
|
247 |
-
#:
|
248 |
-
msgid "
|
249 |
msgstr ""
|
250 |
|
251 |
-
#:
|
252 |
-
msgid "Delete
|
253 |
msgstr ""
|
254 |
|
255 |
-
#:
|
256 |
-
msgid ""
|
257 |
-
"Adds the ability to delete post meta fields based on value and to schedule "
|
258 |
-
"automatic deletion"
|
259 |
msgstr ""
|
260 |
|
261 |
-
#:
|
262 |
-
msgid "
|
263 |
msgstr ""
|
264 |
|
265 |
-
#:
|
266 |
-
msgid ""
|
267 |
-
"Adds the ability to delete comment meta fields based on value and to "
|
268 |
-
"schedule automatic deletion"
|
269 |
msgstr ""
|
270 |
|
271 |
-
#:
|
272 |
-
|
|
|
|
|
273 |
msgstr ""
|
274 |
|
275 |
-
#:
|
276 |
msgid ""
|
277 |
-
"
|
278 |
-
"
|
279 |
msgstr ""
|
280 |
|
281 |
-
#:
|
282 |
-
msgid "
|
283 |
msgstr ""
|
284 |
|
285 |
-
#:
|
286 |
msgid ""
|
287 |
-
"
|
288 |
-
"
|
289 |
msgstr ""
|
290 |
|
291 |
-
#:
|
292 |
-
msgid "
|
293 |
msgstr ""
|
294 |
|
295 |
-
#:
|
296 |
-
msgid ""
|
297 |
-
"Adds the ability to delete Jetpack Contact Form Messages based on filters "
|
298 |
-
"and to schedule automatic deletion"
|
299 |
msgstr ""
|
300 |
|
301 |
-
#:
|
302 |
-
|
303 |
-
msgid ""
|
304 |
-
"\"%s\" addon requires \"<a href=\"%s\" target=\"_blank\">%s</a>\" addon to "
|
305 |
-
"be installed and activated!"
|
306 |
msgstr ""
|
307 |
|
308 |
-
#:
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
#. translators: 1 Number of posts that are deleted.
|
313 |
-
#: dist/include/addons/pages.php:32 dist/include/addons/posts.php:36
|
314 |
-
#: dist/include/addons/posts.php:64 dist/include/addons/posts.php:92
|
315 |
-
#: dist/include/addons/posts.php:120 dist/include/addons/posts.php:147
|
316 |
-
#: dist/include/base/class-bd-meta-box-module.php:167
|
317 |
-
#: dist/include/meta/class-bulk-delete-comment-meta.php:54
|
318 |
-
#: dist/include/meta/class-bulk-delete-post-meta.php:54
|
319 |
-
#: dist/include/meta/class-bulk-delete-user-meta.php:54
|
320 |
-
#: dist/include/misc/class-bulk-delete-jetpack-contact-form-messages.php:47
|
321 |
-
#: dist/include/pages/class-bulk-delete-pages.php:24
|
322 |
-
#: dist/include/posts/class-bulk-delete-posts.php:18
|
323 |
-
#: dist/include/posts/class-bulk-delete-posts.php:192
|
324 |
-
#: dist/include/posts/class-bulk-delete-posts.php:332
|
325 |
-
#: dist/include/posts/class-bulk-delete-posts.php:458
|
326 |
-
#: dist/include/posts/class-bulk-delete-posts.php:652
|
327 |
-
#: dist/include/posts/class-bulk-delete-posts.php:822
|
328 |
-
#: dist/include/posts/class-bulk-delete-posts.php:889
|
329 |
-
#: include/addons/pages.php:32 include/addons/posts.php:36
|
330 |
-
#: include/addons/posts.php:64 include/addons/posts.php:92
|
331 |
-
#: include/addons/posts.php:120 include/addons/posts.php:147
|
332 |
-
#: include/base/class-bd-meta-box-module.php:167
|
333 |
-
#: include/meta/class-bulk-delete-comment-meta.php:54
|
334 |
-
#: include/meta/class-bulk-delete-post-meta.php:54
|
335 |
-
#: include/meta/class-bulk-delete-user-meta.php:54
|
336 |
-
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:47
|
337 |
-
#: include/pages/class-bulk-delete-pages.php:24
|
338 |
-
#: include/posts/class-bulk-delete-posts.php:18
|
339 |
-
#: include/posts/class-bulk-delete-posts.php:192
|
340 |
-
#: include/posts/class-bulk-delete-posts.php:332
|
341 |
-
#: include/posts/class-bulk-delete-posts.php:458
|
342 |
-
#: include/posts/class-bulk-delete-posts.php:652
|
343 |
-
#: include/posts/class-bulk-delete-posts.php:822
|
344 |
-
#: include/posts/class-bulk-delete-posts.php:889
|
345 |
-
msgid ""
|
346 |
-
"This section just got enabled. Kindly <a href = \"%1$s\">refresh</a> the "
|
347 |
-
"page to fully enable it."
|
348 |
msgstr ""
|
349 |
|
350 |
-
#:
|
351 |
-
msgid "
|
352 |
msgstr ""
|
353 |
|
354 |
-
#:
|
355 |
-
msgid "
|
356 |
msgstr ""
|
357 |
|
358 |
-
#:
|
359 |
-
msgid "
|
360 |
msgstr ""
|
361 |
|
362 |
-
#:
|
363 |
-
|
|
|
364 |
msgstr ""
|
365 |
|
366 |
-
#:
|
367 |
-
|
368 |
-
|
369 |
-
#: include/users/modules/class-bulk-delete-users-by-user-role.php:50
|
370 |
-
msgid "By User Role"
|
371 |
msgstr ""
|
372 |
|
373 |
-
#:
|
374 |
-
#:
|
375 |
-
|
|
|
|
|
|
|
|
|
|
|
376 |
msgstr ""
|
377 |
|
378 |
-
#:
|
379 |
msgid ""
|
380 |
-
"
|
381 |
-
"
|
382 |
msgstr ""
|
383 |
|
384 |
-
#:
|
385 |
-
msgid "
|
386 |
msgstr ""
|
387 |
|
388 |
-
#:
|
389 |
msgid ""
|
390 |
-
"
|
391 |
-
"
|
392 |
msgstr ""
|
393 |
|
394 |
-
#:
|
395 |
-
msgid ""
|
396 |
-
"You need \"Bulk Delete Posts by User Role\" Addon, to delete post based on "
|
397 |
-
"User Role"
|
398 |
msgstr ""
|
399 |
|
400 |
-
#:
|
401 |
-
msgid "
|
402 |
msgstr ""
|
403 |
|
404 |
-
|
405 |
-
|
406 |
-
#: dist/include/meta/class-bulk-delete-comment-meta.php:245
|
407 |
-
#: dist/include/meta/class-bulk-delete-post-meta.php:245
|
408 |
-
#: dist/include/meta/class-bulk-delete-user-meta.php:221
|
409 |
-
#: dist/include/misc/class-bulk-delete-jetpack-contact-form-messages.php:228
|
410 |
-
#: dist/include/pages/class-bulk-delete-pages.php:121
|
411 |
-
#: dist/include/posts/class-bulk-delete-posts.php:111
|
412 |
-
#: dist/include/posts/class-bulk-delete-posts.php:269
|
413 |
-
#: dist/include/posts/class-bulk-delete-posts.php:403
|
414 |
-
#: dist/include/posts/class-bulk-delete-posts.php:581
|
415 |
-
#: dist/include/posts/class-bulk-delete-posts.php:750
|
416 |
-
#: include/base/class-bd-meta-box-module.php:293
|
417 |
-
#: include/meta/class-bulk-delete-comment-meta.php:245
|
418 |
-
#: include/meta/class-bulk-delete-post-meta.php:260
|
419 |
-
#: include/meta/class-bulk-delete-user-meta.php:221
|
420 |
-
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:228
|
421 |
-
#: include/pages/class-bulk-delete-pages.php:121
|
422 |
-
#: include/posts/class-bulk-delete-posts.php:111
|
423 |
-
#: include/posts/class-bulk-delete-posts.php:269
|
424 |
-
#: include/posts/class-bulk-delete-posts.php:403
|
425 |
-
#: include/posts/class-bulk-delete-posts.php:581
|
426 |
-
#: include/posts/class-bulk-delete-posts.php:750
|
427 |
-
#: tmp_addon/bulk-delete-posts-by-attachment.php:288
|
428 |
-
#: tmp_addon/bulk-delete-posts-by-content.php:292
|
429 |
-
#: tmp_addon/bulk-delete-posts-by-custom-field.php:338
|
430 |
-
#: tmp_addon/bulk-delete-posts-by-duplicate-title.php:257
|
431 |
-
#: tmp_addon/bulk-delete-posts-by-title.php:275
|
432 |
-
#: tmp_addon/bulk-delete-posts-by-user-role.php:225
|
433 |
-
#: tmp_addon/bulk-delete-posts-by-user.php:265
|
434 |
-
#: tmp_addon/bulk-delete-posts-by-word-count.php:300
|
435 |
-
msgid "See the full list of <a href = \"%s\">scheduled tasks</a>"
|
436 |
msgstr ""
|
437 |
|
438 |
-
#:
|
439 |
-
|
440 |
-
msgid "Restrict to users who are registered in the site for at least "
|
441 |
msgstr ""
|
442 |
|
443 |
-
#:
|
444 |
-
|
445 |
-
msgid "days."
|
446 |
msgstr ""
|
447 |
|
448 |
-
#:
|
449 |
-
|
450 |
-
msgid "Restrict to users who have not logged in the last "
|
451 |
msgstr ""
|
452 |
|
453 |
-
#:
|
454 |
-
#:
|
455 |
-
#:
|
456 |
-
|
457 |
-
#: dist/include/ui/form.php:48
|
458 |
-
#: include/base/users/class-bd-user-meta-box-module.php:189
|
459 |
-
#: include/meta/class-bulk-delete-comment-meta.php:136
|
460 |
-
#: include/meta/class-bulk-delete-post-meta.php:151
|
461 |
-
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:113
|
462 |
-
#: include/ui/form.php:48 tmp_addon/bulk-delete-from-trash.php:348
|
463 |
-
#: tmp_addon/bulk-delete-posts-by-attachment.php:177
|
464 |
-
#: tmp_addon/bulk-delete-posts-by-content.php:197
|
465 |
-
#: tmp_addon/bulk-delete-posts-by-custom-field.php:221
|
466 |
-
#: tmp_addon/bulk-delete-posts-by-title.php:173
|
467 |
-
#: tmp_addon/bulk-delete-posts-by-user-role.php:140
|
468 |
-
#: tmp_addon/bulk-delete-posts-by-user.php:181
|
469 |
-
#: tmp_addon/bulk-delete-posts-by-word-count.php:193
|
470 |
-
msgid "days"
|
471 |
msgstr ""
|
472 |
|
473 |
-
#:
|
474 |
-
#: include/
|
475 |
-
|
|
|
|
|
476 |
msgstr ""
|
477 |
|
478 |
-
#:
|
479 |
-
#: include/base/users/class-bd-user-meta-box-module.php:201
|
480 |
msgid ""
|
481 |
-
"
|
482 |
-
"
|
483 |
-
msgstr ""
|
484 |
-
|
485 |
-
#: dist/include/base/users/class-bd-user-meta-box-module.php:220
|
486 |
-
#: include/base/users/class-bd-user-meta-box-module.php:220
|
487 |
-
msgid "Restrict to users who don't have any posts."
|
488 |
msgstr ""
|
489 |
|
490 |
-
|
491 |
-
#: include/
|
492 |
-
msgid "
|
493 |
-
|
|
|
|
|
494 |
|
495 |
-
#:
|
496 |
-
|
497 |
-
msgid ""
|
498 |
-
"This is the list of jobs that are currently scheduled for auto deleting "
|
499 |
-
"posts in Bulk Delete Plugin."
|
500 |
msgstr ""
|
501 |
|
502 |
-
#:
|
503 |
-
|
504 |
-
msgid "Note: "
|
505 |
msgstr ""
|
506 |
|
507 |
-
#:
|
508 |
-
|
509 |
-
msgid ""
|
510 |
-
"Scheduling auto post or user deletion is available only when you buy pro "
|
511 |
-
"addons."
|
512 |
msgstr ""
|
513 |
|
514 |
-
#:
|
515 |
-
|
516 |
-
msgid "Next Due"
|
517 |
msgstr ""
|
518 |
|
519 |
-
#:
|
520 |
-
|
521 |
-
#: dist/include/meta/class-bulk-delete-post-meta.php:152
|
522 |
-
#: dist/include/meta/class-bulk-delete-user-meta.php:132
|
523 |
-
#: dist/include/misc/class-bulk-delete-jetpack-contact-form-messages.php:144
|
524 |
-
#: dist/include/ui/form.php:127 include/cron/class-cron-list-table.php:50
|
525 |
-
#: include/meta/class-bulk-delete-comment-meta.php:152
|
526 |
-
#: include/meta/class-bulk-delete-post-meta.php:167
|
527 |
-
#: include/meta/class-bulk-delete-user-meta.php:132
|
528 |
-
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:144
|
529 |
-
#: include/ui/form.php:127 tmp_addon/bulk-delete-posts-by-attachment.php:209
|
530 |
-
#: tmp_addon/bulk-delete-posts-by-content.php:227
|
531 |
-
#: tmp_addon/bulk-delete-posts-by-custom-field.php:254
|
532 |
-
#: tmp_addon/bulk-delete-posts-by-duplicate-title.php:186
|
533 |
-
#: tmp_addon/bulk-delete-posts-by-title.php:201
|
534 |
-
#: tmp_addon/bulk-delete-posts-by-user-role.php:164
|
535 |
-
#: tmp_addon/bulk-delete-posts-by-user.php:205
|
536 |
-
#: tmp_addon/bulk-delete-posts-by-word-count.php:230
|
537 |
-
msgid "Schedule"
|
538 |
msgstr ""
|
539 |
|
540 |
-
#:
|
541 |
-
|
542 |
-
msgid "Type"
|
543 |
msgstr ""
|
544 |
|
545 |
-
#:
|
546 |
-
|
547 |
-
msgid "Options"
|
548 |
msgstr ""
|
549 |
|
550 |
-
#:
|
551 |
-
|
552 |
-
#: include/cron/class-cron-list-table.php:114
|
553 |
-
#: include/license/class-license-list-table.php:98
|
554 |
-
msgid "Delete"
|
555 |
msgstr ""
|
556 |
|
557 |
-
#:
|
558 |
-
|
559 |
-
msgid "You have not scheduled any bulk delete jobs."
|
560 |
msgstr ""
|
561 |
|
562 |
-
#:
|
563 |
-
|
564 |
-
msgid ""
|
565 |
-
"There is a new version of %1$s available. %2$sView version %3$s details%4$s."
|
566 |
msgstr ""
|
567 |
|
568 |
-
#:
|
569 |
-
|
570 |
-
msgid ""
|
571 |
-
"There is a new version of %1$s available. %2$sView version %3$s details%4$s "
|
572 |
-
"or %5$supdate now%6$s."
|
573 |
msgstr ""
|
574 |
|
575 |
-
#:
|
576 |
-
|
577 |
-
msgid "You do not have permission to install plugin updates"
|
578 |
msgstr ""
|
579 |
|
580 |
-
#:
|
581 |
-
|
582 |
-
msgid "Error"
|
583 |
msgstr ""
|
584 |
|
585 |
-
#:
|
586 |
-
|
587 |
-
msgid ""
|
588 |
-
"\"%1$s\" addon is installed but not activated. To activate the addon, please "
|
589 |
-
"<a href=\"%2$s\">enter your license key</a>. If you don't have a license "
|
590 |
-
"key, then you can <a href=\"%3$s\" target=\"_blank\">purchase one</a>."
|
591 |
msgstr ""
|
592 |
|
593 |
-
#:
|
594 |
-
#: include/
|
595 |
-
msgid ""
|
596 |
-
"The license for \"%1$s\" addon is either invalid or has expired. Please <a "
|
597 |
-
"href=\"%2$s\" target=\"_blank\">renew the license</a> or <a href=\"%3$s"
|
598 |
-
"\">enter a new license key</a> to receive updates and support."
|
599 |
msgstr ""
|
600 |
|
601 |
-
#:
|
602 |
-
|
603 |
-
msgid ""
|
604 |
-
"Addon is not activated. To activate the addon, please <a href=\"%1$s\">enter "
|
605 |
-
"your license key</a>. If you don't have a license key, then you can <a href="
|
606 |
-
"\"%2$s\" target=\"_blank\">purchase one</a>."
|
607 |
msgstr ""
|
608 |
|
609 |
-
#:
|
610 |
-
#: include/license/class-bd-license-handler.php:212
|
611 |
msgid ""
|
612 |
-
"
|
613 |
-
"
|
614 |
-
"new license key</a> to receive updates and support."
|
615 |
msgstr ""
|
616 |
|
617 |
-
#:
|
618 |
-
|
619 |
-
msgid "Addon License Key"
|
620 |
msgstr ""
|
621 |
|
622 |
-
#:
|
623 |
-
|
624 |
-
msgid "Enter license key"
|
625 |
msgstr ""
|
626 |
|
627 |
-
#:
|
628 |
-
|
629 |
-
msgid "Activate License"
|
630 |
msgstr ""
|
631 |
|
632 |
-
#:
|
633 |
-
|
634 |
-
msgid "The license key for \"%s\" addon was successfully deactivated"
|
635 |
msgstr ""
|
636 |
|
637 |
-
#:
|
638 |
-
|
639 |
-
msgid ""
|
640 |
-
"There was some problem while trying to deactivate license key for \"%s\" "
|
641 |
-
"addon. Kindly try again"
|
642 |
msgstr ""
|
643 |
|
644 |
-
#:
|
645 |
-
|
646 |
-
msgid "The license key was successfully deleted"
|
647 |
msgstr ""
|
648 |
|
649 |
-
#:
|
650 |
-
|
651 |
-
msgid ""
|
652 |
-
"There was some problem in contacting our store to activate the license key "
|
653 |
-
"for \"%s\" addon"
|
654 |
msgstr ""
|
655 |
|
656 |
-
#:
|
657 |
-
#: include/license/class-bd-license.php:281
|
658 |
msgid ""
|
659 |
-
"
|
660 |
-
"
|
661 |
msgstr ""
|
662 |
|
663 |
-
|
664 |
-
#: include/
|
665 |
-
msgid ""
|
666 |
-
|
667 |
-
"Kindly buy a new license."
|
668 |
-
msgstr ""
|
669 |
-
|
670 |
-
#: dist/include/license/class-bd-license.php:292
|
671 |
-
#: include/license/class-bd-license.php:292
|
672 |
-
msgid "The license key for \"%s\" addon is revoked. Kindly buy a new license."
|
673 |
-
msgstr ""
|
674 |
-
|
675 |
-
#: dist/include/license/class-bd-license.php:296
|
676 |
-
#: include/license/class-bd-license.php:296
|
677 |
-
msgid "The license key for \"%s\" addon has expired. Kindly buy a new license."
|
678 |
-
msgstr ""
|
679 |
-
|
680 |
-
#: dist/include/license/class-bd-license.php:300
|
681 |
-
#: include/license/class-bd-license.php:300
|
682 |
-
msgid "The license key for \"%s\" addon is invalid"
|
683 |
-
msgstr ""
|
684 |
-
|
685 |
-
#: dist/include/license/class-license-list-table.php:38
|
686 |
-
#: include/license/class-license-list-table.php:38
|
687 |
-
msgid ""
|
688 |
-
"This is the list of addon license that are currently registered with the "
|
689 |
-
"plugin."
|
690 |
-
msgstr ""
|
691 |
-
|
692 |
-
#: dist/include/license/class-license-list-table.php:52
|
693 |
-
#: include/license/class-license-list-table.php:52
|
694 |
-
msgid "Addon Name"
|
695 |
-
msgstr ""
|
696 |
-
|
697 |
-
#: dist/include/license/class-license-list-table.php:53
|
698 |
-
#: include/license/class-license-list-table.php:53
|
699 |
-
msgid "License Code"
|
700 |
-
msgstr ""
|
701 |
-
|
702 |
-
#: dist/include/license/class-license-list-table.php:54
|
703 |
-
#: include/license/class-license-list-table.php:54
|
704 |
-
msgid "Validity"
|
705 |
-
msgstr ""
|
706 |
-
|
707 |
-
#: dist/include/license/class-license-list-table.php:55
|
708 |
-
#: include/license/class-license-list-table.php:55
|
709 |
-
msgid "Expires"
|
710 |
-
msgstr ""
|
711 |
-
|
712 |
-
#: dist/include/license/class-license-list-table.php:102
|
713 |
-
#: include/license/class-license-list-table.php:102
|
714 |
-
msgid "Deactivate"
|
715 |
-
msgstr ""
|
716 |
-
|
717 |
-
#: dist/include/license/class-license-list-table.php:169
|
718 |
-
#: include/license/class-license-list-table.php:169
|
719 |
-
msgid "N/A"
|
720 |
-
msgstr ""
|
721 |
-
|
722 |
-
#: dist/include/license/class-license-list-table.php:179
|
723 |
-
#: include/license/class-license-list-table.php:179
|
724 |
-
msgid "You don't have any valid addon license yet."
|
725 |
-
msgstr ""
|
726 |
-
|
727 |
-
#: dist/include/meta/class-bulk-delete-comment-meta.php:38
|
728 |
-
#: include/meta/class-bulk-delete-comment-meta.php:38
|
729 |
-
msgid "Bulk Delete Comment Meta"
|
730 |
-
msgstr ""
|
731 |
-
|
732 |
-
#: dist/include/meta/class-bulk-delete-comment-meta.php:70
|
733 |
-
#: include/meta/class-bulk-delete-comment-meta.php:70
|
734 |
-
msgid "Select the post type whose comment meta fields you want to delete"
|
735 |
-
msgstr ""
|
736 |
-
|
737 |
-
#: dist/include/meta/class-bulk-delete-comment-meta.php:86
|
738 |
-
#: include/meta/class-bulk-delete-comment-meta.php:86
|
739 |
-
msgid "Choose your comment meta field settings"
|
740 |
-
msgstr ""
|
741 |
-
|
742 |
-
#: dist/include/meta/class-bulk-delete-comment-meta.php:91
|
743 |
-
#: include/meta/class-bulk-delete-comment-meta.php:91
|
744 |
-
msgid "Delete based on comment meta key name only"
|
745 |
-
msgstr ""
|
746 |
-
|
747 |
-
#: dist/include/meta/class-bulk-delete-comment-meta.php:98
|
748 |
-
#: include/meta/class-bulk-delete-comment-meta.php:98
|
749 |
-
msgid "Delete based on comment meta key name and value"
|
750 |
-
msgstr ""
|
751 |
-
|
752 |
-
#: dist/include/meta/class-bulk-delete-comment-meta.php:100
|
753 |
-
#: dist/include/meta/class-bulk-delete-comment-meta.php:166
|
754 |
-
#: dist/include/meta/class-bulk-delete-post-meta.php:100
|
755 |
-
#: dist/include/meta/class-bulk-delete-post-meta.php:166
|
756 |
-
#: dist/include/meta/class-bulk-delete-user-meta.php:92
|
757 |
-
#: dist/include/meta/class-bulk-delete-user-meta.php:146
|
758 |
-
#: dist/include/misc/class-bulk-delete-jetpack-contact-form-messages.php:83
|
759 |
-
#: dist/include/misc/class-bulk-delete-jetpack-contact-form-messages.php:157
|
760 |
-
#: dist/include/ui/form.php:138
|
761 |
-
#: include/meta/class-bulk-delete-comment-meta.php:100
|
762 |
-
#: include/meta/class-bulk-delete-comment-meta.php:166
|
763 |
-
#: include/meta/class-bulk-delete-post-meta.php:100
|
764 |
-
#: include/meta/class-bulk-delete-post-meta.php:110
|
765 |
-
#: include/meta/class-bulk-delete-post-meta.php:181
|
766 |
-
#: include/meta/class-bulk-delete-user-meta.php:92
|
767 |
-
#: include/meta/class-bulk-delete-user-meta.php:146
|
768 |
-
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:83
|
769 |
-
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:157
|
770 |
-
#: include/ui/form.php:138 tmp_addon/bulk-delete-posts-by-attachment.php:222
|
771 |
-
#: tmp_addon/bulk-delete-posts-by-content.php:240
|
772 |
-
#: tmp_addon/bulk-delete-posts-by-custom-field.php:268
|
773 |
-
#: tmp_addon/bulk-delete-posts-by-duplicate-title.php:199
|
774 |
-
#: tmp_addon/bulk-delete-posts-by-title.php:216
|
775 |
-
#: tmp_addon/bulk-delete-posts-by-user-role.php:177
|
776 |
-
#: tmp_addon/bulk-delete-posts-by-user.php:218
|
777 |
-
#: tmp_addon/bulk-delete-posts-by-word-count.php:245
|
778 |
-
msgid "Only available in Pro Addon"
|
779 |
-
msgstr ""
|
780 |
-
|
781 |
-
#: dist/include/meta/class-bulk-delete-comment-meta.php:107
|
782 |
-
#: include/meta/class-bulk-delete-comment-meta.php:107
|
783 |
-
msgid "Comment Meta Key "
|
784 |
-
msgstr ""
|
785 |
-
|
786 |
-
#: dist/include/meta/class-bulk-delete-comment-meta.php:108
|
787 |
-
#: dist/include/meta/class-bulk-delete-post-meta.php:108
|
788 |
-
#: dist/include/meta/class-bulk-delete-user-meta.php:100
|
789 |
-
#: include/meta/class-bulk-delete-comment-meta.php:108
|
790 |
-
#: include/meta/class-bulk-delete-post-meta.php:123
|
791 |
-
#: include/meta/class-bulk-delete-user-meta.php:100
|
792 |
-
msgid "Meta Key"
|
793 |
-
msgstr ""
|
794 |
-
|
795 |
-
#: dist/include/meta/class-bulk-delete-comment-meta.php:124
|
796 |
-
#: dist/include/meta/class-bulk-delete-post-meta.php:124
|
797 |
-
#: dist/include/meta/class-bulk-delete-user-meta.php:116
|
798 |
-
#: dist/include/misc/class-bulk-delete-jetpack-contact-form-messages.php:130
|
799 |
-
#: include/meta/class-bulk-delete-comment-meta.php:124
|
800 |
-
#: include/meta/class-bulk-delete-post-meta.php:139
|
801 |
-
#: include/meta/class-bulk-delete-user-meta.php:116
|
802 |
-
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:130
|
803 |
-
msgid "Choose your deletion options"
|
804 |
-
msgstr ""
|
805 |
-
|
806 |
-
#: dist/include/meta/class-bulk-delete-comment-meta.php:131
|
807 |
-
#: include/meta/class-bulk-delete-comment-meta.php:131
|
808 |
-
msgid "Only restrict to comments which are "
|
809 |
-
msgstr ""
|
810 |
-
|
811 |
-
#: dist/include/meta/class-bulk-delete-comment-meta.php:133
|
812 |
-
#: dist/include/meta/class-bulk-delete-post-meta.php:133
|
813 |
-
#: dist/include/misc/class-bulk-delete-jetpack-contact-form-messages.php:110
|
814 |
-
#: dist/include/ui/form.php:45
|
815 |
-
#: include/meta/class-bulk-delete-comment-meta.php:133
|
816 |
-
#: include/meta/class-bulk-delete-post-meta.php:148
|
817 |
-
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:110
|
818 |
-
#: include/ui/form.php:45 tmp_addon/bulk-delete-posts-by-attachment.php:174
|
819 |
-
#: tmp_addon/bulk-delete-posts-by-content.php:194
|
820 |
-
#: tmp_addon/bulk-delete-posts-by-custom-field.php:217
|
821 |
-
#: tmp_addon/bulk-delete-posts-by-title.php:169
|
822 |
-
#: tmp_addon/bulk-delete-posts-by-user-role.php:137
|
823 |
-
#: tmp_addon/bulk-delete-posts-by-user.php:178
|
824 |
-
#: tmp_addon/bulk-delete-posts-by-word-count.php:189
|
825 |
-
msgid "older than"
|
826 |
-
msgstr ""
|
827 |
-
|
828 |
-
#: dist/include/meta/class-bulk-delete-comment-meta.php:134
|
829 |
-
#: include/meta/class-bulk-delete-comment-meta.php:134
|
830 |
-
msgid "commented within last"
|
831 |
-
msgstr ""
|
832 |
-
|
833 |
-
#: dist/include/meta/class-bulk-delete-comment-meta.php:143
|
834 |
-
#: include/meta/class-bulk-delete-comment-meta.php:143
|
835 |
-
msgid "Only delete comment meta field from first "
|
836 |
-
msgstr ""
|
837 |
-
|
838 |
-
#: dist/include/meta/class-bulk-delete-comment-meta.php:144
|
839 |
-
#: include/meta/class-bulk-delete-comment-meta.php:144
|
840 |
-
msgid "comments."
|
841 |
-
msgstr ""
|
842 |
-
|
843 |
-
#: dist/include/meta/class-bulk-delete-comment-meta.php:145
|
844 |
-
#: dist/include/meta/class-bulk-delete-post-meta.php:145
|
845 |
-
#: dist/include/misc/class-bulk-delete-jetpack-contact-form-messages.php:124
|
846 |
-
#: tmp_addon/bulk-delete-posts-by-attachment.php:202
|
847 |
-
#: tmp_addon/bulk-delete-posts-by-content.php:220
|
848 |
-
#: tmp_addon/bulk-delete-posts-by-custom-field.php:247
|
849 |
-
#: tmp_addon/bulk-delete-posts-by-duplicate-title.php:179
|
850 |
-
#: tmp_addon/bulk-delete-posts-by-title.php:192
|
851 |
-
#: tmp_addon/bulk-delete-posts-by-word-count.php:221
|
852 |
-
msgid ""
|
853 |
-
"Use this option if there are more than 1000 posts and the script timesout."
|
854 |
-
msgstr ""
|
855 |
-
|
856 |
-
#: dist/include/meta/class-bulk-delete-comment-meta.php:151
|
857 |
-
#: dist/include/meta/class-bulk-delete-post-meta.php:151
|
858 |
-
#: dist/include/meta/class-bulk-delete-user-meta.php:131
|
859 |
-
#: dist/include/misc/class-bulk-delete-jetpack-contact-form-messages.php:143
|
860 |
-
#: dist/include/ui/form.php:126
|
861 |
-
#: include/meta/class-bulk-delete-comment-meta.php:151
|
862 |
-
#: include/meta/class-bulk-delete-post-meta.php:166
|
863 |
-
#: include/meta/class-bulk-delete-user-meta.php:131
|
864 |
-
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:143
|
865 |
-
#: include/ui/form.php:126 tmp_addon/bulk-delete-posts-by-attachment.php:208
|
866 |
-
#: tmp_addon/bulk-delete-posts-by-content.php:226
|
867 |
-
#: tmp_addon/bulk-delete-posts-by-custom-field.php:253
|
868 |
-
#: tmp_addon/bulk-delete-posts-by-duplicate-title.php:185
|
869 |
-
#: tmp_addon/bulk-delete-posts-by-title.php:199
|
870 |
-
#: tmp_addon/bulk-delete-posts-by-user-role.php:163
|
871 |
-
#: tmp_addon/bulk-delete-posts-by-user.php:204
|
872 |
-
#: tmp_addon/bulk-delete-posts-by-word-count.php:228
|
873 |
-
msgid "Delete now"
|
874 |
-
msgstr ""
|
875 |
-
|
876 |
-
#: dist/include/meta/class-bulk-delete-comment-meta.php:153
|
877 |
-
#: dist/include/meta/class-bulk-delete-post-meta.php:153
|
878 |
-
#: dist/include/meta/class-bulk-delete-user-meta.php:133
|
879 |
-
#: dist/include/misc/class-bulk-delete-jetpack-contact-form-messages.php:145
|
880 |
-
#: dist/include/ui/form.php:128
|
881 |
-
#: include/meta/class-bulk-delete-comment-meta.php:153
|
882 |
-
#: include/meta/class-bulk-delete-post-meta.php:168
|
883 |
-
#: include/meta/class-bulk-delete-user-meta.php:133
|
884 |
-
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:145
|
885 |
-
#: include/ui/form.php:128 tmp_addon/bulk-delete-posts-by-attachment.php:210
|
886 |
-
#: tmp_addon/bulk-delete-posts-by-content.php:228
|
887 |
-
#: tmp_addon/bulk-delete-posts-by-custom-field.php:255
|
888 |
-
#: tmp_addon/bulk-delete-posts-by-duplicate-title.php:187
|
889 |
-
#: tmp_addon/bulk-delete-posts-by-title.php:203
|
890 |
-
#: tmp_addon/bulk-delete-posts-by-user-role.php:165
|
891 |
-
#: tmp_addon/bulk-delete-posts-by-user.php:206
|
892 |
-
#: tmp_addon/bulk-delete-posts-by-word-count.php:232
|
893 |
-
msgid "repeat "
|
894 |
-
msgstr ""
|
895 |
-
|
896 |
-
#: dist/include/meta/class-bulk-delete-comment-meta.php:155
|
897 |
-
#: dist/include/meta/class-bulk-delete-post-meta.php:155
|
898 |
-
#: dist/include/meta/class-bulk-delete-user-meta.php:135
|
899 |
-
#: dist/include/misc/class-bulk-delete-jetpack-contact-form-messages.php:147
|
900 |
-
#: dist/include/ui/form.php:130
|
901 |
-
#: include/meta/class-bulk-delete-comment-meta.php:155
|
902 |
-
#: include/meta/class-bulk-delete-post-meta.php:170
|
903 |
-
#: include/meta/class-bulk-delete-user-meta.php:135
|
904 |
-
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:147
|
905 |
-
#: include/ui/form.php:130 tmp_addon/bulk-delete-posts-by-attachment.php:212
|
906 |
-
#: tmp_addon/bulk-delete-posts-by-content.php:230
|
907 |
-
#: tmp_addon/bulk-delete-posts-by-custom-field.php:258
|
908 |
-
#: tmp_addon/bulk-delete-posts-by-duplicate-title.php:189
|
909 |
-
#: tmp_addon/bulk-delete-posts-by-title.php:205
|
910 |
-
#: tmp_addon/bulk-delete-posts-by-user-role.php:167
|
911 |
-
#: tmp_addon/bulk-delete-posts-by-user.php:208
|
912 |
-
#: tmp_addon/bulk-delete-posts-by-word-count.php:234
|
913 |
-
msgid "Don't repeat"
|
914 |
-
msgstr ""
|
915 |
-
|
916 |
-
#: dist/include/meta/class-bulk-delete-comment-meta.php:173
|
917 |
-
#: dist/include/meta/class-bulk-delete-post-meta.php:173
|
918 |
-
#: dist/include/meta/class-bulk-delete-user-meta.php:153
|
919 |
-
#: include/meta/class-bulk-delete-comment-meta.php:173
|
920 |
-
#: include/meta/class-bulk-delete-post-meta.php:188
|
921 |
-
#: include/meta/class-bulk-delete-user-meta.php:153
|
922 |
-
#: tmp_addon/bulk-delete-posts-by-attachment.php:228
|
923 |
-
#: tmp_addon/bulk-delete-posts-by-content.php:246
|
924 |
-
#: tmp_addon/bulk-delete-posts-by-custom-field.php:276
|
925 |
-
#: tmp_addon/bulk-delete-posts-by-duplicate-title.php:205
|
926 |
-
#: tmp_addon/bulk-delete-posts-by-title.php:223
|
927 |
-
#: tmp_addon/bulk-delete-posts-by-user-role.php:183
|
928 |
-
#: tmp_addon/bulk-delete-posts-by-user.php:224
|
929 |
-
#: tmp_addon/bulk-delete-posts-by-word-count.php:252
|
930 |
-
msgid "Enter time in Y-m-d H:i:s format or enter now to use current time"
|
931 |
-
msgstr ""
|
932 |
-
|
933 |
-
#: dist/include/meta/class-bulk-delete-comment-meta.php:181
|
934 |
-
#: dist/include/meta/class-bulk-delete-post-meta.php:181
|
935 |
-
#: dist/include/meta/class-bulk-delete-user-meta.php:161
|
936 |
-
#: dist/include/misc/class-bulk-delete-jetpack-contact-form-messages.php:164
|
937 |
-
#: dist/include/ui/form.php:160
|
938 |
-
#: include/meta/class-bulk-delete-comment-meta.php:181
|
939 |
-
#: include/meta/class-bulk-delete-post-meta.php:196
|
940 |
-
#: include/meta/class-bulk-delete-user-meta.php:161
|
941 |
-
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:164
|
942 |
-
#: include/ui/form.php:160 tmp_addon/bulk-delete-from-trash.php:162
|
943 |
-
#: tmp_addon/bulk-delete-from-trash.php:270
|
944 |
-
#: tmp_addon/bulk-delete-posts-by-attachment.php:235
|
945 |
-
#: tmp_addon/bulk-delete-posts-by-content.php:254
|
946 |
-
#: tmp_addon/bulk-delete-posts-by-custom-field.php:285
|
947 |
-
#: tmp_addon/bulk-delete-posts-by-duplicate-title.php:213
|
948 |
-
#: tmp_addon/bulk-delete-posts-by-title.php:232
|
949 |
-
#: tmp_addon/bulk-delete-posts-by-user-role.php:191
|
950 |
-
#: tmp_addon/bulk-delete-posts-by-user.php:232
|
951 |
-
#: tmp_addon/bulk-delete-posts-by-word-count.php:261
|
952 |
-
msgid "Bulk Delete "
|
953 |
-
msgstr ""
|
954 |
-
|
955 |
-
#: dist/include/meta/class-bulk-delete-comment-meta.php:202
|
956 |
-
#: include/meta/class-bulk-delete-comment-meta.php:202
|
957 |
-
msgid ""
|
958 |
-
"Are you sure you want to delete all the comment meta fields that match the "
|
959 |
-
"selected filters?"
|
960 |
-
msgstr ""
|
961 |
-
|
962 |
-
#: dist/include/meta/class-bulk-delete-comment-meta.php:244
|
963 |
-
#: include/meta/class-bulk-delete-comment-meta.php:244
|
964 |
-
msgid ""
|
965 |
-
"Comment meta fields from the comments with the selected criteria are "
|
966 |
-
"scheduled for deletion."
|
967 |
-
msgstr ""
|
968 |
-
|
969 |
-
#: dist/include/meta/class-bulk-delete-comment-meta.php:248
|
970 |
-
#: include/meta/class-bulk-delete-comment-meta.php:248
|
971 |
-
msgid "Deleted comment meta field from %d comment"
|
972 |
-
msgid_plural "Deleted comment meta field from %d comments"
|
973 |
msgstr[0] ""
|
974 |
msgstr[1] ""
|
975 |
|
976 |
-
#:
|
977 |
-
|
978 |
-
#: dist/include/meta/class-bulk-delete-meta.php:106
|
979 |
-
#: include/meta/class-bulk-delete-meta.php:40
|
980 |
-
#: include/meta/class-bulk-delete-meta.php:41
|
981 |
-
#: include/meta/class-bulk-delete-meta.php:106
|
982 |
-
msgid "Bulk Delete Meta Fields"
|
983 |
-
msgstr ""
|
984 |
-
|
985 |
-
#: dist/include/meta/class-bulk-delete-meta.php:121
|
986 |
-
#: include/meta/class-bulk-delete-meta.php:121
|
987 |
-
msgid "WARNING: Items deleted once cannot be retrieved back. Use with caution."
|
988 |
-
msgstr ""
|
989 |
-
|
990 |
-
#: dist/include/meta/class-bulk-delete-post-meta.php:38
|
991 |
-
#: include/meta/class-bulk-delete-post-meta.php:38
|
992 |
-
msgid "Bulk Delete Post Meta"
|
993 |
-
msgstr ""
|
994 |
-
|
995 |
-
#: dist/include/meta/class-bulk-delete-post-meta.php:70
|
996 |
-
#: include/meta/class-bulk-delete-post-meta.php:70
|
997 |
-
msgid "Select the post type whose post meta fields you want to delete"
|
998 |
-
msgstr ""
|
999 |
-
|
1000 |
-
#: dist/include/meta/class-bulk-delete-post-meta.php:86
|
1001 |
-
#: include/meta/class-bulk-delete-post-meta.php:86
|
1002 |
-
msgid "Choose your post meta field settings"
|
1003 |
-
msgstr ""
|
1004 |
-
|
1005 |
-
#: dist/include/meta/class-bulk-delete-post-meta.php:91
|
1006 |
-
#: include/meta/class-bulk-delete-post-meta.php:91
|
1007 |
-
msgid "Delete based on post meta key name only"
|
1008 |
-
msgstr ""
|
1009 |
-
|
1010 |
-
#: dist/include/meta/class-bulk-delete-post-meta.php:98
|
1011 |
-
#: include/meta/class-bulk-delete-post-meta.php:108
|
1012 |
-
msgid "Delete based on post meta key name and value"
|
1013 |
-
msgstr ""
|
1014 |
-
|
1015 |
-
#: dist/include/meta/class-bulk-delete-post-meta.php:107
|
1016 |
-
#: include/meta/class-bulk-delete-post-meta.php:117
|
1017 |
-
msgid "Post Meta Key "
|
1018 |
-
msgstr ""
|
1019 |
-
|
1020 |
-
#: dist/include/meta/class-bulk-delete-post-meta.php:131
|
1021 |
-
#: dist/include/misc/class-bulk-delete-jetpack-contact-form-messages.php:108
|
1022 |
-
#: include/meta/class-bulk-delete-post-meta.php:146
|
1023 |
-
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:108
|
1024 |
-
#: tmp_addon/bulk-delete-posts-by-attachment.php:172
|
1025 |
-
#: tmp_addon/bulk-delete-posts-by-content.php:192
|
1026 |
-
#: tmp_addon/bulk-delete-posts-by-custom-field.php:215
|
1027 |
-
#: tmp_addon/bulk-delete-posts-by-title.php:167
|
1028 |
-
#: tmp_addon/bulk-delete-posts-by-user-role.php:135
|
1029 |
-
#: tmp_addon/bulk-delete-posts-by-user.php:176
|
1030 |
-
#: tmp_addon/bulk-delete-posts-by-word-count.php:187
|
1031 |
-
msgid "Only restrict to posts which are "
|
1032 |
-
msgstr ""
|
1033 |
-
|
1034 |
-
#: dist/include/meta/class-bulk-delete-post-meta.php:134
|
1035 |
-
#: dist/include/misc/class-bulk-delete-jetpack-contact-form-messages.php:111
|
1036 |
-
#: dist/include/ui/form.php:46 include/meta/class-bulk-delete-post-meta.php:149
|
1037 |
-
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:111
|
1038 |
-
#: include/ui/form.php:46 tmp_addon/bulk-delete-posts-by-attachment.php:175
|
1039 |
-
#: tmp_addon/bulk-delete-posts-by-content.php:195
|
1040 |
-
#: tmp_addon/bulk-delete-posts-by-custom-field.php:218
|
1041 |
-
#: tmp_addon/bulk-delete-posts-by-title.php:170
|
1042 |
-
#: tmp_addon/bulk-delete-posts-by-user-role.php:138
|
1043 |
-
#: tmp_addon/bulk-delete-posts-by-user.php:179
|
1044 |
-
#: tmp_addon/bulk-delete-posts-by-word-count.php:190
|
1045 |
-
msgid "posted within last"
|
1046 |
-
msgstr ""
|
1047 |
-
|
1048 |
-
#: dist/include/meta/class-bulk-delete-post-meta.php:143
|
1049 |
-
#: include/meta/class-bulk-delete-post-meta.php:158
|
1050 |
-
msgid "Only delete post meta field from first "
|
1051 |
-
msgstr ""
|
1052 |
-
|
1053 |
-
#: dist/include/meta/class-bulk-delete-post-meta.php:144
|
1054 |
-
#: dist/include/misc/class-bulk-delete-jetpack-contact-form-messages.php:123
|
1055 |
-
#: include/meta/class-bulk-delete-post-meta.php:159
|
1056 |
-
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:123
|
1057 |
-
#: tmp_addon/bulk-delete-posts-by-attachment.php:201
|
1058 |
-
#: tmp_addon/bulk-delete-posts-by-content.php:219
|
1059 |
-
#: tmp_addon/bulk-delete-posts-by-custom-field.php:246
|
1060 |
-
#: tmp_addon/bulk-delete-posts-by-title.php:191
|
1061 |
-
#: tmp_addon/bulk-delete-posts-by-user-role.php:156
|
1062 |
-
#: tmp_addon/bulk-delete-posts-by-user.php:197
|
1063 |
-
#: tmp_addon/bulk-delete-posts-by-word-count.php:220
|
1064 |
-
msgid "posts."
|
1065 |
-
msgstr ""
|
1066 |
-
|
1067 |
-
#: dist/include/meta/class-bulk-delete-post-meta.php:202
|
1068 |
-
#: include/meta/class-bulk-delete-post-meta.php:217
|
1069 |
-
msgid ""
|
1070 |
-
"Are you sure you want to delete all the post meta fields that match the "
|
1071 |
-
"selected filters?"
|
1072 |
msgstr ""
|
1073 |
|
1074 |
-
#:
|
1075 |
-
#: include/meta/class-bulk-delete-post-meta.php:259
|
1076 |
msgid ""
|
1077 |
-
"
|
1078 |
"deletion."
|
1079 |
msgstr ""
|
1080 |
|
1081 |
-
#:
|
1082 |
-
|
1083 |
-
msgid "Deleted post meta field from %d post"
|
1084 |
-
msgid_plural "Deleted post meta field from %d posts"
|
1085 |
-
msgstr[0] ""
|
1086 |
-
msgstr[1] ""
|
1087 |
-
|
1088 |
-
#: dist/include/meta/class-bulk-delete-user-meta.php:38
|
1089 |
-
#: include/meta/class-bulk-delete-user-meta.php:38
|
1090 |
-
msgid "Bulk Delete User Meta"
|
1091 |
msgstr ""
|
1092 |
|
1093 |
-
#:
|
1094 |
-
#: include/meta/class-bulk-delete-user-meta.php:61
|
1095 |
msgid "Select the user role whose user meta fields you want to delete"
|
1096 |
msgstr ""
|
1097 |
|
1098 |
-
#:
|
1099 |
-
#: dist/include/users/modules/class-bulk-delete-users-by-user-role.php:76
|
1100 |
-
#: include/meta/class-bulk-delete-user-meta.php:70
|
1101 |
-
#: include/users/modules/class-bulk-delete-users-by-user-role.php:76
|
1102 |
-
#: tmp_addon/bulk-delete-posts-by-user-role.php:96
|
1103 |
-
msgid "Users"
|
1104 |
-
msgstr ""
|
1105 |
-
|
1106 |
-
#: dist/include/meta/class-bulk-delete-user-meta.php:78
|
1107 |
-
#: include/meta/class-bulk-delete-user-meta.php:78
|
1108 |
msgid "Choose your user meta field settings"
|
1109 |
msgstr ""
|
1110 |
|
1111 |
-
#:
|
1112 |
-
#: include/meta/class-bulk-delete-user-meta.php:83
|
1113 |
msgid "Delete based on user meta key name only"
|
1114 |
msgstr ""
|
1115 |
|
1116 |
-
#:
|
1117 |
-
#: include/meta/class-bulk-delete-user-meta.php:90
|
1118 |
msgid "Delete based on user meta key name and value"
|
1119 |
msgstr ""
|
1120 |
|
1121 |
-
#:
|
1122 |
-
#: include/meta/class-bulk-delete-user-meta.php:99
|
1123 |
msgid "User Meta Key "
|
1124 |
msgstr ""
|
1125 |
|
1126 |
-
#:
|
1127 |
-
#: include/meta/class-bulk-delete-user-meta.php:123
|
1128 |
-
msgid "Only delete user meta field from first "
|
1129 |
-
msgstr ""
|
1130 |
-
|
1131 |
-
#: dist/include/meta/class-bulk-delete-user-meta.php:124
|
1132 |
-
#: include/meta/class-bulk-delete-user-meta.php:124
|
1133 |
-
msgid "users."
|
1134 |
-
msgstr ""
|
1135 |
-
|
1136 |
-
#: dist/include/meta/class-bulk-delete-user-meta.php:125
|
1137 |
-
msgid ""
|
1138 |
-
"Use this option if there are more than 1000 users and the script timesout."
|
1139 |
-
msgstr ""
|
1140 |
-
|
1141 |
-
#: dist/include/meta/class-bulk-delete-user-meta.php:182
|
1142 |
-
#: include/meta/class-bulk-delete-user-meta.php:182
|
1143 |
msgid ""
|
1144 |
"Are you sure you want to delete all the user meta fields that match the "
|
1145 |
"selected filters?"
|
1146 |
msgstr ""
|
1147 |
|
1148 |
-
|
1149 |
-
#: include/
|
1150 |
-
msgid ""
|
1151 |
-
"User meta fields from the users with the selected criteria are scheduled for "
|
1152 |
-
"deletion."
|
1153 |
-
msgstr ""
|
1154 |
-
|
1155 |
-
#: dist/include/meta/class-bulk-delete-user-meta.php:224
|
1156 |
-
#: include/meta/class-bulk-delete-user-meta.php:224
|
1157 |
msgid "Deleted user meta field from %d user"
|
1158 |
msgid_plural "Deleted user meta field from %d users"
|
1159 |
msgstr[0] ""
|
1160 |
msgstr[1] ""
|
1161 |
|
1162 |
-
#:
|
1163 |
-
#: include/
|
1164 |
-
msgid "Bulk Delete
|
1165 |
-
msgstr ""
|
1166 |
-
|
1167 |
-
#: dist/include/misc/class-bulk-delete-jetpack-contact-form-messages.php:57
|
1168 |
-
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:57
|
1169 |
-
msgid "Jetpack contact form is not enabled."
|
1170 |
-
msgstr ""
|
1171 |
-
|
1172 |
-
#: dist/include/misc/class-bulk-delete-jetpack-contact-form-messages.php:73
|
1173 |
-
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:73
|
1174 |
-
msgid "Delete all Contact Form Messages"
|
1175 |
-
msgstr ""
|
1176 |
-
|
1177 |
-
#: dist/include/misc/class-bulk-delete-jetpack-contact-form-messages.php:73
|
1178 |
-
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:73
|
1179 |
-
msgid "in total"
|
1180 |
-
msgstr ""
|
1181 |
-
|
1182 |
-
#: dist/include/misc/class-bulk-delete-jetpack-contact-form-messages.php:82
|
1183 |
-
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:82
|
1184 |
-
msgid "Delete Messages based on filters"
|
1185 |
-
msgstr ""
|
1186 |
-
|
1187 |
-
#: dist/include/misc/class-bulk-delete-jetpack-contact-form-messages.php:99
|
1188 |
-
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:99
|
1189 |
-
msgid "Choose your date options"
|
1190 |
-
msgstr ""
|
1191 |
-
|
1192 |
-
#: dist/include/misc/class-bulk-delete-jetpack-contact-form-messages.php:122
|
1193 |
-
#: dist/include/ui/form.php:105
|
1194 |
-
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:122
|
1195 |
-
#: include/ui/form.php:105 tmp_addon/bulk-delete-posts-by-attachment.php:200
|
1196 |
-
#: tmp_addon/bulk-delete-posts-by-content.php:218
|
1197 |
-
#: tmp_addon/bulk-delete-posts-by-custom-field.php:244
|
1198 |
-
#: tmp_addon/bulk-delete-posts-by-duplicate-title.php:177
|
1199 |
-
#: tmp_addon/bulk-delete-posts-by-title.php:189
|
1200 |
-
#: tmp_addon/bulk-delete-posts-by-user-role.php:154
|
1201 |
-
#: tmp_addon/bulk-delete-posts-by-user.php:195
|
1202 |
-
#: tmp_addon/bulk-delete-posts-by-word-count.php:218
|
1203 |
-
msgid "Only delete first "
|
1204 |
-
msgstr ""
|
1205 |
-
|
1206 |
-
#: dist/include/misc/class-bulk-delete-jetpack-contact-form-messages.php:136
|
1207 |
-
#: dist/include/ui/form.php:65
|
1208 |
-
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:136
|
1209 |
-
#: include/ui/form.php:65 tmp_addon/bulk-delete-posts-by-attachment.php:183
|
1210 |
-
#: tmp_addon/bulk-delete-posts-by-content.php:203
|
1211 |
-
#: tmp_addon/bulk-delete-posts-by-custom-field.php:227
|
1212 |
-
#: tmp_addon/bulk-delete-posts-by-duplicate-title.php:169
|
1213 |
-
#: tmp_addon/bulk-delete-posts-by-title.php:180
|
1214 |
-
#: tmp_addon/bulk-delete-posts-by-user-role.php:146
|
1215 |
-
#: tmp_addon/bulk-delete-posts-by-user.php:187
|
1216 |
-
#: tmp_addon/bulk-delete-posts-by-word-count.php:200
|
1217 |
-
msgid "Move to Trash"
|
1218 |
-
msgstr ""
|
1219 |
-
|
1220 |
-
#: dist/include/misc/class-bulk-delete-jetpack-contact-form-messages.php:137
|
1221 |
-
#: dist/include/ui/form.php:66
|
1222 |
-
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:137
|
1223 |
-
#: include/ui/form.php:66 tmp_addon/bulk-delete-posts-by-attachment.php:184
|
1224 |
-
#: tmp_addon/bulk-delete-posts-by-content.php:204
|
1225 |
-
#: tmp_addon/bulk-delete-posts-by-custom-field.php:228
|
1226 |
-
#: tmp_addon/bulk-delete-posts-by-duplicate-title.php:170
|
1227 |
-
#: tmp_addon/bulk-delete-posts-by-title.php:182
|
1228 |
-
#: tmp_addon/bulk-delete-posts-by-user-role.php:147
|
1229 |
-
#: tmp_addon/bulk-delete-posts-by-user.php:188
|
1230 |
-
#: tmp_addon/bulk-delete-posts-by-word-count.php:202
|
1231 |
-
msgid "Delete permanently"
|
1232 |
-
msgstr ""
|
1233 |
-
|
1234 |
-
#: dist/include/misc/class-bulk-delete-jetpack-contact-form-messages.php:186
|
1235 |
-
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:186
|
1236 |
-
msgid ""
|
1237 |
-
"Are you sure you want to delete all the Jetpack contact form messages based "
|
1238 |
-
"on the selected filters?"
|
1239 |
-
msgstr ""
|
1240 |
-
|
1241 |
-
#: dist/include/misc/class-bulk-delete-jetpack-contact-form-messages.php:227
|
1242 |
-
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:227
|
1243 |
-
msgid ""
|
1244 |
-
"Jetpack contact form messages with the selected criteria are scheduled for "
|
1245 |
-
"deletion."
|
1246 |
-
msgstr ""
|
1247 |
-
|
1248 |
-
#: dist/include/misc/class-bulk-delete-jetpack-contact-form-messages.php:231
|
1249 |
-
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:231
|
1250 |
-
msgid "Deleted %d Jetpack contact form message"
|
1251 |
-
msgid_plural "Deleted %d Jetpack contact form messages"
|
1252 |
-
msgstr[0] ""
|
1253 |
-
msgstr[1] ""
|
1254 |
-
|
1255 |
-
#: dist/include/misc/class-bulk-delete-jetpack-contact-form-messages.php:343
|
1256 |
-
#: dist/include/ui/form.php:22
|
1257 |
-
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:343
|
1258 |
-
#: include/ui/form.php:22
|
1259 |
-
#: tmp_addon/bulk-delete-jetpack-contact-form-messages.php:123
|
1260 |
-
#: tmp_addon/bulk-delete-posts-by-attachment.php:163
|
1261 |
-
#: tmp_addon/bulk-delete-posts-by-content.php:186
|
1262 |
-
#: tmp_addon/bulk-delete-posts-by-custom-field.php:206
|
1263 |
-
#: tmp_addon/bulk-delete-posts-by-duplicate-title.php:163
|
1264 |
-
#: tmp_addon/bulk-delete-posts-by-title.php:160
|
1265 |
-
#: tmp_addon/bulk-delete-posts-by-user-role.php:130
|
1266 |
-
#: tmp_addon/bulk-delete-posts-by-user.php:171
|
1267 |
-
#: tmp_addon/bulk-delete-posts-by-word-count.php:181
|
1268 |
-
msgid "Choose your filtering options"
|
1269 |
-
msgstr ""
|
1270 |
-
|
1271 |
-
#: dist/include/misc/class-bulk-delete-jetpack-contact-form-messages.php:352
|
1272 |
-
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:352
|
1273 |
-
#: tmp_addon/bulk-delete-jetpack-contact-form-messages.php:132
|
1274 |
-
msgid "Only if author name "
|
1275 |
-
msgstr ""
|
1276 |
-
|
1277 |
-
#: dist/include/misc/class-bulk-delete-jetpack-contact-form-messages.php:354
|
1278 |
-
#: dist/include/misc/class-bulk-delete-jetpack-contact-form-messages.php:368
|
1279 |
-
#: dist/include/misc/class-bulk-delete-jetpack-contact-form-messages.php:382
|
1280 |
-
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:354
|
1281 |
-
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:368
|
1282 |
-
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:382
|
1283 |
-
#: tmp_addon/bulk-delete-jetpack-contact-form-messages.php:134
|
1284 |
-
#: tmp_addon/bulk-delete-jetpack-contact-form-messages.php:148
|
1285 |
-
#: tmp_addon/bulk-delete-jetpack-contact-form-messages.php:162
|
1286 |
-
msgid "is"
|
1287 |
-
msgstr ""
|
1288 |
-
|
1289 |
-
#: dist/include/misc/class-bulk-delete-jetpack-contact-form-messages.php:355
|
1290 |
-
#: dist/include/misc/class-bulk-delete-jetpack-contact-form-messages.php:369
|
1291 |
-
#: dist/include/misc/class-bulk-delete-jetpack-contact-form-messages.php:383
|
1292 |
-
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:355
|
1293 |
-
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:369
|
1294 |
-
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:383
|
1295 |
-
#: tmp_addon/bulk-delete-jetpack-contact-form-messages.php:135
|
1296 |
-
#: tmp_addon/bulk-delete-jetpack-contact-form-messages.php:149
|
1297 |
-
#: tmp_addon/bulk-delete-jetpack-contact-form-messages.php:163
|
1298 |
-
msgid "is not"
|
1299 |
-
msgstr ""
|
1300 |
-
|
1301 |
-
#: dist/include/misc/class-bulk-delete-jetpack-contact-form-messages.php:357
|
1302 |
-
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:357
|
1303 |
-
#: tmp_addon/bulk-delete-jetpack-contact-form-messages.php:137
|
1304 |
-
msgid "Author Name"
|
1305 |
-
msgstr ""
|
1306 |
-
|
1307 |
-
#: dist/include/misc/class-bulk-delete-jetpack-contact-form-messages.php:366
|
1308 |
-
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:366
|
1309 |
-
#: tmp_addon/bulk-delete-jetpack-contact-form-messages.php:146
|
1310 |
-
msgid "Only if author email "
|
1311 |
-
msgstr ""
|
1312 |
-
|
1313 |
-
#: dist/include/misc/class-bulk-delete-jetpack-contact-form-messages.php:371
|
1314 |
-
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:371
|
1315 |
-
#: tmp_addon/bulk-delete-jetpack-contact-form-messages.php:151
|
1316 |
-
msgid "Author Email"
|
1317 |
-
msgstr ""
|
1318 |
-
|
1319 |
-
#: dist/include/misc/class-bulk-delete-jetpack-contact-form-messages.php:380
|
1320 |
-
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:380
|
1321 |
-
#: tmp_addon/bulk-delete-jetpack-contact-form-messages.php:160
|
1322 |
-
msgid "Only if author ip "
|
1323 |
-
msgstr ""
|
1324 |
-
|
1325 |
-
#: dist/include/misc/class-bulk-delete-jetpack-contact-form-messages.php:385
|
1326 |
-
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:385
|
1327 |
-
#: tmp_addon/bulk-delete-jetpack-contact-form-messages.php:165
|
1328 |
-
msgid "Author ip"
|
1329 |
-
msgstr ""
|
1330 |
-
|
1331 |
-
#: dist/include/misc/class-bulk-delete-misc.php:35
|
1332 |
-
#: dist/include/misc/class-bulk-delete-misc.php:101
|
1333 |
-
#: include/misc/class-bulk-delete-misc.php:35
|
1334 |
-
#: include/misc/class-bulk-delete-misc.php:101
|
1335 |
-
msgid "Bulk Delete Miscellaneous Items"
|
1336 |
-
msgstr ""
|
1337 |
-
|
1338 |
-
#: dist/include/misc/class-bulk-delete-misc.php:36
|
1339 |
-
#: include/misc/class-bulk-delete-misc.php:36
|
1340 |
-
msgid "Bulk Delete Misc"
|
1341 |
-
msgstr ""
|
1342 |
-
|
1343 |
-
#: dist/include/pages/class-bulk-delete-pages.php:37
|
1344 |
-
#: include/pages/class-bulk-delete-pages.php:37
|
1345 |
-
msgid "Select the status from which you want to delete pages"
|
1346 |
-
msgstr ""
|
1347 |
-
|
1348 |
-
#: dist/include/pages/class-bulk-delete-pages.php:44
|
1349 |
-
#: include/pages/class-bulk-delete-pages.php:44
|
1350 |
-
msgid "All Published Pages"
|
1351 |
-
msgstr ""
|
1352 |
-
|
1353 |
-
#: dist/include/pages/class-bulk-delete-pages.php:44
|
1354 |
-
#: dist/include/pages/class-bulk-delete-pages.php:51
|
1355 |
-
#: dist/include/pages/class-bulk-delete-pages.php:58
|
1356 |
-
#: dist/include/pages/class-bulk-delete-pages.php:65
|
1357 |
-
#: dist/include/pages/class-bulk-delete-pages.php:72
|
1358 |
-
#: include/pages/class-bulk-delete-pages.php:44
|
1359 |
-
#: include/pages/class-bulk-delete-pages.php:51
|
1360 |
-
#: include/pages/class-bulk-delete-pages.php:58
|
1361 |
-
#: include/pages/class-bulk-delete-pages.php:65
|
1362 |
-
#: include/pages/class-bulk-delete-pages.php:72
|
1363 |
-
msgid "Pages"
|
1364 |
-
msgstr ""
|
1365 |
-
|
1366 |
-
#: dist/include/pages/class-bulk-delete-pages.php:51
|
1367 |
-
#: include/pages/class-bulk-delete-pages.php:51
|
1368 |
-
msgid "All Draft Pages"
|
1369 |
-
msgstr ""
|
1370 |
-
|
1371 |
-
#: dist/include/pages/class-bulk-delete-pages.php:58
|
1372 |
-
#: include/pages/class-bulk-delete-pages.php:58
|
1373 |
-
msgid "All Scheduled Pages"
|
1374 |
-
msgstr ""
|
1375 |
-
|
1376 |
-
#: dist/include/pages/class-bulk-delete-pages.php:65
|
1377 |
-
#: include/pages/class-bulk-delete-pages.php:65
|
1378 |
-
msgid "All Pending Pages"
|
1379 |
-
msgstr ""
|
1380 |
-
|
1381 |
-
#: dist/include/pages/class-bulk-delete-pages.php:72
|
1382 |
-
#: include/pages/class-bulk-delete-pages.php:72
|
1383 |
-
msgid "All Private Pages"
|
1384 |
-
msgstr ""
|
1385 |
-
|
1386 |
-
#: dist/include/pages/class-bulk-delete-pages.php:120
|
1387 |
-
#: include/pages/class-bulk-delete-pages.php:120
|
1388 |
-
msgid "The selected pages are scheduled for deletion."
|
1389 |
-
msgstr ""
|
1390 |
-
|
1391 |
-
#: dist/include/pages/class-bulk-delete-pages.php:124
|
1392 |
-
#: include/pages/class-bulk-delete-pages.php:124
|
1393 |
-
msgid "Deleted %d page"
|
1394 |
-
msgid_plural "Deleted %d pages"
|
1395 |
-
msgstr[0] ""
|
1396 |
-
msgstr[1] ""
|
1397 |
-
|
1398 |
-
#: dist/include/posts/class-bulk-delete-posts.php:26
|
1399 |
-
#: include/posts/class-bulk-delete-posts.php:26
|
1400 |
-
msgid "Select the post statuses from which you want to delete posts"
|
1401 |
-
msgstr ""
|
1402 |
-
|
1403 |
-
#: dist/include/posts/class-bulk-delete-posts.php:40
|
1404 |
-
#: dist/include/posts/class-bulk-delete-posts.php:54
|
1405 |
-
#: dist/include/posts/class-bulk-delete-posts.php:218
|
1406 |
-
#: dist/include/posts/class-bulk-delete-posts.php:350
|
1407 |
-
#: dist/include/posts/class-bulk-delete-posts.php:522
|
1408 |
-
#: dist/include/ui/form.php:238 include/posts/class-bulk-delete-posts.php:40
|
1409 |
-
#: include/posts/class-bulk-delete-posts.php:54
|
1410 |
-
#: include/posts/class-bulk-delete-posts.php:218
|
1411 |
-
#: include/posts/class-bulk-delete-posts.php:350
|
1412 |
-
#: include/posts/class-bulk-delete-posts.php:522 include/ui/form.php:238
|
1413 |
-
msgid "Posts"
|
1414 |
-
msgstr ""
|
1415 |
-
|
1416 |
-
#: dist/include/posts/class-bulk-delete-posts.php:53
|
1417 |
-
#: include/posts/class-bulk-delete-posts.php:53
|
1418 |
-
msgid "All Sticky Posts"
|
1419 |
-
msgstr ""
|
1420 |
-
|
1421 |
-
#: dist/include/posts/class-bulk-delete-posts.php:55
|
1422 |
-
#: include/posts/class-bulk-delete-posts.php:55
|
1423 |
-
msgid "Note"
|
1424 |
-
msgstr ""
|
1425 |
-
|
1426 |
-
#: dist/include/posts/class-bulk-delete-posts.php:55
|
1427 |
-
#: include/posts/class-bulk-delete-posts.php:55
|
1428 |
-
msgid "The date filter will not work for sticky posts"
|
1429 |
-
msgstr ""
|
1430 |
-
|
1431 |
-
#: dist/include/posts/class-bulk-delete-posts.php:108
|
1432 |
-
#: include/posts/class-bulk-delete-posts.php:108
|
1433 |
-
msgid "Posts with the selected status are scheduled for deletion."
|
1434 |
-
msgstr ""
|
1435 |
-
|
1436 |
-
#. translators: 1 Number of posts deleted
|
1437 |
-
#: dist/include/posts/class-bulk-delete-posts.php:116
|
1438 |
-
#: include/posts/class-bulk-delete-posts.php:116
|
1439 |
-
msgid "Deleted %d post with the selected post status"
|
1440 |
-
msgid_plural "Deleted %d posts with the selected post status"
|
1441 |
-
msgstr[0] ""
|
1442 |
-
msgstr[1] ""
|
1443 |
-
|
1444 |
-
#: dist/include/posts/class-bulk-delete-posts.php:198
|
1445 |
-
#: include/posts/class-bulk-delete-posts.php:198
|
1446 |
-
msgid "Select the post type from which you want to delete posts by category"
|
1447 |
msgstr ""
|
1448 |
|
1449 |
-
#:
|
1450 |
-
|
1451 |
-
msgid "Select the categories from which you wan to delete posts"
|
1452 |
msgstr ""
|
1453 |
|
1454 |
-
#:
|
1455 |
-
#: include/
|
1456 |
msgid ""
|
1457 |
-
"
|
1458 |
-
"
|
1459 |
-
msgstr ""
|
1460 |
-
|
1461 |
-
#: dist/include/posts/class-bulk-delete-posts.php:215
|
1462 |
-
#: include/posts/class-bulk-delete-posts.php:215
|
1463 |
-
msgid "Select Categories"
|
1464 |
-
msgstr ""
|
1465 |
-
|
1466 |
-
#: dist/include/posts/class-bulk-delete-posts.php:216
|
1467 |
-
#: include/posts/class-bulk-delete-posts.php:216
|
1468 |
-
msgid "All Categories"
|
1469 |
msgstr ""
|
1470 |
|
1471 |
-
#:
|
1472 |
-
|
1473 |
-
msgid "Posts from the selected categories are scheduled for deletion."
|
1474 |
msgstr ""
|
1475 |
|
1476 |
-
#:
|
1477 |
-
|
1478 |
-
msgid "Deleted %d post from the selected categories"
|
1479 |
-
msgid_plural "Deleted %d posts from the selected categories"
|
1480 |
-
msgstr[0] ""
|
1481 |
-
msgstr[1] ""
|
1482 |
-
|
1483 |
-
#: dist/include/posts/class-bulk-delete-posts.php:340
|
1484 |
-
#: include/posts/class-bulk-delete-posts.php:340
|
1485 |
-
msgid "Select the tags from which you want to delete posts"
|
1486 |
msgstr ""
|
1487 |
|
1488 |
-
#:
|
1489 |
-
|
1490 |
-
msgid "Select Tags"
|
1491 |
msgstr ""
|
1492 |
|
1493 |
-
#:
|
1494 |
-
|
1495 |
-
msgid "All Tags"
|
1496 |
msgstr ""
|
1497 |
|
1498 |
-
#:
|
1499 |
-
|
1500 |
-
|
1501 |
msgstr ""
|
1502 |
|
1503 |
-
#:
|
1504 |
-
|
1505 |
-
|
1506 |
msgstr ""
|
1507 |
|
1508 |
-
|
1509 |
-
#: include/
|
1510 |
-
msgid "Deleted %d
|
1511 |
-
msgid_plural "Deleted %d
|
1512 |
msgstr[0] ""
|
1513 |
msgstr[1] ""
|
1514 |
|
1515 |
-
#:
|
1516 |
-
#: include/
|
1517 |
-
msgid ""
|
1518 |
-
"Select the post type from which you want to delete posts by custom taxonomy"
|
1519 |
msgstr ""
|
1520 |
|
1521 |
-
#:
|
1522 |
-
#: include/
|
1523 |
-
msgid "
|
1524 |
msgstr ""
|
1525 |
|
1526 |
-
#:
|
1527 |
-
#: include/
|
1528 |
-
msgid ""
|
1529 |
-
"The selected taxonomy has the following terms. Select the terms from which "
|
1530 |
-
"you want to delete posts"
|
1531 |
msgstr ""
|
1532 |
|
1533 |
-
#:
|
1534 |
-
#: include/
|
1535 |
msgid ""
|
1536 |
-
"
|
1537 |
-
"
|
1538 |
msgstr ""
|
1539 |
|
1540 |
-
#:
|
1541 |
-
|
1542 |
-
msgid ""
|
1543 |
-
"This WordPress installation doesn't have any non-empty custom taxonomies "
|
1544 |
-
"defined"
|
1545 |
msgstr ""
|
1546 |
|
1547 |
-
#:
|
1548 |
-
#: include/
|
1549 |
-
|
|
|
|
|
|
|
|
|
1550 |
msgstr ""
|
1551 |
|
1552 |
-
#:
|
1553 |
-
|
1554 |
-
|
1555 |
-
|
1556 |
-
|
1557 |
-
|
|
|
1558 |
|
1559 |
-
#:
|
1560 |
-
|
1561 |
-
msgid "Select the custom post types from which you want to delete posts"
|
1562 |
msgstr ""
|
1563 |
|
1564 |
-
#:
|
1565 |
-
#: include/posts/class-bulk-delete-posts.php:717
|
1566 |
msgid ""
|
1567 |
-
"
|
|
|
1568 |
msgstr ""
|
1569 |
|
1570 |
-
#:
|
1571 |
-
|
1572 |
-
msgid "Posts from the selected custom post type are scheduled for deletion."
|
1573 |
msgstr ""
|
1574 |
|
1575 |
-
|
1576 |
-
#: include/
|
1577 |
-
msgid "Deleted %d post
|
1578 |
-
msgid_plural "Deleted %d posts
|
1579 |
msgstr[0] ""
|
1580 |
msgstr[1] ""
|
1581 |
|
1582 |
-
#:
|
1583 |
-
|
1584 |
-
msgid "Delete posts and pages that have the following Permalink"
|
1585 |
msgstr ""
|
1586 |
|
1587 |
-
#:
|
1588 |
-
|
1589 |
-
msgid "Enter one post url (not post ids) per line"
|
1590 |
msgstr ""
|
1591 |
|
1592 |
-
#:
|
1593 |
-
|
1594 |
-
|
1595 |
-
msgid_plural "Deleted %d posts with the specified urls"
|
1596 |
-
msgstr[0] ""
|
1597 |
-
msgstr[1] ""
|
1598 |
|
1599 |
-
#:
|
1600 |
-
|
1601 |
-
msgid "Select the posts which you want to delete"
|
1602 |
msgstr ""
|
1603 |
|
1604 |
-
#:
|
1605 |
-
|
1606 |
-
|
|
|
1607 |
msgstr ""
|
1608 |
|
1609 |
-
#:
|
1610 |
-
|
1611 |
-
|
|
|
1612 |
msgstr ""
|
1613 |
|
1614 |
-
|
1615 |
-
#: include/
|
1616 |
-
msgid "Deleted %d post
|
1617 |
-
msgid_plural "Deleted %d
|
1618 |
msgstr[0] ""
|
1619 |
msgstr[1] ""
|
1620 |
|
1621 |
-
#:
|
1622 |
-
|
1623 |
-
msgid ""
|
1624 |
-
"Are you sure you want to delete all the posts based on the selected option?"
|
1625 |
msgstr ""
|
1626 |
|
1627 |
-
#:
|
1628 |
-
|
1629 |
-
msgid "Please select posts from at least one option"
|
1630 |
msgstr ""
|
1631 |
|
1632 |
-
#:
|
1633 |
-
|
1634 |
-
msgid "Please select at least one category"
|
1635 |
msgstr ""
|
1636 |
|
1637 |
-
#:
|
1638 |
-
|
1639 |
-
msgid "Please select at least one tag"
|
1640 |
msgstr ""
|
1641 |
|
1642 |
-
|
1643 |
-
#: include/
|
1644 |
-
msgid "
|
1645 |
msgstr ""
|
1646 |
|
1647 |
-
|
1648 |
-
#: include/
|
1649 |
-
msgid "
|
1650 |
msgstr ""
|
1651 |
|
1652 |
-
#:
|
1653 |
-
|
1654 |
-
#: include/settings/class-bd-settings-page.php:47
|
1655 |
-
#: include/settings/class-bd-settings-page.php:101
|
1656 |
-
msgid "Bulk Delete Settings"
|
1657 |
msgstr ""
|
1658 |
|
1659 |
-
#:
|
1660 |
-
|
1661 |
-
msgid "Settings"
|
1662 |
msgstr ""
|
1663 |
|
1664 |
-
#:
|
1665 |
-
|
1666 |
-
msgid "Add Addon License"
|
1667 |
msgstr ""
|
1668 |
|
1669 |
-
#:
|
1670 |
-
|
1671 |
-
msgid "Bulk Delete - System Info"
|
1672 |
msgstr ""
|
1673 |
|
1674 |
-
#:
|
1675 |
-
|
1676 |
-
msgid "System Info"
|
1677 |
msgstr ""
|
1678 |
|
1679 |
-
|
1680 |
-
#: include/
|
1681 |
-
|
1682 |
-
|
|
|
|
|
|
|
1683 |
|
1684 |
-
#:
|
1685 |
-
|
1686 |
-
msgid ""
|
1687 |
-
"SAVEQUERIES is <a href=\"%s\" target=\"_blank\">enabled</a>. This puts "
|
1688 |
-
"additional load on the memory and will restrict the number of items that can "
|
1689 |
-
"be deleted."
|
1690 |
msgstr ""
|
1691 |
|
1692 |
-
#:
|
1693 |
-
|
1694 |
-
msgid ""
|
1695 |
-
"DISABLE_WP_CRON is <a href=\"%s\" target=\"_blank\">enabled</a>. This "
|
1696 |
-
"prevents scheduler from running."
|
1697 |
msgstr ""
|
1698 |
|
1699 |
-
#:
|
1700 |
-
#: include/system-info/class-bd-system-info-page.php:101
|
1701 |
msgid ""
|
1702 |
-
"
|
1703 |
-
"(Mac)."
|
1704 |
msgstr ""
|
1705 |
|
1706 |
-
#:
|
1707 |
msgid ""
|
1708 |
-
"
|
1709 |
-
"href = \"%2$s\">rate us</a> at <a href = \"%2$s\">WordPress.org</a>"
|
1710 |
msgstr ""
|
1711 |
|
1712 |
-
|
1713 |
-
|
|
|
1714 |
msgstr ""
|
1715 |
|
1716 |
-
|
1717 |
-
#: include/
|
1718 |
-
msgid "
|
1719 |
msgstr ""
|
1720 |
|
1721 |
-
#:
|
1722 |
-
|
1723 |
-
msgid "Support Forums"
|
1724 |
msgstr ""
|
1725 |
|
1726 |
-
#:
|
1727 |
-
|
1728 |
-
msgid "Buy pro addons"
|
1729 |
msgstr ""
|
1730 |
|
1731 |
-
#:
|
1732 |
-
|
1733 |
-
msgid "Plugin author's blog"
|
1734 |
msgstr ""
|
1735 |
|
1736 |
-
#:
|
1737 |
-
|
1738 |
-
msgid "Other Plugin's by Author"
|
1739 |
msgstr ""
|
1740 |
|
1741 |
-
#:
|
1742 |
-
|
1743 |
-
#: dist/include/users/class-bd-users-page.php:88
|
1744 |
-
#: include/ui/class-bulk-delete-help-screen.php:59
|
1745 |
-
#: include/ui/class-bulk-delete-help-screen.php:71
|
1746 |
-
#: include/users/class-bd-users-page.php:88
|
1747 |
-
#: tmp_addon/class-bd-attachment-page.php:62
|
1748 |
-
msgid "Overview"
|
1749 |
msgstr ""
|
1750 |
|
1751 |
-
#:
|
1752 |
-
|
1753 |
-
msgid ""
|
1754 |
-
"This screen contains different modules that allows you to delete posts or "
|
1755 |
-
"schedule them for deletion."
|
1756 |
msgstr ""
|
1757 |
|
1758 |
-
#:
|
1759 |
-
|
1760 |
-
msgid ""
|
1761 |
-
"This screen contains different modules that allows you to delete pages or "
|
1762 |
-
"schedule them for deletion."
|
1763 |
msgstr ""
|
1764 |
|
1765 |
-
|
1766 |
-
#: include/
|
1767 |
-
msgid "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1768 |
msgstr ""
|
1769 |
|
1770 |
-
#:
|
1771 |
-
|
1772 |
-
msgid "This plugin allows you to perform bulk operations in WordPress easily."
|
1773 |
msgstr ""
|
1774 |
|
1775 |
-
#:
|
1776 |
-
|
1777 |
-
msgid ""
|
1778 |
-
"This plugin can be used to delete the posts, pages or users using various "
|
1779 |
-
"filters and conditions."
|
1780 |
msgstr ""
|
1781 |
|
1782 |
-
#:
|
1783 |
-
msgid "
|
1784 |
msgstr ""
|
1785 |
|
1786 |
-
#:
|
1787 |
-
|
1788 |
-
#: tmp_addon/bulk-delete-posts-by-content.php:210
|
1789 |
-
#: tmp_addon/bulk-delete-posts-by-custom-field.php:234
|
1790 |
-
#: tmp_addon/bulk-delete-posts-by-word-count.php:209
|
1791 |
-
msgid "Public posts"
|
1792 |
msgstr ""
|
1793 |
|
1794 |
-
|
1795 |
-
#:
|
1796 |
-
|
1797 |
-
|
1798 |
-
|
1799 |
-
|
|
|
|
|
|
|
1800 |
msgstr ""
|
1801 |
|
1802 |
-
#:
|
1803 |
-
msgid "
|
1804 |
msgstr ""
|
1805 |
|
1806 |
-
#:
|
1807 |
-
msgid ""
|
1808 |
-
"Enter time in <strong>Y-m-d H:i:s</strong> format or enter <strong>now</"
|
1809 |
-
"strong> to use current time"
|
1810 |
msgstr ""
|
1811 |
|
1812 |
-
#:
|
1813 |
-
|
1814 |
-
msgid "All"
|
1815 |
msgstr ""
|
1816 |
|
1817 |
-
#:
|
1818 |
-
|
1819 |
-
|
1820 |
-
|
1821 |
-
#: include/users/class-bd-users-page.php:49
|
1822 |
-
#: include/users/class-bd-users-page.php:72
|
1823 |
-
msgid "Bulk Delete Users"
|
1824 |
msgstr ""
|
1825 |
|
1826 |
-
#:
|
1827 |
-
|
1828 |
-
|
|
|
1829 |
msgstr ""
|
1830 |
|
1831 |
-
#:
|
1832 |
-
#: include/users/class-bd-users-page.php:90
|
1833 |
-
#: tmp_addon/class-bd-attachment-page.php:64
|
1834 |
msgid ""
|
1835 |
-
"This
|
1836 |
-
"schedule them for deletion."
|
1837 |
msgstr ""
|
1838 |
|
1839 |
-
|
1840 |
-
#: include/
|
1841 |
-
msgid "
|
|
|
|
|
|
|
|
|
|
|
|
|
1842 |
msgstr ""
|
1843 |
|
1844 |
-
#:
|
1845 |
-
|
1846 |
-
msgid "Users from with the selected user meta are scheduled for deletion."
|
1847 |
msgstr ""
|
1848 |
|
1849 |
-
#:
|
1850 |
-
|
1851 |
-
msgid "Deleted %d user with the selected user meta"
|
1852 |
msgstr ""
|
1853 |
|
1854 |
-
#:
|
1855 |
-
|
1856 |
-
msgid "Deleted %d users with the selected user meta"
|
1857 |
msgstr ""
|
1858 |
|
1859 |
-
#:
|
1860 |
-
|
1861 |
-
msgid "Select the user meta from which you want to delete users"
|
1862 |
msgstr ""
|
1863 |
|
1864 |
-
#:
|
1865 |
-
|
1866 |
-
#: tmp_addon/bulk-delete-comment-meta.php:145
|
1867 |
-
#: tmp_addon/bulk-delete-post-meta.php:145
|
1868 |
-
#: tmp_addon/bulk-delete-user-meta.php:145
|
1869 |
-
msgid "Meta Value"
|
1870 |
msgstr ""
|
1871 |
|
1872 |
-
#:
|
1873 |
-
|
1874 |
-
msgid "If you want to check for null values, then leave the value column blank"
|
1875 |
msgstr ""
|
1876 |
|
1877 |
-
#:
|
1878 |
-
|
1879 |
-
msgid ""
|
1880 |
-
"Are you sure you want to delete all the users from the selected user meta?"
|
1881 |
msgstr ""
|
1882 |
|
1883 |
-
|
1884 |
-
#: include/
|
1885 |
msgid ""
|
1886 |
-
"
|
1887 |
-
"
|
|
|
1888 |
msgstr ""
|
1889 |
|
1890 |
-
|
1891 |
-
#: include/
|
1892 |
-
msgid "
|
|
|
|
|
|
|
1893 |
msgstr ""
|
1894 |
|
1895 |
-
#:
|
1896 |
-
|
1897 |
-
msgid "Deleted %d user from the selected roles"
|
1898 |
msgstr ""
|
1899 |
|
1900 |
-
#:
|
1901 |
-
|
1902 |
-
msgid "Deleted %d users from the selected roles"
|
1903 |
msgstr ""
|
1904 |
|
1905 |
-
#:
|
1906 |
-
|
1907 |
-
msgid "Select the user roles from which you want to delete users"
|
1908 |
msgstr ""
|
1909 |
|
1910 |
-
#:
|
1911 |
-
#: include/users/modules/class-bulk-delete-users-by-user-role.php:154
|
1912 |
msgid ""
|
1913 |
-
"
|
1914 |
-
msgstr ""
|
1915 |
-
|
1916 |
-
#: dist/include/users/modules/class-bulk-delete-users-by-user-role.php:157
|
1917 |
-
#: include/users/modules/class-bulk-delete-users-by-user-role.php:157
|
1918 |
-
msgid "Select at least one user role from which users should be deleted"
|
1919 |
msgstr ""
|
1920 |
|
1921 |
-
#:
|
1922 |
-
|
1923 |
-
|
|
|
1924 |
msgstr ""
|
1925 |
|
1926 |
-
#:
|
1927 |
-
msgid "
|
1928 |
msgstr ""
|
1929 |
|
1930 |
-
#: include/
|
1931 |
-
#: include/
|
1932 |
-
|
1933 |
-
msgid ""
|
1934 |
-
"Use this option if there are more than 1000 posts and the script times out."
|
1935 |
msgstr ""
|
1936 |
|
1937 |
-
#: include/
|
1938 |
-
|
|
|
1939 |
msgstr ""
|
1940 |
|
1941 |
-
#: include/
|
1942 |
-
|
1943 |
-
|
|
|
|
|
1944 |
msgstr ""
|
1945 |
|
1946 |
-
#: include/
|
1947 |
-
msgid ""
|
1948 |
-
"Use this option if there are more than 1000 %s and the script times out."
|
1949 |
msgstr ""
|
1950 |
|
1951 |
-
#:
|
1952 |
-
msgid "
|
1953 |
msgstr ""
|
1954 |
|
1955 |
-
#:
|
1956 |
-
|
1957 |
-
#: tmp_addon/bulk-delete-posts-by-content.php:165
|
1958 |
-
#: tmp_addon/bulk-delete-posts-by-title.php:133
|
1959 |
-
#: tmp_addon/bulk-delete-posts-by-word-count.php:171
|
1960 |
-
#: tmp_addon/bulk-delete-user-meta.php:125
|
1961 |
-
msgid "equal to"
|
1962 |
msgstr ""
|
1963 |
|
1964 |
-
#:
|
1965 |
-
#:
|
1966 |
-
|
1967 |
-
|
1968 |
-
#: tmp_addon/bulk-delete-user-meta.php:126
|
1969 |
-
msgid "not equal to"
|
1970 |
msgstr ""
|
1971 |
|
1972 |
-
#:
|
1973 |
-
|
1974 |
-
#: tmp_addon/bulk-delete-posts-by-word-count.php:172
|
1975 |
-
#: tmp_addon/bulk-delete-user-meta.php:127
|
1976 |
-
msgid "less than"
|
1977 |
msgstr ""
|
1978 |
|
1979 |
-
#:
|
1980 |
-
|
1981 |
-
#: tmp_addon/bulk-delete-user-meta.php:128
|
1982 |
-
msgid "less than or equal to"
|
1983 |
msgstr ""
|
1984 |
|
1985 |
-
#:
|
1986 |
-
|
1987 |
-
#: tmp_addon/bulk-delete-posts-by-word-count.php:173
|
1988 |
-
#: tmp_addon/bulk-delete-user-meta.php:129
|
1989 |
-
msgid "greater than"
|
1990 |
msgstr ""
|
1991 |
|
1992 |
-
#:
|
1993 |
-
|
1994 |
-
|
1995 |
-
|
1996 |
msgstr ""
|
1997 |
|
1998 |
-
|
1999 |
-
#:
|
2000 |
-
|
2001 |
-
|
2002 |
-
msgstr ""
|
|
|
2003 |
|
2004 |
-
#:
|
2005 |
-
#:
|
2006 |
-
|
2007 |
-
msgid "not like"
|
2008 |
msgstr ""
|
2009 |
|
2010 |
-
#:
|
2011 |
-
|
2012 |
-
#: tmp_addon/bulk-delete-user-meta.php:135
|
2013 |
-
msgid "CHAR"
|
2014 |
msgstr ""
|
2015 |
|
2016 |
-
#:
|
2017 |
-
|
2018 |
-
|
2019 |
-
|
2020 |
msgstr ""
|
2021 |
|
2022 |
-
#:
|
2023 |
-
|
2024 |
-
#: tmp_addon/bulk-delete-user-meta.php:137
|
2025 |
-
msgid "DECIMAL"
|
2026 |
msgstr ""
|
2027 |
|
2028 |
-
#:
|
2029 |
-
|
2030 |
-
#: tmp_addon/bulk-delete-user-meta.php:138
|
2031 |
-
msgid "SIGNED"
|
2032 |
msgstr ""
|
2033 |
|
2034 |
-
#:
|
2035 |
-
|
2036 |
-
#: tmp_addon/bulk-delete-user-meta.php:139
|
2037 |
-
msgid "UNSIGNED"
|
2038 |
msgstr ""
|
2039 |
|
2040 |
-
#:
|
2041 |
-
|
2042 |
-
#: tmp_addon/bulk-delete-user-meta.php:140
|
2043 |
-
msgid "DATE"
|
2044 |
msgstr ""
|
2045 |
|
2046 |
-
#:
|
2047 |
-
|
2048 |
-
#: tmp_addon/bulk-delete-user-meta.php:141
|
2049 |
-
msgid "TIME"
|
2050 |
msgstr ""
|
2051 |
|
2052 |
-
#:
|
2053 |
-
|
2054 |
-
|
2055 |
-
msgid "DATETIME"
|
2056 |
msgstr ""
|
2057 |
|
2058 |
-
#:
|
2059 |
-
|
2060 |
-
|
2061 |
-
|
2062 |
msgstr ""
|
2063 |
|
2064 |
-
|
2065 |
-
#:
|
2066 |
-
|
2067 |
-
|
2068 |
-
#: tmp_addon/bulk-delete-posts-by-attachment.php:377
|
2069 |
-
#: tmp_addon/bulk-delete-posts-by-content.php:388
|
2070 |
-
#: tmp_addon/bulk-delete-posts-by-custom-field.php:568
|
2071 |
-
#: tmp_addon/bulk-delete-posts-by-duplicate-title.php:367
|
2072 |
-
#: tmp_addon/bulk-delete-posts-by-title.php:429
|
2073 |
-
#: tmp_addon/bulk-delete-posts-by-user-role.php:325
|
2074 |
-
#: tmp_addon/bulk-delete-posts-by-user.php:335
|
2075 |
-
#: tmp_addon/bulk-delete-posts-by-word-count.php:513
|
2076 |
-
#: tmp_addon/bulk-delete-scheduler-email.php:335
|
2077 |
-
#: tmp_addon/bulk-delete-scheduler-for-deleting-pages-by-status.php:108
|
2078 |
-
#: tmp_addon/bulk-delete-scheduler-for-deleting-posts-by-attachment.php:114
|
2079 |
-
#: tmp_addon/bulk-delete-scheduler-for-deleting-posts-by-category.php:108
|
2080 |
-
#: tmp_addon/bulk-delete-scheduler-for-deleting-posts-by-content.php:112
|
2081 |
-
#: tmp_addon/bulk-delete-scheduler-for-deleting-posts-by-custom-field.php:108
|
2082 |
-
#: tmp_addon/bulk-delete-scheduler-for-deleting-posts-by-duplicate-title.php:117
|
2083 |
-
#: tmp_addon/bulk-delete-scheduler-for-deleting-posts-by-post-type.php:107
|
2084 |
-
#: tmp_addon/bulk-delete-scheduler-for-deleting-posts-by-status.php:108
|
2085 |
-
#: tmp_addon/bulk-delete-scheduler-for-deleting-posts-by-tag.php:108
|
2086 |
-
#: tmp_addon/bulk-delete-scheduler-for-deleting-posts-by-taxonomy.php:103
|
2087 |
-
#: tmp_addon/bulk-delete-scheduler-for-deleting-posts-by-user-role.php:108
|
2088 |
-
#: tmp_addon/bulk-delete-scheduler-for-deleting-posts-by-user.php:129
|
2089 |
-
#: tmp_addon/bulk-delete-scheduler-for-deleting-users-by-role.php:108
|
2090 |
-
#: tmp_addon/bulk-delete-user-meta.php:213
|
2091 |
-
msgid ""
|
2092 |
-
"<strong>%s</strong> addon needs <a href=\"%s\">Bulk Delete plugin</a> to be "
|
2093 |
-
"installed and activated; the addon has been <strong>deactivated</strong>."
|
2094 |
-
msgstr ""
|
2095 |
-
|
2096 |
-
#: tmp_addon/bulk-delete-from-trash.php:142
|
2097 |
-
msgid "Select the post type whose posts you want to delete from trash"
|
2098 |
-
msgstr ""
|
2099 |
-
|
2100 |
-
#: tmp_addon/bulk-delete-from-trash.php:157
|
2101 |
-
msgid "posts"
|
2102 |
-
msgstr ""
|
2103 |
-
|
2104 |
-
#: tmp_addon/bulk-delete-from-trash.php:178
|
2105 |
-
msgid "Deleted %d post from trash"
|
2106 |
-
msgid_plural "Deleted %d posts from trash"
|
2107 |
msgstr[0] ""
|
2108 |
msgstr[1] ""
|
2109 |
|
2110 |
-
#:
|
2111 |
-
msgid "
|
2112 |
msgstr ""
|
2113 |
|
2114 |
-
#:
|
2115 |
-
msgid "
|
2116 |
msgstr ""
|
2117 |
|
2118 |
-
#:
|
2119 |
-
msgid "
|
2120 |
msgstr ""
|
2121 |
|
2122 |
-
#:
|
2123 |
-
msgid "
|
2124 |
-
msgid_plural "Deleted %d pages from trash"
|
2125 |
-
msgstr[0] ""
|
2126 |
-
msgstr[1] ""
|
2127 |
-
|
2128 |
-
#: tmp_addon/bulk-delete-from-trash.php:305
|
2129 |
-
msgid "Are you sure you want to delete the selected posts from trash?"
|
2130 |
msgstr ""
|
2131 |
|
2132 |
-
#:
|
2133 |
msgid ""
|
2134 |
-
"
|
2135 |
msgstr ""
|
2136 |
|
2137 |
-
#:
|
2138 |
-
msgid "
|
2139 |
msgstr ""
|
2140 |
|
2141 |
-
|
2142 |
-
|
2143 |
-
|
|
|
|
|
|
|
2144 |
|
2145 |
-
#:
|
2146 |
-
msgid "
|
2147 |
msgstr ""
|
2148 |
|
2149 |
-
#:
|
2150 |
-
msgid "
|
2151 |
msgstr ""
|
2152 |
|
2153 |
-
#:
|
2154 |
-
|
2155 |
-
msgid "created"
|
2156 |
msgstr ""
|
2157 |
|
2158 |
-
#:
|
2159 |
-
|
2160 |
-
msgid "modified"
|
2161 |
msgstr ""
|
2162 |
|
2163 |
-
#:
|
2164 |
-
msgid "
|
2165 |
msgstr ""
|
2166 |
|
2167 |
-
#:
|
2168 |
-
|
|
|
|
|
2169 |
msgstr ""
|
2170 |
|
2171 |
-
#:
|
2172 |
-
msgid "
|
2173 |
msgstr ""
|
2174 |
|
2175 |
-
#:
|
2176 |
-
msgid "
|
|
|
|
|
2177 |
msgstr ""
|
2178 |
|
2179 |
-
#:
|
2180 |
-
msgid "
|
2181 |
msgstr ""
|
2182 |
|
2183 |
-
#:
|
2184 |
-
|
2185 |
-
msgid "Select the post type whose posts you want to delete"
|
2186 |
msgstr ""
|
2187 |
|
2188 |
-
#:
|
2189 |
-
|
2190 |
-
msgid "Choose your attachment settings"
|
2191 |
msgstr ""
|
2192 |
|
2193 |
-
#:
|
2194 |
-
msgid "Delete
|
2195 |
msgstr ""
|
2196 |
|
2197 |
-
#:
|
2198 |
-
msgid "Delete
|
2199 |
msgstr ""
|
2200 |
|
2201 |
-
#:
|
2202 |
-
msgid ""
|
2203 |
-
"Posts matching the selected attachment setting are scheduled for deletion."
|
2204 |
msgstr ""
|
2205 |
|
2206 |
-
#:
|
2207 |
-
msgid "
|
2208 |
-
msgid_plural "Deleted %d posts using the selected attachment condition"
|
2209 |
-
msgstr[0] ""
|
2210 |
-
msgstr[1] ""
|
2211 |
-
|
2212 |
-
#: tmp_addon/bulk-delete-posts-by-content.php:118
|
2213 |
-
msgid "By Content"
|
2214 |
msgstr ""
|
2215 |
|
2216 |
-
#:
|
2217 |
-
|
2218 |
-
msgid "Select the fields to check for"
|
2219 |
msgstr ""
|
2220 |
|
2221 |
-
#:
|
2222 |
-
|
2223 |
-
msgid "Check only Post Content"
|
2224 |
msgstr ""
|
2225 |
|
2226 |
-
#:
|
2227 |
-
|
2228 |
-
msgid "Check only Post Title"
|
2229 |
msgstr ""
|
2230 |
|
2231 |
-
#:
|
2232 |
-
msgid "
|
2233 |
msgstr ""
|
2234 |
|
2235 |
-
#:
|
2236 |
-
msgid "
|
|
|
|
|
2237 |
msgstr ""
|
2238 |
|
2239 |
-
#:
|
2240 |
-
|
|
|
2241 |
msgstr ""
|
2242 |
|
2243 |
-
#:
|
2244 |
-
|
2245 |
-
|
|
|
2246 |
msgstr ""
|
2247 |
|
2248 |
-
#:
|
2249 |
-
|
2250 |
-
msgid "doesn't contains"
|
2251 |
msgstr ""
|
2252 |
|
2253 |
-
#:
|
2254 |
-
|
2255 |
-
msgid "starts with"
|
2256 |
msgstr ""
|
2257 |
|
2258 |
-
#:
|
2259 |
-
#:
|
2260 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2261 |
msgstr ""
|
2262 |
|
2263 |
-
#:
|
2264 |
-
msgid "
|
2265 |
msgstr ""
|
2266 |
|
2267 |
-
#:
|
2268 |
-
msgid "
|
2269 |
msgstr ""
|
2270 |
|
2271 |
-
#:
|
2272 |
-
msgid "
|
2273 |
msgstr ""
|
2274 |
|
2275 |
-
#:
|
2276 |
-
msgid "
|
2277 |
msgstr ""
|
2278 |
|
2279 |
-
#:
|
2280 |
-
|
2281 |
-
msgid "Posts matching the selected content setting are scheduled for deletion."
|
2282 |
msgstr ""
|
2283 |
|
2284 |
-
#:
|
2285 |
-
#: tmp_addon/bulk-delete-posts-by-word-count.php:303
|
2286 |
-
msgid "Deleted %d post using the selected content condition"
|
2287 |
-
msgid_plural "Deleted %d posts using the selected content condition"
|
2288 |
-
msgstr[0] ""
|
2289 |
-
msgstr[1] ""
|
2290 |
-
|
2291 |
-
#: tmp_addon/bulk-delete-posts-by-content.php:366
|
2292 |
-
#: tmp_addon/bulk-delete-posts-by-word-count.php:489
|
2293 |
msgid ""
|
2294 |
-
"
|
2295 |
-
"
|
2296 |
msgstr ""
|
2297 |
|
2298 |
-
#:
|
2299 |
-
msgid "
|
2300 |
msgstr ""
|
2301 |
|
2302 |
-
#:
|
2303 |
-
msgid "
|
2304 |
msgstr ""
|
2305 |
|
2306 |
-
#:
|
2307 |
-
msgid "
|
2308 |
msgstr ""
|
2309 |
|
2310 |
-
#:
|
2311 |
-
msgid "
|
2312 |
msgstr ""
|
2313 |
|
2314 |
-
#:
|
2315 |
-
msgid "
|
2316 |
msgstr ""
|
2317 |
|
2318 |
-
#:
|
2319 |
-
msgid "
|
2320 |
msgstr ""
|
2321 |
|
2322 |
-
#:
|
2323 |
-
msgid "
|
2324 |
msgstr ""
|
2325 |
|
2326 |
-
#:
|
2327 |
-
msgid "
|
2328 |
msgstr ""
|
2329 |
|
2330 |
-
#:
|
2331 |
-
msgid "
|
2332 |
msgstr ""
|
2333 |
|
2334 |
-
#:
|
2335 |
-
msgid "
|
2336 |
msgstr ""
|
2337 |
|
2338 |
-
#:
|
2339 |
-
msgid "
|
2340 |
msgstr ""
|
2341 |
|
2342 |
-
#:
|
2343 |
-
msgid "
|
|
|
2344 |
msgstr ""
|
2345 |
|
2346 |
-
#:
|
2347 |
-
msgid "
|
2348 |
msgstr ""
|
2349 |
|
2350 |
-
#:
|
2351 |
-
msgid "
|
|
|
2352 |
msgstr ""
|
2353 |
|
2354 |
-
#:
|
2355 |
-
msgid "
|
2356 |
msgstr ""
|
2357 |
|
2358 |
-
#:
|
2359 |
-
msgid "
|
|
|
|
|
2360 |
msgstr ""
|
2361 |
|
2362 |
-
#:
|
2363 |
-
msgid "
|
2364 |
msgstr ""
|
2365 |
|
2366 |
-
#:
|
2367 |
-
msgid "
|
2368 |
msgstr ""
|
2369 |
|
2370 |
-
#:
|
2371 |
-
msgid "
|
2372 |
msgstr ""
|
2373 |
|
2374 |
-
#:
|
2375 |
-
msgid "
|
2376 |
msgstr ""
|
2377 |
|
2378 |
-
#:
|
2379 |
-
msgid "
|
2380 |
msgstr ""
|
2381 |
|
2382 |
-
#:
|
2383 |
-
msgid "
|
2384 |
msgstr ""
|
2385 |
|
2386 |
-
#:
|
2387 |
-
msgid "
|
2388 |
msgstr ""
|
2389 |
|
2390 |
-
#:
|
2391 |
-
msgid "
|
|
|
|
|
2392 |
msgstr ""
|
2393 |
|
2394 |
-
#:
|
2395 |
-
msgid "
|
2396 |
msgstr ""
|
2397 |
|
2398 |
-
#:
|
2399 |
-
msgid "
|
|
|
|
|
2400 |
msgstr ""
|
2401 |
|
2402 |
-
#:
|
2403 |
-
msgid "
|
2404 |
msgstr ""
|
2405 |
|
2406 |
-
|
2407 |
-
#: tmp_addon/bulk-delete-posts-by-custom-field.php:196
|
2408 |
msgid ""
|
2409 |
-
"
|
2410 |
-
"
|
2411 |
-
"noreferrer\">Mysql format specifiers</a>."
|
2412 |
msgstr ""
|
2413 |
|
2414 |
-
#:
|
2415 |
-
msgid ""
|
2416 |
-
"Posts matching the selected custom field setting are scheduled for deletion."
|
2417 |
msgstr ""
|
2418 |
|
2419 |
-
#:
|
2420 |
-
msgid "Deleted %d post using the selected custom field condition"
|
2421 |
-
msgid_plural "Deleted %d posts using the selected custom field condition"
|
2422 |
-
msgstr[0] ""
|
2423 |
-
msgstr[1] ""
|
2424 |
-
|
2425 |
-
#: tmp_addon/bulk-delete-posts-by-custom-field.php:475
|
2426 |
msgid ""
|
2427 |
-
"
|
2428 |
-
"
|
2429 |
msgstr ""
|
2430 |
|
2431 |
-
#:
|
2432 |
-
msgid "
|
2433 |
msgstr ""
|
2434 |
|
2435 |
-
#:
|
2436 |
-
msgid "
|
|
|
|
|
2437 |
msgstr ""
|
2438 |
|
2439 |
-
#:
|
2440 |
-
msgid "
|
2441 |
msgstr ""
|
2442 |
|
2443 |
-
#:
|
2444 |
-
msgid "
|
2445 |
msgstr ""
|
2446 |
|
2447 |
-
#:
|
2448 |
-
msgid "
|
|
|
2449 |
msgstr ""
|
2450 |
|
2451 |
-
#:
|
2452 |
-
msgid "
|
|
|
|
|
2453 |
msgstr ""
|
2454 |
|
2455 |
-
#:
|
2456 |
-
msgid "
|
2457 |
msgstr ""
|
2458 |
|
2459 |
-
#:
|
2460 |
-
msgid "
|
2461 |
msgstr ""
|
2462 |
|
2463 |
-
#:
|
2464 |
-
msgid "
|
|
|
|
|
|
|
2465 |
msgstr ""
|
2466 |
|
2467 |
-
#:
|
2468 |
msgid ""
|
2469 |
-
"
|
2470 |
-
"
|
|
|
2471 |
msgstr ""
|
2472 |
|
2473 |
-
#:
|
2474 |
-
#: tmp_addon/bulk-delete-posts-by-title.php:278
|
2475 |
-
msgid "Deleted %d post using the selected title condition"
|
2476 |
-
msgid_plural "Deleted %d posts using the selected title condition"
|
2477 |
-
msgstr[0] ""
|
2478 |
-
msgstr[1] ""
|
2479 |
-
|
2480 |
-
#: tmp_addon/bulk-delete-posts-by-duplicate-title.php:348
|
2481 |
msgid ""
|
2482 |
-
"
|
|
|
|
|
2483 |
msgstr ""
|
2484 |
|
2485 |
-
#:
|
2486 |
-
msgid "
|
|
|
|
|
|
|
2487 |
msgstr ""
|
2488 |
|
2489 |
-
#:
|
2490 |
-
msgid "
|
2491 |
msgstr ""
|
2492 |
|
2493 |
-
#:
|
2494 |
-
msgid "
|
2495 |
msgstr ""
|
2496 |
|
2497 |
-
#:
|
2498 |
-
msgid "
|
2499 |
msgstr ""
|
2500 |
|
2501 |
-
#:
|
2502 |
-
msgid "
|
2503 |
msgstr ""
|
2504 |
|
2505 |
-
#:
|
2506 |
msgid ""
|
2507 |
-
"
|
|
|
2508 |
msgstr ""
|
2509 |
|
2510 |
-
#:
|
2511 |
-
msgid "
|
2512 |
msgstr ""
|
2513 |
|
2514 |
-
#:
|
2515 |
-
msgid "
|
|
|
|
|
2516 |
msgstr ""
|
2517 |
|
2518 |
-
#:
|
2519 |
-
|
2520 |
-
|
|
|
2521 |
msgstr ""
|
2522 |
|
2523 |
-
#:
|
2524 |
-
#: tmp_addon/bulk-delete-posts-by-user.php:198
|
2525 |
msgid ""
|
2526 |
-
"
|
|
|
2527 |
msgstr ""
|
2528 |
|
2529 |
-
#:
|
2530 |
-
msgid "
|
2531 |
msgstr ""
|
2532 |
|
2533 |
-
#:
|
2534 |
-
msgid "
|
2535 |
-
msgid_plural "Deleted %d posts from selected user roles"
|
2536 |
-
msgstr[0] ""
|
2537 |
-
msgstr[1] ""
|
2538 |
-
|
2539 |
-
#: tmp_addon/bulk-delete-posts-by-user-role.php:305
|
2540 |
-
msgid ""
|
2541 |
-
"Are you sure you want to delete all the posts that belong to the selected "
|
2542 |
-
"user role?"
|
2543 |
msgstr ""
|
2544 |
|
2545 |
-
#:
|
2546 |
-
msgid "
|
2547 |
msgstr ""
|
2548 |
|
2549 |
-
#:
|
2550 |
-
msgid "
|
|
|
|
|
2551 |
msgstr ""
|
2552 |
|
2553 |
-
#:
|
2554 |
-
msgid "
|
2555 |
msgstr ""
|
2556 |
|
2557 |
-
#:
|
2558 |
-
msgid "
|
2559 |
msgstr ""
|
2560 |
|
2561 |
-
#:
|
2562 |
-
msgid "
|
2563 |
-
msgid_plural "Deleted %d posts belonging to the selected user"
|
2564 |
-
msgstr[0] ""
|
2565 |
-
msgstr[1] ""
|
2566 |
-
|
2567 |
-
#: tmp_addon/bulk-delete-posts-by-user.php:316
|
2568 |
-
msgid ""
|
2569 |
-
"Are you sure you want to delete all the posts belonging to the selected user?"
|
2570 |
msgstr ""
|
2571 |
|
2572 |
-
#:
|
2573 |
-
msgid "
|
2574 |
msgstr ""
|
2575 |
|
2576 |
-
#:
|
2577 |
-
msgid "
|
2578 |
msgstr ""
|
2579 |
|
2580 |
-
#:
|
2581 |
-
msgid "
|
2582 |
msgstr ""
|
2583 |
|
2584 |
-
#:
|
2585 |
-
msgid "
|
2586 |
msgstr ""
|
2587 |
|
2588 |
-
#:
|
2589 |
-
msgid "
|
2590 |
msgstr ""
|
2591 |
|
2592 |
-
#:
|
2593 |
-
msgid "
|
2594 |
msgstr ""
|
2595 |
|
2596 |
-
#:
|
2597 |
-
msgid "
|
2598 |
msgstr ""
|
2599 |
|
2600 |
-
#:
|
2601 |
-
msgid "
|
2602 |
msgstr ""
|
2603 |
|
2604 |
-
#:
|
2605 |
-
msgid ""
|
2606 |
-
"The name scheduler emails are said to come from. This should probably be "
|
2607 |
-
"your site name."
|
2608 |
msgstr ""
|
2609 |
|
2610 |
-
#:
|
2611 |
-
msgid "
|
2612 |
msgstr ""
|
2613 |
|
2614 |
-
#:
|
2615 |
-
msgid ""
|
2616 |
-
"Email to send scheduler emails from. This will act as the \"from\" and "
|
2617 |
-
"\"reply-to\" address."
|
2618 |
msgstr ""
|
2619 |
|
2620 |
-
#:
|
2621 |
-
|
|
|
2622 |
msgstr ""
|
2623 |
|
2624 |
-
#:
|
2625 |
-
|
|
|
2626 |
msgstr ""
|
2627 |
|
2628 |
-
#:
|
2629 |
-
|
|
|
2630 |
msgstr ""
|
2631 |
|
2632 |
-
#:
|
2633 |
-
msgid "
|
2634 |
msgstr ""
|
2635 |
|
2636 |
-
#:
|
2637 |
-
msgid "
|
|
|
2638 |
msgstr ""
|
2639 |
|
2640 |
-
#:
|
2641 |
-
|
|
|
2642 |
msgstr ""
|
2643 |
|
2644 |
-
#:
|
2645 |
-
|
|
|
2646 |
msgstr ""
|
2647 |
|
2648 |
-
#:
|
2649 |
-
|
|
|
2650 |
msgstr ""
|
2651 |
|
2652 |
-
#:
|
2653 |
msgid ""
|
2654 |
-
"
|
2655 |
-
"
|
2656 |
msgstr ""
|
2657 |
|
2658 |
-
#:
|
2659 |
-
msgid "
|
|
|
|
|
2660 |
msgstr ""
|
2661 |
|
2662 |
-
#:
|
2663 |
-
msgid "
|
|
|
|
|
|
|
|
|
|
|
|
|
2664 |
msgstr ""
|
2665 |
|
2666 |
-
#:
|
2667 |
-
|
|
|
|
|
2668 |
msgstr ""
|
2669 |
|
2670 |
-
#:
|
2671 |
-
|
|
|
|
|
2672 |
msgstr ""
|
2673 |
|
2674 |
-
#:
|
2675 |
-
msgid "
|
2676 |
msgstr ""
|
2677 |
|
2678 |
-
#:
|
2679 |
-
msgid "
|
2680 |
msgstr ""
|
2681 |
|
2682 |
-
#:
|
2683 |
-
msgid "
|
2684 |
msgstr ""
|
2685 |
|
2686 |
-
#:
|
2687 |
-
msgid ""
|
2688 |
-
"Enter the email that is sent after the scheduler runs. HTML is accepted. "
|
2689 |
-
"Available template tags:"
|
2690 |
msgstr ""
|
2691 |
|
2692 |
-
#:
|
2693 |
-
msgid "
|
2694 |
msgstr ""
|
2695 |
|
2696 |
-
#:
|
2697 |
-
|
|
|
2698 |
msgstr ""
|
2699 |
|
2700 |
-
#:
|
2701 |
-
msgid "
|
2702 |
msgstr ""
|
2703 |
|
2704 |
-
#:
|
2705 |
-
|
|
|
2706 |
msgstr ""
|
2707 |
|
2708 |
-
#:
|
2709 |
-
msgid "
|
2710 |
msgstr ""
|
2711 |
|
2712 |
-
#:
|
2713 |
-
msgid "
|
2714 |
msgstr ""
|
2715 |
|
2716 |
-
#:
|
2717 |
-
msgid "
|
|
|
|
|
2718 |
msgstr ""
|
2719 |
|
2720 |
-
#:
|
2721 |
-
msgid "
|
2722 |
msgstr ""
|
2723 |
|
2724 |
-
#:
|
2725 |
-
msgid "
|
2726 |
msgstr ""
|
2727 |
|
2728 |
-
#:
|
2729 |
-
msgid "
|
2730 |
msgstr ""
|
2731 |
|
2732 |
-
#:
|
2733 |
-
msgid ""
|
2734 |
-
" addon requires Bulk Delete plugin version %s or above! Please %s to "
|
2735 |
-
"continue!"
|
2736 |
msgstr ""
|
2737 |
|
2738 |
-
#:
|
2739 |
-
|
2740 |
-
msgid "Bulk Delete Attachments"
|
2741 |
msgstr ""
|
2742 |
|
2743 |
-
#:
|
2744 |
-
msgid ""
|
2745 |
-
"WARNING: Attachments deleted once cannot be retrieved back. Use with caution."
|
2746 |
msgstr ""
|
2747 |
|
2748 |
-
#:
|
2749 |
-
msgid "
|
2750 |
msgstr ""
|
2751 |
|
2752 |
-
#:
|
2753 |
-
msgid "
|
2754 |
msgstr ""
|
2755 |
|
2756 |
-
#:
|
2757 |
-
msgid "
|
|
|
|
|
2758 |
msgstr ""
|
2759 |
|
2760 |
-
#:
|
2761 |
-
msgid "
|
2762 |
msgstr ""
|
2763 |
|
2764 |
-
#:
|
2765 |
-
msgid "
|
2766 |
msgstr ""
|
2767 |
|
2768 |
-
#:
|
2769 |
-
msgid "
|
2770 |
msgstr ""
|
2771 |
|
2772 |
-
#:
|
2773 |
-
msgid "
|
|
|
2774 |
msgstr ""
|
2775 |
|
2776 |
-
#:
|
2777 |
msgid ""
|
2778 |
-
"
|
2779 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2780 |
msgstr ""
|
2781 |
|
2782 |
#: vendor/10up/wp_mock/tests/FunctionMocksTest.php:65
|
@@ -2788,6 +1778,12 @@ msgstr ""
|
|
2788 |
msgid "Input"
|
2789 |
msgstr ""
|
2790 |
|
|
|
|
|
|
|
|
|
|
|
|
|
2791 |
#. Plugin Name of the plugin/theme
|
2792 |
msgid "Bulk Delete"
|
2793 |
msgstr ""
|
1 |
+
# Copyright (C) 2019 Bulk Delete
|
2 |
# This file is distributed under the same license as the Bulk Delete package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Bulk Delete 6.0.0\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/bulk-delete\n"
|
7 |
+
"POT-Creation-Date: 2019-02-22 06:18:05+00:00\n"
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
11 |
+
"PO-Revision-Date: 2019-MO-DA HO:MI+ZONE\n"
|
12 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
13 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
14 |
|
15 |
+
#: bulk-delete.php:53
|
16 |
+
msgid ""
|
17 |
+
"Bulk Delete requires at least PHP 5.3 to function properly. Please upgrade "
|
18 |
+
"PHP or use <a href=\"%s\">v5.6.1 of Bulk Delete</a>."
|
19 |
msgstr ""
|
20 |
|
21 |
+
#: include/Core/Addon/UpsellModule.php:55
|
22 |
+
msgid "Buy Now"
|
23 |
msgstr ""
|
24 |
|
25 |
+
#. translators: 1 Module url
|
26 |
+
#: include/Core/Base/BaseModule.php:172
|
27 |
+
#: include/base/class-bd-meta-box-module.php:167
|
28 |
+
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:47
|
29 |
+
msgid ""
|
30 |
+
"This section just got enabled. Kindly <a href = \"%1$s\">refresh</a> the "
|
31 |
+
"page to fully enable it."
|
32 |
msgstr ""
|
33 |
|
34 |
+
#: include/Core/Base/BaseModule.php:225
|
35 |
+
msgid ""
|
36 |
+
"Are you sure you want to delete all the posts based on the selected option?"
|
37 |
msgstr ""
|
38 |
|
39 |
+
#: include/Core/Base/BaseModule.php:226
|
40 |
+
msgid "Please select posts from at least one option"
|
|
|
41 |
msgstr ""
|
42 |
|
43 |
+
#. translators: 1 Cron page url
|
44 |
+
#: include/Core/Base/BaseModule.php:393
|
45 |
+
#: include/base/class-bd-meta-box-module.php:293
|
46 |
+
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:240
|
47 |
+
msgid "See the full list of <a href = \"%s\">scheduled tasks</a>"
|
48 |
msgstr ""
|
49 |
|
50 |
+
#: include/Core/Base/Mixin/Fetcher.php:62
|
51 |
+
#: include/Core/Base/Mixin/Renderer.php:41
|
52 |
+
#: include/Core/Base/Mixin/Renderer.php:216
|
53 |
+
#: include/Core/Base/Mixin/Renderer.php:351
|
54 |
+
#: include/Core/Base/Mixin/Renderer.php:387
|
55 |
+
#: include/Core/Posts/Modules/DeletePostsByTaxonomyModule.php:96
|
56 |
+
#: include/ui/form.php:262
|
57 |
+
msgid "Posts"
|
58 |
msgstr ""
|
59 |
|
60 |
+
#: include/Core/Base/Mixin/Renderer.php:127
|
61 |
+
msgid "Also delete all posts of the users"
|
62 |
msgstr ""
|
63 |
|
64 |
+
#: include/Core/Base/Mixin/Renderer.php:129
|
65 |
+
msgid "Re-assign the posts to"
|
66 |
msgstr ""
|
67 |
|
68 |
+
#: include/Core/Base/Mixin/Renderer.php:135
|
69 |
+
msgid "Select User"
|
70 |
msgstr ""
|
71 |
|
72 |
+
#: include/Core/Base/Mixin/Renderer.php:155
|
73 |
+
msgid "Select User Role"
|
74 |
msgstr ""
|
75 |
|
76 |
+
#: include/Core/Base/Mixin/Renderer.php:159
|
77 |
+
#: include/Core/Base/Mixin/Renderer.php:166
|
78 |
+
msgid "Users"
|
79 |
msgstr ""
|
80 |
|
81 |
+
#: include/Core/Base/Mixin/Renderer.php:166
|
82 |
+
msgid "No role"
|
83 |
msgstr ""
|
84 |
|
85 |
+
#: include/Core/Base/Mixin/Renderer.php:189
|
86 |
+
msgid "Select Taxonomy"
|
87 |
msgstr ""
|
88 |
|
89 |
+
#: include/Core/Base/Mixin/Renderer.php:206
|
90 |
+
msgid "Select Categories"
|
91 |
msgstr ""
|
92 |
|
93 |
+
#: include/Core/Base/Mixin/Renderer.php:211
|
94 |
+
msgid "All Categories"
|
|
|
|
|
95 |
msgstr ""
|
96 |
|
97 |
+
#: include/Core/Base/Mixin/Renderer.php:230
|
98 |
+
#: include/Core/Base/Mixin/Renderer.php:246
|
99 |
+
#: include/Core/Metas/Modules/DeleteCommentMetaModule.php:198
|
100 |
+
msgid "equal to"
|
101 |
msgstr ""
|
102 |
|
103 |
+
#: include/Core/Base/Mixin/Renderer.php:231
|
104 |
+
#: include/Core/Base/Mixin/Renderer.php:247
|
105 |
+
#: include/Core/Metas/Modules/DeleteCommentMetaModule.php:199
|
106 |
+
msgid "not equal to"
|
107 |
msgstr ""
|
108 |
|
109 |
+
#: include/Core/Base/Mixin/Renderer.php:232
|
110 |
+
msgid "starts with"
|
111 |
msgstr ""
|
112 |
|
113 |
+
#: include/Core/Base/Mixin/Renderer.php:233
|
114 |
+
msgid "ends with"
|
115 |
msgstr ""
|
116 |
|
117 |
+
#: include/Core/Base/Mixin/Renderer.php:234
|
118 |
+
msgid "contains"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
msgstr ""
|
120 |
|
121 |
+
#: include/Core/Base/Mixin/Renderer.php:235
|
122 |
+
msgid "not contains"
|
123 |
msgstr ""
|
124 |
|
125 |
+
#: include/Core/Base/Mixin/Renderer.php:248
|
126 |
+
#: include/Core/Metas/Modules/DeleteCommentMetaModule.php:200
|
127 |
+
msgid "less than"
|
128 |
msgstr ""
|
129 |
|
130 |
+
#: include/Core/Base/Mixin/Renderer.php:249
|
131 |
+
#: include/Core/Metas/Modules/DeleteCommentMetaModule.php:202
|
132 |
+
msgid "greater than"
|
133 |
msgstr ""
|
134 |
|
135 |
+
#: include/Core/Base/Mixin/Renderer.php:260
|
136 |
+
msgid "Number"
|
137 |
msgstr ""
|
138 |
|
139 |
+
#: include/Core/Base/Mixin/Renderer.php:261
|
140 |
+
msgid "Character"
|
141 |
msgstr ""
|
142 |
|
143 |
+
#: include/Core/Base/Mixin/Renderer.php:262
|
144 |
+
msgid "Date"
|
|
|
|
|
145 |
msgstr ""
|
146 |
|
147 |
+
#: include/Core/Base/Mixin/Renderer.php:341
|
148 |
+
msgid "Select Tags"
|
149 |
msgstr ""
|
150 |
|
151 |
+
#: include/Core/Base/Mixin/Renderer.php:346
|
152 |
+
msgid "All Tags"
|
153 |
msgstr ""
|
154 |
|
155 |
+
#: include/Core/Base/Mixin/Renderer.php:387
|
156 |
+
msgid "All sticky posts"
|
157 |
msgstr ""
|
158 |
|
159 |
+
#: include/Core/Base/Mixin/Renderer.php:401
|
160 |
+
msgid "Published on"
|
161 |
msgstr ""
|
162 |
|
163 |
+
#: include/Core/Base/Mixin/Renderer.php:402
|
164 |
+
msgid " by "
|
165 |
msgstr ""
|
166 |
|
167 |
+
#: include/Core/Base/Mixin/Renderer.php:422
|
168 |
+
msgid "Exclude sticky posts"
|
169 |
msgstr ""
|
170 |
|
171 |
+
#: include/Core/Base/Mixin/Renderer.php:489
|
172 |
+
msgid "Remove Sticky"
|
173 |
msgstr ""
|
174 |
|
175 |
+
#: include/Core/Base/Mixin/Renderer.php:493
|
176 |
+
msgid "Delete Post"
|
177 |
msgstr ""
|
178 |
|
179 |
+
#: include/Core/Base/Mixin/Renderer.php:556
|
180 |
+
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:151
|
181 |
+
#: include/ui/form.php:126
|
182 |
+
msgid "Delete now"
|
183 |
msgstr ""
|
184 |
|
185 |
+
#: include/Core/Base/Mixin/Renderer.php:558
|
186 |
+
#: include/Core/Cron/CronListTable.php:59
|
187 |
+
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:155
|
188 |
+
#: include/ui/form.php:127
|
189 |
+
msgid "Schedule"
|
190 |
msgstr ""
|
191 |
|
192 |
+
#: include/Core/Base/Mixin/Renderer.php:561
|
193 |
+
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:157
|
194 |
+
#: include/ui/form.php:128
|
195 |
+
msgid "repeat "
|
196 |
msgstr ""
|
197 |
|
198 |
+
#: include/Core/Base/Mixin/Renderer.php:566
|
199 |
+
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:159
|
200 |
+
#: include/ui/form.php:130
|
201 |
+
msgid "Don't repeat"
|
202 |
msgstr ""
|
203 |
|
204 |
+
#: include/Core/Base/Mixin/Renderer.php:602
|
205 |
+
#: include/Core/Metas/Modules/DeletePostMetaModule.php:56
|
206 |
+
#: include/Core/Metas/Modules/DeletePostMetaModule.php:66
|
207 |
+
#: include/Core/Metas/Modules/DeleteUserMetaModule.php:55
|
208 |
+
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:83
|
209 |
+
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:169
|
210 |
+
#: include/ui/form.php:138
|
211 |
+
msgid "Only available in Pro Addon"
|
212 |
msgstr ""
|
213 |
|
214 |
+
#: include/Core/Base/Mixin/Renderer.php:617
|
215 |
msgid ""
|
216 |
+
"Enter time in <strong>Y-m-d H:i:s</strong> format or enter <strong>now</"
|
217 |
+
"strong> to use current time."
|
|
|
|
|
|
|
218 |
msgstr ""
|
219 |
|
220 |
+
#: include/Core/Base/Mixin/Renderer.php:619
|
221 |
+
msgid "Want to add new a Cron schedule?"
|
|
|
|
|
222 |
msgstr ""
|
223 |
|
224 |
+
#: include/Core/Base/Mixin/Renderer.php:620
|
225 |
+
msgid "Find out how"
|
226 |
msgstr ""
|
227 |
|
228 |
+
#: include/Core/Base/Mixin/Renderer.php:622
|
229 |
+
msgid "Learn how to add your desired Cron schedule."
|
230 |
msgstr ""
|
231 |
|
232 |
+
#: include/Core/BulkDelete.php:194
|
233 |
+
msgid ""
|
234 |
+
"This class can't be cloned. Use `get_instance()` method to get an instance."
|
235 |
msgstr ""
|
236 |
|
237 |
+
#: include/Core/BulkDelete.php:206
|
238 |
+
msgid ""
|
239 |
+
"This class can't be serialized. Use `get_instance()` method to get an "
|
240 |
+
"instance."
|
241 |
msgstr ""
|
242 |
|
243 |
+
#: include/Core/BulkDelete.php:293 include/Core/BulkDelete.php:294
|
244 |
+
#: include/license/class-bd-license.php:33
|
245 |
+
msgid "Addon Licenses"
|
246 |
msgstr ""
|
247 |
|
248 |
+
#: include/Core/Controller.php:155
|
249 |
+
msgid " Posts"
|
250 |
msgstr ""
|
251 |
|
252 |
+
#: include/Core/Cron/CronListPage.php:27
|
253 |
+
msgid "Bulk Delete Schedules"
|
254 |
msgstr ""
|
255 |
|
256 |
+
#: include/Core/Cron/CronListPage.php:28
|
257 |
+
msgid "Scheduled Jobs"
|
|
|
|
|
258 |
msgstr ""
|
259 |
|
260 |
+
#: include/Core/Cron/CronListPage.php:60
|
261 |
+
msgid "The selected scheduled job was successfully run"
|
262 |
msgstr ""
|
263 |
|
264 |
+
#: include/Core/Cron/CronListPage.php:90
|
265 |
+
msgid "The selected scheduled job was successfully deleted "
|
|
|
|
|
266 |
msgstr ""
|
267 |
|
268 |
+
#: include/Core/Cron/CronListPage.php:110
|
269 |
+
#: include/Core/SystemInfo/BulkDeleteSystemInfo.php:72
|
270 |
+
msgctxt "Cron table date format"
|
271 |
+
msgid "M j, Y @ G:i"
|
272 |
msgstr ""
|
273 |
|
274 |
+
#: include/Core/Cron/CronListTable.php:42
|
275 |
msgid ""
|
276 |
+
"This is the list of jobs that are currently scheduled for auto deleting "
|
277 |
+
"posts in Bulk Delete Plugin."
|
278 |
msgstr ""
|
279 |
|
280 |
+
#: include/Core/Cron/CronListTable.php:44
|
281 |
+
msgid "Note: "
|
282 |
msgstr ""
|
283 |
|
284 |
+
#: include/Core/Cron/CronListTable.php:46
|
285 |
msgid ""
|
286 |
+
"Scheduling auto post or user deletion is available only when you buy pro "
|
287 |
+
"addons."
|
288 |
msgstr ""
|
289 |
|
290 |
+
#: include/Core/Cron/CronListTable.php:58
|
291 |
+
msgid "Next Due"
|
292 |
msgstr ""
|
293 |
|
294 |
+
#: include/Core/Cron/CronListTable.php:60
|
295 |
+
msgid "Type"
|
|
|
|
|
296 |
msgstr ""
|
297 |
|
298 |
+
#: include/Core/Cron/CronListTable.php:61
|
299 |
+
msgid "Options"
|
|
|
|
|
|
|
300 |
msgstr ""
|
301 |
|
302 |
+
#: include/Core/Cron/CronListTable.php:110
|
303 |
+
#: include/license/class-license-list-table.php:98
|
304 |
+
msgid "Delete"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
305 |
msgstr ""
|
306 |
|
307 |
+
#: include/Core/Cron/CronListTable.php:118
|
308 |
+
msgid "'Are you sure you want to run the schedule job manually'"
|
309 |
msgstr ""
|
310 |
|
311 |
+
#: include/Core/Cron/CronListTable.php:119
|
312 |
+
msgid "Run Now"
|
313 |
msgstr ""
|
314 |
|
315 |
+
#: include/Core/Cron/CronListTable.php:170
|
316 |
+
msgid "You have not scheduled any bulk delete jobs."
|
317 |
msgstr ""
|
318 |
|
319 |
+
#: include/Core/Metas/DeleteMetasPage.php:26
|
320 |
+
#: include/Core/Metas/DeleteMetasPage.php:27
|
321 |
+
msgid "Bulk Delete Meta Fields"
|
322 |
msgstr ""
|
323 |
|
324 |
+
#: include/Core/Metas/DeleteMetasPage.php:31
|
325 |
+
msgid ""
|
326 |
+
"WARNING: Meta Fields deleted once cannot be retrieved back. Use with caution."
|
|
|
|
|
327 |
msgstr ""
|
328 |
|
329 |
+
#: include/Core/Metas/DeleteMetasPage.php:44
|
330 |
+
#: include/Core/Pages/DeletePagesPage.php:44
|
331 |
+
#: include/Core/Posts/DeletePostsPage.php:81
|
332 |
+
#: include/Core/Terms/DeleteTermsPage.php:43
|
333 |
+
#: include/Core/Users/DeleteUsersPage.php:51
|
334 |
+
#: include/ui/class-bulk-delete-help-screen.php:59
|
335 |
+
#: include/ui/class-bulk-delete-help-screen.php:71
|
336 |
+
msgid "Overview"
|
337 |
msgstr ""
|
338 |
|
339 |
+
#: include/Core/Metas/DeleteMetasPage.php:46
|
340 |
msgid ""
|
341 |
+
"This screen contains different modules that allows you to delete meta fields "
|
342 |
+
"or schedule them for deletion."
|
343 |
msgstr ""
|
344 |
|
345 |
+
#: include/Core/Metas/Modules/DeleteCommentMetaModule.php:21
|
346 |
+
msgid "Bulk Delete Comment Meta"
|
347 |
msgstr ""
|
348 |
|
349 |
+
#: include/Core/Metas/Modules/DeleteCommentMetaModule.php:22
|
350 |
msgid ""
|
351 |
+
"Comment meta fields from the comments with the selected criteria are "
|
352 |
+
"scheduled for deletion."
|
353 |
msgstr ""
|
354 |
|
355 |
+
#: include/Core/Metas/Modules/DeleteCommentMetaModule.php:23
|
356 |
+
msgid "Delete Comment Meta"
|
|
|
|
|
357 |
msgstr ""
|
358 |
|
359 |
+
#: include/Core/Metas/Modules/DeleteCommentMetaModule.php:43
|
360 |
+
msgid "Select the post type whose comment meta fields you want to delete"
|
361 |
msgstr ""
|
362 |
|
363 |
+
#: include/Core/Metas/Modules/DeleteCommentMetaModule.php:48
|
364 |
+
msgid "Choose your comment meta field settings"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
365 |
msgstr ""
|
366 |
|
367 |
+
#: include/Core/Metas/Modules/DeleteCommentMetaModule.php:53
|
368 |
+
msgid "Delete based on comment meta key name only"
|
|
|
369 |
msgstr ""
|
370 |
|
371 |
+
#: include/Core/Metas/Modules/DeleteCommentMetaModule.php:61
|
372 |
+
msgid "Delete based on comment meta key name and value"
|
|
|
373 |
msgstr ""
|
374 |
|
375 |
+
#: include/Core/Metas/Modules/DeleteCommentMetaModule.php:67
|
376 |
+
msgid "Comment Meta Key "
|
|
|
377 |
msgstr ""
|
378 |
|
379 |
+
#: include/Core/Metas/Modules/DeleteCommentMetaModule.php:68
|
380 |
+
#: include/Core/Metas/Modules/DeletePostMetaModule.php:79
|
381 |
+
#: include/Core/Metas/Modules/DeleteUserMetaModule.php:64
|
382 |
+
msgid "Meta Key"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
383 |
msgstr ""
|
384 |
|
385 |
+
#: include/Core/Metas/Modules/DeleteCommentMetaModule.php:85
|
386 |
+
#: include/Core/Metas/Modules/DeletePostMetaModule.php:97
|
387 |
+
#: include/Core/Metas/Modules/DeleteUserMetaModule.php:80
|
388 |
+
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:130
|
389 |
+
msgid "Choose your deletion options"
|
390 |
msgstr ""
|
391 |
|
392 |
+
#: include/Core/Metas/Modules/DeleteCommentMetaModule.php:163
|
|
|
393 |
msgid ""
|
394 |
+
"Are you sure you want to delete all the comment meta fields that match the "
|
395 |
+
"selected filters?"
|
|
|
|
|
|
|
|
|
|
|
396 |
msgstr ""
|
397 |
|
398 |
+
#. translators: 1 Number of comment deleted
|
399 |
+
#: include/Core/Metas/Modules/DeleteCommentMetaModule.php:170
|
400 |
+
msgid "Deleted comment meta field from %d comment"
|
401 |
+
msgid_plural "Deleted comment meta field from %d comments"
|
402 |
+
msgstr[0] ""
|
403 |
+
msgstr[1] ""
|
404 |
|
405 |
+
#: include/Core/Metas/Modules/DeleteCommentMetaModule.php:185
|
406 |
+
msgid "Comment Meta Value "
|
|
|
|
|
|
|
407 |
msgstr ""
|
408 |
|
409 |
+
#: include/Core/Metas/Modules/DeleteCommentMetaModule.php:187
|
410 |
+
msgid "CHAR"
|
|
|
411 |
msgstr ""
|
412 |
|
413 |
+
#: include/Core/Metas/Modules/DeleteCommentMetaModule.php:188
|
414 |
+
msgid "NUMERIC"
|
|
|
|
|
|
|
415 |
msgstr ""
|
416 |
|
417 |
+
#: include/Core/Metas/Modules/DeleteCommentMetaModule.php:189
|
418 |
+
msgid "DECIMAL"
|
|
|
419 |
msgstr ""
|
420 |
|
421 |
+
#: include/Core/Metas/Modules/DeleteCommentMetaModule.php:190
|
422 |
+
msgid "SIGNED"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
423 |
msgstr ""
|
424 |
|
425 |
+
#: include/Core/Metas/Modules/DeleteCommentMetaModule.php:191
|
426 |
+
msgid "UNSIGNED"
|
|
|
427 |
msgstr ""
|
428 |
|
429 |
+
#: include/Core/Metas/Modules/DeleteCommentMetaModule.php:192
|
430 |
+
msgid "DATE"
|
|
|
431 |
msgstr ""
|
432 |
|
433 |
+
#: include/Core/Metas/Modules/DeleteCommentMetaModule.php:193
|
434 |
+
msgid "TIME"
|
|
|
|
|
|
|
435 |
msgstr ""
|
436 |
|
437 |
+
#: include/Core/Metas/Modules/DeleteCommentMetaModule.php:194
|
438 |
+
msgid "DATETIME"
|
|
|
439 |
msgstr ""
|
440 |
|
441 |
+
#: include/Core/Metas/Modules/DeleteCommentMetaModule.php:195
|
442 |
+
msgid "BINARY"
|
|
|
|
|
443 |
msgstr ""
|
444 |
|
445 |
+
#: include/Core/Metas/Modules/DeleteCommentMetaModule.php:201
|
446 |
+
msgid "less than or equal to"
|
|
|
|
|
|
|
447 |
msgstr ""
|
448 |
|
449 |
+
#: include/Core/Metas/Modules/DeleteCommentMetaModule.php:203
|
450 |
+
msgid "greater than or equal to"
|
|
|
451 |
msgstr ""
|
452 |
|
453 |
+
#: include/Core/Metas/Modules/DeleteCommentMetaModule.php:204
|
454 |
+
msgid "like"
|
|
|
455 |
msgstr ""
|
456 |
|
457 |
+
#: include/Core/Metas/Modules/DeleteCommentMetaModule.php:205
|
458 |
+
msgid "not like"
|
|
|
|
|
|
|
|
|
459 |
msgstr ""
|
460 |
|
461 |
+
#: include/Core/Metas/Modules/DeleteCommentMetaModule.php:207
|
462 |
+
#: include/Core/Users/Modules/DeleteUsersByUserMetaModule.php:68
|
463 |
+
msgid "Meta Value"
|
|
|
|
|
|
|
464 |
msgstr ""
|
465 |
|
466 |
+
#: include/Core/Metas/Modules/DeletePostMetaModule.php:21
|
467 |
+
msgid "Bulk Delete Post Meta"
|
|
|
|
|
|
|
|
|
468 |
msgstr ""
|
469 |
|
470 |
+
#: include/Core/Metas/Modules/DeletePostMetaModule.php:22
|
|
|
471 |
msgid ""
|
472 |
+
"Post meta fields from the posts with the selected criteria are scheduled for "
|
473 |
+
"deletion."
|
|
|
474 |
msgstr ""
|
475 |
|
476 |
+
#: include/Core/Metas/Modules/DeletePostMetaModule.php:23
|
477 |
+
msgid "Delete Post Meta"
|
|
|
478 |
msgstr ""
|
479 |
|
480 |
+
#: include/Core/Metas/Modules/DeletePostMetaModule.php:36
|
481 |
+
msgid "Select the post type whose post meta fields you want to delete"
|
|
|
482 |
msgstr ""
|
483 |
|
484 |
+
#: include/Core/Metas/Modules/DeletePostMetaModule.php:42
|
485 |
+
msgid "Choose your post meta field settings"
|
|
|
486 |
msgstr ""
|
487 |
|
488 |
+
#: include/Core/Metas/Modules/DeletePostMetaModule.php:47
|
489 |
+
msgid "Delete based on post meta key name only"
|
|
|
490 |
msgstr ""
|
491 |
|
492 |
+
#: include/Core/Metas/Modules/DeletePostMetaModule.php:54
|
493 |
+
msgid "Delete based on post meta key name prefix or postfix"
|
|
|
|
|
|
|
494 |
msgstr ""
|
495 |
|
496 |
+
#: include/Core/Metas/Modules/DeletePostMetaModule.php:64
|
497 |
+
msgid "Delete based on post meta key name and value"
|
|
|
498 |
msgstr ""
|
499 |
|
500 |
+
#: include/Core/Metas/Modules/DeletePostMetaModule.php:73
|
501 |
+
msgid "Post Meta Key "
|
|
|
|
|
|
|
502 |
msgstr ""
|
503 |
|
504 |
+
#: include/Core/Metas/Modules/DeletePostMetaModule.php:187
|
|
|
505 |
msgid ""
|
506 |
+
"Are you sure you want to delete all the post meta fields that match the "
|
507 |
+
"selected filters?"
|
508 |
msgstr ""
|
509 |
|
510 |
+
#. translators: 1 Number of posts deleted
|
511 |
+
#: include/Core/Metas/Modules/DeletePostMetaModule.php:194
|
512 |
+
msgid "Deleted post meta field from %d post"
|
513 |
+
msgid_plural "Deleted post meta field from %d posts"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
514 |
msgstr[0] ""
|
515 |
msgstr[1] ""
|
516 |
|
517 |
+
#: include/Core/Metas/Modules/DeleteUserMetaModule.php:21
|
518 |
+
msgid "Bulk Delete User Meta"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
519 |
msgstr ""
|
520 |
|
521 |
+
#: include/Core/Metas/Modules/DeleteUserMetaModule.php:22
|
|
|
522 |
msgid ""
|
523 |
+
"User meta fields from the users with the selected criteria are scheduled for "
|
524 |
"deletion."
|
525 |
msgstr ""
|
526 |
|
527 |
+
#: include/Core/Metas/Modules/DeleteUserMetaModule.php:23
|
528 |
+
msgid "Delete User Meta`"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
529 |
msgstr ""
|
530 |
|
531 |
+
#: include/Core/Metas/Modules/DeleteUserMetaModule.php:34
|
|
|
532 |
msgid "Select the user role whose user meta fields you want to delete"
|
533 |
msgstr ""
|
534 |
|
535 |
+
#: include/Core/Metas/Modules/DeleteUserMetaModule.php:40
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
536 |
msgid "Choose your user meta field settings"
|
537 |
msgstr ""
|
538 |
|
539 |
+
#: include/Core/Metas/Modules/DeleteUserMetaModule.php:45
|
|
|
540 |
msgid "Delete based on user meta key name only"
|
541 |
msgstr ""
|
542 |
|
543 |
+
#: include/Core/Metas/Modules/DeleteUserMetaModule.php:53
|
|
|
544 |
msgid "Delete based on user meta key name and value"
|
545 |
msgstr ""
|
546 |
|
547 |
+
#: include/Core/Metas/Modules/DeleteUserMetaModule.php:63
|
|
|
548 |
msgid "User Meta Key "
|
549 |
msgstr ""
|
550 |
|
551 |
+
#: include/Core/Metas/Modules/DeleteUserMetaModule.php:152
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
552 |
msgid ""
|
553 |
"Are you sure you want to delete all the user meta fields that match the "
|
554 |
"selected filters?"
|
555 |
msgstr ""
|
556 |
|
557 |
+
#. translators: 1 Number of posts deleted
|
558 |
+
#: include/Core/Metas/Modules/DeleteUserMetaModule.php:159
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
559 |
msgid "Deleted user meta field from %d user"
|
560 |
msgid_plural "Deleted user meta field from %d users"
|
561 |
msgstr[0] ""
|
562 |
msgstr[1] ""
|
563 |
|
564 |
+
#: include/Core/Pages/DeletePagesPage.php:26
|
565 |
+
#: include/Core/Pages/DeletePagesPage.php:27
|
566 |
+
msgid "Bulk Delete Pages"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
567 |
msgstr ""
|
568 |
|
569 |
+
#: include/Core/Pages/DeletePagesPage.php:31
|
570 |
+
msgid "WARNING: Pages deleted once cannot be retrieved back. Use with caution."
|
|
|
571 |
msgstr ""
|
572 |
|
573 |
+
#: include/Core/Pages/DeletePagesPage.php:46
|
574 |
+
#: include/ui/class-bulk-delete-help-screen.php:73
|
575 |
msgid ""
|
576 |
+
"This screen contains different modules that allows you to delete pages or "
|
577 |
+
"schedule them for deletion."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
578 |
msgstr ""
|
579 |
|
580 |
+
#: include/Core/Pages/Modules/DeletePagesByStatusModule.php:23
|
581 |
+
msgid "By Page Status"
|
|
|
582 |
msgstr ""
|
583 |
|
584 |
+
#: include/Core/Pages/Modules/DeletePagesByStatusModule.php:24
|
585 |
+
msgid "The selected pages are scheduled for deletion"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
586 |
msgstr ""
|
587 |
|
588 |
+
#: include/Core/Pages/Modules/DeletePagesByStatusModule.php:25
|
589 |
+
msgid "Delete Pages By status"
|
|
|
590 |
msgstr ""
|
591 |
|
592 |
+
#: include/Core/Pages/Modules/DeletePagesByStatusModule.php:32
|
593 |
+
msgid "Select the post statuses from which you want to delete pages"
|
|
|
594 |
msgstr ""
|
595 |
|
596 |
+
#: include/Core/Pages/Modules/DeletePagesByStatusModule.php:59
|
597 |
+
msgid ""
|
598 |
+
"Please select at least one post status from which pages should be deleted"
|
599 |
msgstr ""
|
600 |
|
601 |
+
#: include/Core/Pages/Modules/DeletePagesByStatusModule.php:60
|
602 |
+
msgid ""
|
603 |
+
"Are you sure you want to delete all the pages from the selected post status?"
|
604 |
msgstr ""
|
605 |
|
606 |
+
#. translators: 1 Number of pages deleted
|
607 |
+
#: include/Core/Pages/Modules/DeletePagesByStatusModule.php:86
|
608 |
+
msgid "Deleted %d page from the selected post status"
|
609 |
+
msgid_plural "Deleted %d pages from the selected post status"
|
610 |
msgstr[0] ""
|
611 |
msgstr[1] ""
|
612 |
|
613 |
+
#: include/Core/Posts/DeletePostsPage.php:31
|
614 |
+
#: include/Core/Posts/DeletePostsPage.php:32
|
615 |
+
msgid "Bulk Delete Posts"
|
|
|
616 |
msgstr ""
|
617 |
|
618 |
+
#: include/Core/Posts/DeletePostsPage.php:36
|
619 |
+
#: include/misc/class-bulk-delete-misc.php:130
|
620 |
+
msgid "WARNING: Posts deleted once cannot be retrieved back. Use with caution."
|
621 |
msgstr ""
|
622 |
|
623 |
+
#: include/Core/Posts/DeletePostsPage.php:44
|
624 |
+
#: include/Core/Posts/DeletePostsPage.php:45
|
625 |
+
msgid "Bulk WP"
|
|
|
|
|
626 |
msgstr ""
|
627 |
|
628 |
+
#: include/Core/Posts/DeletePostsPage.php:83
|
629 |
+
#: include/ui/class-bulk-delete-help-screen.php:61
|
630 |
msgid ""
|
631 |
+
"This screen contains different modules that allows you to delete posts or "
|
632 |
+
"schedule them for deletion."
|
633 |
msgstr ""
|
634 |
|
635 |
+
#: include/Core/Posts/Modules/DeletePostsByCategoryModule.php:23
|
636 |
+
msgid "By Post Category"
|
|
|
|
|
|
|
637 |
msgstr ""
|
638 |
|
639 |
+
#: include/Core/Posts/Modules/DeletePostsByCategoryModule.php:24
|
640 |
+
#: include/Core/Posts/Modules/DeletePostsByCommentsModule.php:27
|
641 |
+
#: include/Core/Posts/Modules/DeletePostsByPostTypeModule.php:24
|
642 |
+
#: include/Core/Posts/Modules/DeletePostsByStatusModule.php:24
|
643 |
+
#: include/Core/Posts/Modules/DeletePostsByTagModule.php:27
|
644 |
+
#: include/Core/Posts/Modules/DeletePostsByTaxonomyModule.php:24
|
645 |
+
msgid "The selected posts are scheduled for deletion"
|
646 |
msgstr ""
|
647 |
|
648 |
+
#: include/Core/Posts/Modules/DeletePostsByCategoryModule.php:25
|
649 |
+
msgid "Delete Post By Category"
|
650 |
+
msgstr ""
|
651 |
+
|
652 |
+
#: include/Core/Posts/Modules/DeletePostsByCategoryModule.php:35
|
653 |
+
msgid "Select the post type from which you want to delete posts by category"
|
654 |
+
msgstr ""
|
655 |
|
656 |
+
#: include/Core/Posts/Modules/DeletePostsByCategoryModule.php:41
|
657 |
+
msgid "Select the categories from which you want to delete posts"
|
|
|
658 |
msgstr ""
|
659 |
|
660 |
+
#: include/Core/Posts/Modules/DeletePostsByCategoryModule.php:43
|
|
|
661 |
msgid ""
|
662 |
+
"Note: The post count below for each category is the total number of posts in "
|
663 |
+
"that category, irrespective of post type."
|
664 |
msgstr ""
|
665 |
|
666 |
+
#: include/Core/Posts/Modules/DeletePostsByCategoryModule.php:74
|
667 |
+
msgid "Please select at least one category"
|
|
|
668 |
msgstr ""
|
669 |
|
670 |
+
#. translators: 1 Number of posts deleted
|
671 |
+
#: include/Core/Posts/Modules/DeletePostsByCategoryModule.php:123
|
672 |
+
msgid "Deleted %d post with the selected post category"
|
673 |
+
msgid_plural "Deleted %d posts with the selected post category"
|
674 |
msgstr[0] ""
|
675 |
msgstr[1] ""
|
676 |
|
677 |
+
#: include/Core/Posts/Modules/DeletePostsByCommentsModule.php:26
|
678 |
+
msgid "By Comment count"
|
|
|
679 |
msgstr ""
|
680 |
|
681 |
+
#: include/Core/Posts/Modules/DeletePostsByCommentsModule.php:28
|
682 |
+
msgid "Delete Post By Comments"
|
|
|
683 |
msgstr ""
|
684 |
|
685 |
+
#: include/Core/Posts/Modules/DeletePostsByCommentsModule.php:37
|
686 |
+
msgid "Delete Posts based on the number of comments"
|
687 |
+
msgstr ""
|
|
|
|
|
|
|
688 |
|
689 |
+
#: include/Core/Posts/Modules/DeletePostsByCommentsModule.php:44
|
690 |
+
msgid "Delete posts that have comments"
|
|
|
691 |
msgstr ""
|
692 |
|
693 |
+
#: include/Core/Posts/Modules/DeletePostsByCommentsModule.php:107
|
694 |
+
msgid ""
|
695 |
+
"Please enter the comments count based on which posts should be deleted. A "
|
696 |
+
"valid comment count will be greater than or equal to zero"
|
697 |
msgstr ""
|
698 |
|
699 |
+
#: include/Core/Posts/Modules/DeletePostsByCommentsModule.php:110
|
700 |
+
msgid ""
|
701 |
+
"Are you sure you want to delete all the posts based on the selected comment "
|
702 |
+
"count?"
|
703 |
msgstr ""
|
704 |
|
705 |
+
#. translators: 1 Number of posts deleted
|
706 |
+
#: include/Core/Posts/Modules/DeletePostsByCommentsModule.php:124
|
707 |
+
msgid "Deleted %d post with the selected comments count"
|
708 |
+
msgid_plural "Deleted %d posts with the selected comments count"
|
709 |
msgstr[0] ""
|
710 |
msgstr[1] ""
|
711 |
|
712 |
+
#: include/Core/Posts/Modules/DeletePostsByPostTypeModule.php:23
|
713 |
+
msgid "By Post Type"
|
|
|
|
|
714 |
msgstr ""
|
715 |
|
716 |
+
#: include/Core/Posts/Modules/DeletePostsByPostTypeModule.php:25
|
717 |
+
msgid "Delete Post By Post Type"
|
|
|
718 |
msgstr ""
|
719 |
|
720 |
+
#: include/Core/Posts/Modules/DeletePostsByPostTypeModule.php:26
|
721 |
+
msgid "Are you sure you want to delete the posts from the selected post type?"
|
|
|
722 |
msgstr ""
|
723 |
|
724 |
+
#: include/Core/Posts/Modules/DeletePostsByPostTypeModule.php:27
|
725 |
+
msgid "Please select at least one post type"
|
|
|
726 |
msgstr ""
|
727 |
|
728 |
+
#. translators: 1 Number of posts deleted
|
729 |
+
#: include/Core/Posts/Modules/DeletePostsByPostTypeModule.php:29
|
730 |
+
msgid "Deleted %d post from the selected post type"
|
731 |
msgstr ""
|
732 |
|
733 |
+
#. translators: 1 Number of posts deleted
|
734 |
+
#: include/Core/Posts/Modules/DeletePostsByPostTypeModule.php:31
|
735 |
+
msgid "Deleted %d posts from the selected post type"
|
736 |
msgstr ""
|
737 |
|
738 |
+
#: include/Core/Posts/Modules/DeletePostsByPostTypeModule.php:39
|
739 |
+
msgid "Select the post type and the status from which you want to delete posts"
|
|
|
|
|
|
|
740 |
msgstr ""
|
741 |
|
742 |
+
#: include/Core/Posts/Modules/DeletePostsByRevisionModule.php:21
|
743 |
+
msgid "By Post Revisions"
|
|
|
744 |
msgstr ""
|
745 |
|
746 |
+
#: include/Core/Posts/Modules/DeletePostsByRevisionModule.php:30
|
747 |
+
msgid "Select the posts which you want to delete"
|
|
|
748 |
msgstr ""
|
749 |
|
750 |
+
#: include/Core/Posts/Modules/DeletePostsByRevisionModule.php:37
|
751 |
+
msgid "All Revisions"
|
|
|
752 |
msgstr ""
|
753 |
|
754 |
+
#: include/Core/Posts/Modules/DeletePostsByRevisionModule.php:37
|
755 |
+
msgid "Revisions"
|
|
|
756 |
msgstr ""
|
757 |
|
758 |
+
#. translators: 1 Number of pages deleted
|
759 |
+
#: include/Core/Posts/Modules/DeletePostsByRevisionModule.php:72
|
760 |
+
#: include/Core/Posts/Modules/DeletePostsByURLModule.php:87
|
761 |
+
msgid "Deleted %d post with the selected post status"
|
762 |
+
msgid_plural "Deleted %d posts with the selected post status"
|
763 |
+
msgstr[0] ""
|
764 |
+
msgstr[1] ""
|
765 |
|
766 |
+
#: include/Core/Posts/Modules/DeletePostsByStatusModule.php:23
|
767 |
+
msgid "By Post Status"
|
|
|
|
|
|
|
|
|
768 |
msgstr ""
|
769 |
|
770 |
+
#: include/Core/Posts/Modules/DeletePostsByStatusModule.php:25
|
771 |
+
msgid "Delete Post By Status"
|
|
|
|
|
|
|
772 |
msgstr ""
|
773 |
|
774 |
+
#: include/Core/Posts/Modules/DeletePostsByStatusModule.php:26
|
|
|
775 |
msgid ""
|
776 |
+
"Please select at least one post status from which posts should be deleted"
|
|
|
777 |
msgstr ""
|
778 |
|
779 |
+
#: include/Core/Posts/Modules/DeletePostsByStatusModule.php:27
|
780 |
msgid ""
|
781 |
+
"Are you sure you want to delete all the posts from the selected post status?"
|
|
|
782 |
msgstr ""
|
783 |
|
784 |
+
#. translators: 1 Number of posts deleted
|
785 |
+
#: include/Core/Posts/Modules/DeletePostsByStatusModule.php:29
|
786 |
+
msgid "Deleted %d post from the selected post status"
|
787 |
msgstr ""
|
788 |
|
789 |
+
#. translators: 1 Number of posts deleted
|
790 |
+
#: include/Core/Posts/Modules/DeletePostsByStatusModule.php:31
|
791 |
+
msgid "Deleted %d posts from the selected post status"
|
792 |
msgstr ""
|
793 |
|
794 |
+
#: include/Core/Posts/Modules/DeletePostsByStatusModule.php:37
|
795 |
+
msgid "Select the post statuses from which you want to delete posts"
|
|
|
796 |
msgstr ""
|
797 |
|
798 |
+
#: include/Core/Posts/Modules/DeletePostsByStickyPostModule.php:29
|
799 |
+
msgid "By Sticky Post"
|
|
|
800 |
msgstr ""
|
801 |
|
802 |
+
#: include/Core/Posts/Modules/DeletePostsByStickyPostModule.php:37
|
803 |
+
msgid "There are no sticky post present in this WordPress installation."
|
|
|
804 |
msgstr ""
|
805 |
|
806 |
+
#: include/Core/Posts/Modules/DeletePostsByStickyPostModule.php:42
|
807 |
+
msgid "Select the sticky post that you want to delete"
|
|
|
808 |
msgstr ""
|
809 |
|
810 |
+
#: include/Core/Posts/Modules/DeletePostsByStickyPostModule.php:67
|
811 |
+
msgid "Are you sure you want to remove the selected posts from being sticky?"
|
|
|
|
|
|
|
|
|
|
|
|
|
812 |
msgstr ""
|
813 |
|
814 |
+
#: include/Core/Posts/Modules/DeletePostsByStickyPostModule.php:68
|
815 |
+
msgid "Are you sure you want to delete all the selected posts?"
|
|
|
|
|
|
|
816 |
msgstr ""
|
817 |
|
818 |
+
#: include/Core/Posts/Modules/DeletePostsByStickyPostModule.php:69
|
819 |
+
msgid "Select at least one sticky post"
|
|
|
|
|
|
|
820 |
msgstr ""
|
821 |
|
822 |
+
#. translators: 1 Number of posts unsticked
|
823 |
+
#: include/Core/Posts/Modules/DeletePostsByStickyPostModule.php:145
|
824 |
+
msgid "%d sticky post was made into normal post"
|
825 |
+
msgid_plural "%d sticky posts were made into normal posts"
|
826 |
+
msgstr[0] ""
|
827 |
+
msgstr[1] ""
|
828 |
+
|
829 |
+
#. translators: 1 Number of posts deleted
|
830 |
+
#: include/Core/Posts/Modules/DeletePostsByStickyPostModule.php:149
|
831 |
+
msgid "Deleted %d sticky post"
|
832 |
+
msgid_plural "Deleted %d sticky posts"
|
833 |
+
msgstr[0] ""
|
834 |
+
msgstr[1] ""
|
835 |
+
|
836 |
+
#: include/Core/Posts/Modules/DeletePostsByTagModule.php:26
|
837 |
+
msgid "By Post Tag"
|
838 |
msgstr ""
|
839 |
|
840 |
+
#: include/Core/Posts/Modules/DeletePostsByTagModule.php:28
|
841 |
+
msgid "Delete Post By Tag"
|
|
|
842 |
msgstr ""
|
843 |
|
844 |
+
#: include/Core/Posts/Modules/DeletePostsByTagModule.php:38
|
845 |
+
msgid "There are no tags present in this WordPress installation."
|
|
|
|
|
|
|
846 |
msgstr ""
|
847 |
|
848 |
+
#: include/Core/Posts/Modules/DeletePostsByTagModule.php:43
|
849 |
+
msgid "Select the tags from which you want to delete posts"
|
850 |
msgstr ""
|
851 |
|
852 |
+
#: include/Core/Posts/Modules/DeletePostsByTagModule.php:74
|
853 |
+
msgid "Please select at least one tag"
|
|
|
|
|
|
|
|
|
854 |
msgstr ""
|
855 |
|
856 |
+
#. translators: 1 Number of posts deleted
|
857 |
+
#: include/Core/Posts/Modules/DeletePostsByTagModule.php:115
|
858 |
+
msgid "Deleted %d post with the selected post tag"
|
859 |
+
msgid_plural "Deleted %d posts with the selected post tag"
|
860 |
+
msgstr[0] ""
|
861 |
+
msgstr[1] ""
|
862 |
+
|
863 |
+
#: include/Core/Posts/Modules/DeletePostsByTaxonomyModule.php:23
|
864 |
+
msgid "By Taxonomy"
|
865 |
msgstr ""
|
866 |
|
867 |
+
#: include/Core/Posts/Modules/DeletePostsByTaxonomyModule.php:25
|
868 |
+
msgid "Delete Post By Taxonomy"
|
869 |
msgstr ""
|
870 |
|
871 |
+
#: include/Core/Posts/Modules/DeletePostsByTaxonomyModule.php:45
|
872 |
+
msgid "Select the post type from which you want to delete posts by taxonomy"
|
|
|
|
|
873 |
msgstr ""
|
874 |
|
875 |
+
#: include/Core/Posts/Modules/DeletePostsByTaxonomyModule.php:53
|
876 |
+
msgid "Select the taxonomies from which you want to delete posts"
|
|
|
877 |
msgstr ""
|
878 |
|
879 |
+
#: include/Core/Posts/Modules/DeletePostsByTaxonomyModule.php:74
|
880 |
+
msgid ""
|
881 |
+
"The selected taxonomy has the following terms. Select the terms from which "
|
882 |
+
"you want to delete posts"
|
|
|
|
|
|
|
883 |
msgstr ""
|
884 |
|
885 |
+
#: include/Core/Posts/Modules/DeletePostsByTaxonomyModule.php:78
|
886 |
+
msgid ""
|
887 |
+
"Note: The post count below for each term is the total number of posts in "
|
888 |
+
"that term, irrespective of post type"
|
889 |
msgstr ""
|
890 |
|
891 |
+
#: include/Core/Posts/Modules/DeletePostsByTaxonomyModule.php:122
|
|
|
|
|
892 |
msgid ""
|
893 |
+
"This WordPress installation doesn't have any non-empty taxonomies defined"
|
|
|
894 |
msgstr ""
|
895 |
|
896 |
+
#. translators: 1 Number of pages deleted
|
897 |
+
#: include/Core/Posts/Modules/DeletePostsByTaxonomyModule.php:159
|
898 |
+
msgid "Deleted %d post with the selected taxonomy"
|
899 |
+
msgid_plural "Deleted %d posts with the selected post taxonomy"
|
900 |
+
msgstr[0] ""
|
901 |
+
msgstr[1] ""
|
902 |
+
|
903 |
+
#: include/Core/Posts/Modules/DeletePostsByURLModule.php:21
|
904 |
+
msgid "By URL"
|
905 |
msgstr ""
|
906 |
|
907 |
+
#: include/Core/Posts/Modules/DeletePostsByURLModule.php:27
|
908 |
+
msgid "Delete posts and pages that have the following Permalink"
|
|
|
909 |
msgstr ""
|
910 |
|
911 |
+
#: include/Core/Posts/Modules/DeletePostsByURLModule.php:33
|
912 |
+
msgid "Enter one post url (not post ids) per line"
|
|
|
913 |
msgstr ""
|
914 |
|
915 |
+
#: include/Core/Posts/Modules/DeletePostsByURLModule.php:53
|
916 |
+
msgid "Please enter at least one post url"
|
|
|
917 |
msgstr ""
|
918 |
|
919 |
+
#: include/Core/Posts/Modules/DeletePostsByURLModule.php:54
|
920 |
+
msgid "Are you sure you want to delete all the posts based on the entered url?"
|
|
|
921 |
msgstr ""
|
922 |
|
923 |
+
#: include/Core/SystemInfo/SystemInfoPage.php:37
|
924 |
+
msgid "Bulk Delete - System Info"
|
|
|
|
|
|
|
|
|
925 |
msgstr ""
|
926 |
|
927 |
+
#: include/Core/SystemInfo/SystemInfoPage.php:38
|
928 |
+
msgid "System Info"
|
|
|
929 |
msgstr ""
|
930 |
|
931 |
+
#: include/Core/SystemInfo/SystemInfoPage.php:56
|
932 |
+
msgid "Please include this information when posting support requests."
|
|
|
|
|
933 |
msgstr ""
|
934 |
|
935 |
+
#. translators: 1 Codex URL
|
936 |
+
#: include/Core/SystemInfo/SystemInfoPage.php:68
|
937 |
msgid ""
|
938 |
+
"SAVEQUERIES is <a href=\"%s\" target=\"_blank\">enabled</a>. This puts "
|
939 |
+
"additional load on the memory and will restrict the number of items that can "
|
940 |
+
"be deleted."
|
941 |
msgstr ""
|
942 |
|
943 |
+
#. translators: 1 Codex URL.
|
944 |
+
#: include/Core/SystemInfo/SystemInfoPage.php:84
|
945 |
+
msgid ""
|
946 |
+
"DISABLE_WP_CRON is <a href=\"%s\" rel=\"noopener\" target=\"_blank"
|
947 |
+
"\">enabled</a>. Scheduled deletion will not work if WP Cron is disabled. "
|
948 |
+
"Please disable it to enable scheduled deletion."
|
949 |
msgstr ""
|
950 |
|
951 |
+
#: include/Core/SystemInfo/SystemInfoPage.php:101
|
952 |
+
msgid "Download System Info File"
|
|
|
953 |
msgstr ""
|
954 |
|
955 |
+
#: include/Core/Terms/DeleteTermsPage.php:23
|
956 |
+
msgid "Bulk Delete Taxonomy Terms"
|
|
|
957 |
msgstr ""
|
958 |
|
959 |
+
#: include/Core/Terms/DeleteTermsPage.php:24
|
960 |
+
msgid "Bulk Delete Terms"
|
|
|
961 |
msgstr ""
|
962 |
|
963 |
+
#: include/Core/Terms/DeleteTermsPage.php:28
|
|
|
964 |
msgid ""
|
965 |
+
"WARNING: Once deleted, terms cannot be retrieved back. Use with caution."
|
|
|
|
|
|
|
|
|
|
|
966 |
msgstr ""
|
967 |
|
968 |
+
#: include/Core/Terms/DeleteTermsPage.php:45
|
969 |
+
msgid ""
|
970 |
+
"This screen contains different modules that allows you to delete terms from "
|
971 |
+
"taxonomies"
|
972 |
msgstr ""
|
973 |
|
974 |
+
#: include/Core/Terms/Modules/DeleteTermsByNameModule.php:21
|
975 |
+
msgid "Delete Terms by Name"
|
976 |
msgstr ""
|
977 |
|
978 |
+
#: include/Core/Terms/Modules/DeleteTermsByNameModule.php:22
|
979 |
+
#: include/Core/Terms/Modules/DeleteTermsByPostCountModule.php:22
|
980 |
+
msgid "The selected terms are scheduled for deletion"
|
|
|
|
|
981 |
msgstr ""
|
982 |
|
983 |
+
#: include/Core/Terms/Modules/DeleteTermsByNameModule.php:30
|
984 |
+
#: include/Core/Terms/Modules/DeleteTermsByPostCountModule.php:30
|
985 |
+
msgid "Select the taxonomy from which you want to delete terms"
|
986 |
msgstr ""
|
987 |
|
988 |
+
#: include/Core/Terms/Modules/DeleteTermsByNameModule.php:34
|
989 |
+
#: include/Core/Terms/Modules/DeleteTermsByPostCountModule.php:34
|
990 |
+
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:355
|
991 |
+
#: include/ui/form.php:22
|
992 |
+
msgid "Choose your filtering options"
|
993 |
msgstr ""
|
994 |
|
995 |
+
#: include/Core/Terms/Modules/DeleteTermsByNameModule.php:36
|
996 |
+
msgid "Delete Terms if the name "
|
|
|
997 |
msgstr ""
|
998 |
|
999 |
+
#: include/Core/Terms/Modules/DeleteTermsByNameModule.php:38
|
1000 |
+
msgid "Term Name"
|
1001 |
msgstr ""
|
1002 |
|
1003 |
+
#: include/Core/Terms/Modules/DeleteTermsByNameModule.php:48
|
1004 |
+
msgid "Please enter the term name that should be deleted"
|
|
|
|
|
|
|
|
|
|
|
1005 |
msgstr ""
|
1006 |
|
1007 |
+
#: include/Core/Terms/Modules/DeleteTermsByNameModule.php:51
|
1008 |
+
#: include/Core/Terms/Modules/DeleteTermsByPostCountModule.php:56
|
1009 |
+
msgid ""
|
1010 |
+
"Are you sure you want to delete all the terms based on the selected option?"
|
|
|
|
|
1011 |
msgstr ""
|
1012 |
|
1013 |
+
#: include/Core/Terms/Modules/DeleteTermsByPostCountModule.php:21
|
1014 |
+
msgid "Delete Terms by Post Count"
|
|
|
|
|
|
|
1015 |
msgstr ""
|
1016 |
|
1017 |
+
#: include/Core/Terms/Modules/DeleteTermsByPostCountModule.php:36
|
1018 |
+
msgid "Delete Terms if the post count is "
|
|
|
|
|
1019 |
msgstr ""
|
1020 |
|
1021 |
+
#: include/Core/Terms/Modules/DeleteTermsByPostCountModule.php:41
|
1022 |
+
msgid "Post count is the number of posts that are assigned to a term."
|
|
|
|
|
|
|
1023 |
msgstr ""
|
1024 |
|
1025 |
+
#: include/Core/Terms/Modules/DeleteTermsByPostCountModule.php:53
|
1026 |
+
msgid ""
|
1027 |
+
"Please enter the post count based on which terms should be deleted. A valid "
|
1028 |
+
"post count will be greater than or equal to zero"
|
1029 |
msgstr ""
|
1030 |
|
1031 |
+
#. translators: 1 Number of terms deleted
|
1032 |
+
#: include/Core/Terms/TermsModule.php:140
|
1033 |
+
msgid "Deleted %d term with the selected options"
|
1034 |
+
msgid_plural "Deleted %d terms with the selected options"
|
1035 |
+
msgstr[0] ""
|
1036 |
+
msgstr[1] ""
|
1037 |
|
1038 |
+
#: include/Core/Users/DeleteUsersPage.php:29
|
1039 |
+
#: include/Core/Users/DeleteUsersPage.php:30
|
1040 |
+
msgid "Bulk Delete Users"
|
|
|
1041 |
msgstr ""
|
1042 |
|
1043 |
+
#: include/Core/Users/DeleteUsersPage.php:34
|
1044 |
+
msgid "WARNING: Users deleted once cannot be retrieved back. Use with caution."
|
|
|
|
|
1045 |
msgstr ""
|
1046 |
|
1047 |
+
#: include/Core/Users/DeleteUsersPage.php:53
|
1048 |
+
msgid ""
|
1049 |
+
"This screen contains different modules that allows you to delete users or "
|
1050 |
+
"schedule them for deletion."
|
1051 |
msgstr ""
|
1052 |
|
1053 |
+
#: include/Core/Users/Modules/DeleteUsersByUserMetaModule.php:29
|
1054 |
+
msgid "By User Meta"
|
|
|
|
|
1055 |
msgstr ""
|
1056 |
|
1057 |
+
#: include/Core/Users/Modules/DeleteUsersByUserMetaModule.php:30
|
1058 |
+
msgid "Users from with the selected user meta are scheduled for deletion."
|
|
|
|
|
1059 |
msgstr ""
|
1060 |
|
1061 |
+
#: include/Core/Users/Modules/DeleteUsersByUserMetaModule.php:31
|
1062 |
+
msgid "Delete Users by User Meta"
|
|
|
|
|
1063 |
msgstr ""
|
1064 |
|
1065 |
+
#: include/Core/Users/Modules/DeleteUsersByUserMetaModule.php:43
|
1066 |
+
msgid "Select the user meta from which you want to delete users"
|
|
|
|
|
1067 |
msgstr ""
|
1068 |
|
1069 |
+
#: include/Core/Users/Modules/DeleteUsersByUserMetaModule.php:73
|
1070 |
+
msgid "If you want to check for null values, then leave the value column blank"
|
|
|
|
|
1071 |
msgstr ""
|
1072 |
|
1073 |
+
#: include/Core/Users/Modules/DeleteUsersByUserMetaModule.php:148
|
1074 |
+
msgid ""
|
1075 |
+
"Are you sure you want to delete all the users from the selected user meta?"
|
|
|
1076 |
msgstr ""
|
1077 |
|
1078 |
+
#: include/Core/Users/Modules/DeleteUsersByUserMetaModule.php:151
|
1079 |
+
msgid ""
|
1080 |
+
"Please enter the value for the user meta field based on which you want to "
|
1081 |
+
"delete users"
|
1082 |
msgstr ""
|
1083 |
|
1084 |
+
#. translators: 1 Number of users deleted
|
1085 |
+
#: include/Core/Users/Modules/DeleteUsersByUserMetaModule.php:158
|
1086 |
+
msgid "Deleted %d user with the selected user meta"
|
1087 |
+
msgid_plural "Deleted %d users with the selected user meta"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1088 |
msgstr[0] ""
|
1089 |
msgstr[1] ""
|
1090 |
|
1091 |
+
#: include/Core/Users/Modules/DeleteUsersByUserRoleModule.php:29
|
1092 |
+
msgid "By User Role"
|
1093 |
msgstr ""
|
1094 |
|
1095 |
+
#: include/Core/Users/Modules/DeleteUsersByUserRoleModule.php:30
|
1096 |
+
msgid "Users from the selected user role are scheduled for deletion."
|
1097 |
msgstr ""
|
1098 |
|
1099 |
+
#: include/Core/Users/Modules/DeleteUsersByUserRoleModule.php:31
|
1100 |
+
msgid "Delete Users by User Role"
|
1101 |
msgstr ""
|
1102 |
|
1103 |
+
#: include/Core/Users/Modules/DeleteUsersByUserRoleModule.php:42
|
1104 |
+
msgid "Select the user roles from which you want to delete users"
|
|
|
|
|
|
|
|
|
|
|
|
|
1105 |
msgstr ""
|
1106 |
|
1107 |
+
#: include/Core/Users/Modules/DeleteUsersByUserRoleModule.php:189
|
1108 |
msgid ""
|
1109 |
+
"Are you sure you want to delete all the users from the selected user role?"
|
1110 |
msgstr ""
|
1111 |
|
1112 |
+
#: include/Core/Users/Modules/DeleteUsersByUserRoleModule.php:192
|
1113 |
+
msgid "Select at least one user role from which users should be deleted"
|
1114 |
msgstr ""
|
1115 |
|
1116 |
+
#. translators: 1 Number of users deleted
|
1117 |
+
#: include/Core/Users/Modules/DeleteUsersByUserRoleModule.php:199
|
1118 |
+
msgid "Deleted %d user from the selected roles"
|
1119 |
+
msgid_plural "Deleted %d users from the selected roles"
|
1120 |
+
msgstr[0] ""
|
1121 |
+
msgstr[1] ""
|
1122 |
|
1123 |
+
#: include/Core/Users/UsersModule.php:263
|
1124 |
+
msgid "Restrict to users who are registered in the site "
|
1125 |
msgstr ""
|
1126 |
|
1127 |
+
#: include/Core/Users/UsersModule.php:266
|
1128 |
+
msgid "for at least"
|
1129 |
msgstr ""
|
1130 |
|
1131 |
+
#: include/Core/Users/UsersModule.php:267
|
1132 |
+
msgid "in the last"
|
|
|
1133 |
msgstr ""
|
1134 |
|
1135 |
+
#: include/Core/Users/UsersModule.php:269
|
1136 |
+
msgid " days."
|
|
|
1137 |
msgstr ""
|
1138 |
|
1139 |
+
#: include/Core/Users/UsersModule.php:277
|
1140 |
+
msgid "Restrict to users who have not logged in the last "
|
1141 |
msgstr ""
|
1142 |
|
1143 |
+
#: include/Core/Users/UsersModule.php:279
|
1144 |
+
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:113
|
1145 |
+
#: include/ui/form.php:48
|
1146 |
+
msgid "days"
|
1147 |
msgstr ""
|
1148 |
|
1149 |
+
#: include/Core/Users/UsersModule.php:283
|
1150 |
+
msgid "Need the free \"Simple Login Log\" Plugin"
|
1151 |
msgstr ""
|
1152 |
|
1153 |
+
#: include/Core/Users/UsersModule.php:292
|
1154 |
+
msgid ""
|
1155 |
+
"Enter \"0 days\" to delete users who have never logged in after the \"Simple "
|
1156 |
+
"Login Log\" plugin has been installed."
|
1157 |
msgstr ""
|
1158 |
|
1159 |
+
#: include/Core/Users/UsersModule.php:311
|
1160 |
+
msgid "Restrict to users who don't have any posts."
|
1161 |
msgstr ""
|
1162 |
|
1163 |
+
#: include/Core/Users/UsersModule.php:321
|
1164 |
+
msgid "Select the post types. By default all post types are considered."
|
|
|
1165 |
msgstr ""
|
1166 |
|
1167 |
+
#: include/Deprecated/Addons/DeleteFromTrashModule.php:26
|
1168 |
+
msgid "Delete Posts from Trash"
|
|
|
1169 |
msgstr ""
|
1170 |
|
1171 |
+
#: include/Deprecated/Addons/DeleteFromTrashModule.php:44
|
1172 |
+
msgid "Delete Pages from Trash"
|
1173 |
msgstr ""
|
1174 |
|
1175 |
+
#: include/Deprecated/Addons/DeletePostsByAttachmentModule.php:26
|
1176 |
+
msgid "Delete Posts By Attachment"
|
1177 |
msgstr ""
|
1178 |
|
1179 |
+
#: include/Deprecated/Addons/DeletePostsByContentModule.php:26
|
1180 |
+
msgid "Delete Posts By Content"
|
|
|
1181 |
msgstr ""
|
1182 |
|
1183 |
+
#: include/Deprecated/Addons/DeletePostsByCustomFieldModule.php:26
|
1184 |
+
msgid "Delete Posts By Custom Field"
|
|
|
|
|
|
|
|
|
|
|
|
|
1185 |
msgstr ""
|
1186 |
|
1187 |
+
#: include/Deprecated/Addons/DeletePostsByDuplicateTitleModule.php:26
|
1188 |
+
msgid "Delete Posts By Duplicate Title"
|
|
|
1189 |
msgstr ""
|
1190 |
|
1191 |
+
#: include/Deprecated/Addons/DeletePostsByTitleModule.php:26
|
1192 |
+
msgid "Delete Posts By Title"
|
|
|
1193 |
msgstr ""
|
1194 |
|
1195 |
+
#: include/Deprecated/Addons/DeletePostsByUserModule.php:26
|
1196 |
+
msgid "Delete Posts By User"
|
|
|
1197 |
msgstr ""
|
1198 |
|
1199 |
+
#: include/Deprecated/Addons/DeletePostsByUserRoleModule.php:26
|
1200 |
+
msgid "Delete Posts By User Role"
|
1201 |
msgstr ""
|
1202 |
|
1203 |
+
#: include/Deprecated/class-bd-scheduler-addon.php:112
|
1204 |
+
msgid ""
|
1205 |
+
"\"%s\" addon requires \"<a href=\"%s\" target=\"_blank\">%s</a>\" addon to "
|
1206 |
+
"be installed and activated!"
|
1207 |
msgstr ""
|
1208 |
|
1209 |
+
#: include/Deprecated/old-bulk-delete.php:119
|
1210 |
+
#: include/Deprecated/old-bulk-delete.php:131
|
1211 |
+
msgid "Cheatin’ huh?"
|
1212 |
msgstr ""
|
1213 |
|
1214 |
+
#: include/addons/addon-list.php:20
|
1215 |
+
msgid ""
|
1216 |
+
"The following are the list of pro addons that are currently available for "
|
1217 |
+
"purchase."
|
1218 |
msgstr ""
|
1219 |
|
1220 |
+
#: include/addons/addon-list.php:26
|
1221 |
+
msgid "Delete posts by custom field"
|
|
|
1222 |
msgstr ""
|
1223 |
|
1224 |
+
#: include/addons/addon-list.php:27
|
1225 |
+
msgid "Adds the ability to delete posts based on custom fields"
|
|
|
1226 |
msgstr ""
|
1227 |
|
1228 |
+
#: include/addons/addon-list.php:28 include/addons/addon-list.php:34
|
1229 |
+
#: include/addons/addon-list.php:40 include/addons/addon-list.php:46
|
1230 |
+
#: include/addons/addon-list.php:52 include/addons/addon-list.php:58
|
1231 |
+
#: include/addons/addon-list.php:64 include/addons/addon-list.php:70
|
1232 |
+
#: include/addons/addon-list.php:76 include/addons/addon-list.php:82
|
1233 |
+
#: include/addons/addon-list.php:88 include/addons/addon-list.php:94
|
1234 |
+
#: include/addons/addon-list.php:100 include/addons/addon-list.php:106
|
1235 |
+
#: include/addons/addon-list.php:112 include/addons/addon-list.php:118
|
1236 |
+
#: include/addons/addon-list.php:124 include/addons/addon-list.php:130
|
1237 |
+
#: include/addons/addon-list.php:136 include/addons/addon-list.php:142
|
1238 |
+
msgid "More Info"
|
1239 |
msgstr ""
|
1240 |
|
1241 |
+
#: include/addons/addon-list.php:32
|
1242 |
+
msgid "Delete posts by title"
|
1243 |
msgstr ""
|
1244 |
|
1245 |
+
#: include/addons/addon-list.php:33
|
1246 |
+
msgid "Adds the ability to delete posts based on title"
|
1247 |
msgstr ""
|
1248 |
|
1249 |
+
#: include/addons/addon-list.php:38
|
1250 |
+
msgid "Delete posts by duplicate title"
|
1251 |
msgstr ""
|
1252 |
|
1253 |
+
#: include/addons/addon-list.php:39
|
1254 |
+
msgid "Adds the ability to delete posts based on duplicate title"
|
1255 |
msgstr ""
|
1256 |
|
1257 |
+
#: include/addons/addon-list.php:44
|
1258 |
+
msgid "Delete posts by attachment"
|
|
|
1259 |
msgstr ""
|
1260 |
|
1261 |
+
#: include/addons/addon-list.php:45
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1262 |
msgid ""
|
1263 |
+
"Adds the ability to delete posts based on whether it contains attachment or "
|
1264 |
+
"not"
|
1265 |
msgstr ""
|
1266 |
|
1267 |
+
#: include/addons/addon-list.php:50
|
1268 |
+
msgid "Delete posts by user role"
|
1269 |
msgstr ""
|
1270 |
|
1271 |
+
#: include/addons/addon-list.php:51
|
1272 |
+
msgid "Adds the ability to delete posts based on user role"
|
1273 |
msgstr ""
|
1274 |
|
1275 |
+
#: include/addons/addon-list.php:56
|
1276 |
+
msgid "Delete from trash"
|
1277 |
msgstr ""
|
1278 |
|
1279 |
+
#: include/addons/addon-list.php:57
|
1280 |
+
msgid "Adds the ability to delete posts and pages from trash"
|
1281 |
msgstr ""
|
1282 |
|
1283 |
+
#: include/addons/addon-list.php:62
|
1284 |
+
msgid "Scheduler Email"
|
1285 |
msgstr ""
|
1286 |
|
1287 |
+
#: include/addons/addon-list.php:63
|
1288 |
+
msgid "Sends an email every time a Bulk WP scheduler runs"
|
1289 |
msgstr ""
|
1290 |
|
1291 |
+
#: include/addons/addon-list.php:68
|
1292 |
+
msgid "Scheduler for deleting Posts by Category"
|
1293 |
msgstr ""
|
1294 |
|
1295 |
+
#: include/addons/addon-list.php:69
|
1296 |
+
msgid "Adds the ability to schedule auto delete of posts based on category"
|
1297 |
msgstr ""
|
1298 |
|
1299 |
+
#: include/addons/addon-list.php:74
|
1300 |
+
msgid "Scheduler for deleting Posts by Tag"
|
1301 |
msgstr ""
|
1302 |
|
1303 |
+
#: include/addons/addon-list.php:75
|
1304 |
+
msgid "Adds the ability to schedule auto delete of posts based on tag"
|
1305 |
msgstr ""
|
1306 |
|
1307 |
+
#: include/addons/addon-list.php:80
|
1308 |
+
msgid "Scheduler for deleting Posts by Custom Taxonomy"
|
1309 |
msgstr ""
|
1310 |
|
1311 |
+
#: include/addons/addon-list.php:81
|
1312 |
+
msgid ""
|
1313 |
+
"Adds the ability to schedule auto delete of posts based on custom taxonomy"
|
1314 |
msgstr ""
|
1315 |
|
1316 |
+
#: include/addons/addon-list.php:86
|
1317 |
+
msgid "Scheduler for deleting Posts by Custom Post Type"
|
1318 |
msgstr ""
|
1319 |
|
1320 |
+
#: include/addons/addon-list.php:87
|
1321 |
+
msgid ""
|
1322 |
+
"Adds the ability to schedule auto delete of posts based on custom post type"
|
1323 |
msgstr ""
|
1324 |
|
1325 |
+
#: include/addons/addon-list.php:92
|
1326 |
+
msgid "Scheduler for deleting Posts by Post Status"
|
1327 |
msgstr ""
|
1328 |
|
1329 |
+
#: include/addons/addon-list.php:93
|
1330 |
+
msgid ""
|
1331 |
+
"Adds the ability to schedule auto delete of posts based on post status like "
|
1332 |
+
"drafts, pending posts, scheduled posts etc."
|
1333 |
msgstr ""
|
1334 |
|
1335 |
+
#: include/addons/addon-list.php:98
|
1336 |
+
msgid "Scheduler for deleting Pages by Status"
|
1337 |
msgstr ""
|
1338 |
|
1339 |
+
#: include/addons/addon-list.php:99
|
1340 |
+
msgid "Adds the ability to schedule auto delete pages based on status"
|
1341 |
msgstr ""
|
1342 |
|
1343 |
+
#: include/addons/addon-list.php:104
|
1344 |
+
msgid "Scheduler for deleting Users by User Role"
|
1345 |
msgstr ""
|
1346 |
|
1347 |
+
#: include/addons/addon-list.php:105
|
1348 |
+
msgid "Adds the ability to schedule auto delete of users based on user role"
|
1349 |
msgstr ""
|
1350 |
|
1351 |
+
#: include/addons/addon-list.php:110
|
1352 |
+
msgid "Scheduler for deleting Users by User Meta"
|
1353 |
msgstr ""
|
1354 |
|
1355 |
+
#: include/addons/addon-list.php:111
|
1356 |
+
msgid "Adds the ability to schedule auto delete of users based on user meta"
|
1357 |
msgstr ""
|
1358 |
|
1359 |
+
#: include/addons/addon-list.php:116
|
1360 |
+
msgid "Delete Post Meta Fields"
|
1361 |
msgstr ""
|
1362 |
|
1363 |
+
#: include/addons/addon-list.php:117
|
1364 |
+
msgid ""
|
1365 |
+
"Adds the ability to delete post meta fields based on value and to schedule "
|
1366 |
+
"automatic deletion"
|
1367 |
msgstr ""
|
1368 |
|
1369 |
+
#: include/addons/addon-list.php:122
|
1370 |
+
msgid "Delete Comment Meta Fields"
|
1371 |
msgstr ""
|
1372 |
|
1373 |
+
#: include/addons/addon-list.php:123
|
1374 |
+
msgid ""
|
1375 |
+
"Adds the ability to delete comment meta fields based on value and to "
|
1376 |
+
"schedule automatic deletion"
|
1377 |
msgstr ""
|
1378 |
|
1379 |
+
#: include/addons/addon-list.php:128
|
1380 |
+
msgid "Delete User Meta Fields"
|
1381 |
msgstr ""
|
1382 |
|
1383 |
+
#: include/addons/addon-list.php:129
|
|
|
1384 |
msgid ""
|
1385 |
+
"Adds the ability to delete user meta fields based on value and to schedule "
|
1386 |
+
"automatic deletion"
|
|
|
1387 |
msgstr ""
|
1388 |
|
1389 |
+
#: include/addons/addon-list.php:134
|
1390 |
+
msgid "Delete attachment"
|
|
|
1391 |
msgstr ""
|
1392 |
|
1393 |
+
#: include/addons/addon-list.php:135
|
|
|
|
|
|
|
|
|
|
|
|
|
1394 |
msgid ""
|
1395 |
+
"Adds the ability to delete attachments based on whether they are attached to "
|
1396 |
+
"a post or not"
|
1397 |
msgstr ""
|
1398 |
|
1399 |
+
#: include/addons/addon-list.php:140
|
1400 |
+
msgid "Delete Jetpack Contact Form Messages"
|
1401 |
msgstr ""
|
1402 |
|
1403 |
+
#: include/addons/addon-list.php:141
|
1404 |
+
msgid ""
|
1405 |
+
"Adds the ability to delete Jetpack Contact Form Messages based on filters "
|
1406 |
+
"and to schedule automatic deletion"
|
1407 |
msgstr ""
|
1408 |
|
1409 |
+
#: include/helpers/common.php:161
|
1410 |
+
msgid "All mime types"
|
1411 |
msgstr ""
|
1412 |
|
1413 |
+
#: include/helpers/common.php:169 include/ui/form.php:262
|
1414 |
+
msgid "All"
|
1415 |
msgstr ""
|
1416 |
|
1417 |
+
#: include/libraries/EDD_SL_Plugin_Updater.php:201
|
1418 |
+
msgid ""
|
1419 |
+
"There is a new version of %1$s available. %2$sView version %3$s details%4$s."
|
1420 |
msgstr ""
|
1421 |
|
1422 |
+
#: include/libraries/EDD_SL_Plugin_Updater.php:209
|
1423 |
+
msgid ""
|
1424 |
+
"There is a new version of %1$s available. %2$sView version %3$s details%4$s "
|
1425 |
+
"or %5$supdate now%6$s."
|
1426 |
msgstr ""
|
1427 |
|
1428 |
+
#: include/libraries/EDD_SL_Plugin_Updater.php:399
|
1429 |
+
msgid "You do not have permission to install plugin updates"
|
1430 |
msgstr ""
|
1431 |
|
1432 |
+
#: include/libraries/EDD_SL_Plugin_Updater.php:399
|
1433 |
+
msgid "Error"
|
1434 |
msgstr ""
|
1435 |
|
1436 |
+
#: include/license/class-bd-license-handler.php:133
|
1437 |
+
msgid ""
|
1438 |
+
"\"%1$s\" addon is installed but not activated. To activate the addon, please "
|
1439 |
+
"<a href=\"%2$s\">enter your license key</a>. If you don't have a license "
|
1440 |
+
"key, then you can <a href=\"%3$s\" target=\"_blank\">purchase one</a>."
|
1441 |
msgstr ""
|
1442 |
|
1443 |
+
#: include/license/class-bd-license-handler.php:136
|
1444 |
msgid ""
|
1445 |
+
"The license for \"%1$s\" addon is either invalid or has expired. Please <a "
|
1446 |
+
"href=\"%2$s\" target=\"_blank\">renew the license</a> or <a href=\"%3$s"
|
1447 |
+
"\">enter a new license key</a> to receive updates and support."
|
1448 |
msgstr ""
|
1449 |
|
1450 |
+
#: include/license/class-bd-license-handler.php:209
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1451 |
msgid ""
|
1452 |
+
"Addon is not activated. To activate the addon, please <a href=\"%1$s\">enter "
|
1453 |
+
"your license key</a>. If you don't have a license key, then you can <a href="
|
1454 |
+
"\"%2$s\" target=\"_blank\">purchase one</a>."
|
1455 |
msgstr ""
|
1456 |
|
1457 |
+
#: include/license/class-bd-license-handler.php:219
|
1458 |
+
msgid ""
|
1459 |
+
"The license for this addon is either invalid or has expired. Please <a href="
|
1460 |
+
"\"%1$s\" target=\"_blank\">renew the license</a> or <a href=\"%2$s\">enter a "
|
1461 |
+
"new license key</a> to receive updates and support."
|
1462 |
msgstr ""
|
1463 |
|
1464 |
+
#: include/license/class-bd-license-handler.php:252
|
1465 |
+
msgid "Addon License Key"
|
1466 |
msgstr ""
|
1467 |
|
1468 |
+
#: include/license/class-bd-license-handler.php:272
|
1469 |
+
msgid "Enter license key"
|
1470 |
msgstr ""
|
1471 |
|
1472 |
+
#: include/license/class-bd-license.php:66
|
1473 |
+
msgid "Activate License"
|
1474 |
msgstr ""
|
1475 |
|
1476 |
+
#: include/license/class-bd-license.php:198
|
1477 |
+
msgid "The license key for \"%s\" addon was successfully deactivated"
|
1478 |
msgstr ""
|
1479 |
|
1480 |
+
#: include/license/class-bd-license.php:202
|
1481 |
msgid ""
|
1482 |
+
"There was some problem while trying to deactivate license key for \"%s\" "
|
1483 |
+
"addon. Kindly try again"
|
1484 |
msgstr ""
|
1485 |
|
1486 |
+
#: include/license/class-bd-license.php:225
|
1487 |
+
msgid "The license key was successfully deleted"
|
1488 |
msgstr ""
|
1489 |
|
1490 |
+
#: include/license/class-bd-license.php:271
|
1491 |
+
msgid ""
|
1492 |
+
"There was some problem in contacting our store to activate the license key "
|
1493 |
+
"for \"%s\" addon"
|
1494 |
msgstr ""
|
1495 |
|
1496 |
+
#: include/license/class-bd-license.php:281
|
1497 |
+
msgid ""
|
1498 |
+
"The license key for \"%s\" addon was successfully activated. The addon will "
|
1499 |
+
"get updates automatically till the license key is valid."
|
1500 |
msgstr ""
|
1501 |
|
1502 |
+
#: include/license/class-bd-license.php:288
|
|
|
1503 |
msgid ""
|
1504 |
+
"The license key for \"%s\" addon doesn't have any more activations left. "
|
1505 |
+
"Kindly buy a new license."
|
1506 |
msgstr ""
|
1507 |
|
1508 |
+
#: include/license/class-bd-license.php:292
|
1509 |
+
msgid "The license key for \"%s\" addon is revoked. Kindly buy a new license."
|
1510 |
msgstr ""
|
1511 |
|
1512 |
+
#: include/license/class-bd-license.php:296
|
1513 |
+
msgid "The license key for \"%s\" addon has expired. Kindly buy a new license."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1514 |
msgstr ""
|
1515 |
|
1516 |
+
#: include/license/class-bd-license.php:300
|
1517 |
+
msgid "The license key for \"%s\" addon is invalid"
|
1518 |
msgstr ""
|
1519 |
|
1520 |
+
#: include/license/class-license-list-table.php:38
|
1521 |
+
msgid ""
|
1522 |
+
"This is the list of addon license that are currently registered with the "
|
1523 |
+
"plugin."
|
1524 |
msgstr ""
|
1525 |
|
1526 |
+
#: include/license/class-license-list-table.php:52
|
1527 |
+
msgid "Addon Name"
|
1528 |
msgstr ""
|
1529 |
|
1530 |
+
#: include/license/class-license-list-table.php:53
|
1531 |
+
msgid "License Code"
|
1532 |
msgstr ""
|
1533 |
|
1534 |
+
#: include/license/class-license-list-table.php:54
|
1535 |
+
msgid "Validity"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1536 |
msgstr ""
|
1537 |
|
1538 |
+
#: include/license/class-license-list-table.php:55
|
1539 |
+
msgid "Expires"
|
1540 |
msgstr ""
|
1541 |
|
1542 |
+
#: include/license/class-license-list-table.php:102
|
1543 |
+
msgid "Deactivate"
|
1544 |
msgstr ""
|
1545 |
|
1546 |
+
#: include/license/class-license-list-table.php:169
|
1547 |
+
msgid "N/A"
|
1548 |
msgstr ""
|
1549 |
|
1550 |
+
#: include/license/class-license-list-table.php:179
|
1551 |
+
msgid "You don't have any valid addon license yet."
|
1552 |
msgstr ""
|
1553 |
|
1554 |
+
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:31
|
1555 |
+
msgid "Bulk Delete Jetpack Contact Form Messages"
|
1556 |
msgstr ""
|
1557 |
|
1558 |
+
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:57
|
1559 |
+
msgid "Jetpack contact form is not enabled."
|
1560 |
msgstr ""
|
1561 |
|
1562 |
+
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:73
|
1563 |
+
msgid "Delete all Contact Form Messages"
|
1564 |
msgstr ""
|
1565 |
|
1566 |
+
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:73
|
1567 |
+
msgid "in total"
|
1568 |
msgstr ""
|
1569 |
|
1570 |
+
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:82
|
1571 |
+
msgid "Delete Messages based on filters"
|
|
|
|
|
1572 |
msgstr ""
|
1573 |
|
1574 |
+
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:99
|
1575 |
+
msgid "Choose your date options"
|
1576 |
msgstr ""
|
1577 |
|
1578 |
+
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:108
|
1579 |
+
msgid "Only restrict to posts which are "
|
|
|
|
|
1580 |
msgstr ""
|
1581 |
|
1582 |
+
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:110
|
1583 |
+
#: include/ui/form.php:45
|
1584 |
+
msgid "older than"
|
1585 |
msgstr ""
|
1586 |
|
1587 |
+
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:111
|
1588 |
+
#: include/ui/form.php:46
|
1589 |
+
msgid "posted within last"
|
1590 |
msgstr ""
|
1591 |
|
1592 |
+
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:122
|
1593 |
+
#: include/ui/form.php:105
|
1594 |
+
msgid "Only delete first "
|
1595 |
msgstr ""
|
1596 |
|
1597 |
+
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:123
|
1598 |
+
msgid "posts."
|
1599 |
msgstr ""
|
1600 |
|
1601 |
+
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:124
|
1602 |
+
msgid ""
|
1603 |
+
"Use this option if there are more than 1000 posts and the script times out."
|
1604 |
msgstr ""
|
1605 |
|
1606 |
+
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:138
|
1607 |
+
#: include/ui/form.php:65
|
1608 |
+
msgid "Move to Trash"
|
1609 |
msgstr ""
|
1610 |
|
1611 |
+
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:142
|
1612 |
+
#: include/ui/form.php:66
|
1613 |
+
msgid "Delete permanently"
|
1614 |
msgstr ""
|
1615 |
|
1616 |
+
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:176
|
1617 |
+
#: include/ui/form.php:160
|
1618 |
+
msgid "Bulk Delete "
|
1619 |
msgstr ""
|
1620 |
|
1621 |
+
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:198
|
1622 |
msgid ""
|
1623 |
+
"Are you sure you want to delete all the Jetpack contact form messages based "
|
1624 |
+
"on the selected filters?"
|
1625 |
msgstr ""
|
1626 |
|
1627 |
+
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:239
|
1628 |
+
msgid ""
|
1629 |
+
"Jetpack contact form messages with the selected criteria are scheduled for "
|
1630 |
+
"deletion."
|
1631 |
msgstr ""
|
1632 |
|
1633 |
+
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:243
|
1634 |
+
msgid "Deleted %d Jetpack contact form message"
|
1635 |
+
msgid_plural "Deleted %d Jetpack contact form messages"
|
1636 |
+
msgstr[0] ""
|
1637 |
+
msgstr[1] ""
|
1638 |
+
|
1639 |
+
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:364
|
1640 |
+
msgid "Only if author name "
|
1641 |
msgstr ""
|
1642 |
|
1643 |
+
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:366
|
1644 |
+
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:380
|
1645 |
+
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:394
|
1646 |
+
msgid "is"
|
1647 |
msgstr ""
|
1648 |
|
1649 |
+
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:367
|
1650 |
+
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:381
|
1651 |
+
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:395
|
1652 |
+
msgid "is not"
|
1653 |
msgstr ""
|
1654 |
|
1655 |
+
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:369
|
1656 |
+
msgid "Author Name"
|
1657 |
msgstr ""
|
1658 |
|
1659 |
+
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:378
|
1660 |
+
msgid "Only if author email "
|
1661 |
msgstr ""
|
1662 |
|
1663 |
+
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:383
|
1664 |
+
msgid "Author Email"
|
1665 |
msgstr ""
|
1666 |
|
1667 |
+
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:392
|
1668 |
+
msgid "Only if author ip "
|
|
|
|
|
1669 |
msgstr ""
|
1670 |
|
1671 |
+
#: include/misc/class-bulk-delete-jetpack-contact-form-messages.php:397
|
1672 |
+
msgid "Author ip"
|
1673 |
msgstr ""
|
1674 |
|
1675 |
+
#: include/misc/class-bulk-delete-misc.php:35
|
1676 |
+
#: include/misc/class-bulk-delete-misc.php:114
|
1677 |
+
msgid "Bulk Delete Miscellaneous Items"
|
1678 |
msgstr ""
|
1679 |
|
1680 |
+
#: include/misc/class-bulk-delete-misc.php:36
|
1681 |
+
msgid "Bulk Delete Misc"
|
1682 |
msgstr ""
|
1683 |
|
1684 |
+
#: include/settings/class-bd-settings-page.php:47
|
1685 |
+
#: include/settings/class-bd-settings-page.php:101
|
1686 |
+
msgid "Bulk Delete Settings"
|
1687 |
msgstr ""
|
1688 |
|
1689 |
+
#: include/settings/class-bd-settings-page.php:48
|
1690 |
+
msgid "Settings"
|
1691 |
msgstr ""
|
1692 |
|
1693 |
+
#: include/settings/class-bd-settings.php:29
|
1694 |
+
msgid "Add Addon License"
|
1695 |
msgstr ""
|
1696 |
|
1697 |
+
#: include/ui/admin-ui.php:23
|
1698 |
+
msgid ""
|
1699 |
+
"Thank you for using <a href = \"%1$s\">Bulk Delete</a> plugin! Kindly <a "
|
1700 |
+
"href = \"%2$s\">rate us</a> at <a href = \"%2$s\">WordPress.org</a>"
|
1701 |
msgstr ""
|
1702 |
|
1703 |
+
#: include/ui/admin-ui.php:56
|
1704 |
+
msgid "Buy Addons"
|
1705 |
msgstr ""
|
1706 |
|
1707 |
+
#: include/ui/class-bulk-delete-help-screen.php:33
|
1708 |
+
msgid "More information"
|
1709 |
msgstr ""
|
1710 |
|
1711 |
+
#: include/ui/class-bulk-delete-help-screen.php:34
|
1712 |
+
msgid "Support Forums"
|
1713 |
msgstr ""
|
1714 |
|
1715 |
+
#: include/ui/class-bulk-delete-help-screen.php:35
|
1716 |
+
msgid "Buy pro addons"
|
|
|
|
|
1717 |
msgstr ""
|
1718 |
|
1719 |
+
#: include/ui/class-bulk-delete-help-screen.php:36
|
1720 |
+
msgid "Plugin author's blog"
|
|
|
1721 |
msgstr ""
|
1722 |
|
1723 |
+
#: include/ui/class-bulk-delete-help-screen.php:37
|
1724 |
+
msgid "Other Plugin's by Author"
|
|
|
1725 |
msgstr ""
|
1726 |
|
1727 |
+
#: include/ui/class-bulk-delete-help-screen.php:83
|
1728 |
+
msgid "About Plugin"
|
1729 |
msgstr ""
|
1730 |
|
1731 |
+
#: include/ui/class-bulk-delete-help-screen.php:106
|
1732 |
+
msgid "This plugin allows you to perform bulk operations in WordPress easily."
|
1733 |
msgstr ""
|
1734 |
|
1735 |
+
#: include/ui/class-bulk-delete-help-screen.php:107
|
1736 |
+
msgid ""
|
1737 |
+
"This plugin can be used to delete the posts, pages or users using various "
|
1738 |
+
"filters and conditions."
|
1739 |
msgstr ""
|
1740 |
|
1741 |
+
#: include/ui/form.php:43
|
1742 |
+
msgid "Only restrict to %s which are "
|
1743 |
msgstr ""
|
1744 |
|
1745 |
+
#: include/ui/form.php:83
|
1746 |
+
msgid "Public posts"
|
1747 |
msgstr ""
|
1748 |
|
1749 |
+
#: include/ui/form.php:84
|
1750 |
+
msgid "Private Posts"
|
1751 |
msgstr ""
|
1752 |
|
1753 |
+
#: include/ui/form.php:107
|
1754 |
+
msgid ""
|
1755 |
+
"Use this option if there are more than 1000 %s and the script times out."
|
1756 |
msgstr ""
|
1757 |
|
1758 |
+
#: include/ui/form.php:144
|
1759 |
msgid ""
|
1760 |
+
"Enter time in <strong>Y-m-d H:i:s</strong> format or enter <strong>now</"
|
1761 |
+
"strong> to use current time"
|
1762 |
+
msgstr ""
|
1763 |
+
|
1764 |
+
#: include/ui/form.php:222
|
1765 |
+
msgid "Built-in Post Types"
|
1766 |
+
msgstr ""
|
1767 |
+
|
1768 |
+
#: include/ui/form.php:230
|
1769 |
+
msgid "Custom Post Types"
|
1770 |
msgstr ""
|
1771 |
|
1772 |
#: vendor/10up/wp_mock/tests/FunctionMocksTest.php:65
|
1778 |
msgid "Input"
|
1779 |
msgstr ""
|
1780 |
|
1781 |
+
#: vendor/sudar/wp-system-info/src/SystemInfo.php:79
|
1782 |
+
msgid ""
|
1783 |
+
"To copy the system info, click below then press Ctrl + C (PC) or Cmd + C "
|
1784 |
+
"(Mac)."
|
1785 |
+
msgstr ""
|
1786 |
+
|
1787 |
#. Plugin Name of the plugin/theme
|
1788 |
msgid "Bulk Delete"
|
1789 |
msgstr ""
|
load-bulk-delete.php
ADDED
@@ -0,0 +1,116 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Load Bulk Delete plugin.
|
4 |
+
*
|
5 |
+
* We need this load code in a separate file since it requires namespace
|
6 |
+
* and using namespace in PHP 5.2 will generate a fatal error.
|
7 |
+
*
|
8 |
+
* @since 6.0.0
|
9 |
+
*/
|
10 |
+
use BulkWP\BulkDelete\BulkDeleteAutoloader;
|
11 |
+
use BulkWP\BulkDelete\Core\BulkDelete;
|
12 |
+
|
13 |
+
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Load Bulk Delete plugin.
|
17 |
+
*
|
18 |
+
* @since 6.0.0
|
19 |
+
*
|
20 |
+
* @param string $plugin_file Main plugin file.
|
21 |
+
*/
|
22 |
+
function bulk_delete_load( $plugin_file ) {
|
23 |
+
$plugin_dir = plugin_dir_path( $plugin_file );
|
24 |
+
|
25 |
+
// setup autoloader.
|
26 |
+
require_once 'include/BulkDeleteAutoloader.php';
|
27 |
+
|
28 |
+
$loader = new BulkDeleteAutoloader();
|
29 |
+
$loader->set_custom_mapping( bd_get_custom_class_map( $plugin_dir ) );
|
30 |
+
|
31 |
+
$loader->add_namespace( 'BulkWP\\BulkDelete\\', $plugin_dir . 'include' );
|
32 |
+
$loader->add_namespace( 'Sudar\\WPSystemInfo', $plugin_dir . 'vendor/sudar/wp-system-info/src/' );
|
33 |
+
|
34 |
+
$custom_include_files = bd_get_custom_include_files();
|
35 |
+
foreach ( $custom_include_files as $custom_include_file ) {
|
36 |
+
$loader->add_file( $plugin_dir . $custom_include_file );
|
37 |
+
}
|
38 |
+
|
39 |
+
$loader->register();
|
40 |
+
|
41 |
+
$plugin = BulkDelete::get_instance();
|
42 |
+
$plugin->set_plugin_file( $plugin_file );
|
43 |
+
$plugin->set_loader( $loader );
|
44 |
+
|
45 |
+
add_action( 'plugins_loaded', array( $plugin, 'load' ), 101 );
|
46 |
+
}
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Get class map of legacy classes.
|
50 |
+
*
|
51 |
+
* These classes don't have namespace and so can't be autoloaded automatically.
|
52 |
+
* This function would be eventually removed once all the classes are loaded.
|
53 |
+
*
|
54 |
+
* @since 6.0.0
|
55 |
+
*
|
56 |
+
* @param string $plugin_dir Path to plugin directory.
|
57 |
+
*
|
58 |
+
* @return array Class map.
|
59 |
+
*/
|
60 |
+
function bd_get_custom_class_map( $plugin_dir ) {
|
61 |
+
return array(
|
62 |
+
'BD_Base_Page' => $plugin_dir . 'include/base/class-bd-base-page.php',
|
63 |
+
'Bulk_Delete_Help_Screen' => $plugin_dir . 'include/ui/class-bulk-delete-help-screen.php',
|
64 |
+
'BD_License' => $plugin_dir . 'include/license/class-bd-license.php',
|
65 |
+
'BD_License_Handler' => $plugin_dir . 'include/license/class-bd-license-handler.php',
|
66 |
+
'BD_EDD_API_Wrapper' => $plugin_dir . 'include/license/class-bd-edd-api-wrapper.php',
|
67 |
+
'Bulk_Delete_Misc' => $plugin_dir . 'include/misc/class-bulk-delete-misc.php',
|
68 |
+
'Bulk_Delete_Jetpack_Contact_Form_Message' => $plugin_dir . 'include/misc/class-bulk-delete-jetpack-contact-form-messages.php',
|
69 |
+
'BD_Settings_Page' => $plugin_dir . 'include/settings/class-bd-settings-page.php',
|
70 |
+
'BD_Settings' => $plugin_dir . 'include/settings/class-bd-settings.php',
|
71 |
+
|
72 |
+
// Compatibility. Will be removed once compatibility is addressed.
|
73 |
+
'BD_Meta_Box_Module' => $plugin_dir . 'include/base/class-bd-meta-box-module.php', // Used in Bulk Delete Attachments Addon - v1.2.
|
74 |
+
'BD_Page' => $plugin_dir . 'include/base/class-bd-page.php', // Used in Bulk Delete Attachments Addon - v1.2.
|
75 |
+
|
76 |
+
'BD_Addon' => $plugin_dir . 'include/Deprecated/class-bd-addon.php', // Used in Bulk Delete Attachments Addon - v1.2.
|
77 |
+
'BD_Base_Addon' => $plugin_dir . 'include/Deprecated/class-bd-base-addon.php', // Used in Bulk Delete Attachments Addon - v1.2.
|
78 |
+
'BD_Scheduler_Addon' => $plugin_dir . 'include/Deprecated/class-bd-scheduler-addon.php', // Used in Scheduler for Deleting Attachments and Users by Meta Addon.
|
79 |
+
'Bulk_Delete_Users_By_User_Meta' => $plugin_dir . 'include/Deprecated/Bulk_Delete_Users_By_User_Meta.php', // Used in Scheduler for Deleting Users by User Meta Addon - v1.0.
|
80 |
+
|
81 |
+
// Deprecated classes.
|
82 |
+
'Bulk_Delete_Posts' => $plugin_dir . 'include/Deprecated/class-bulk-delete-posts.php',
|
83 |
+
'Bulk_Delete_Pages' => $plugin_dir . 'include/Deprecated/class-bulk-delete-pages.php',
|
84 |
+
'Bulk_Delete_Users' => $plugin_dir . 'include/Deprecated/class-bulk-delete-users.php',
|
85 |
+
'Bulk_Delete_Post_Meta' => $plugin_dir . 'include/Deprecated/class-bulk-delete-post-meta.php',
|
86 |
+
'Bulk_Delete_User_Meta' => $plugin_dir . 'include/Deprecated/class-bulk-delete-user-meta.php',
|
87 |
+
);
|
88 |
+
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Get the list of custom included files.
|
92 |
+
*
|
93 |
+
* These files will be autoloaded using the autoloader.
|
94 |
+
*
|
95 |
+
* @since 6.0.0
|
96 |
+
*
|
97 |
+
* @return array List of files.
|
98 |
+
*/
|
99 |
+
function bd_get_custom_include_files() {
|
100 |
+
return array(
|
101 |
+
'include/addons/addon-list.php',
|
102 |
+
'include/addons/util.php',
|
103 |
+
'include/compatibility/simple-login-log.php',
|
104 |
+
'include/compatibility/the-event-calendar.php',
|
105 |
+
'include/compatibility/woocommerce.php',
|
106 |
+
'include/compatibility/advanced-custom-fields-pro.php',
|
107 |
+
'include/helpers/common.php',
|
108 |
+
'include/helpers/addon.php',
|
109 |
+
'include/ui/form.php',
|
110 |
+
'include/ui/admin-ui.php',
|
111 |
+
'include/util/query.php',
|
112 |
+
'include/settings/setting-helpers.php',
|
113 |
+
'include/Deprecated/deprecated.php',
|
114 |
+
'include/Deprecated/support-old-addons.php',
|
115 |
+
);
|
116 |
+
}
|
readme.txt
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
=== Bulk Delete ===
|
2 |
-
Contributors: sudar
|
3 |
-
Tags: mass, bulk, delete, post,
|
4 |
-
Requires at least: 4.
|
5 |
-
Tested up to:
|
6 |
-
Stable tag:
|
7 |
|
8 |
Bulk delete posts, pages, users, attachments and meta fields based on different conditions and filters.
|
9 |
|
@@ -23,6 +23,7 @@ This Plugin supports the following bulk delete options for deleting posts
|
|
23 |
- Delete posts by tag
|
24 |
- Delete posts by custom taxonomy
|
25 |
- Delete posts by custom post type
|
|
|
26 |
- Delete posts by url
|
27 |
- Delete posts by custom field (Available as a [Pro addon](http://bulkwp.com/addons/bulk-delete-posts-by-custom-field/?utm_source=wprepo&utm_campaign=BulkDelete&utm_medium=readme&utm_content=bd-cf))
|
28 |
- Delete posts by title (Available as a [Pro addon](http://bulkwp.com/addons/bulk-delete-posts-by-title/?utm_source=wprepo&utm_campaign=BulkDelete&utm_medium=readme&utm_content=bd-ti))
|
@@ -130,6 +131,10 @@ The following are the popular pro addons that are available for purchase. The fu
|
|
130 |
- **Delete attachment** - Adds the ability to delete attachments [More details](http://bulkwp.com/addons/bulk-delete-attachments/?utm_source=wprepo&utm_campaign=BulkDelete&utm_medium=readme&utm_content=bd-at).
|
131 |
- **Delete Jetpack Contact Form Messages Pro** - Adds the ability to delete Jetpack Contact Form Messages based on filters and to schedule automatic deletion. [More details](http://bulkwp.com/addons/bulk-delete-jetpack-contact-form-messages/?utm_source=wprepo&utm_campaign=BulkDelete&utm_medium=readme&utm_content=bd-jcm).
|
132 |
|
|
|
|
|
|
|
|
|
133 |
### Development
|
134 |
|
135 |
The development of the Plugin happens over at [github][6]. If you want to contribute to the Plugin, fork the [project at github][6] and send me a pull request.
|
@@ -274,6 +279,29 @@ You can contact us by posting about it in our [support forum](http://bulkwp.com/
|
|
274 |
This Readme file was generated using <a href = 'http://sudarmuthu.com/wordpress/wp-readme'>wp-readme</a>, which generates readme files for WordPress Plugins.
|
275 |
== Changelog ==
|
276 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
277 |
= 2018-01-29 - v5.6.1 =
|
278 |
|
279 |
- New Features
|
@@ -292,405 +320,17 @@ This Readme file was generated using <a href = 'http://sudarmuthu.com/wordpress/
|
|
292 |
- Enhancements
|
293 |
- Now works in PHP version from 5.2 to 7.2
|
294 |
|
295 |
-
=
|
296 |
-
|
297 |
-
- Enhancements
|
298 |
-
- Improved the UI by removing all unnecessary sidebars.
|
299 |
-
|
300 |
-
= 2017-07-06 - v5.5.6 - (Dev time: 1 hour) =
|
301 |
-
|
302 |
-
- New Features
|
303 |
-
- Ability to delete users who have empty value in a user meta field.
|
304 |
-
|
305 |
-
- Enhancements
|
306 |
-
- Added custom taxonomies in System Info.
|
307 |
-
|
308 |
-
= 2017-01-28 - v5.5.5 - (Dev time: 1 hour) =
|
309 |
-
|
310 |
-
- Bug Fixes
|
311 |
-
- Fixed a bug that caused Jetpack messages to be not deleted properly.
|
312 |
-
|
313 |
-
= 2016-02-13 - v5.5.4 - (Dev time: 5 hours) =
|
314 |
-
|
315 |
-
- Bug Fixes
|
316 |
-
- Security fix that prevents non-privileged users from deleting posts.
|
317 |
-
|
318 |
-
- Enhancements
|
319 |
-
- Lot of code refactoring to improve quality.
|
320 |
-
|
321 |
-
= 2015-11-02 - v5.5.3 - (Dev time: 3 hours) =
|
322 |
-
- New Features
|
323 |
-
- Added the ability to delete users based on their registered date. (Issue #115)
|
324 |
-
|
325 |
-
- Enhancements
|
326 |
-
- Sanitize action post field before using it.
|
327 |
-
- Updated Screenshots that are linked in the readme.
|
328 |
-
|
329 |
-
- Bug Fixes
|
330 |
-
- Fixed a bug that caused a warning while updating addons. (Issue #113)
|
331 |
-
- Fixed typos and enhanced labels.
|
332 |
-
|
333 |
-
= 2015-10-05 - v5.5.2 (Dev time: 2 hours) =
|
334 |
-
- New Features
|
335 |
-
- Added the ability to delete users who have never logged in.
|
336 |
-
|
337 |
-
- Enhancements
|
338 |
-
- Added compatibility with "Advanced Custom Fields Pro" plugin.
|
339 |
-
|
340 |
-
- Bug Fixes
|
341 |
-
- Fixed issue in deleting posts by category
|
342 |
-
|
343 |
-
= 2015-08-15 - v5.5.1 (Dev time: 2.5 hours) =
|
344 |
-
- New Features
|
345 |
-
- Added actions that are executed before and after a query is executed.
|
346 |
-
- Added actions that are executed before and after scripts and styles are enqueued.
|
347 |
-
|
348 |
-
- Enhancements
|
349 |
-
- Added compatibility with "The Events Calendar" plugin.
|
350 |
-
- Added compatibility with "WooCommerce" plugin. (Issue #111)
|
351 |
-
- Display warning in the System Info page if certain required options are disabled. (Issue #106)
|
352 |
-
- Added information about "WP_CRON_LOCK_TIMEOUT" to System Info
|
353 |
-
|
354 |
-
= 2015-07-21 - v5.5 (Dev time: 50 hours) =
|
355 |
-
- New Features
|
356 |
-
- Added the ability to delete users based on user meta. (Issue #79)
|
357 |
-
- Improved the UI of dropdowns. (Issue #101)
|
358 |
-
- (Addon) Added the ability to delete attachments. (Issue #98)
|
359 |
-
|
360 |
-
- Enhancements
|
361 |
-
- Tweaked the code that generates the UI and lot of hidden improvements.
|
362 |
-
- Tweaked the code that retrieves Mysql version. (Issue #102)
|
363 |
-
- Tweaked the license handling code. (Issue #92)
|
364 |
-
- Tweaked the build process
|
365 |
-
- Use compressed JS and CSS files for better performance. (Issue #62)
|
366 |
-
|
367 |
-
= 2015-03-03 - v5.4.2 (Dev time: 5.0 hours) =
|
368 |
-
- Tweak: Improve performance of DB queries to prevent timeouts. (Issue #93)
|
369 |
-
- Tweak: Add details about different post types in system info. (Issue #100)
|
370 |
-
- Tweak: Add details about timezone settings in system info. (Issue #100)
|
371 |
-
|
372 |
-
= 2015-02-14 - v5.4.1 - (Dev time: 0.5 hours) =
|
373 |
-
- Tweak: Use Google CDN for jQuery UI CSS, instead of ASP.NET
|
374 |
-
|
375 |
-
= 2014-09-14 - v5.4 - (Dev time: 20 hours) =
|
376 |
-
- New: Added the ability to delete post meta fields (Issue #43)
|
377 |
-
- New: Added the ability to delete comment meta fields (Issue #70)
|
378 |
-
- New: Added the ability to delete user meta fields (Issue #87)
|
379 |
-
- New: (Addon) Added the ability to delete posts based on attachment
|
380 |
-
- New: Added the ability to hook into JavaScript message, date picker and validation (Issue 82, 83, 84)
|
381 |
-
- New: Prevent PHP from timing out while performing bulk operations(Issue #81)
|
382 |
-
|
383 |
-
- Tweak: Group memory related info together in system info output
|
384 |
-
- Tweak: Tweak the warning and error messages that are shown to the users
|
385 |
-
- Tweak: Remove hard dependency on "Bulk Delete From Trash" addon in code
|
386 |
-
- Tweak: Tweak the admin UI for WordPress 4.0 and added custom plugin icons
|
387 |
-
- Tweak: Tweak the code that handles automatic update of addons
|
388 |
-
|
389 |
-
= 2014-08-17 - v5.3 - (Dev time: 17 hours) =
|
390 |
-
- New: Ability to delete Jetpack Contact Form Messages (Issue #72)
|
391 |
-
- New: New Addon to send email whenever a Bulk WP Scheduler runs
|
392 |
-
- New: Settings screen for addons (Issue #78)
|
393 |
-
- New: Add setting helper functions for addons
|
394 |
-
|
395 |
-
- Tweak: Tweak the names of the menu items (Issue #73)
|
396 |
-
- Tweak: Add information about `DISABLE_WP_CRON` in system info
|
397 |
-
- Tweak: Tweak labels in Scheduled Jobs page (Issue #71)
|
398 |
-
- Tweak: Removed unused variable
|
399 |
-
- Tweak: Removed old compatibility code for `The Events Calendar` plugin
|
400 |
-
- Tweak: Add filters to extend menu items (Issue #74)
|
401 |
-
- Tweak: Add filters to extend meta boxes in each page (Issue #75)
|
402 |
-
- Tweak: Remove `upgraded from` from system info (Issue #77)
|
403 |
-
|
404 |
-
- Bug: Fixed a warning that happened because of duplicate call to `add_meta_boxes`
|
405 |
-
|
406 |
-
= 2014-07-03 - v5.2 - (Dev time: 8 hours) =
|
407 |
-
- New: Ability to delete users in batches (Issue #47)
|
408 |
-
- New: A new addon to delete posts based on users (Issue #6)
|
409 |
-
|
410 |
-
= 2014-06-14 - v5.1 - (Dev time: 8 hours) =
|
411 |
-
- New: Added the "Delete posts from trash" addon (Issue #65)
|
412 |
-
|
413 |
-
- Tweak: Added `EMPTY_TRASH_DAYS` to system info page (Issue #67)
|
414 |
-
- Tweak: Change the contextual help content for admin screens (Issue #68)
|
415 |
-
|
416 |
-
- Bug: Added compatibility for PHP version 5.2.4 (Issue #66)
|
417 |
-
- Bug: Fixed a bug in JavaScript validation in "Delete by URL" module (Issue #69)
|
418 |
-
|
419 |
-
= 2014-06-12 - v5.0.2 - (Dev time: 1 hours) =
|
420 |
-
- Bug: Added compatibility for PHP version 5.2.4 (Issue #64)
|
421 |
-
|
422 |
-
= 2014-06-10 - v5.0.1 - (Dev time: 1 hours) =
|
423 |
-
- Fix: Deleting users had as issue that was introduced in v5.0
|
424 |
-
|
425 |
-
= 2014-06-10 - v5.0 - (Dev time: 60 hours) =
|
426 |
-
- New: Add the ability to delete posts by duplicate title (#56)
|
427 |
-
- New: Add a new page that displays system information for debugging
|
428 |
-
- New: Add the ability to handle addon license
|
429 |
-
- New: Use `add_settings_error` method to display information to users
|
430 |
-
|
431 |
-
- Tweak: Make Bulk_Delete class singleton
|
432 |
-
- Tweak: Move all deprecated functions and code to a separate file
|
433 |
-
- Tweak: Add the ability to filter text displayed in admin footer
|
434 |
-
- Tweak: Change the menu text for Schedule page
|
435 |
-
- Tweak: Move delete page modules to a separate page
|
436 |
-
- Tweak: Refactored the way request was handled
|
437 |
-
- Tweak: Update screenshots
|
438 |
-
- Tweak: Handle expired license properly
|
439 |
-
|
440 |
-
= 2014-01-26 - v4.4.3 - (Dev time: 1.5 hours) =
|
441 |
-
- Tweak: Ability to delete posts from non-public post types as well
|
442 |
-
- Fix: Fix the height of the sidebar
|
443 |
-
|
444 |
-
= 2014-01-05 - v4.4.2 - (Dev time: 1.5 hours) =
|
445 |
-
- Tweak: Move request processing code for deleting by custom field to addon
|
446 |
-
- Fix: Deleting first x posts deletes all posts while deleting by category (#44)
|
447 |
-
- Fix: Posts are moved to trash even if "Delete permanently" option is selected (#45)
|
448 |
-
|
449 |
-
= 2013-12-18 - v4.4.1 - (Dev time: 0.5 hours) =
|
450 |
-
- Fix: Bulk Delete menu overrides other menus at the same position
|
451 |
-
|
452 |
-
= 2013-12-14 - v4.4 - (Dev time: 10 hours) =
|
453 |
-
- New: Ability to delete all published posts from "Post Status" module
|
454 |
-
- New: Ability to delete all sticky posts from "Post Status" module
|
455 |
-
- New: Ability to delete posts by title
|
456 |
-
- Tweak: Moved all option page to a separate top menu
|
457 |
-
- Tweak: Tweak UI for WordPress 3.8
|
458 |
-
- Fix: Fix undefined notices and strict warnings
|
459 |
-
|
460 |
-
= 2013-12-08 - v4.3 - (Dev time: 2 hours) =
|
461 |
-
- New: Ability to delete custom post type posts by categories
|
462 |
-
- New: Ability to delete custom post type posts by custom taxonomy
|
463 |
-
- Fix: Fix link to "Custom Field" Addon
|
464 |
-
|
465 |
-
= 2013-11-11 - v4.2.2 - (Dev time: 1 hour) =
|
466 |
-
- Fix: Bug in deleting custom post types with hypen
|
467 |
-
|
468 |
-
= 2013-11-07 - v4.2.1 - (Dev time: 0.5 hours) =
|
469 |
-
- Explicitly mark static methods as static
|
470 |
-
|
471 |
-
= 2013-10-22 - v4.2 - (Dev time: 3 hours) =
|
472 |
-
- Add the ability to custom post type posts by post status
|
473 |
-
|
474 |
-
= 2013-10-12 - v4.1 - (Dev time: 6 hours) =
|
475 |
-
- Add the "delete by custom field" pro addon
|
476 |
-
|
477 |
-
= 2013-10-07 - v4.0.2 - (Dev time: 1 hours) =
|
478 |
-
- Fix issue in displaying meta boxes
|
479 |
-
- Show taxonomy label instead of slug
|
480 |
-
- Fix issue in deleting posts by custom taxonomy
|
481 |
-
|
482 |
-
= 2013-09-12 - v4.0.1 - (Dev time: 1 hours) =
|
483 |
-
- Fix JavaScript bug that prevented deleting posts by days and in batches
|
484 |
-
|
485 |
-
= 2013-09-09 - v4.0 - (Dev time: 25 hours) =
|
486 |
-
- Add the ability to delete users
|
487 |
-
- Move menu items under tools
|
488 |
-
|
489 |
-
= 2013-07-07 - v3.6.0 - (Dev time: 2 hours) =
|
490 |
-
- Change minimum requirement to WordPress 3.3
|
491 |
-
- Fix compatibility issues with "The event calendar" Plugin
|
492 |
-
|
493 |
-
= 2013-06-01 - v3.5 - (Dev time: 10 hours) =
|
494 |
-
- Added support to delete custom post types
|
495 |
-
- Added Gujarati translations
|
496 |
-
- Ignore sticky posts when deleting drafts
|
497 |
-
|
498 |
-
= 2013-05-22 - v3.4 - (Dev time: 20 hours) =
|
499 |
-
* Incorporated Screen API to select/deselect different sections of the page
|
500 |
-
* Load only sections that are selected by the user
|
501 |
-
|
502 |
-
= 2013-05-11 - v3.3 - (Dev time: 10 hours) =
|
503 |
-
* Enhanced the deletion of posts using custom taxonomies
|
504 |
-
* Added the ability to schedule auto delete of taxonomies by date
|
505 |
-
* Cleaned up all messages that are shown to the user
|
506 |
-
* Added on screen help tab
|
507 |
-
|
508 |
-
= 2013-05-04 - v3.2 - (Dev time: 20 hours) =
|
509 |
-
* Added support for scheduling auto delete of pages
|
510 |
-
* Added support for scheduling auto delete of drafts
|
511 |
-
* Fixed issue in deleting post revisions
|
512 |
-
* Move post revisions to a separate section
|
513 |
-
* Better handling of post count to improve performance
|
514 |
-
* Moved pages to a separate section
|
515 |
-
* Added ability to delete pages in different status
|
516 |
-
* Added the option to schedule auto delete of tags by date
|
517 |
-
* Fixed a bug which was not allowing categories to be deleted based on date
|
518 |
-
|
519 |
-
= 2013-04-28 - v3.1 - (Dev time: 5 hours) =
|
520 |
-
* Added separate delete by sections for pages, drafts and urls
|
521 |
-
* Added the option to delete by date for drafts, revisions, future posts etc
|
522 |
-
* Added the option to delete by date for pages
|
523 |
-
|
524 |
-
= 2013-04-27 - v3.0 - (Dev time: 10 hours) =
|
525 |
-
* Added support for pro addons
|
526 |
-
* Added GUI to see cron jobs
|
527 |
-
|
528 |
-
= v2.2.2 (2012-12-20) (Dev time: 0.5 hour) =
|
529 |
-
* Removed unused wpdb->prepare() function calls
|
530 |
-
|
531 |
-
= v2.2.1 (2012-10-28) (Dev time: 0.5 hour) =
|
532 |
-
* Added Serbian translations
|
533 |
-
|
534 |
-
= v2.2 (2012-07-11) (Dev time: 0.5 hour) =
|
535 |
-
* Added Hindi translations
|
536 |
-
* Added checks to see if elements are present in the array before accessing them.
|
537 |
-
|
538 |
-
= v2.1 (2012-04-07) Dev Time: 1 hour =
|
539 |
-
* Fixed CSS issues in IE
|
540 |
-
* Added Lithuanian translations
|
541 |
-
|
542 |
-
= v2.0 (2012-04-01) Dev Time: 10 hours =
|
543 |
-
* Fixed a major issue in how dates were handled.
|
544 |
-
* Major UI revamp
|
545 |
-
* Added debug information and support urls
|
546 |
|
547 |
-
|
548 |
-
* Added support for deleting by permalink. Credit Martin Capodici
|
549 |
-
* Fixed issues with translations
|
550 |
-
* Added Russian translations
|
551 |
-
|
552 |
-
= v1.8 (2012-01-31) =
|
553 |
-
* Added roles and capabilities for menu
|
554 |
-
|
555 |
-
= v1.7 (2012-01-12) =
|
556 |
-
* Added Bulgarian translations
|
557 |
-
|
558 |
-
= v1.6 (2011-11-28) =
|
559 |
-
* Added Italian translations
|
560 |
-
|
561 |
-
= v1.5 (2011-11-13) =
|
562 |
-
* Added Spanish translations
|
563 |
-
|
564 |
-
= v1.4 (2011-08-25) =
|
565 |
-
* Added Turkish translations
|
566 |
-
|
567 |
-
= v1.3 (2011-05-11) =
|
568 |
-
* Added German translations
|
569 |
-
|
570 |
-
= v1.2 (2011-02-06) =
|
571 |
-
* Added some optimization to handle huge number of posts in underpowered servers
|
572 |
-
|
573 |
-
= v1.1 (2011-01-22) =
|
574 |
-
* Added support to delete posts by custom taxonomies
|
575 |
-
* Added Dutch Translation
|
576 |
-
* Added Brazilian Portuguese Translation
|
577 |
-
|
578 |
-
= v1.0 (2010-06-19) =
|
579 |
-
* Proper handling of limits.
|
580 |
-
|
581 |
-
= v0.8 (2010-03-17) =
|
582 |
-
* Added support for private posts.
|
583 |
-
|
584 |
-
= v0.7 (2010-02-21) =
|
585 |
-
* Added an option to delete posts directly or send them to trash.
|
586 |
-
* Added support for translation.
|
587 |
-
|
588 |
-
= v0.6 (2009-07-22) =
|
589 |
-
* Added option to delete all scheduled posts.
|
590 |
-
|
591 |
-
= v0.5 (2009-07-21) =
|
592 |
-
* Added option to delete all pending posts.
|
593 |
-
|
594 |
-
= v0.4 (2009-07-05) =
|
595 |
-
* Added option to delete by date.
|
596 |
-
|
597 |
-
= v0.3 (2009-04-05) =
|
598 |
-
* Prevented drafts from deleted when only posts are selected
|
599 |
-
|
600 |
-
= v0.2 (2009-02-03) =
|
601 |
-
* Fixed issues with paging
|
602 |
-
|
603 |
-
= v0.1 (2009-02-02) =
|
604 |
-
* First version
|
605 |
|
606 |
== Upgrade Notice ==
|
607 |
|
|
|
|
|
|
|
608 |
= 5.6.1 =
|
609 |
Added the ability to delete users based on partial user meta values.
|
610 |
|
611 |
= 5.6.0 =
|
612 |
Added the ability to delete posts based on custom post status
|
613 |
-
|
614 |
-
= 5.5.7 =
|
615 |
-
Improved the UI by removing all unnecessary sidebars.
|
616 |
-
|
617 |
-
= 5.5.5 =
|
618 |
-
Fixed a bug that caused Jetpack messages to be not deleted properly
|
619 |
-
|
620 |
-
= 5.5.4 =
|
621 |
-
Fixed a security bug that allowed non-privileged users to delete posts
|
622 |
-
|
623 |
-
= 5.5.3 =
|
624 |
-
Added the ability to delete users based on registration date
|
625 |
-
|
626 |
-
= 5.5.2 =
|
627 |
-
Added the ability to delete users who have never logged in
|
628 |
-
|
629 |
-
= 5.5.1 =
|
630 |
-
Fixed compatibility issues with WooCommerce and The Event Calendar plugins
|
631 |
-
|
632 |
-
= 5.5 =
|
633 |
-
Added the ability to delete users based on user meta and lot of UI improvement
|
634 |
-
|
635 |
-
= 5.4.1 =
|
636 |
-
Changed jQuery UI CSS CDN to Google CDN from ASP.NET, which seems to be discontinued
|
637 |
-
|
638 |
-
= 5.4 =
|
639 |
-
Ability to delete post, comment and user meta fields
|
640 |
-
|
641 |
-
= 5.3 =
|
642 |
-
Ability to delete Jetpack Contact Form messages
|
643 |
-
|
644 |
-
= 5.2 =
|
645 |
-
Ability to delete users in batches and a new addon to delete posts based on users
|
646 |
-
|
647 |
-
= 5.1 =
|
648 |
-
Added the ability to delete posts and pages from trash
|
649 |
-
|
650 |
-
= 5.0.2 =
|
651 |
-
Added compatibility for PHP version 5.2.4
|
652 |
-
|
653 |
-
= 5.0.1 =
|
654 |
-
Fix delete users. Note: This version is only compatible with addons above v0.5
|
655 |
-
|
656 |
-
= 5.0 =
|
657 |
-
This version is only compatible with addons above v0.5
|
658 |
-
|
659 |
-
= 4.4.1 =
|
660 |
-
Fix: Prevent Bulk Delete from overriding other menus
|
661 |
-
|
662 |
-
= 4.2.2 =
|
663 |
-
Fix: Bug in deleting custom post types with hypen
|
664 |
-
|
665 |
-
= 4.2.1 =
|
666 |
-
Fix warning message in PHP 5.2.x
|
667 |
-
|
668 |
-
= 4.2 =
|
669 |
-
Add the ability to custom post type posts by post status
|
670 |
-
|
671 |
-
= 4.0.2 =
|
672 |
-
Fixed issue in deleting posts by custom taxonomy
|
673 |
-
|
674 |
-
= 4.0.1 =
|
675 |
-
Fixed JS bug that was introduced in v4.0
|
676 |
-
|
677 |
-
= 4.0 =
|
678 |
-
Add the ability to delete users
|
679 |
-
|
680 |
-
= 3.6.0 =
|
681 |
-
Fix compatibility issues with "The event calendar" Plugin
|
682 |
-
|
683 |
-
= 3.5 =
|
684 |
-
Added the ability to delete posts by custom post types.
|
685 |
-
|
686 |
-
= 3.4 =
|
687 |
-
Added the ability to disable different sections of the Plugin.
|
688 |
-
|
689 |
-
= 3.3 =
|
690 |
-
Fixed issues in deleting posts using custom taxonomy
|
691 |
-
|
692 |
-
= 3.2 =
|
693 |
-
Fixed bugs in handling post revisions and dates in categories. Added more options to delete pages.
|
694 |
-
|
695 |
-
= 3.1 =
|
696 |
-
Added the option to delete by date for pages, drafts, revisions, future posts etc
|
1 |
=== Bulk Delete ===
|
2 |
+
Contributors: bulkwp, sudar
|
3 |
+
Tags: mass, bulk, delete, post, user, meta fields, draft
|
4 |
+
Requires at least: 4.4
|
5 |
+
Tested up to: 5.1
|
6 |
+
Stable tag: 6.0.0
|
7 |
|
8 |
Bulk delete posts, pages, users, attachments and meta fields based on different conditions and filters.
|
9 |
|
23 |
- Delete posts by tag
|
24 |
- Delete posts by custom taxonomy
|
25 |
- Delete posts by custom post type
|
26 |
+
- Delete posts by comment count
|
27 |
- Delete posts by url
|
28 |
- Delete posts by custom field (Available as a [Pro addon](http://bulkwp.com/addons/bulk-delete-posts-by-custom-field/?utm_source=wprepo&utm_campaign=BulkDelete&utm_medium=readme&utm_content=bd-cf))
|
29 |
- Delete posts by title (Available as a [Pro addon](http://bulkwp.com/addons/bulk-delete-posts-by-title/?utm_source=wprepo&utm_campaign=BulkDelete&utm_medium=readme&utm_content=bd-ti))
|
131 |
- **Delete attachment** - Adds the ability to delete attachments [More details](http://bulkwp.com/addons/bulk-delete-attachments/?utm_source=wprepo&utm_campaign=BulkDelete&utm_medium=readme&utm_content=bd-at).
|
132 |
- **Delete Jetpack Contact Form Messages Pro** - Adds the ability to delete Jetpack Contact Form Messages based on filters and to schedule automatic deletion. [More details](http://bulkwp.com/addons/bulk-delete-jetpack-contact-form-messages/?utm_source=wprepo&utm_campaign=BulkDelete&utm_medium=readme&utm_content=bd-jcm).
|
133 |
|
134 |
+
### PHP Support
|
135 |
+
|
136 |
+
Fully compatible with PHP v5.3 to v7.3
|
137 |
+
|
138 |
### Development
|
139 |
|
140 |
The development of the Plugin happens over at [github][6]. If you want to contribute to the Plugin, fork the [project at github][6] and send me a pull request.
|
279 |
This Readme file was generated using <a href = 'http://sudarmuthu.com/wordpress/wp-readme'>wp-readme</a>, which generates readme files for WordPress Plugins.
|
280 |
== Changelog ==
|
281 |
|
282 |
+
= 2019-02-22 - v6.0.0 (10th Anniversary release) =
|
283 |
+
|
284 |
+
New Features:
|
285 |
+
|
286 |
+
- Added the ability to delete taxonomy terms based on name.
|
287 |
+
- Added the ability to delete taxonomy terms based on post count.
|
288 |
+
- Added the ability to delete posts based on comment count.
|
289 |
+
- Added the ability to delete users who don't belong to any role (no role).
|
290 |
+
- Added the ability to reassign posts of a user who is going to be deleted to another user before deletion.
|
291 |
+
- Added the ability to unstick sticky posts.
|
292 |
+
- Added support for custom post status.
|
293 |
+
- Added the ability to delete comment meta based on both meta key and value.
|
294 |
+
- Complete rewrite of the way deletion is handled to improve performance.
|
295 |
+
|
296 |
+
Enhancements:
|
297 |
+
|
298 |
+
- Load all 3rd party library js and css locally and not from CDN. The plugin can work fully in offline mode.
|
299 |
+
- Introduced a filter to exclude certain posts or users from getting deleted.
|
300 |
+
- Display schedule label instead of slug in scheduled jobs list table.
|
301 |
+
- Lot of UI/UX improvements.
|
302 |
+
- Fully compatible with from PHP 5.3 to 7.3.
|
303 |
+
- Fully compatible with Gutenberg.
|
304 |
+
|
305 |
= 2018-01-29 - v5.6.1 =
|
306 |
|
307 |
- New Features
|
320 |
- Enhancements
|
321 |
- Now works in PHP version from 5.2 to 7.2
|
322 |
|
323 |
+
= Old Releases =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
324 |
|
325 |
+
We have made more than 50 releases in the last 10 years. You can read the changelog of all the old releases at https://bulkwp.com/bulk-delete-changelog/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
326 |
|
327 |
== Upgrade Notice ==
|
328 |
|
329 |
+
= 6.0.0 =
|
330 |
+
Added the ability to delete taxonomy terms and lot of new features.
|
331 |
+
|
332 |
= 5.6.1 =
|
333 |
Added the ability to delete users based on partial user meta values.
|
334 |
|
335 |
= 5.6.0 =
|
336 |
Added the ability to delete posts based on custom post status
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/sudar/wp-system-info/LICENSE
ADDED
@@ -0,0 +1,339 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
GNU GENERAL PUBLIC LICENSE
|
2 |
+
Version 2, June 1991
|
3 |
+
|
4 |
+
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
5 |
+
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
6 |
+
Everyone is permitted to copy and distribute verbatim copies
|
7 |
+
of this license document, but changing it is not allowed.
|
8 |
+
|
9 |
+
Preamble
|
10 |
+
|
11 |
+
The licenses for most software are designed to take away your
|
12 |
+
freedom to share and change it. By contrast, the GNU General Public
|
13 |
+
License is intended to guarantee your freedom to share and change free
|
14 |
+
software--to make sure the software is free for all its users. This
|
15 |
+
General Public License applies to most of the Free Software
|
16 |
+
Foundation's software and to any other program whose authors commit to
|
17 |
+
using it. (Some other Free Software Foundation software is covered by
|
18 |
+
the GNU Lesser General Public License instead.) You can apply it to
|
19 |
+
your programs, too.
|
20 |
+
|
21 |
+
When we speak of free software, we are referring to freedom, not
|
22 |
+
price. Our General Public Licenses are designed to make sure that you
|
23 |
+
have the freedom to distribute copies of free software (and charge for
|
24 |
+
this service if you wish), that you receive source code or can get it
|
25 |
+
if you want it, that you can change the software or use pieces of it
|
26 |
+
in new free programs; and that you know you can do these things.
|
27 |
+
|
28 |
+
To protect your rights, we need to make restrictions that forbid
|
29 |
+
anyone to deny you these rights or to ask you to surrender the rights.
|
30 |
+
These restrictions translate to certain responsibilities for you if you
|
31 |
+
distribute copies of the software, or if you modify it.
|
32 |
+
|
33 |
+
For example, if you distribute copies of such a program, whether
|
34 |
+
gratis or for a fee, you must give the recipients all the rights that
|
35 |
+
you have. You must make sure that they, too, receive or can get the
|
36 |
+
source code. And you must show them these terms so they know their
|
37 |
+
rights.
|
38 |
+
|
39 |
+
We protect your rights with two steps: (1) copyright the software, and
|
40 |
+
(2) offer you this license which gives you legal permission to copy,
|
41 |
+
distribute and/or modify the software.
|
42 |
+
|
43 |
+
Also, for each author's protection and ours, we want to make certain
|
44 |
+
that everyone understands that there is no warranty for this free
|
45 |
+
software. If the software is modified by someone else and passed on, we
|
46 |
+
want its recipients to know that what they have is not the original, so
|
47 |
+
that any problems introduced by others will not reflect on the original
|
48 |
+
authors' reputations.
|
49 |
+
|
50 |
+
Finally, any free program is threatened constantly by software
|
51 |
+
patents. We wish to avoid the danger that redistributors of a free
|
52 |
+
program will individually obtain patent licenses, in effect making the
|
53 |
+
program proprietary. To prevent this, we have made it clear that any
|
54 |
+
patent must be licensed for everyone's free use or not licensed at all.
|
55 |
+
|
56 |
+
The precise terms and conditions for copying, distribution and
|
57 |
+
modification follow.
|
58 |
+
|
59 |
+
GNU GENERAL PUBLIC LICENSE
|
60 |
+
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
61 |
+
|
62 |
+
0. This License applies to any program or other work which contains
|
63 |
+
a notice placed by the copyright holder saying it may be distributed
|
64 |
+
under the terms of this General Public License. The "Program", below,
|
65 |
+
refers to any such program or work, and a "work based on the Program"
|
66 |
+
means either the Program or any derivative work under copyright law:
|
67 |
+
that is to say, a work containing the Program or a portion of it,
|
68 |
+
either verbatim or with modifications and/or translated into another
|
69 |
+
language. (Hereinafter, translation is included without limitation in
|
70 |
+
the term "modification".) Each licensee is addressed as "you".
|
71 |
+
|
72 |
+
Activities other than copying, distribution and modification are not
|
73 |
+
covered by this License; they are outside its scope. The act of
|
74 |
+
running the Program is not restricted, and the output from the Program
|
75 |
+
is covered only if its contents constitute a work based on the
|
76 |
+
Program (independent of having been made by running the Program).
|
77 |
+
Whether that is true depends on what the Program does.
|
78 |
+
|
79 |
+
1. You may copy and distribute verbatim copies of the Program's
|
80 |
+
source code as you receive it, in any medium, provided that you
|
81 |
+
conspicuously and appropriately publish on each copy an appropriate
|
82 |
+
copyright notice and disclaimer of warranty; keep intact all the
|
83 |
+
notices that refer to this License and to the absence of any warranty;
|
84 |
+
and give any other recipients of the Program a copy of this License
|
85 |
+
along with the Program.
|
86 |
+
|
87 |
+
You may charge a fee for the physical act of transferring a copy, and
|
88 |
+
you may at your option offer warranty protection in exchange for a fee.
|
89 |
+
|
90 |
+
2. You may modify your copy or copies of the Program or any portion
|
91 |
+
of it, thus forming a work based on the Program, and copy and
|
92 |
+
distribute such modifications or work under the terms of Section 1
|
93 |
+
above, provided that you also meet all of these conditions:
|
94 |
+
|
95 |
+
a) You must cause the modified files to carry prominent notices
|
96 |
+
stating that you changed the files and the date of any change.
|
97 |
+
|
98 |
+
b) You must cause any work that you distribute or publish, that in
|
99 |
+
whole or in part contains or is derived from the Program or any
|
100 |
+
part thereof, to be licensed as a whole at no charge to all third
|
101 |
+
parties under the terms of this License.
|
102 |
+
|
103 |
+
c) If the modified program normally reads commands interactively
|
104 |
+
when run, you must cause it, when started running for such
|
105 |
+
interactive use in the most ordinary way, to print or display an
|
106 |
+
announcement including an appropriate copyright notice and a
|
107 |
+
notice that there is no warranty (or else, saying that you provide
|
108 |
+
a warranty) and that users may redistribute the program under
|
109 |
+
these conditions, and telling the user how to view a copy of this
|
110 |
+
License. (Exception: if the Program itself is interactive but
|
111 |
+
does not normally print such an announcement, your work based on
|
112 |
+
the Program is not required to print an announcement.)
|
113 |
+
|
114 |
+
These requirements apply to the modified work as a whole. If
|
115 |
+
identifiable sections of that work are not derived from the Program,
|
116 |
+
and can be reasonably considered independent and separate works in
|
117 |
+
themselves, then this License, and its terms, do not apply to those
|
118 |
+
sections when you distribute them as separate works. But when you
|
119 |
+
distribute the same sections as part of a whole which is a work based
|
120 |
+
on the Program, the distribution of the whole must be on the terms of
|
121 |
+
this License, whose permissions for other licensees extend to the
|
122 |
+
entire whole, and thus to each and every part regardless of who wrote it.
|
123 |
+
|
124 |
+
Thus, it is not the intent of this section to claim rights or contest
|
125 |
+
your rights to work written entirely by you; rather, the intent is to
|
126 |
+
exercise the right to control the distribution of derivative or
|
127 |
+
collective works based on the Program.
|
128 |
+
|
129 |
+
In addition, mere aggregation of another work not based on the Program
|
130 |
+
with the Program (or with a work based on the Program) on a volume of
|
131 |
+
a storage or distribution medium does not bring the other work under
|
132 |
+
the scope of this License.
|
133 |
+
|
134 |
+
3. You may copy and distribute the Program (or a work based on it,
|
135 |
+
under Section 2) in object code or executable form under the terms of
|
136 |
+
Sections 1 and 2 above provided that you also do one of the following:
|
137 |
+
|
138 |
+
a) Accompany it with the complete corresponding machine-readable
|
139 |
+
source code, which must be distributed under the terms of Sections
|
140 |
+
1 and 2 above on a medium customarily used for software interchange; or,
|
141 |
+
|
142 |
+
b) Accompany it with a written offer, valid for at least three
|
143 |
+
years, to give any third party, for a charge no more than your
|
144 |
+
cost of physically performing source distribution, a complete
|
145 |
+
machine-readable copy of the corresponding source code, to be
|
146 |
+
distributed under the terms of Sections 1 and 2 above on a medium
|
147 |
+
customarily used for software interchange; or,
|
148 |
+
|
149 |
+
c) Accompany it with the information you received as to the offer
|
150 |
+
to distribute corresponding source code. (This alternative is
|
151 |
+
allowed only for noncommercial distribution and only if you
|
152 |
+
received the program in object code or executable form with such
|
153 |
+
an offer, in accord with Subsection b above.)
|
154 |
+
|
155 |
+
The source code for a work means the preferred form of the work for
|
156 |
+
making modifications to it. For an executable work, complete source
|
157 |
+
code means all the source code for all modules it contains, plus any
|
158 |
+
associated interface definition files, plus the scripts used to
|
159 |
+
control compilation and installation of the executable. However, as a
|
160 |
+
special exception, the source code distributed need not include
|
161 |
+
anything that is normally distributed (in either source or binary
|
162 |
+
form) with the major components (compiler, kernel, and so on) of the
|
163 |
+
operating system on which the executable runs, unless that component
|
164 |
+
itself accompanies the executable.
|
165 |
+
|
166 |
+
If distribution of executable or object code is made by offering
|
167 |
+
access to copy from a designated place, then offering equivalent
|
168 |
+
access to copy the source code from the same place counts as
|
169 |
+
distribution of the source code, even though third parties are not
|
170 |
+
compelled to copy the source along with the object code.
|
171 |
+
|
172 |
+
4. You may not copy, modify, sublicense, or distribute the Program
|
173 |
+
except as expressly provided under this License. Any attempt
|
174 |
+
otherwise to copy, modify, sublicense or distribute the Program is
|
175 |
+
void, and will automatically terminate your rights under this License.
|
176 |
+
However, parties who have received copies, or rights, from you under
|
177 |
+
this License will not have their licenses terminated so long as such
|
178 |
+
parties remain in full compliance.
|
179 |
+
|
180 |
+
5. You are not required to accept this License, since you have not
|
181 |
+
signed it. However, nothing else grants you permission to modify or
|
182 |
+
distribute the Program or its derivative works. These actions are
|
183 |
+
prohibited by law if you do not accept this License. Therefore, by
|
184 |
+
modifying or distributing the Program (or any work based on the
|
185 |
+
Program), you indicate your acceptance of this License to do so, and
|
186 |
+
all its terms and conditions for copying, distributing or modifying
|
187 |
+
the Program or works based on it.
|
188 |
+
|
189 |
+
6. Each time you redistribute the Program (or any work based on the
|
190 |
+
Program), the recipient automatically receives a license from the
|
191 |
+
original licensor to copy, distribute or modify the Program subject to
|
192 |
+
these terms and conditions. You may not impose any further
|
193 |
+
restrictions on the recipients' exercise of the rights granted herein.
|
194 |
+
You are not responsible for enforcing compliance by third parties to
|
195 |
+
this License.
|
196 |
+
|
197 |
+
7. If, as a consequence of a court judgment or allegation of patent
|
198 |
+
infringement or for any other reason (not limited to patent issues),
|
199 |
+
conditions are imposed on you (whether by court order, agreement or
|
200 |
+
otherwise) that contradict the conditions of this License, they do not
|
201 |
+
excuse you from the conditions of this License. If you cannot
|
202 |
+
distribute so as to satisfy simultaneously your obligations under this
|
203 |
+
License and any other pertinent obligations, then as a consequence you
|
204 |
+
may not distribute the Program at all. For example, if a patent
|
205 |
+
license would not permit royalty-free redistribution of the Program by
|
206 |
+
all those who receive copies directly or indirectly through you, then
|
207 |
+
the only way you could satisfy both it and this License would be to
|
208 |
+
refrain entirely from distribution of the Program.
|
209 |
+
|
210 |
+
If any portion of this section is held invalid or unenforceable under
|
211 |
+
any particular circumstance, the balance of the section is intended to
|
212 |
+
apply and the section as a whole is intended to apply in other
|
213 |
+
circumstances.
|
214 |
+
|
215 |
+
It is not the purpose of this section to induce you to infringe any
|
216 |
+
patents or other property right claims or to contest validity of any
|
217 |
+
such claims; this section has the sole purpose of protecting the
|
218 |
+
integrity of the free software distribution system, which is
|
219 |
+
implemented by public license practices. Many people have made
|
220 |
+
generous contributions to the wide range of software distributed
|
221 |
+
through that system in reliance on consistent application of that
|
222 |
+
system; it is up to the author/donor to decide if he or she is willing
|
223 |
+
to distribute software through any other system and a licensee cannot
|
224 |
+
impose that choice.
|
225 |
+
|
226 |
+
This section is intended to make thoroughly clear what is believed to
|
227 |
+
be a consequence of the rest of this License.
|
228 |
+
|
229 |
+
8. If the distribution and/or use of the Program is restricted in
|
230 |
+
certain countries either by patents or by copyrighted interfaces, the
|
231 |
+
original copyright holder who places the Program under this License
|
232 |
+
may add an explicit geographical distribution limitation excluding
|
233 |
+
those countries, so that distribution is permitted only in or among
|
234 |
+
countries not thus excluded. In such case, this License incorporates
|
235 |
+
the limitation as if written in the body of this License.
|
236 |
+
|
237 |
+
9. The Free Software Foundation may publish revised and/or new versions
|
238 |
+
of the General Public License from time to time. Such new versions will
|
239 |
+
be similar in spirit to the present version, but may differ in detail to
|
240 |
+
address new problems or concerns.
|
241 |
+
|
242 |
+
Each version is given a distinguishing version number. If the Program
|
243 |
+
specifies a version number of this License which applies to it and "any
|
244 |
+
later version", you have the option of following the terms and conditions
|
245 |
+
either of that version or of any later version published by the Free
|
246 |
+
Software Foundation. If the Program does not specify a version number of
|
247 |
+
this License, you may choose any version ever published by the Free Software
|
248 |
+
Foundation.
|
249 |
+
|
250 |
+
10. If you wish to incorporate parts of the Program into other free
|
251 |
+
programs whose distribution conditions are different, write to the author
|
252 |
+
to ask for permission. For software which is copyrighted by the Free
|
253 |
+
Software Foundation, write to the Free Software Foundation; we sometimes
|
254 |
+
make exceptions for this. Our decision will be guided by the two goals
|
255 |
+
of preserving the free status of all derivatives of our free software and
|
256 |
+
of promoting the sharing and reuse of software generally.
|
257 |
+
|
258 |
+
NO WARRANTY
|
259 |
+
|
260 |
+
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
261 |
+
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
262 |
+
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
263 |
+
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
264 |
+
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
265 |
+
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
266 |
+
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
267 |
+
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
268 |
+
REPAIR OR CORRECTION.
|
269 |
+
|
270 |
+
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
271 |
+
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
272 |
+
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
273 |
+
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
274 |
+
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
275 |
+
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
276 |
+
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
277 |
+
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
278 |
+
POSSIBILITY OF SUCH DAMAGES.
|
279 |
+
|
280 |
+
END OF TERMS AND CONDITIONS
|
281 |
+
|
282 |
+
How to Apply These Terms to Your New Programs
|
283 |
+
|
284 |
+
If you develop a new program, and you want it to be of the greatest
|
285 |
+
possible use to the public, the best way to achieve this is to make it
|
286 |
+
free software which everyone can redistribute and change under these terms.
|
287 |
+
|
288 |
+
To do so, attach the following notices to the program. It is safest
|
289 |
+
to attach them to the start of each source file to most effectively
|
290 |
+
convey the exclusion of warranty; and each file should have at least
|
291 |
+
the "copyright" line and a pointer to where the full notice is found.
|
292 |
+
|
293 |
+
<one line to give the program's name and a brief idea of what it does.>
|
294 |
+
Copyright (C) <year> <name of author>
|
295 |
+
|
296 |
+
This program is free software; you can redistribute it and/or modify
|
297 |
+
it under the terms of the GNU General Public License as published by
|
298 |
+
the Free Software Foundation; either version 2 of the License, or
|
299 |
+
(at your option) any later version.
|
300 |
+
|
301 |
+
This program is distributed in the hope that it will be useful,
|
302 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
303 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
304 |
+
GNU General Public License for more details.
|
305 |
+
|
306 |
+
You should have received a copy of the GNU General Public License along
|
307 |
+
with this program; if not, write to the Free Software Foundation, Inc.,
|
308 |
+
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
309 |
+
|
310 |
+
Also add information on how to contact you by electronic and paper mail.
|
311 |
+
|
312 |
+
If the program is interactive, make it output a short notice like this
|
313 |
+
when it starts in an interactive mode:
|
314 |
+
|
315 |
+
Gnomovision version 69, Copyright (C) year name of author
|
316 |
+
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
317 |
+
This is free software, and you are welcome to redistribute it
|
318 |
+
under certain conditions; type `show c' for details.
|
319 |
+
|
320 |
+
The hypothetical commands `show w' and `show c' should show the appropriate
|
321 |
+
parts of the General Public License. Of course, the commands you use may
|
322 |
+
be called something other than `show w' and `show c'; they could even be
|
323 |
+
mouse-clicks or menu items--whatever suits your program.
|
324 |
+
|
325 |
+
You should also get your employer (if you work as a programmer) or your
|
326 |
+
school, if any, to sign a "copyright disclaimer" for the program, if
|
327 |
+
necessary. Here is a sample; alter the names:
|
328 |
+
|
329 |
+
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
330 |
+
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
331 |
+
|
332 |
+
<signature of Ty Coon>, 1 April 1989
|
333 |
+
Ty Coon, President of Vice
|
334 |
+
|
335 |
+
This General Public License does not permit incorporating your program into
|
336 |
+
proprietary programs. If your program is a subroutine library, you may
|
337 |
+
consider it more useful to permit linking proprietary applications with the
|
338 |
+
library. If this is what you want to do, use the GNU Lesser General
|
339 |
+
Public License instead of this License.
|
vendor/sudar/wp-system-info/README.md
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
# wp-system-info
|
2 |
+
A WordPress library that adds System Info to WordPress plugins
|
vendor/sudar/wp-system-info/composer.json
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name": "sudar/wp-system-info",
|
3 |
+
"description": "A WordPress library that adds System Info to WordPress plugins",
|
4 |
+
"type": "library",
|
5 |
+
"license": "GPL-2.0-or-later",
|
6 |
+
"authors": [
|
7 |
+
{
|
8 |
+
"name": "Sudar Muthu",
|
9 |
+
"homepage": "https://sudarmuthu.com"
|
10 |
+
}
|
11 |
+
],
|
12 |
+
"support": {
|
13 |
+
"issues": "https://github.com/sudar/wp-system-info/issues"
|
14 |
+
},
|
15 |
+
"require": {
|
16 |
+
"php": ">=5.3"
|
17 |
+
},
|
18 |
+
"autoload": {
|
19 |
+
"psr-4": {
|
20 |
+
"Sudar\\WPSystemInfo\\": "src/"
|
21 |
+
}
|
22 |
+
}
|
23 |
+
}
|
vendor/sudar/wp-system-info/src/SystemInfo.php
ADDED
@@ -0,0 +1,407 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Library to show and generate System Info file for WordPress plugins.
|
4 |
+
*
|
5 |
+
* Greatly inspired (and shares code) from the system info component in Easy Digital Downloads plugin.
|
6 |
+
* https://github.com/easydigitaldownloads/easy-digital-downloads
|
7 |
+
*
|
8 |
+
* @license GPL-2.0+
|
9 |
+
* @author Sudar (https://sudarmuthu.com)
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Sudar\WPSystemInfo;
|
13 |
+
|
14 |
+
if ( class_exists( 'Sudar\\WPSystemInfo\\SystemInfo' ) ) {
|
15 |
+
return;
|
16 |
+
}
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Shows and generates the System Info file.
|
20 |
+
*
|
21 |
+
* @since 1.0.0
|
22 |
+
*/
|
23 |
+
class SystemInfo {
|
24 |
+
/**
|
25 |
+
* Plugin slug.
|
26 |
+
*
|
27 |
+
* @var string
|
28 |
+
*/
|
29 |
+
protected $plugin_slug = '';
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Config that controls which sections should be displayed.
|
33 |
+
*
|
34 |
+
* @var array
|
35 |
+
*/
|
36 |
+
protected $config = array();
|
37 |
+
|
38 |
+
/**
|
39 |
+
* SystemInfo constructor.
|
40 |
+
*
|
41 |
+
* @param string $plugin_slug Slug of the plugin.
|
42 |
+
* @param array $config (Optional) Configuration options.
|
43 |
+
*
|
44 |
+
* @see SystemInfo::get_default_config for the list of default config information.
|
45 |
+
*/
|
46 |
+
public function __construct( $plugin_slug, $config = array() ) {
|
47 |
+
$this->plugin_slug = $plugin_slug;
|
48 |
+
$this->config = wp_parse_args( $config, $this->get_default_config() );
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Get Default configuration.
|
53 |
+
*
|
54 |
+
* @return array Default configuration.
|
55 |
+
*/
|
56 |
+
protected function get_default_config() {
|
57 |
+
return array(
|
58 |
+
'show_post_types' => true,
|
59 |
+
'show_taxonomies' => true,
|
60 |
+
'show_users' => true,
|
61 |
+
'show_plugins' => true,
|
62 |
+
'show_network_plugins' => true,
|
63 |
+
'show_session_details' => false,
|
64 |
+
);
|
65 |
+
}
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Render system info.
|
69 |
+
*
|
70 |
+
* PHPCS is disabled for this function since alignment will mess up the system info output.
|
71 |
+
* phpcs:disable
|
72 |
+
*/
|
73 |
+
public function render() {
|
74 |
+
global $wpdb;
|
75 |
+
?>
|
76 |
+
|
77 |
+
<textarea wrap="off" readonly="readonly" name="<?php echo esc_attr( $this->plugin_slug ); ?>-system-info"
|
78 |
+
style="font-family:Menlo,Monaco,monospace; white-space:pre; width:100%; height:500px;" onclick="this.focus();this.select()"
|
79 |
+
title="<?php _e( 'To copy the system info, click below then press Ctrl + C (PC) or Cmd + C (Mac).', 'email-log' ); ?>">
|
80 |
+
### Begin System Info (Generated at <?php echo current_time( 'Y-m-d H:i:s', true ); ?>) ###
|
81 |
+
|
82 |
+
<?php
|
83 |
+
/**
|
84 |
+
* Runs before displaying system info.
|
85 |
+
*
|
86 |
+
* This action is primarily for adding extra content in System Info.
|
87 |
+
*
|
88 |
+
* @since 1.0.0
|
89 |
+
*
|
90 |
+
* @param string $plugin_name Plugin slug.
|
91 |
+
*/
|
92 |
+
do_action( 'before_system_info', $this->plugin_slug );
|
93 |
+
do_action( "before_system_info_for_{$this->plugin_slug}" );
|
94 |
+
?>
|
95 |
+
-- Site Info --
|
96 |
+
|
97 |
+
Site URL: <?php echo site_url() . "\n"; ?>
|
98 |
+
Home URL: <?php echo home_url() . "\n"; ?>
|
99 |
+
Multisite: <?php echo is_multisite() ? 'Yes' . "\n" : 'No' . "\n"; ?>
|
100 |
+
Active Theme: <?php echo $this->get_current_theme_name() . "\n"; ?>
|
101 |
+
|
102 |
+
-- WordPress Configuration --
|
103 |
+
|
104 |
+
Version: <?php echo get_bloginfo( 'version' ) . "\n"; ?>
|
105 |
+
Language: <?php echo get_locale() . "\n"; ?>
|
106 |
+
Permalink Structure: <?php echo get_option( 'permalink_structure' ) . "\n"; ?>
|
107 |
+
WP Table Prefix: <?php echo $wpdb->prefix, "\n"; ?>
|
108 |
+
GMT Offset: <?php echo esc_html( get_option( 'gmt_offset' ) ), "\n"; ?>
|
109 |
+
Memory Limit: <?php echo WP_MEMORY_LIMIT; ?><?php echo "\n"; ?>
|
110 |
+
Memory Max Limit: <?php echo WP_MAX_MEMORY_LIMIT; ?><?php echo "\n"; ?>
|
111 |
+
ABSPATH: <?php echo ABSPATH . "\n"; ?>
|
112 |
+
WP_DEBUG: <?php echo defined( 'WP_DEBUG' ) ? WP_DEBUG ? 'Enabled' . "\n" : 'Disabled' . "\n" : 'Not set' . "\n"; ?>
|
113 |
+
WP_DEBUG_LOG: <?php echo defined( 'WP_DEBUG_LOG' ) ? WP_DEBUG_LOG ? 'Enabled' . "\n" : 'Disabled' . "\n" : 'Not set' . "\n"; ?>
|
114 |
+
SAVEQUERIES: <?php echo defined( 'SAVEQUERIES' ) ? SAVEQUERIES ? 'Enabled' . "\n" : 'Disabled' . "\n" : 'Not set' . "\n"; ?>
|
115 |
+
WP_SCRIPT_DEBUG: <?php echo defined( 'WP_SCRIPT_DEBUG' ) ? WP_SCRIPT_DEBUG ? 'Enabled' . "\n" : 'Disabled' . "\n" : 'Not set' . "\n"; ?>
|
116 |
+
DISABLE_WP_CRON: <?php echo defined( 'DISABLE_WP_CRON' ) ? DISABLE_WP_CRON ? 'Yes' . "\n" : 'No' . "\n" : 'Not set' . "\n"; ?>
|
117 |
+
WP_CRON_LOCK_TIMEOUT: <?php echo defined( 'WP_CRON_LOCK_TIMEOUT' ) ? WP_CRON_LOCK_TIMEOUT : 'Not set', "\n"; ?>
|
118 |
+
EMPTY_TRASH_DAYS: <?php echo defined( 'EMPTY_TRASH_DAYS' ) ? EMPTY_TRASH_DAYS : 'Not set', "\n"; ?>
|
119 |
+
|
120 |
+
<?php
|
121 |
+
$this->print_post_types();
|
122 |
+
$this->print_taxonomies();
|
123 |
+
$this->print_user_roles();
|
124 |
+
$this->print_current_plugins();
|
125 |
+
$this->print_network_active_plugins();
|
126 |
+
$this->print_web_host_details();
|
127 |
+
?>
|
128 |
+
-- User Browser --
|
129 |
+
|
130 |
+
User Agent String: <?php echo esc_html( $_SERVER['HTTP_USER_AGENT'] ), "\n"; ?>
|
131 |
+
|
132 |
+
-- Webserver Configuration --
|
133 |
+
|
134 |
+
PHP Version: <?php echo PHP_VERSION . "\n"; ?>
|
135 |
+
MySQL Version: <?php echo $wpdb->db_version() . "\n"; ?>
|
136 |
+
Web Server Info: <?php echo $_SERVER['SERVER_SOFTWARE'] . "\n"; ?>
|
137 |
+
Platform: <?php echo php_uname( 's' ) . "\n"; ?>
|
138 |
+
|
139 |
+
-- PHP Configuration --
|
140 |
+
|
141 |
+
PHP Memory Limit: <?php echo ini_get( 'memory_limit' ) . "\n"; ?>
|
142 |
+
PHP Safe Mode: <?php echo ini_get( 'safe_mode' ) ? 'Yes' : 'No', "\n"; // phpcs:ignore PHPCompatibility.PHP.DeprecatedIniDirectives.safe_modeDeprecatedRemoved ?>
|
143 |
+
PHP Upload Max Size: <?php echo ini_get( 'upload_max_filesize' ) . "\n"; ?>
|
144 |
+
PHP Post Max Size: <?php echo ini_get( 'post_max_size' ) . "\n"; ?>
|
145 |
+
PHP Upload Max Filesize: <?php echo ini_get( 'upload_max_filesize' ) . "\n"; ?>
|
146 |
+
PHP Time Limit: <?php echo ini_get( 'max_execution_time' ) . "\n"; ?>
|
147 |
+
PHP Max Input Vars: <?php echo ini_get( 'max_input_vars' ) . "\n"; // phpcs:ignore PHPCompatibility.PHP.NewIniDirectives.max_input_varsFound ?>
|
148 |
+
Display Errors: <?php echo ( ini_get( 'display_errors' ) ) ? 'On (' . ini_get( 'display_errors' ) . ')' : 'N/A'; ?><?php echo "\n"; ?>
|
149 |
+
PHP Arg Separator: <?php echo ini_get( 'arg_separator.output' ) . "\n"; ?>
|
150 |
+
PHP Allow URL File Open: <?php echo ini_get( 'allow_url_fopen' ) ? 'Yes' : 'No', "\n"; ?>
|
151 |
+
|
152 |
+
-- PHP Extensions --
|
153 |
+
|
154 |
+
fsockopen: <?php echo ( function_exists( 'fsockopen' ) ) ? 'Your server supports fsockopen.' : 'Your server does not support fsockopen.'; ?><?php echo "\n"; ?>
|
155 |
+
cURL: <?php echo ( function_exists( 'curl_init' ) ) ? 'Your server supports cURL.' : 'Your server does not support cURL.'; ?><?php echo "\n"; ?>
|
156 |
+
SOAP Client: <?php echo ( class_exists( 'SoapClient' ) ) ? 'Your server has the SOAP Client enabled.' : 'Your server does not have the SOAP Client enabled.'; ?><?php echo "\n"; ?>
|
157 |
+
SUHOSIN: <?php echo ( extension_loaded( 'suhosin' ) ) ? 'Your server has SUHOSIN installed.' : 'Your server does not have SUHOSIN installed.'; ?><?php echo "\n"; ?>
|
158 |
+
|
159 |
+
<?php
|
160 |
+
$this->print_session_information();
|
161 |
+
|
162 |
+
/**
|
163 |
+
* Runs after displaying system info.
|
164 |
+
*
|
165 |
+
* This action is primarily for adding extra content in System Info.
|
166 |
+
*
|
167 |
+
* @param string $plugin_name Plugin slug.
|
168 |
+
*/
|
169 |
+
do_action( 'after_system_info', $this->plugin_slug );
|
170 |
+
do_action( "after_system_info_for_{$this->plugin_slug}" );
|
171 |
+
?>
|
172 |
+
### End System Info ###</textarea>
|
173 |
+
|
174 |
+
<?php
|
175 |
+
}
|
176 |
+
// phpcs:enable
|
177 |
+
|
178 |
+
/**
|
179 |
+
* Download System info as a file.
|
180 |
+
*
|
181 |
+
* @param string $file_name (Optional)Name of the file. Default is {plugin slug}-system-info.txt.
|
182 |
+
*/
|
183 |
+
public function download_as_file( $file_name = '' ) {
|
184 |
+
if ( empty( $file_name ) ) {
|
185 |
+
$file_name = $this->plugin_slug . '-system-info.txt';
|
186 |
+
}
|
187 |
+
|
188 |
+
nocache_headers();
|
189 |
+
|
190 |
+
header( 'Content-type: text/plain' );
|
191 |
+
header( 'Content-Disposition: attachment; filename="' . $file_name . '"' );
|
192 |
+
|
193 |
+
echo wp_strip_all_tags( $_POST[ $this->plugin_slug . '-system-info'] );
|
194 |
+
die();
|
195 |
+
}
|
196 |
+
|
197 |
+
/**
|
198 |
+
* Get current theme name.
|
199 |
+
*
|
200 |
+
* @return string Current theme name.
|
201 |
+
*/
|
202 |
+
protected function get_current_theme_name() {
|
203 |
+
if ( get_bloginfo( 'version' ) < '3.4' ) {
|
204 |
+
$theme_data = get_theme_data( get_stylesheet_directory() . '/style.css' );
|
205 |
+
|
206 |
+
return $theme_data['Name'] . ' ' . $theme_data['Version'];
|
207 |
+
}
|
208 |
+
|
209 |
+
$theme_data = wp_get_theme();
|
210 |
+
|
211 |
+
return $theme_data->Name . ' ' . $theme_data->Version;
|
212 |
+
}
|
213 |
+
|
214 |
+
/**
|
215 |
+
* Try to identity the hosting provider.
|
216 |
+
*
|
217 |
+
* @return string Web host name if identified, empty string otherwise.
|
218 |
+
*/
|
219 |
+
protected function print_web_host_details() {
|
220 |
+
$host = '';
|
221 |
+
|
222 |
+
if ( defined( 'WPE_APIKEY' ) ) {
|
223 |
+
$host = 'WP Engine';
|
224 |
+
} elseif ( defined( 'PAGELYBIN' ) ) {
|
225 |
+
$host = 'Pagely';
|
226 |
+
}
|
227 |
+
|
228 |
+
/**
|
229 |
+
* Filter the identified webhost.
|
230 |
+
*
|
231 |
+
* @since 1.0.0
|
232 |
+
*
|
233 |
+
* @param string $host Identified web host.
|
234 |
+
* @param string $plugin_name Plugin slug.
|
235 |
+
*/
|
236 |
+
$host = apply_filters( 'system_info_host', $host, $this->plugin_slug );
|
237 |
+
|
238 |
+
if ( empty( $host ) ) {
|
239 |
+
return;
|
240 |
+
}
|
241 |
+
|
242 |
+
echo '-- Hosting Provider --', "\n\n";
|
243 |
+
echo 'Host: ', $host, "\n";
|
244 |
+
echo "\n";
|
245 |
+
}
|
246 |
+
|
247 |
+
/**
|
248 |
+
* Print plugins that are currently active.
|
249 |
+
*/
|
250 |
+
protected function print_current_plugins() {
|
251 |
+
if ( ! $this->config['show_plugins'] ) {
|
252 |
+
return;
|
253 |
+
}
|
254 |
+
|
255 |
+
echo "\n";
|
256 |
+
echo '-- WordPress Active Plugins --', "\n\n";
|
257 |
+
|
258 |
+
$plugins = get_plugins();
|
259 |
+
$active_plugins = get_option( 'active_plugins', array() );
|
260 |
+
|
261 |
+
foreach ( $plugins as $plugin_path => $plugin ) {
|
262 |
+
// If the plugin isn't active, don't show it.
|
263 |
+
if ( ! in_array( $plugin_path, $active_plugins, true ) ) {
|
264 |
+
continue;
|
265 |
+
}
|
266 |
+
|
267 |
+
echo $plugin['Name'] . ': ' . $plugin['Version'] . "\n";
|
268 |
+
}
|
269 |
+
|
270 |
+
echo "\n";
|
271 |
+
}
|
272 |
+
|
273 |
+
/**
|
274 |
+
* Print network active plugins.
|
275 |
+
*/
|
276 |
+
protected function print_network_active_plugins() {
|
277 |
+
if ( ! is_multisite() || ! $this->config['show_network_plugins'] ) {
|
278 |
+
return;
|
279 |
+
}
|
280 |
+
|
281 |
+
echo "\n";
|
282 |
+
echo '-- Network Active Plugins --';
|
283 |
+
|
284 |
+
$plugins = wp_get_active_network_plugins();
|
285 |
+
$active_plugins = get_site_option( 'active_sitewide_plugins', array() );
|
286 |
+
|
287 |
+
foreach ( $plugins as $plugin_path ) {
|
288 |
+
$plugin_base = plugin_basename( $plugin_path );
|
289 |
+
|
290 |
+
// If the plugin isn't active, don't show it.
|
291 |
+
if ( ! array_key_exists( $plugin_base, $active_plugins ) ) {
|
292 |
+
continue;
|
293 |
+
}
|
294 |
+
|
295 |
+
$plugin = get_plugin_data( $plugin_path );
|
296 |
+
|
297 |
+
echo $plugin['Name'] . ' :' . $plugin['Version'] . "\n";
|
298 |
+
}
|
299 |
+
|
300 |
+
echo "\n";
|
301 |
+
}
|
302 |
+
|
303 |
+
/**
|
304 |
+
* Print the list of post types and the number of posts in them.
|
305 |
+
*
|
306 |
+
* @param int $spacing Spacing length.
|
307 |
+
*/
|
308 |
+
protected function print_post_types( $spacing = 26 ) {
|
309 |
+
if ( ! $this->config['show_post_types'] ) {
|
310 |
+
return;
|
311 |
+
}
|
312 |
+
|
313 |
+
$post_types = get_post_types();
|
314 |
+
|
315 |
+
echo 'Registered Post types: ', implode( ', ', $post_types ), "\n";
|
316 |
+
|
317 |
+
foreach ( $post_types as $post_type ) {
|
318 |
+
echo $post_type;
|
319 |
+
|
320 |
+
if ( strlen( $post_type ) < $spacing ) {
|
321 |
+
echo str_repeat( ' ', $spacing - strlen( $post_type ) );
|
322 |
+
}
|
323 |
+
|
324 |
+
$post_count = wp_count_posts( $post_type );
|
325 |
+
foreach ( $post_count as $key => $value ) {
|
326 |
+
echo $key, '=', $value, ', ';
|
327 |
+
}
|
328 |
+
|
329 |
+
echo "\n";
|
330 |
+
}
|
331 |
+
}
|
332 |
+
|
333 |
+
/**
|
334 |
+
* Print the list of taxonomies together with term count.
|
335 |
+
*/
|
336 |
+
protected function print_taxonomies() {
|
337 |
+
if ( ! $this->config['show_taxonomies'] ) {
|
338 |
+
return;
|
339 |
+
}
|
340 |
+
|
341 |
+
echo "\n";
|
342 |
+
echo 'Registered Taxonomies: ';
|
343 |
+
|
344 |
+
$taxonomies = get_taxonomies();
|
345 |
+
foreach ( $taxonomies as $taxonomy ) {
|
346 |
+
echo $taxonomy, ' (', wp_count_terms( $taxonomy, array( 'hide_empty' => false ) ), '), ';
|
347 |
+
}
|
348 |
+
echo "\n";
|
349 |
+
}
|
350 |
+
|
351 |
+
/**
|
352 |
+
* Print list of user roles and the number of users in each role.
|
353 |
+
*/
|
354 |
+
protected function print_user_roles() {
|
355 |
+
global $wp_roles;
|
356 |
+
|
357 |
+
if ( ! $this->config['show_users'] ) {
|
358 |
+
return;
|
359 |
+
}
|
360 |
+
|
361 |
+
echo "\n";
|
362 |
+
echo 'Users: ';
|
363 |
+
|
364 |
+
foreach ( $wp_roles->roles as $role => $role_details ) {
|
365 |
+
echo $role_details['name'], ' (', absint( $this->get_user_count_by_role( $role ) ), '), ';
|
366 |
+
}
|
367 |
+
echo "\n";
|
368 |
+
}
|
369 |
+
|
370 |
+
/**
|
371 |
+
* Print session information.
|
372 |
+
*/
|
373 |
+
protected function print_session_information() {
|
374 |
+
if ( ! $this->config['show_session_details'] ) {
|
375 |
+
return;
|
376 |
+
}
|
377 |
+
?>
|
378 |
+
-- Session Configuration --
|
379 |
+
|
380 |
+
Session: <?php echo isset( $_SESSION ) ? 'Enabled' : 'Disabled'; ?><?php echo "\n"; ?>
|
381 |
+
Session Name: <?php echo esc_html( ini_get( 'session.name' ) ); ?><?php echo "\n"; ?>
|
382 |
+
Cookie Path: <?php echo esc_html( ini_get( 'session.cookie_path' ) ); ?><?php echo "\n"; ?>
|
383 |
+
Save Path: <?php echo esc_html( ini_get( 'session.save_path' ) ); ?><?php echo "\n"; ?>
|
384 |
+
Use Cookies: <?php echo ini_get( 'session.use_cookies' ) ? 'On' : 'Off'; ?><?php echo "\n"; ?>
|
385 |
+
Use Only Cookies: <?php echo ini_get( 'session.use_only_cookies' ) ? 'On' : 'Off'; ?><?php echo "\n"; ?>
|
386 |
+
<?php
|
387 |
+
}
|
388 |
+
|
389 |
+
/**
|
390 |
+
* Get the number of users present in a role.
|
391 |
+
*
|
392 |
+
* @param string $role Role slug.
|
393 |
+
*
|
394 |
+
* @return int Number of users in that role.
|
395 |
+
*/
|
396 |
+
protected function get_user_count_by_role( $role ) {
|
397 |
+
$users_count = count_users();
|
398 |
+
|
399 |
+
$roles = $users_count['avail_roles'];
|
400 |
+
|
401 |
+
if ( ! array_key_exists( $role, $roles ) ) {
|
402 |
+
return 0;
|
403 |
+
}
|
404 |
+
|
405 |
+
return $roles[ $role ];
|
406 |
+
}
|
407 |
+
}
|