Post Expirator - Version 2.6.2

Version Description

Download this release

Release Info

Developer andergmartins
Plugin Icon 128x128 Post Expirator
Version 2.6.2
Comparing to
See all releases

Code changes from version 2.6.1 to 2.6.2

.distignore ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .distignore
2
+ .git
3
+ .github
4
+ .gitignore
5
+ Gruntfile.js
6
+ node_modules
7
+ composer.lock
8
+ package-lock.json
9
+ package.json
10
+ composer.json
11
+ phpcs.xml
12
+ logs
13
+ .babelrc
14
+ assets/jsx
15
+ bin
16
+ codeceptjs
17
+ tests
18
+ webpack.config.js
assets/js/block.js DELETED
@@ -1,2 +0,0 @@
1
- !function(e){var t={};function a(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,a),o.l=!0,o.exports}a.m=e,a.c=t,a.d=function(e,t,r){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)a.d(r,o,function(t){return e[t]}.bind(null,o));return r},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a(a.s=0)}([function(e,t,a){e.exports=a(1)},function(e,t,a){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(){function e(e,t){for(var a=0;a<t.length;a++){var r=t[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,a,r){return a&&e(t.prototype,a),r&&e(t,r),t}}();function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}!function(e,t){var a=e.plugins.registerPlugin,s=e.i18n.__,c=e.editPost.PluginDocumentSettingPanel,u=e.components,p=u.PanelRow,l=u.DateTimePicker,d=u.CheckboxControl,f=u.SelectControl,g=u.FormTokenField,y=u.Spinner,m=e.element,b=m.Fragment,x=m.Component,v=e.htmlEntities.decodeEntities,h=lodash,E=h.isEmpty,P=h.keys,T=h.compact;a("postexpirator-sidebar",{render:function(a){function u(){n(this,u);var e=i(this,(u.__proto__||Object.getPrototypeOf(u)).apply(this,arguments));return e.state={categoriesList:[],catIdVsName:[]},e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(u,a),o(u,[{key:"componentWillMount",value:function(){var a=this,r=(this.state.attributes,e.data.select("core/editor").getEditedPostAttribute("meta")),o=e.data.select("core/editor").getCurrentPostType(),n=function(t){return e.data.dispatch("core/editor").editPost({meta:t})},i=1==t.defaults.autoEnable,c=new Date,u=this.getExpireType(r),p=[];u.includes("category")&&(p=this.getCategories(r)),r["_expiration-date-status"]&&"saved"===r["_expiration-date-status"]&&(i=!0),r["_expiration-date"]?c.setTime(1e3*(r["_expiration-date"]+60*c.getTimezoneOffset())):(p=t.default_categories,t.default_date&&c.setTime(1e3*(parseInt(t.default_date)+60*c.getTimezoneOffset())));var l=t.defaults.taxonomy||"category";this.setState({enabled:i,date:c,expireAction:u,categories:p,taxonomy:l}),n({"_expiration-date-status":i?"saved":""}),n({"_expiration-date":c.getTime()/1e3}),n({"_expiration-date-type":u}),n({"_expiration-date-categories":p});var d=[],f=[];!l&&"post"===o||"category"===l?e.apiFetch({path:e.url.addQueryArgs("wp/v2/categories",{per_page:-1})}).then((function(e){e.forEach((function(e){d[e.name]=e,f[e.id]=e.name})),a.setState({categoriesList:d,catIdVsName:f,taxonomy:s("Category")})})):"page"!==o&&e.apiFetch({path:e.url.addQueryArgs("wp/v2/taxonomies/"+l,{context:"edit"})}).then((function(t){e.apiFetch({path:e.url.addQueryArgs("wp/v2/"+t.rest_base,{context:"edit"})}).then((function(e){e.forEach((function(e){d[v(e.name)]=e,f[e.id]=v(e.name)})),a.setState({categoriesList:d,catIdVsName:f,taxonomy:v(t.name)})}))}))}},{key:"componentDidUpdate",value:function(){var t=this.state,a=t.enabled,r=t.date,o=t.expireAction,n=t.categories,i=t.attribute,s=function(t){return e.data.dispatch("core/editor").editPost({meta:t})},c=e.data.select("core/editor").getEditedPostAttribute("meta");switch(i){case"enabled":s({"_expiration-date-status":a?"saved":""}),c["_expiration-date"]||s({"_expiration-date":this.getDate(r)});break;case"date":"string"==typeof r&&s({"_expiration-date":this.getDate(r)});break;case"action":s({"_expiration-date-type":o}),o.includes("category")||s({"_expiration-date-categories":[]});break;case"category":s({"_expiration-date-categories":n})}}},{key:"render",value:function(){var t=this,a=this.state,r=a.categoriesList,o=a.catIdVsName,n=this.state,i=n.enabled,u=n.date,m=n.expireAction,x=n.categories,v=n.taxonomy,h=e.data.select("core/editor").getCurrentPostType(),S=[{label:s("Draft","post-expirator"),value:"draft"},{label:s("Delete","post-expirator"),value:"delete"},{label:s("Trash","post-expirator"),value:"trash"},{label:s("Private","post-expirator"),value:"private"},{label:s("Stick","post-expirator"),value:"stick"},{label:s("Unstick","post-expirator"),value:"unstick"}];"page"!==h&&(S=_.union(S,[{label:s("Category: Replace","post-expirator"),value:"category"},{label:s("Category: Add","post-expirator"),value:"category-add"},{label:s("Category: Remove","post-expirator"),value:"category-remove"}]));var k=x&&T(x.map((function(e){return o[e]||!1})));return"string"==typeof k&&(k=[]),React.createElement(c,{title:s("Post Expirator","post-expirator"),icon:"calendar",initialOpen:i,className:"post-expirator-panel"},React.createElement(p,null,React.createElement(d,{label:s("Enable Post Expiration","post-expirator"),checked:i,onChange:function(e){t.setState({enabled:!i,attribute:"enabled"})}})),i&&React.createElement(b,null,React.createElement(p,null,React.createElement(l,{currentDate:u,onChange:function(e){return t.setState({date:e,attribute:"date"})},is12Hour:!0})),React.createElement(f,{label:s("How to expire","post-expirator"),value:m,options:S,onChange:function(e){t.setState({expireAction:e,attribute:"action"})}}),m.includes("category")&&(E(P(r))&&React.createElement(b,null,s("Loading","post-expirator")+" ("+v+")",React.createElement(y,null))||React.createElement(g,{label:s("Expiration Categories","post-expirator")+" ("+v+")",value:k,suggestions:Object.keys(r),onChange:function(e){t.setState({categories:t.selectCategories(e),attribute:"category"})},maxSuggestions:10}))))}},{key:"getExpireType",value:function(e){var a=e["_expiration-date-type"],r=e["_expiration-date-options"]&&e["_expiration-date-options"].expireType;return a||(r||(t&&t.defaults&&t.defaults.expireType?t.defaults.expireType:"draft"))}},{key:"getCategories",value:function(e){var t=e["_expiration-date-categories"]&&e["_expiration-date-categories"],a=e["_expiration-date-options"]&&e["_expiration-date-options"].category;return"object"===(void 0===t?"undefined":r(t))&&t.length>0?t:(a&&void 0!==a&&"object"!==(void 0===a?"undefined":r(a))&&(categories=[a]),a)}},{key:"selectCategories",value:function(e){var t=this.state,a=t.categoriesList;t.catIdVsName;if(!e.some((function(e){return"string"==typeof e&&!a[e]})))return e.map((function(e){return"string"==typeof e?a[e]:e})).map((function(e){return e.id}))}},{key:"getDate",value:function(e){var t=new Date;return t.setTime(Date.parse(e)),t.setTime(t.getTime()-60*(new Date).getTimezoneOffset()*1e3),t.getTime()/1e3}}]),u}(x)})}(window.wp,config)}]);
2
- //# sourceMappingURL=block.js.map
 
 
assets/js/block.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./assets/jsx/block.jsx"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","wp","config","registerPlugin","plugins","__","i18n","PluginDocumentSettingPanel","editPost","components","PanelRow","DateTimePicker","CheckboxControl","SelectControl","FormTokenField","Spinner","element","Fragment","Component","decodeEntities","htmlEntities","lodash","isEmpty","keys","compact","render","arguments","state","categoriesList","catIdVsName","postMeta","this","attributes","data","select","getEditedPostAttribute","postType","getCurrentPostType","setPostMeta","newMeta","dispatch","meta","enabled","defaults","autoEnable","date","Date","expireAction","getExpireType","categories","includes","getCategories","setTime","getTimezoneOffset","default_categories","default_date","parseInt","taxonomy","setState","getTime","apiFetch","path","url","addQueryArgs","per_page","then","list","forEach","cat","id","context","taxAttributes","rest_base","terms","term","attribute","getDate","actionsList","label","_","union","selectedCats","map","title","icon","initialOpen","className","checked","onChange","currentDate","is12Hour","options","suggestions","selectCategories","maxSuggestions","typeNew","typeOld","expireType","categoriesNew","categoriesOld","length","tokens","some","token","newDate","parse","window"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhE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iBtE,KAAKJ,MAApCC,EADc,EACdA,eADc,EACEC,YAMvB,IAJsBwE,EAAOC,MAAK,SAAUC,GACxC,MAAwB,iBAAVA,IAAuB3E,EAAe2E,MAWxD,OAJiBF,EAAOnB,KAAI,SAAUqB,GAClC,MAAwB,iBAAVA,EAAqB3E,EAAe2E,GAASA,KAG7CrB,KAAI,SAACd,GAAD,OAASA,EAAIC,QApRxB,8BAuRPxB,GACJ,IAAI2D,EAAU,IAAI1D,KAGlB,OAFA0D,EAAQpD,QAAQN,KAAK2D,MAAM5D,IAC3B2D,EAAQpD,QAAQoD,EAAQ7C,UAA6C,IAAjC,IAAIb,MAAOO,oBAA2B,KACjEmD,EAAQ7C,UAAa,QA3RnB,GAUgBzC,KAVvC,CAqSGwF,OAAOzG,GAAIC","file":"block.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","(function (wp, config) {\n\n const {registerPlugin} = wp.plugins;\n const {__} = wp.i18n;\n const {PluginDocumentSettingPanel} = wp.editPost;\n const {PanelRow, DateTimePicker, CheckboxControl, SelectControl, FormTokenField, Spinner} = wp.components;\n const {Fragment, Component} = wp.element;\n const {decodeEntities} = wp.htmlEntities;\n const {isEmpty, keys, compact} = lodash;\n\n class PostExpiratorSidebar extends Component {\n constructor() {\n super(...arguments);\n\n this.state = {\n categoriesList: [],\n catIdVsName: [],\n }\n }\n\n componentWillMount() {\n const {attributes} = this.state;\n\n const postMeta = wp.data.select('core/editor').getEditedPostAttribute('meta');\n const postType = wp.data.select('core/editor').getCurrentPostType();\n const setPostMeta = (newMeta) => wp.data.dispatch('core/editor').editPost({meta: newMeta});\n\n let enabled = config.defaults.autoEnable == 1;\n let date = new Date();\n\n let expireAction = this.getExpireType(postMeta);\n\n let categories = [];\n if (expireAction.includes('category')) {\n categories = this.getCategories(postMeta);\n }\n\n if (postMeta['_expiration-date-status'] && postMeta['_expiration-date-status'] === 'saved') {\n enabled = true;\n }\n\n if (postMeta['_expiration-date']) {\n date.setTime((postMeta['_expiration-date'] + date.getTimezoneOffset() * 60) * 1000);\n } else {\n categories = config.default_categories;\n if (config.default_date) {\n date.setTime((parseInt(config.default_date) + date.getTimezoneOffset() * 60) * 1000);\n }\n }\n\n let taxonomy = config.defaults.taxonomy || 'category';\n\n this.setState({\n enabled: enabled,\n date: date,\n expireAction: expireAction,\n categories: categories,\n taxonomy: taxonomy,\n });\n\n // Force all the metadata to be saved. Required for making sure the default settings are stored correctly.\n setPostMeta({'_expiration-date-status': (enabled ? 'saved' : '')});\n setPostMeta({'_expiration-date': (date.getTime()) / 1000});\n setPostMeta({'_expiration-date-type': expireAction});\n setPostMeta({'_expiration-date-categories': categories});\n\n let categoriesList = [];\n let catIdVsName = [];\n\n if ((!taxonomy && postType === 'post') || taxonomy === 'category') {\n wp.apiFetch({\n path: wp.url.addQueryArgs('wp/v2/categories', {per_page: -1}),\n }).then((list) => {\n list.forEach(cat => {\n categoriesList[cat.name] = cat;\n catIdVsName[cat.id] = cat.name;\n });\n this.setState({categoriesList: categoriesList, catIdVsName: catIdVsName, taxonomy: __('Category')});\n });\n } else if (postType !== 'page') {\n wp.apiFetch({\n path: wp.url.addQueryArgs(`wp/v2/taxonomies/${taxonomy}`, {context: 'edit'}),\n }).then((taxAttributes) => {\n // fetch all terms\n wp.apiFetch({\n path: wp.url.addQueryArgs(`wp/v2/${taxAttributes.rest_base}`, {context: 'edit'}),\n }).then((terms) => {\n terms.forEach(term => {\n categoriesList[decodeEntities(term.name)] = term;\n catIdVsName[term.id] = decodeEntities(term.name);\n });\n this.setState({\n categoriesList: categoriesList,\n catIdVsName: catIdVsName,\n taxonomy: decodeEntities(taxAttributes.name)\n });\n });\n });\n }\n\n }\n\n componentDidUpdate() {\n const {enabled, date, expireAction, categories, attribute} = this.state;\n const setPostMeta = (newMeta) => wp.data.dispatch('core/editor').editPost({meta: newMeta});\n const postMeta = wp.data.select('core/editor').getEditedPostAttribute('meta');\n\n switch (attribute) {\n case 'enabled':\n setPostMeta({'_expiration-date-status': (enabled ? 'saved' : '')});\n // if date is not set when the checkbox is enabled, set it to the default date\n // this is to prevent the user from having to click the date to set it\n if (!postMeta['_expiration-date']) {\n setPostMeta({'_expiration-date': this.getDate(date)});\n }\n break;\n case 'date':\n if (typeof date === 'string') {\n setPostMeta({'_expiration-date': this.getDate(date)});\n }\n break;\n case 'action':\n setPostMeta({'_expiration-date-type': expireAction});\n if (!expireAction.includes('category')) {\n setPostMeta({'_expiration-date-categories': []});\n }\n break;\n case 'category':\n setPostMeta({'_expiration-date-categories': categories});\n break;\n }\n\n }\n\n render() {\n const {categoriesList, catIdVsName} = this.state;\n const {enabled, date, expireAction, categories, taxonomy} = this.state;\n\n const postType = wp.data.select('core/editor').getCurrentPostType();\n\n let actionsList = [\n {label: __('Draft', 'post-expirator'), value: 'draft'},\n {label: __('Delete', 'post-expirator'), value: 'delete'},\n {label: __('Trash', 'post-expirator'), value: 'trash'},\n {label: __('Private', 'post-expirator'), value: 'private'},\n {label: __('Stick', 'post-expirator'), value: 'stick'},\n {label: __('Unstick', 'post-expirator'), value: 'unstick'},\n ];\n\n if (postType !== 'page') {\n actionsList = _.union(actionsList, [\n {label: __('Category: Replace', 'post-expirator'), value: 'category'},\n {label: __('Category: Add', 'post-expirator'), value: 'category-add'},\n {label: __('Category: Remove', 'post-expirator'), value: 'category-remove'},\n ]);\n }\n\n let selectedCats = categories && compact(categories.map((id) => catIdVsName[id] || false));\n if (typeof selectedCats === 'string') {\n selectedCats = [];\n }\n\n return (\n <PluginDocumentSettingPanel title={__('Post Expirator', 'post-expirator')} icon=\"calendar\"\n initialOpen={enabled} className={'post-expirator-panel'}>\n <PanelRow>\n <CheckboxControl\n label={__('Enable Post Expiration', 'post-expirator')}\n checked={enabled}\n onChange={(value) => {\n this.setState({enabled: !enabled, attribute: 'enabled'})\n }}\n />\n </PanelRow>\n {enabled && (\n <Fragment>\n <PanelRow>\n <DateTimePicker\n currentDate={date}\n onChange={(value) => this.setState({date: value, attribute: 'date'})}\n is12Hour={true}\n />\n </PanelRow>\n <SelectControl\n label={__('How to expire', 'post-expirator')}\n value={expireAction}\n options={actionsList}\n onChange={(value) => {\n this.setState({expireAction: value, attribute: 'action'})\n }}\n />\n {expireAction.includes('category') &&\n (\n (isEmpty(keys(categoriesList)) && (\n <Fragment>\n {__('Loading', 'post-expirator') + ` (${taxonomy})`}\n <Spinner/>\n </Fragment>\n ))\n ||\n (\n <FormTokenField\n label={__('Expiration Categories', 'post-expirator') + ` (${taxonomy})`}\n value={selectedCats}\n suggestions={Object.keys(categoriesList)}\n onChange={(value) => {\n this.setState({\n categories: this.selectCategories(value),\n attribute: 'category'\n })\n }}\n maxSuggestions={10}\n />\n )\n )}\n </Fragment>\n )}\n </PluginDocumentSettingPanel>\n );\n }\n\n // what action to take on expiration\n getExpireType(postMeta) {\n let typeNew = postMeta['_expiration-date-type'];\n let typeOld = postMeta['_expiration-date-options'] && postMeta['_expiration-date-options']['expireType'];\n\n\n\n if (typeNew) {\n return typeNew;\n }\n\n if (typeOld) {\n return typeOld;\n }\n\n if (config && config.defaults && config.defaults.expireType) {\n return config.defaults.expireType;\n }\n\n return 'draft';\n }\n\n // what categories to add/remove/replace\n getCategories(postMeta) {\n let categoriesNew = postMeta['_expiration-date-categories'] && postMeta['_expiration-date-categories'];\n let categoriesOld = postMeta['_expiration-date-options'] && postMeta['_expiration-date-options']['category'];\n\n if (typeof categoriesNew === 'object' && categoriesNew.length > 0) {\n return categoriesNew;\n }\n\n if (categoriesOld && typeof categoriesOld !== 'undefined' && typeof categoriesOld !== 'object') {\n categories = [categoriesOld];\n }\n\n return categoriesOld;\n\n }\n\n // fired for the autocomplete\n selectCategories(tokens) {\n const {categoriesList, catIdVsName} = this.state;\n\n var hasNoSuggestion = tokens.some(function (token) {\n return typeof token === 'string' && !categoriesList[token];\n });\n\n if (hasNoSuggestion) {\n return;\n }\n\n var categories = tokens.map(function (token) {\n return typeof token === 'string' ? categoriesList[token] : token;\n })\n\n return categories.map((cat) => cat.id);\n }\n\n getDate(date) {\n let newDate = new Date();\n newDate.setTime(Date.parse(date));\n newDate.setTime(newDate.getTime() - new Date().getTimezoneOffset() * 60 * 1000);\n return ((newDate.getTime()) / 1000);\n }\n\n }\n\n registerPlugin('postexpirator-sidebar', {\n render: PostExpiratorSidebar\n });\n\n\n})(window.wp, config);\n"],"sourceRoot":""}
 
assets/js/gutenberg-panel.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ !function(e){var t={};function a(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.m=e,a.c=t,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)a.d(n,r,function(t){return e[t]}.bind(null,r));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a(a.s=0)}([function(e,t,a){e.exports=a(1)},function(e,t,a){"use strict";var n,r,o,i,s,c,u,l,p,d,f,g,y,m,b,v,x,h,E,T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},w=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();function P(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function S(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}n=window.wp,r=window.postExpiratorPanelConfig,o=n.plugins.registerPlugin,i=n.editPost.PluginDocumentSettingPanel,s=n.components,c=s.PanelRow,u=s.DateTimePicker,l=s.CheckboxControl,p=s.SelectControl,d=s.FormTokenField,f=s.Spinner,g=n.element,y=g.Fragment,m=g.Component,b=n.htmlEntities.decodeEntities,v=lodash,x=v.isEmpty,h=v.keys,E=v.compact,o("postexpirator-sidebar",{render:function(e){function t(){P(this,t);var e=S(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.state={categoriesList:[],catIdVsName:[]},e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),w(t,[{key:"componentWillMount",value:function(){var e=this,t=(this.state.attributes,n.data.select("core/editor").getEditedPostAttribute("meta")),a=n.data.select("core/editor").getCurrentPostType(),o=function(e){return n.data.dispatch("core/editor").editPost({meta:e})},i=1==r.defaults.autoEnable,s=new Date,c=this.getExpireType(t),u=[];c.includes("category")&&(u=this.getCategories(t)),t["_expiration-date-status"]&&"saved"===t["_expiration-date-status"]&&(i=!0),t["_expiration-date"]?s.setTime(1e3*(t["_expiration-date"]+60*s.getTimezoneOffset())):(u=r.default_categories,r.default_date&&s.setTime(1e3*(parseInt(r.default_date)+60*s.getTimezoneOffset())));var l=r.defaults.taxonomy||"category";this.setState({enabled:i,date:s,expireAction:c,categories:u,taxonomy:l}),o({"_expiration-date-status":i?"saved":""}),o({"_expiration-date":s.getTime()/1e3}),o({"_expiration-date-type":c}),o({"_expiration-date-categories":u});var p=[],d=[];!l&&"post"===a||"category"===l?n.apiFetch({path:n.url.addQueryArgs("wp/v2/categories",{per_page:-1})}).then((function(t){t.forEach((function(e){p[e.name]=e,d[e.id]=e.name})),e.setState({categoriesList:p,catIdVsName:d,taxonomy:r.strings.category})})):"page"!==a&&n.apiFetch({path:n.url.addQueryArgs("wp/v2/taxonomies/"+l,{context:"edit"})}).then((function(t){n.apiFetch({path:n.url.addQueryArgs("wp/v2/"+t.rest_base,{context:"edit"})}).then((function(a){a.forEach((function(e){p[b(e.name)]=e,d[e.id]=b(e.name)})),e.setState({categoriesList:p,catIdVsName:d,taxonomy:b(t.name)})}))}))}},{key:"componentDidUpdate",value:function(){var e=this.state,t=e.enabled,a=e.date,r=e.expireAction,o=e.categories,i=e.attribute,s=function(e){return n.data.dispatch("core/editor").editPost({meta:e})},c=n.data.select("core/editor").getEditedPostAttribute("meta");switch(i){case"enabled":s({"_expiration-date-status":t?"saved":""}),c["_expiration-date"]||s({"_expiration-date":this.getDate(a)});break;case"date":"string"==typeof a&&s({"_expiration-date":this.getDate(a)});break;case"action":s({"_expiration-date-type":r}),r.includes("category")||s({"_expiration-date-categories":[]});break;case"category":s({"_expiration-date-categories":o})}}},{key:"render",value:function(){var e=this,t=this.state,a=t.categoriesList,o=t.catIdVsName,s=this.state,g=s.enabled,m=s.date,b=s.expireAction,v=s.categories,T=s.taxonomy,w=n.data.select("core/editor").getCurrentPostType(),P=[{label:r.strings.draft,value:"draft"},{label:r.strings.delete,value:"delete"},{label:r.strings.trash,value:"trash"},{label:r.strings.private,value:"private"},{label:r.strings.stick,value:"stick"},{label:r.strings.unstick,value:"unstick"}];"page"!==w&&(P=_.union(P,[{label:r.strings.categoryReplace,value:"category"},{label:r.strings.categoryAdd,value:"category-add"},{label:r.strings.categoryRemove,value:"category-remove"}]));var S=v&&E(v.map((function(e){return o[e]||!1})));return"string"==typeof S&&(S=[]),React.createElement(i,{title:r.strings.postExpirator,icon:"calendar",initialOpen:g,className:"post-expirator-panel"},React.createElement(c,null,React.createElement(l,{label:r.strings.enablePostExpiration,checked:g,onChange:function(t){e.setState({enabled:!g,attribute:"enabled"})}})),g&&React.createElement(y,null,React.createElement(c,null,React.createElement(u,{currentDate:m,onChange:function(t){return e.setState({date:t,attribute:"date"})},is12Hour:r.is12Hour})),React.createElement(p,{label:r.strings.howToExpire,value:b,options:P,onChange:function(t){e.setState({expireAction:t,attribute:"action"})}}),b.includes("category")&&(x(h(a))&&React.createElement(y,null,r.strings.loading+" ("+T+")",React.createElement(f,null))||React.createElement(d,{label:r.strings.expirationCategories+" ("+T+")",value:S,suggestions:Object.keys(a),onChange:function(t){e.setState({categories:e.selectCategories(t),attribute:"category"})},maxSuggestions:10}))))}},{key:"getExpireType",value:function(e){var t=e["_expiration-date-type"],a=e["_expiration-date-options"]&&e["_expiration-date-options"].expireType;return t||a||(r&&r.defaults&&r.defaults.expireType?r.defaults.expireType:"draft")}},{key:"getCategories",value:function(e){var t=e["_expiration-date-categories"]&&e["_expiration-date-categories"],a=e["_expiration-date-options"]&&e["_expiration-date-options"].category;return"object"===(void 0===t?"undefined":T(t))&&t.length>0?t:(a&&void 0!==a&&"object"!==(void 0===a?"undefined":T(a))&&(categories=[a]),a)}},{key:"selectCategories",value:function(e){var t=this.state,a=t.categoriesList;if(t.catIdVsName,!e.some((function(e){return"string"==typeof e&&!a[e]})))return e.map((function(e){return"string"==typeof e?a[e]:e})).map((function(e){return e.id}))}},{key:"getDate",value:function(e){var t=new Date;return t.setTime(Date.parse(e)),t.setTime(t.getTime()-60*(new Date).getTimezoneOffset()*1e3),t.getTime()/1e3}}]),t}(m)})}]);
2
+ //# sourceMappingURL=gutenberg-panel.js.map
assets/js/gutenberg-panel.js.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./assets/jsx/gutenberg-panel.jsx"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","wp","config","registerPlugin","PluginDocumentSettingPanel","PanelRow","DateTimePicker","CheckboxControl","SelectControl","FormTokenField","Spinner","Fragment","Component","decodeEntities","isEmpty","keys","compact","window","postExpiratorPanelConfig","plugins","editPost","components","element","htmlEntities","lodash","render","arguments","state","categoriesList","catIdVsName","postMeta","this","attributes","data","select","getEditedPostAttribute","postType","getCurrentPostType","setPostMeta","newMeta","dispatch","meta","enabled","defaults","autoEnable","date","Date","expireAction","getExpireType","categories","includes","getCategories","setTime","getTimezoneOffset","default_categories","default_date","parseInt","taxonomy","setState","getTime","apiFetch","path","url","addQueryArgs","per_page","then","list","forEach","cat","id","strings","category","context","taxAttributes","rest_base","terms","term","attribute","getDate","actionsList","label","draft","delete","trash","private","stick","unstick","_","union","categoryReplace","categoryAdd","categoryRemove","selectedCats","map","title","postExpirator","icon","initialOpen","className","enablePostExpiration","checked","onChange","currentDate","is12Hour","howToExpire","options","loading","expirationCategories","suggestions","selectCategories","maxSuggestions","typeNew","typeOld","expireType","categoriesNew","categoriesOld","length","tokens","some","token","newDate","parse"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,Q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EAAUlF,EAAS,6BAA+BA,EAAS,4BAAT,WAItD,OAAIiF,GAIAC,IAIA9G,GAAUA,EAAOyC,UAAYzC,EAAOyC,SAASsE,WACtC/G,EAAOyC,SAASsE,WAGpB,WA/OI,oCAmPDnF,GACV,IAAIoF,EAAgBpF,EAAS,gCAAkCA,EAAS,+BACpEqF,EAAgBrF,EAAS,6BAA+BA,EAAS,4BAAT,SAE5D,MAA6B,iBAAzB,IAAOoF,EAAP,cAAOA,KAA8BA,EAAcE,OAAS,EACrDF,GAGPC,QAA0C,IAAlBA,GAA0D,iBAAzB,IAAOA,EAAP,cAAOA,MAChElE,WAAa,CAACkE,IAGXA,KA/PI,uCAoQEE,GAAQ,MACiBtF,KAAKJ,MAApCC,EADc,EACdA,eAMP,GAPqB,EACEC,aAEDwF,EAAOC,MAAK,SAAUC,GACxC,MAAwB,iBAAVA,IAAuB3F,EAAe2F,MAWxD,OAJiBF,EAAOxB,KAAI,SAAU0B,GAClC,MAAwB,iBAAVA,EAAqB3F,EAAe2F,GAASA,KAG7C1B,KAAI,SAACzB,GAAD,OAASA,EAAIC,QAnRxB,8BAsRPxB,GACJ,IAAI2E,EAAU,IAAI1E,KAGlB,OAFA0E,EAAQpE,QAAQN,KAAK2E,MAAM5E,IAC3B2E,EAAQpE,QAAQoE,EAAQ7D,UAA6C,IAAjC,IAAIb,MAAOO,oBAA2B,KACjEmE,EAAQ7D,UAAa,QA1RnB,GASgB/C","file":"gutenberg-panel.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","(function (wp, config) {\n\n const {registerPlugin} = wp.plugins;\n const {PluginDocumentSettingPanel} = wp.editPost;\n const {PanelRow, DateTimePicker, CheckboxControl, SelectControl, FormTokenField, Spinner} = wp.components;\n const {Fragment, Component} = wp.element;\n const {decodeEntities} = wp.htmlEntities;\n const {isEmpty, keys, compact} = lodash;\n\n class PostExpiratorSidebar extends Component {\n constructor() {\n super(...arguments);\n\n this.state = {\n categoriesList: [],\n catIdVsName: [],\n }\n }\n\n componentWillMount() {\n const {attributes} = this.state;\n\n const postMeta = wp.data.select('core/editor').getEditedPostAttribute('meta');\n const postType = wp.data.select('core/editor').getCurrentPostType();\n const setPostMeta = (newMeta) => wp.data.dispatch('core/editor').editPost({meta: newMeta});\n\n let enabled = config.defaults.autoEnable == 1;\n let date = new Date();\n\n let expireAction = this.getExpireType(postMeta);\n\n let categories = [];\n if (expireAction.includes('category')) {\n categories = this.getCategories(postMeta);\n }\n\n if (postMeta['_expiration-date-status'] && postMeta['_expiration-date-status'] === 'saved') {\n enabled = true;\n }\n\n if (postMeta['_expiration-date']) {\n date.setTime((postMeta['_expiration-date'] + date.getTimezoneOffset() * 60) * 1000);\n } else {\n categories = config.default_categories;\n if (config.default_date) {\n date.setTime((parseInt(config.default_date) + date.getTimezoneOffset() * 60) * 1000);\n }\n }\n\n let taxonomy = config.defaults.taxonomy || 'category';\n\n this.setState({\n enabled: enabled,\n date: date,\n expireAction: expireAction,\n categories: categories,\n taxonomy: taxonomy,\n });\n\n // Force all the metadata to be saved. Required for making sure the default settings are stored correctly.\n setPostMeta({'_expiration-date-status': (enabled ? 'saved' : '')});\n setPostMeta({'_expiration-date': (date.getTime()) / 1000});\n setPostMeta({'_expiration-date-type': expireAction});\n setPostMeta({'_expiration-date-categories': categories});\n\n let categoriesList = [];\n let catIdVsName = [];\n\n if ((!taxonomy && postType === 'post') || taxonomy === 'category') {\n wp.apiFetch({\n path: wp.url.addQueryArgs('wp/v2/categories', {per_page: -1}),\n }).then((list) => {\n list.forEach(cat => {\n categoriesList[cat.name] = cat;\n catIdVsName[cat.id] = cat.name;\n });\n this.setState({categoriesList: categoriesList, catIdVsName: catIdVsName, taxonomy: config.strings.category});\n });\n } else if (postType !== 'page') {\n wp.apiFetch({\n path: wp.url.addQueryArgs(`wp/v2/taxonomies/${taxonomy}`, {context: 'edit'}),\n }).then((taxAttributes) => {\n // fetch all terms\n wp.apiFetch({\n path: wp.url.addQueryArgs(`wp/v2/${taxAttributes.rest_base}`, {context: 'edit'}),\n }).then((terms) => {\n terms.forEach(term => {\n categoriesList[decodeEntities(term.name)] = term;\n catIdVsName[term.id] = decodeEntities(term.name);\n });\n this.setState({\n categoriesList: categoriesList,\n catIdVsName: catIdVsName,\n taxonomy: decodeEntities(taxAttributes.name)\n });\n });\n });\n }\n\n }\n\n componentDidUpdate() {\n const {enabled, date, expireAction, categories, attribute} = this.state;\n const setPostMeta = (newMeta) => wp.data.dispatch('core/editor').editPost({meta: newMeta});\n const postMeta = wp.data.select('core/editor').getEditedPostAttribute('meta');\n\n switch (attribute) {\n case 'enabled':\n setPostMeta({'_expiration-date-status': (enabled ? 'saved' : '')});\n // if date is not set when the checkbox is enabled, set it to the default date\n // this is to prevent the user from having to click the date to set it\n if (!postMeta['_expiration-date']) {\n setPostMeta({'_expiration-date': this.getDate(date)});\n }\n break;\n case 'date':\n if (typeof date === 'string') {\n setPostMeta({'_expiration-date': this.getDate(date)});\n }\n break;\n case 'action':\n setPostMeta({'_expiration-date-type': expireAction});\n if (!expireAction.includes('category')) {\n setPostMeta({'_expiration-date-categories': []});\n }\n break;\n case 'category':\n setPostMeta({'_expiration-date-categories': categories});\n break;\n }\n\n }\n\n render() {\n const {categoriesList, catIdVsName} = this.state;\n const {enabled, date, expireAction, categories, taxonomy} = this.state;\n\n const postType = wp.data.select('core/editor').getCurrentPostType();\n\n let actionsList = [\n {label: config.strings.draft, value: 'draft'},\n {label: config.strings.delete, value: 'delete'},\n {label: config.strings.trash, value: 'trash'},\n {label: config.strings.private, value: 'private'},\n {label: config.strings.stick, value: 'stick'},\n {label: config.strings.unstick, value: 'unstick'},\n ];\n\n if (postType !== 'page') {\n actionsList = _.union(actionsList, [\n {label: config.strings.categoryReplace, value: 'category'},\n {label: config.strings.categoryAdd, value: 'category-add'},\n {label: config.strings.categoryRemove, value: 'category-remove'},\n ]);\n }\n\n let selectedCats = categories && compact(categories.map((id) => catIdVsName[id] || false));\n if (typeof selectedCats === 'string') {\n selectedCats = [];\n }\n\n return (\n <PluginDocumentSettingPanel title={config.strings.postExpirator} icon=\"calendar\"\n initialOpen={enabled} className={'post-expirator-panel'}>\n <PanelRow>\n <CheckboxControl\n label={config.strings.enablePostExpiration}\n checked={enabled}\n onChange={(value) => {\n this.setState({enabled: !enabled, attribute: 'enabled'})\n }}\n />\n </PanelRow>\n {enabled && (\n <Fragment>\n <PanelRow>\n <DateTimePicker\n currentDate={date}\n onChange={(value) => this.setState({date: value, attribute: 'date'})}\n is12Hour={config.is12Hour}\n />\n </PanelRow>\n <SelectControl\n label={config.strings.howToExpire}\n value={expireAction}\n options={actionsList}\n onChange={(value) => {\n this.setState({expireAction: value, attribute: 'action'})\n }}\n />\n {expireAction.includes('category') &&\n (\n (isEmpty(keys(categoriesList)) && (\n <Fragment>\n {config.strings.loading + ` (${taxonomy})`}\n <Spinner/>\n </Fragment>\n ))\n ||\n (\n <FormTokenField\n label={config.strings.expirationCategories + ` (${taxonomy})`}\n value={selectedCats}\n suggestions={Object.keys(categoriesList)}\n onChange={(value) => {\n this.setState({\n categories: this.selectCategories(value),\n attribute: 'category'\n })\n }}\n maxSuggestions={10}\n />\n )\n )}\n </Fragment>\n )}\n </PluginDocumentSettingPanel>\n );\n }\n\n // what action to take on expiration\n getExpireType(postMeta) {\n let typeNew = postMeta['_expiration-date-type'];\n let typeOld = postMeta['_expiration-date-options'] && postMeta['_expiration-date-options']['expireType'];\n\n\n\n if (typeNew) {\n return typeNew;\n }\n\n if (typeOld) {\n return typeOld;\n }\n\n if (config && config.defaults && config.defaults.expireType) {\n return config.defaults.expireType;\n }\n\n return 'draft';\n }\n\n // what categories to add/remove/replace\n getCategories(postMeta) {\n let categoriesNew = postMeta['_expiration-date-categories'] && postMeta['_expiration-date-categories'];\n let categoriesOld = postMeta['_expiration-date-options'] && postMeta['_expiration-date-options']['category'];\n\n if (typeof categoriesNew === 'object' && categoriesNew.length > 0) {\n return categoriesNew;\n }\n\n if (categoriesOld && typeof categoriesOld !== 'undefined' && typeof categoriesOld !== 'object') {\n categories = [categoriesOld];\n }\n\n return categoriesOld;\n\n }\n\n // fired for the autocomplete\n selectCategories(tokens) {\n const {categoriesList, catIdVsName} = this.state;\n\n var hasNoSuggestion = tokens.some(function (token) {\n return typeof token === 'string' && !categoriesList[token];\n });\n\n if (hasNoSuggestion) {\n return;\n }\n\n var categories = tokens.map(function (token) {\n return typeof token === 'string' ? categoriesList[token] : token;\n })\n\n return categories.map((cat) => cat.id);\n }\n\n getDate(date) {\n let newDate = new Date();\n newDate.setTime(Date.parse(date));\n newDate.setTime(newDate.getTime() - new Date().getTimezoneOffset() * 60 * 1000);\n return ((newDate.getTime()) / 1000);\n }\n\n }\n\n registerPlugin('postexpirator-sidebar', {\n render: PostExpiratorSidebar\n });\n\n\n})(window.wp, window.postExpiratorPanelConfig);\n"],"sourceRoot":""}
assets/jsx/{block.jsx → gutenberg-panel.jsx} RENAMED
@@ -1,7 +1,6 @@
1
  (function (wp, config) {
2
 
3
  const {registerPlugin} = wp.plugins;
4
- const {__} = wp.i18n;
5
  const {PluginDocumentSettingPanel} = wp.editPost;
6
  const {PanelRow, DateTimePicker, CheckboxControl, SelectControl, FormTokenField, Spinner} = wp.components;
7
  const {Fragment, Component} = wp.element;
@@ -75,7 +74,7 @@
75
  categoriesList[cat.name] = cat;
76
  catIdVsName[cat.id] = cat.name;
77
  });
78
- this.setState({categoriesList: categoriesList, catIdVsName: catIdVsName, taxonomy: __('Category')});
79
  });
80
  } else if (postType !== 'page') {
81
  wp.apiFetch({
@@ -139,19 +138,19 @@
139
  const postType = wp.data.select('core/editor').getCurrentPostType();
140
 
141
  let actionsList = [
142
- {label: __('Draft', 'post-expirator'), value: 'draft'},
143
- {label: __('Delete', 'post-expirator'), value: 'delete'},
144
- {label: __('Trash', 'post-expirator'), value: 'trash'},
145
- {label: __('Private', 'post-expirator'), value: 'private'},
146
- {label: __('Stick', 'post-expirator'), value: 'stick'},
147
- {label: __('Unstick', 'post-expirator'), value: 'unstick'},
148
  ];
149
 
150
  if (postType !== 'page') {
151
  actionsList = _.union(actionsList, [
152
- {label: __('Category: Replace', 'post-expirator'), value: 'category'},
153
- {label: __('Category: Add', 'post-expirator'), value: 'category-add'},
154
- {label: __('Category: Remove', 'post-expirator'), value: 'category-remove'},
155
  ]);
156
  }
157
 
@@ -161,11 +160,11 @@
161
  }
162
 
163
  return (
164
- <PluginDocumentSettingPanel title={__('Post Expirator', 'post-expirator')} icon="calendar"
165
  initialOpen={enabled} className={'post-expirator-panel'}>
166
  <PanelRow>
167
  <CheckboxControl
168
- label={__('Enable Post Expiration', 'post-expirator')}
169
  checked={enabled}
170
  onChange={(value) => {
171
  this.setState({enabled: !enabled, attribute: 'enabled'})
@@ -178,11 +177,11 @@
178
  <DateTimePicker
179
  currentDate={date}
180
  onChange={(value) => this.setState({date: value, attribute: 'date'})}
181
- is12Hour={true}
182
  />
183
  </PanelRow>
184
  <SelectControl
185
- label={__('How to expire', 'post-expirator')}
186
  value={expireAction}
187
  options={actionsList}
188
  onChange={(value) => {
@@ -193,14 +192,14 @@
193
  (
194
  (isEmpty(keys(categoriesList)) && (
195
  <Fragment>
196
- {__('Loading', 'post-expirator') + ` (${taxonomy})`}
197
  <Spinner/>
198
  </Fragment>
199
  ))
200
  ||
201
  (
202
  <FormTokenField
203
- label={__('Expiration Categories', 'post-expirator') + ` (${taxonomy})`}
204
  value={selectedCats}
205
  suggestions={Object.keys(categoriesList)}
206
  onChange={(value) => {
@@ -291,4 +290,4 @@
291
  });
292
 
293
 
294
- })(window.wp, config);
1
  (function (wp, config) {
2
 
3
  const {registerPlugin} = wp.plugins;
 
4
  const {PluginDocumentSettingPanel} = wp.editPost;
5
  const {PanelRow, DateTimePicker, CheckboxControl, SelectControl, FormTokenField, Spinner} = wp.components;
6
  const {Fragment, Component} = wp.element;
74
  categoriesList[cat.name] = cat;
75
  catIdVsName[cat.id] = cat.name;
76
  });
77
+ this.setState({categoriesList: categoriesList, catIdVsName: catIdVsName, taxonomy: config.strings.category});
78
  });
79
  } else if (postType !== 'page') {
80
  wp.apiFetch({
138
  const postType = wp.data.select('core/editor').getCurrentPostType();
139
 
140
  let actionsList = [
141
+ {label: config.strings.draft, value: 'draft'},
142
+ {label: config.strings.delete, value: 'delete'},
143
+ {label: config.strings.trash, value: 'trash'},
144
+ {label: config.strings.private, value: 'private'},
145
+ {label: config.strings.stick, value: 'stick'},
146
+ {label: config.strings.unstick, value: 'unstick'},
147
  ];
148
 
149
  if (postType !== 'page') {
150
  actionsList = _.union(actionsList, [
151
+ {label: config.strings.categoryReplace, value: 'category'},
152
+ {label: config.strings.categoryAdd, value: 'category-add'},
153
+ {label: config.strings.categoryRemove, value: 'category-remove'},
154
  ]);
155
  }
156
 
160
  }
161
 
162
  return (
163
+ <PluginDocumentSettingPanel title={config.strings.postExpirator} icon="calendar"
164
  initialOpen={enabled} className={'post-expirator-panel'}>
165
  <PanelRow>
166
  <CheckboxControl
167
+ label={config.strings.enablePostExpiration}
168
  checked={enabled}
169
  onChange={(value) => {
170
  this.setState({enabled: !enabled, attribute: 'enabled'})
177
  <DateTimePicker
178
  currentDate={date}
179
  onChange={(value) => this.setState({date: value, attribute: 'date'})}
180
+ is12Hour={config.is12Hour}
181
  />
182
  </PanelRow>
183
  <SelectControl
184
+ label={config.strings.howToExpire}
185
  value={expireAction}
186
  options={actionsList}
187
  onChange={(value) => {
192
  (
193
  (isEmpty(keys(categoriesList)) && (
194
  <Fragment>
195
+ {config.strings.loading + ` (${taxonomy})`}
196
  <Spinner/>
197
  </Fragment>
198
  ))
199
  ||
200
  (
201
  <FormTokenField
202
+ label={config.strings.expirationCategories + ` (${taxonomy})`}
203
  value={selectedCats}
204
  suggestions={Object.keys(categoriesList)}
205
  onChange={(value) => {
290
  });
291
 
292
 
293
+ })(window.wp, window.postExpiratorPanelConfig);
classes/Facade.class.php CHANGED
@@ -70,6 +70,11 @@ class PostExpirator_Facade
70
  public function set_default_capabilities()
71
  {
72
  $admin_role = get_role('administrator');
 
 
 
 
 
73
  $admin_role->add_cap(self::DEFAULT_CAPABILITY_EXPIRE_POST);
74
  }
75
 
@@ -330,30 +335,48 @@ class PostExpirator_Facade
330
  if (
331
  (! isset($defaults['activeMetaBox']) && in_array(
332
  $post->post_type,
333
- array(
334
  'post',
335
  'page',
336
- ),
337
  true
338
  )) || $defaults['activeMetaBox'] === 'active'
339
  ) {
340
  wp_enqueue_script(
341
- 'postexpirator-block',
342
- POSTEXPIRATOR_BASEURL . 'assets/js/block.js',
343
- array('wp-edit-post'),
344
  POSTEXPIRATOR_VERSION,
345
  true
346
  );
347
 
348
  $default_expiry = PostExpirator_Facade::get_default_expiry($post->post_type);
349
  wp_localize_script(
350
- 'postexpirator-block',
351
- 'config',
352
- array(
353
  'defaults' => $defaults,
354
  'default_date' => $default_expiry['ts'],
355
  'default_categories' => get_option('expirationdateCategoryDefaults'),
356
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
357
  );
358
  }
359
  }
70
  public function set_default_capabilities()
71
  {
72
  $admin_role = get_role('administrator');
73
+
74
+ if (! is_a($admin_role, WP_Role::class)) {
75
+ return;
76
+ }
77
+
78
  $admin_role->add_cap(self::DEFAULT_CAPABILITY_EXPIRE_POST);
79
  }
80
 
335
  if (
336
  (! isset($defaults['activeMetaBox']) && in_array(
337
  $post->post_type,
338
+ [
339
  'post',
340
  'page',
341
+ ],
342
  true
343
  )) || $defaults['activeMetaBox'] === 'active'
344
  ) {
345
  wp_enqueue_script(
346
+ 'postexpirator-gutenberg-panel',
347
+ POSTEXPIRATOR_BASEURL . 'assets/js/gutenberg-panel.js',
348
+ ['wp-edit-post'],
349
  POSTEXPIRATOR_VERSION,
350
  true
351
  );
352
 
353
  $default_expiry = PostExpirator_Facade::get_default_expiry($post->post_type);
354
  wp_localize_script(
355
+ 'postexpirator-gutenberg-panel',
356
+ 'postExpiratorPanelConfig',
357
+ [
358
  'defaults' => $defaults,
359
  'default_date' => $default_expiry['ts'],
360
  'default_categories' => get_option('expirationdateCategoryDefaults'),
361
+ 'is12Hour' => get_option('time_format') !== 'H:i',
362
+ 'strings' => [
363
+ 'category' => __('Category'),
364
+ 'draft' => __('Draft', 'post-expirator'),
365
+ 'delete' => __('Delete', 'post-expirator'),
366
+ 'trash' => __('Trash', 'post-expirator'),
367
+ 'private' => __('Private', 'post-expirator'),
368
+ 'stick' => __('Stick', 'post-expirator'),
369
+ 'unstick' => __('Unstick', 'post-expirator'),
370
+ 'categoryReplace' => __('Category: Replace', 'post-expirator'),
371
+ 'categoryAdd' => __('Category: Add', 'post-expirator'),
372
+ 'categoryRemove' => __('Category: Remove', 'post-expirator'),
373
+ 'postExpirator' => __('Post Expirator', 'post-expirator'),
374
+ 'enablePostExpiration' => __('Enable Post Expiration', 'post-expirator'),
375
+ 'howToExpire' => __('How to expire', 'post-expirator'),
376
+ 'loading' => __('Loading', 'post-expirator'),
377
+ 'expirationCategories' => __('Expiration Categories', 'post-expirator'),
378
+ ]
379
+ ]
380
  );
381
  }
382
  }
composer.json CHANGED
@@ -51,4 +51,4 @@
51
  "require": {
52
  "publishpress/wordpress-reviews": "^1.1"
53
  }
54
- }
51
  "require": {
52
  "publishpress/wordpress-reviews": "^1.1"
53
  }
54
+ }
composer.lock CHANGED
@@ -2172,7 +2172,7 @@
2172
  },
2173
  {
2174
  "name": "illuminate/collections",
2175
- "version": "v8.68.1",
2176
  "source": {
2177
  "type": "git",
2178
  "url": "https://github.com/illuminate/collections.git",
@@ -2226,7 +2226,7 @@
2226
  },
2227
  {
2228
  "name": "illuminate/contracts",
2229
- "version": "v8.68.1",
2230
  "source": {
2231
  "type": "git",
2232
  "url": "https://github.com/illuminate/contracts.git",
@@ -2274,7 +2274,7 @@
2274
  },
2275
  {
2276
  "name": "illuminate/macroable",
2277
- "version": "v8.68.1",
2278
  "source": {
2279
  "type": "git",
2280
  "url": "https://github.com/illuminate/macroable.git",
@@ -2320,16 +2320,16 @@
2320
  },
2321
  {
2322
  "name": "illuminate/support",
2323
- "version": "v8.68.1",
2324
  "source": {
2325
  "type": "git",
2326
  "url": "https://github.com/illuminate/support.git",
2327
- "reference": "f0a1ffbfd93a24758f39cc76821ce5a408e20b53"
2328
  },
2329
  "dist": {
2330
  "type": "zip",
2331
- "url": "https://api.github.com/repos/illuminate/support/zipball/f0a1ffbfd93a24758f39cc76821ce5a408e20b53",
2332
- "reference": "f0a1ffbfd93a24758f39cc76821ce5a408e20b53",
2333
  "shasum": ""
2334
  },
2335
  "require": {
@@ -2384,7 +2384,7 @@
2384
  "issues": "https://github.com/laravel/framework/issues",
2385
  "source": "https://github.com/laravel/framework"
2386
  },
2387
- "time": "2021-10-24T14:32:18+00:00"
2388
  },
2389
  {
2390
  "name": "justinrainbow/json-schema",
@@ -2537,16 +2537,16 @@
2537
  },
2538
  {
2539
  "name": "lucatume/wp-browser",
2540
- "version": "3.0.11",
2541
  "source": {
2542
  "type": "git",
2543
  "url": "https://github.com/lucatume/wp-browser.git",
2544
- "reference": "c215ae0aff4a4ea58e2172e7014a2a7b0c160e25"
2545
  },
2546
  "dist": {
2547
  "type": "zip",
2548
- "url": "https://api.github.com/repos/lucatume/wp-browser/zipball/c215ae0aff4a4ea58e2172e7014a2a7b0c160e25",
2549
- "reference": "c215ae0aff4a4ea58e2172e7014a2a7b0c160e25",
2550
  "shasum": ""
2551
  },
2552
  "require": {
@@ -2619,7 +2619,7 @@
2619
  ],
2620
  "support": {
2621
  "issues": "https://github.com/lucatume/wp-browser/issues",
2622
- "source": "https://github.com/lucatume/wp-browser/tree/3.0.11"
2623
  },
2624
  "funding": [
2625
  {
@@ -2627,7 +2627,7 @@
2627
  "type": "github"
2628
  }
2629
  ],
2630
- "time": "2021-09-20T17:00:45+00:00"
2631
  },
2632
  {
2633
  "name": "mikehaertl/php-shellcommand",
@@ -5847,16 +5847,16 @@
5847
  },
5848
  {
5849
  "name": "symfony/config",
5850
- "version": "v5.3.4",
5851
  "source": {
5852
  "type": "git",
5853
  "url": "https://github.com/symfony/config.git",
5854
- "reference": "4268f3059c904c61636275182707f81645517a37"
5855
  },
5856
  "dist": {
5857
  "type": "zip",
5858
- "url": "https://api.github.com/repos/symfony/config/zipball/4268f3059c904c61636275182707f81645517a37",
5859
- "reference": "4268f3059c904c61636275182707f81645517a37",
5860
  "shasum": ""
5861
  },
5862
  "require": {
@@ -5906,7 +5906,7 @@
5906
  "description": "Helps you find, load, combine, autofill and validate configuration values of any kind",
5907
  "homepage": "https://symfony.com",
5908
  "support": {
5909
- "source": "https://github.com/symfony/config/tree/v5.3.4"
5910
  },
5911
  "funding": [
5912
  {
@@ -5922,7 +5922,7 @@
5922
  "type": "tidelift"
5923
  }
5924
  ],
5925
- "time": "2021-07-21T12:40:44+00:00"
5926
  },
5927
  {
5928
  "name": "symfony/console",
@@ -6083,16 +6083,16 @@
6083
  },
6084
  {
6085
  "name": "symfony/dependency-injection",
6086
- "version": "v5.3.8",
6087
  "source": {
6088
  "type": "git",
6089
  "url": "https://github.com/symfony/dependency-injection.git",
6090
- "reference": "e39c344e06a3ceab531ebeb6c077e6652c4a0829"
6091
  },
6092
  "dist": {
6093
  "type": "zip",
6094
- "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/e39c344e06a3ceab531ebeb6c077e6652c4a0829",
6095
- "reference": "e39c344e06a3ceab531ebeb6c077e6652c4a0829",
6096
  "shasum": ""
6097
  },
6098
  "require": {
@@ -6151,7 +6151,7 @@
6151
  "description": "Allows you to standardize and centralize the way objects are constructed in your application",
6152
  "homepage": "https://symfony.com",
6153
  "support": {
6154
- "source": "https://github.com/symfony/dependency-injection/tree/v5.3.8"
6155
  },
6156
  "funding": [
6157
  {
@@ -6167,7 +6167,7 @@
6167
  "type": "tidelift"
6168
  }
6169
  ],
6170
- "time": "2021-09-21T20:52:44+00:00"
6171
  },
6172
  {
6173
  "name": "symfony/deprecation-contracts",
@@ -7308,16 +7308,16 @@
7308
  },
7309
  {
7310
  "name": "symfony/string",
7311
- "version": "v5.3.7",
7312
  "source": {
7313
  "type": "git",
7314
  "url": "https://github.com/symfony/string.git",
7315
- "reference": "8d224396e28d30f81969f083a58763b8b9ceb0a5"
7316
  },
7317
  "dist": {
7318
  "type": "zip",
7319
- "url": "https://api.github.com/repos/symfony/string/zipball/8d224396e28d30f81969f083a58763b8b9ceb0a5",
7320
- "reference": "8d224396e28d30f81969f083a58763b8b9ceb0a5",
7321
  "shasum": ""
7322
  },
7323
  "require": {
@@ -7371,7 +7371,7 @@
7371
  "utf8"
7372
  ],
7373
  "support": {
7374
- "source": "https://github.com/symfony/string/tree/v5.3.7"
7375
  },
7376
  "funding": [
7377
  {
@@ -7387,20 +7387,20 @@
7387
  "type": "tidelift"
7388
  }
7389
  ],
7390
- "time": "2021-08-26T08:00:08+00:00"
7391
  },
7392
  {
7393
  "name": "symfony/translation",
7394
- "version": "v5.3.9",
7395
  "source": {
7396
  "type": "git",
7397
  "url": "https://github.com/symfony/translation.git",
7398
- "reference": "6e69f3551c1a3356cf6ea8d019bf039a0f8b6886"
7399
  },
7400
  "dist": {
7401
  "type": "zip",
7402
- "url": "https://api.github.com/repos/symfony/translation/zipball/6e69f3551c1a3356cf6ea8d019bf039a0f8b6886",
7403
- "reference": "6e69f3551c1a3356cf6ea8d019bf039a0f8b6886",
7404
  "shasum": ""
7405
  },
7406
  "require": {
@@ -7466,7 +7466,7 @@
7466
  "description": "Provides tools to internationalize your application",
7467
  "homepage": "https://symfony.com",
7468
  "support": {
7469
- "source": "https://github.com/symfony/translation/tree/v5.3.9"
7470
  },
7471
  "funding": [
7472
  {
@@ -7482,7 +7482,7 @@
7482
  "type": "tidelift"
7483
  }
7484
  ],
7485
- "time": "2021-08-26T08:22:53+00:00"
7486
  },
7487
  {
7488
  "name": "symfony/translation-contracts",
2172
  },
2173
  {
2174
  "name": "illuminate/collections",
2175
+ "version": "v8.69.0",
2176
  "source": {
2177
  "type": "git",
2178
  "url": "https://github.com/illuminate/collections.git",
2226
  },
2227
  {
2228
  "name": "illuminate/contracts",
2229
+ "version": "v8.69.0",
2230
  "source": {
2231
  "type": "git",
2232
  "url": "https://github.com/illuminate/contracts.git",
2274
  },
2275
  {
2276
  "name": "illuminate/macroable",
2277
+ "version": "v8.69.0",
2278
  "source": {
2279
  "type": "git",
2280
  "url": "https://github.com/illuminate/macroable.git",
2320
  },
2321
  {
2322
  "name": "illuminate/support",
2323
+ "version": "v8.69.0",
2324
  "source": {
2325
  "type": "git",
2326
  "url": "https://github.com/illuminate/support.git",
2327
+ "reference": "a8851b7001530d3c11626a81449ed9b63dd10db7"
2328
  },
2329
  "dist": {
2330
  "type": "zip",
2331
+ "url": "https://api.github.com/repos/illuminate/support/zipball/a8851b7001530d3c11626a81449ed9b63dd10db7",
2332
+ "reference": "a8851b7001530d3c11626a81449ed9b63dd10db7",
2333
  "shasum": ""
2334
  },
2335
  "require": {
2384
  "issues": "https://github.com/laravel/framework/issues",
2385
  "source": "https://github.com/laravel/framework"
2386
  },
2387
+ "time": "2021-10-29T13:34:03+00:00"
2388
  },
2389
  {
2390
  "name": "justinrainbow/json-schema",
2537
  },
2538
  {
2539
  "name": "lucatume/wp-browser",
2540
+ "version": "3.0.12",
2541
  "source": {
2542
  "type": "git",
2543
  "url": "https://github.com/lucatume/wp-browser.git",
2544
+ "reference": "f6e8d3b38e2b457057262d414a1a69270521dcbd"
2545
  },
2546
  "dist": {
2547
  "type": "zip",
2548
+ "url": "https://api.github.com/repos/lucatume/wp-browser/zipball/f6e8d3b38e2b457057262d414a1a69270521dcbd",
2549
+ "reference": "f6e8d3b38e2b457057262d414a1a69270521dcbd",
2550
  "shasum": ""
2551
  },
2552
  "require": {
2619
  ],
2620
  "support": {
2621
  "issues": "https://github.com/lucatume/wp-browser/issues",
2622
+ "source": "https://github.com/lucatume/wp-browser/tree/3.0.12"
2623
  },
2624
  "funding": [
2625
  {
2627
  "type": "github"
2628
  }
2629
  ],
2630
+ "time": "2021-10-30T16:28:12+00:00"
2631
  },
2632
  {
2633
  "name": "mikehaertl/php-shellcommand",
5847
  },
5848
  {
5849
  "name": "symfony/config",
5850
+ "version": "v5.3.10",
5851
  "source": {
5852
  "type": "git",
5853
  "url": "https://github.com/symfony/config.git",
5854
+ "reference": "ac23c2f24d5634966d665d836c3933d54347e5d4"
5855
  },
5856
  "dist": {
5857
  "type": "zip",
5858
+ "url": "https://api.github.com/repos/symfony/config/zipball/ac23c2f24d5634966d665d836c3933d54347e5d4",
5859
+ "reference": "ac23c2f24d5634966d665d836c3933d54347e5d4",
5860
  "shasum": ""
5861
  },
5862
  "require": {
5906
  "description": "Helps you find, load, combine, autofill and validate configuration values of any kind",
5907
  "homepage": "https://symfony.com",
5908
  "support": {
5909
+ "source": "https://github.com/symfony/config/tree/v5.3.10"
5910
  },
5911
  "funding": [
5912
  {
5922
  "type": "tidelift"
5923
  }
5924
  ],
5925
+ "time": "2021-10-22T09:06:52+00:00"
5926
  },
5927
  {
5928
  "name": "symfony/console",
6083
  },
6084
  {
6085
  "name": "symfony/dependency-injection",
6086
+ "version": "v5.3.10",
6087
  "source": {
6088
  "type": "git",
6089
  "url": "https://github.com/symfony/dependency-injection.git",
6090
+ "reference": "be833dd336c248ef2bdabf24665351455f52afdb"
6091
  },
6092
  "dist": {
6093
  "type": "zip",
6094
+ "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/be833dd336c248ef2bdabf24665351455f52afdb",
6095
+ "reference": "be833dd336c248ef2bdabf24665351455f52afdb",
6096
  "shasum": ""
6097
  },
6098
  "require": {
6151
  "description": "Allows you to standardize and centralize the way objects are constructed in your application",
6152
  "homepage": "https://symfony.com",
6153
  "support": {
6154
+ "source": "https://github.com/symfony/dependency-injection/tree/v5.3.10"
6155
  },
6156
  "funding": [
6157
  {
6167
  "type": "tidelift"
6168
  }
6169
  ],
6170
+ "time": "2021-10-22T18:11:05+00:00"
6171
  },
6172
  {
6173
  "name": "symfony/deprecation-contracts",
7308
  },
7309
  {
7310
  "name": "symfony/string",
7311
+ "version": "v5.3.10",
7312
  "source": {
7313
  "type": "git",
7314
  "url": "https://github.com/symfony/string.git",
7315
+ "reference": "d70c35bb20bbca71fc4ab7921e3c6bda1a82a60c"
7316
  },
7317
  "dist": {
7318
  "type": "zip",
7319
+ "url": "https://api.github.com/repos/symfony/string/zipball/d70c35bb20bbca71fc4ab7921e3c6bda1a82a60c",
7320
+ "reference": "d70c35bb20bbca71fc4ab7921e3c6bda1a82a60c",
7321
  "shasum": ""
7322
  },
7323
  "require": {
7371
  "utf8"
7372
  ],
7373
  "support": {
7374
+ "source": "https://github.com/symfony/string/tree/v5.3.10"
7375
  },
7376
  "funding": [
7377
  {
7387
  "type": "tidelift"
7388
  }
7389
  ],
7390
+ "time": "2021-10-27T18:21:46+00:00"
7391
  },
7392
  {
7393
  "name": "symfony/translation",
7394
+ "version": "v5.3.10",
7395
  "source": {
7396
  "type": "git",
7397
  "url": "https://github.com/symfony/translation.git",
7398
+ "reference": "6ef197aea2ac8b9cd63e0da7522b3771714035aa"
7399
  },
7400
  "dist": {
7401
  "type": "zip",
7402
+ "url": "https://api.github.com/repos/symfony/translation/zipball/6ef197aea2ac8b9cd63e0da7522b3771714035aa",
7403
+ "reference": "6ef197aea2ac8b9cd63e0da7522b3771714035aa",
7404
  "shasum": ""
7405
  },
7406
  "require": {
7466
  "description": "Provides tools to internationalize your application",
7467
  "homepage": "https://symfony.com",
7468
  "support": {
7469
+ "source": "https://github.com/symfony/translation/tree/v5.3.10"
7470
  },
7471
  "funding": [
7472
  {
7482
  "type": "tidelift"
7483
  }
7484
  ],
7485
+ "time": "2021-10-10T06:43:24+00:00"
7486
  },
7487
  {
7488
  "name": "symfony/translation-contracts",
languages/post-expirator.pot CHANGED
@@ -1,52 +1,78 @@
1
- # Copyright (C) 2021 Aaron Axelsen
2
- # This file is distributed under the same license as the Post Expirator package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Post Expirator 2.4.4\n"
6
- "Report-Msgid-Bugs-To: "
7
- "https://wordpress.org/support/plugin/PublishPress-Future\n"
8
- "POT-Creation-Date: 2021-09-07 07:34:21+00:00\n"
9
  "MIME-Version: 1.0\n"
10
- "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "Last-Translator: PostExpirator Translate Team\n"
13
- "Language-Team: PostExpirator Translate Team\n"
 
 
14
 
15
- #: classes/Display.class.php:41 views/tabs.php:6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  msgid "Post Expirator Options"
17
  msgstr ""
18
 
19
- #: classes/Display.class.php:123
 
 
 
 
 
20
  msgid "Debugging Disabled"
21
  msgstr ""
22
 
23
- #: classes/Display.class.php:128
24
  msgid "Debugging Enabled"
25
  msgstr ""
26
 
27
- #: classes/Display.class.php:135
28
  msgid "Debugging Table Emptied"
29
  msgstr ""
30
 
31
- #: classes/Display.class.php:150
32
- msgid ""
33
- "Below is a dump of the debugging table, this should be useful for "
34
- "troubleshooting."
35
- msgstr ""
36
-
37
- #: classes/Display.class.php:197 classes/Display.class.php:234
38
- msgid "Saved Options!"
39
  msgstr ""
40
 
41
- #: post-expirator-debug.php:66
42
  msgid "Debugging table is currently empty."
43
  msgstr ""
44
 
45
- #: post-expirator-debug.php:70
46
  msgid "Timestamp"
47
  msgstr ""
48
 
49
- #: post-expirator-debug.php:71
50
  msgid "Message"
51
  msgstr ""
52
 
@@ -62,556 +88,543 @@ msgstr ""
62
  msgid "Post expires at EXPIRATIONTIME on EXPIRATIONDATE"
63
  msgstr ""
64
 
65
- #: post-expirator.php:42
66
  msgid "Settings"
67
  msgstr ""
68
 
69
- #: post-expirator.php:72 post-expirator.php:149
 
70
  msgid "Expires"
71
  msgstr ""
72
 
73
- #: post-expirator.php:618 post-expirator.php:629 post-expirator.php:640
74
- #: post-expirator.php:651
75
- msgid ""
76
- "%1$s (%2$s) has expired at %3$s. Post status has been successfully changed "
77
- "to \"%4$s\"."
78
  msgstr ""
79
 
80
- #: post-expirator.php:662
81
- msgid ""
82
- "%1$s (%2$s) has expired at %3$s. Post \"%4$s\" status has been successfully "
83
- "set."
84
  msgstr ""
85
 
86
- #: post-expirator.php:673
87
- msgid ""
88
- "%1$s (%2$s) has expired at %3$s. Post \"%4$s\" status has been successfully "
89
- "removed."
90
  msgstr ""
91
 
92
- #: post-expirator.php:686 post-expirator.php:700
93
- msgid ""
94
- "%1$s (%2$s) has expired at %3$s. Post \"%4$s\" have now been set to "
95
- "\"%5$s\"."
96
  msgstr ""
97
 
98
- #: post-expirator.php:723 post-expirator.php:737
99
- msgid ""
100
- "%1$s (%2$s) has expired at %3$s. The following post \"%4$s\" have now been "
101
- "added: \"%5$s\". The full list of categories on the post are: \"%6$s\"."
102
  msgstr ""
103
 
104
- #: post-expirator.php:766 post-expirator.php:787
105
- msgid ""
106
- "%1$s (%2$s) has expired at %3$s. The following post \"%4$s\" have now been "
107
- "removed: \"%5$s\". The full list of categories on the post are: \"%6$s\"."
108
  msgstr ""
109
 
110
- #: post-expirator.php:806
111
  msgid "Post Expiration Complete \"%s\""
112
  msgstr ""
113
 
114
- #: post-expirator.php:842
115
- msgid "[%1$s] %2$s"
116
  msgstr ""
117
 
118
- #: post-expirator.php:1415
119
- msgid ""
120
- "Select the hierarchical taxonomy to be used for \"category\" based "
121
- "expiration."
122
  msgstr ""
123
 
124
- #: post-expirator.php:1417
125
- msgid "No taxonomies found"
126
  msgstr ""
127
 
128
- #: views/bulk-edit.php:18 views/menu-diagnostics.php:45 views/quick-edit.php:12
 
 
 
 
 
 
129
  msgid "Date"
130
  msgstr ""
131
 
132
- #: views/bulk-edit.php:20 views/classic-metabox.php:3 views/quick-edit.php:7
 
 
 
133
  msgid "Enable Post Expiration"
134
  msgstr ""
135
 
136
- #: views/bulk-edit.php:22
137
  msgid "No Change"
138
  msgstr ""
139
 
140
- #: views/bulk-edit.php:23
141
  msgid "Change expiry date if enabled on posts"
142
  msgstr ""
143
 
144
- #: views/bulk-edit.php:23
145
  msgid "Change on posts"
146
  msgstr ""
147
 
148
- #: views/bulk-edit.php:24
149
  msgid "Add expiry date if not enabled on posts"
150
  msgstr ""
151
 
152
- #: views/bulk-edit.php:24
153
  msgid "Add to posts"
154
  msgstr ""
155
 
156
- #: views/bulk-edit.php:25
157
  msgid "Change & Add"
158
  msgstr ""
159
 
160
- #: views/bulk-edit.php:26
161
  msgid "Remove from posts"
162
  msgstr ""
163
 
164
- #: views/bulk-edit.php:31 views/classic-metabox.php:40 views/quick-edit.php:14
 
 
165
  msgid "Month"
166
  msgstr ""
167
 
168
- #: views/bulk-edit.php:47 views/classic-metabox.php:57 views/quick-edit.php:28
 
 
169
  msgid "Day"
170
  msgstr ""
171
 
172
- #: views/bulk-edit.php:51 views/classic-metabox.php:16 views/quick-edit.php:32
 
 
173
  msgid "Year"
174
  msgstr ""
175
 
176
- #: views/bulk-edit.php:55 views/classic-metabox.php:61 views/quick-edit.php:36
 
 
177
  msgid "Hour"
178
  msgstr ""
179
 
180
- #: views/bulk-edit.php:59 views/classic-metabox.php:79 views/quick-edit.php:40
 
 
181
  msgid "Minute"
182
  msgstr ""
183
 
184
- #: views/bulk-edit.php:66 views/quick-edit.php:46
 
185
  msgid "Type"
186
  msgstr ""
187
 
188
- #: views/bulk-edit.php:67 views/classic-metabox.php:83
189
- #: views/menu-defaults.php:60 views/quick-edit.php:47
 
 
 
190
  msgid "How to expire"
191
  msgstr ""
192
 
193
- #: views/bulk-edit.php:79 views/classic-metabox.php:96 views/quick-edit.php:57
 
 
 
194
  msgid "Expiration Categories"
195
  msgstr ""
196
 
197
- #: views/classic-metabox.php:9
198
  msgid "The published date/time will be used as the expiration value"
199
  msgstr ""
200
 
201
- #: views/classic-metabox.php:104
202
- msgid ""
203
- "You must assign a heirarchical taxonomy to this post type to use this "
204
- "feature."
205
  msgstr ""
206
 
207
- #: views/classic-metabox.php:106
208
- msgid ""
209
- "More than 1 heirachical taxonomy detected. You must assign a default "
210
- "taxonomy on the settings screen."
211
  msgstr ""
212
 
213
- #: views/classic-metabox.php:116
214
  msgid "Taxonomy Name"
215
  msgstr ""
216
 
217
- #: views/expire-column.php:3
218
  msgid "Never"
219
  msgstr ""
220
 
221
- #: views/how-to-expire.php:24
 
222
  msgid "Draft"
223
  msgstr ""
224
 
225
- #: views/how-to-expire.php:25
 
226
  msgid "Delete"
227
  msgstr ""
228
 
229
- #: views/how-to-expire.php:26
 
230
  msgid "Trash"
231
  msgstr ""
232
 
233
- #: views/how-to-expire.php:27
 
234
  msgid "Private"
235
  msgstr ""
236
 
237
- #: views/how-to-expire.php:28
 
238
  msgid "Stick"
239
  msgstr ""
240
 
241
- #: views/how-to-expire.php:29
 
242
  msgid "Unstick"
243
  msgstr ""
244
 
245
- #: views/how-to-expire.php:31
 
246
  msgid "Category: Replace"
247
  msgstr ""
248
 
249
- #: views/how-to-expire.php:32
 
250
  msgid "Category: Add"
251
  msgstr ""
252
 
253
- #: views/how-to-expire.php:33
 
254
  msgid "Category: Remove"
255
  msgstr ""
256
 
257
- #: views/menu-defaults.php:3
258
  msgid "Default Expiration Values"
259
  msgstr ""
260
 
261
- #: views/menu-defaults.php:5
262
- msgid ""
263
- "Use the values below to set the default actions/values to be used for each "
264
- "for the corresponding post types. These values can all be overwritten when "
265
- "creating/editing the post/page."
266
  msgstr ""
267
 
268
- #: views/menu-defaults.php:51 views/menu-defaults.php:53
 
269
  msgid "Active"
270
  msgstr ""
271
 
272
- #: views/menu-defaults.php:55
273
  msgid "Inactive"
274
  msgstr ""
275
 
276
- #: views/menu-defaults.php:56
277
  msgid "Select whether the post expirator meta box is active for this post type."
278
  msgstr ""
279
 
280
- #: views/menu-defaults.php:63
281
  msgid "Select the default expire action for the post type."
282
  msgstr ""
283
 
284
- #: views/menu-defaults.php:67
285
  msgid "Auto-Enable?"
286
  msgstr ""
287
 
288
- #: views/menu-defaults.php:69 views/menu-general.php:113
289
- #: views/menu-general.php:122 views/menu-general.php:143
 
 
 
 
290
  msgid "Enabled"
291
  msgstr ""
292
 
293
- #: views/menu-defaults.php:71 views/menu-general.php:115
294
- #: views/menu-general.php:124 views/menu-general.php:145
 
 
 
 
295
  msgid "Disabled"
296
  msgstr ""
297
 
298
- #: views/menu-defaults.php:72
299
  msgid "Select whether the post expirator is enabled for all new posts."
300
  msgstr ""
301
 
302
- #: views/menu-defaults.php:76
303
  msgid "Taxonomy (hierarchical)"
304
  msgstr ""
305
 
306
- #: views/menu-defaults.php:82 views/menu-general.php:129
 
307
  msgid "Who to notify"
308
  msgstr ""
309
 
310
- #: views/menu-defaults.php:85
311
- msgid ""
312
- "Enter a comma separate list of emails that you would like to be notified "
313
- "when the post expires."
314
  msgstr ""
315
 
316
- #: views/menu-defaults.php:90 views/menu-general.php:77
 
317
  msgid "None"
318
  msgstr ""
319
 
320
- #: views/menu-defaults.php:91
321
  msgid "Inherit from General Settings"
322
  msgstr ""
323
 
324
- #: views/menu-defaults.php:92 views/menu-defaults.php:116
325
- #: views/menu-general.php:78 views/menu-general.php:85
 
 
326
  msgid "Custom"
327
  msgstr ""
328
 
329
- #: views/menu-defaults.php:93
330
  msgid "Publish Time"
331
  msgstr ""
332
 
333
- #: views/menu-defaults.php:106 views/menu-general.php:74
 
334
  msgid "Default Date/Time Duration"
335
  msgstr ""
336
 
337
- #: views/menu-defaults.php:113
338
- msgid ""
339
- "Set the default expiration date to be used when creating a new post of this "
340
- "type."
341
- msgstr ""
342
-
343
- #: views/menu-defaults.php:118 views/menu-general.php:87
344
- msgid ""
345
- "Set the custom value to use for the default expiration date. For "
346
- "information on formatting, see %1$s. For example, you could enter %2$s+1 "
347
- "month%3$s or %4$s+1 week 2 days 4 hours 2 seconds%5$s or %6$snext "
348
- "Thursday%7$s."
349
  msgstr ""
350
 
351
- #: views/menu-defaults.php:129 views/menu-general.php:189
 
352
  msgid "Save Changes"
353
  msgstr ""
354
 
355
- #: views/menu-diagnostics.php:3
356
  msgid "Advanced Diagnostics"
357
  msgstr ""
358
 
359
- #: views/menu-diagnostics.php:6
360
  msgid "Debug Logging"
361
  msgstr ""
362
 
363
- #: views/menu-diagnostics.php:11
364
- msgid "Status: Enabled"
365
- msgstr ""
366
-
367
- #: views/menu-diagnostics.php:11
368
  msgid "Disable Debugging"
369
  msgstr ""
370
 
371
- #: views/menu-diagnostics.php:12 views/tabs.php:13
372
- msgid "View Debug Logs"
373
- msgstr ""
374
-
375
  #: views/menu-diagnostics.php:14
376
- msgid "Status: Disabled"
 
377
  msgstr ""
378
 
379
- #: views/menu-diagnostics.php:14
380
  msgid "Enable Debugging"
381
  msgstr ""
382
 
383
- #: views/menu-diagnostics.php:20 views/menu-diagnostics.php:22
 
384
  msgid "Purge Debug Log"
385
  msgstr ""
386
 
387
- #: views/menu-diagnostics.php:26
388
  msgid "WP-Cron Status"
389
  msgstr ""
390
 
391
- #: views/menu-diagnostics.php:30
392
- msgid "DISABLED"
393
- msgstr ""
394
-
395
- #: views/menu-diagnostics.php:32
396
- msgid "ENABLED - OK"
397
  msgstr ""
398
 
399
- #: views/menu-diagnostics.php:38
400
- msgid "Current Cron Schedule"
401
  msgstr ""
402
 
403
- #: views/menu-diagnostics.php:40
404
- msgid ""
405
- "The below table will show all currently scheduled cron events with the next "
406
- "run time."
407
  msgstr ""
408
 
409
- #: views/menu-diagnostics.php:46
410
  msgid "Event"
411
  msgstr ""
412
 
413
- #: views/menu-diagnostics.php:47
414
  msgid "Arguments / Schedule"
415
  msgstr ""
416
 
417
- #: views/menu-diagnostics.php:62
 
 
 
 
418
  msgid "No Arguments"
419
  msgstr ""
420
 
421
- #: views/menu-diagnostics.php:73
422
  msgid "Single Event"
423
  msgstr ""
424
 
425
- #: views/menu-general.php:44
426
- msgid ""
427
- "The post expirator plugin sets a custom meta value, and then optionally "
428
- "allows you to select if you want the post changed to a draft status or "
429
- "deleted when it expires."
430
  msgstr ""
431
 
432
- #: views/menu-general.php:46
433
  msgid "Shortcode"
434
  msgstr ""
435
 
436
- #: views/menu-general.php:47
437
  msgid "Valid %s attributes:"
438
  msgstr ""
439
 
440
- #: views/menu-general.php:49
441
  msgid "%1$s - valid options are %2$sfull%3$s (default), %4$sdate%5$s, %6$stime%7$s"
442
  msgstr ""
443
 
444
- #: views/menu-general.php:50 views/menu-general.php:51
 
445
  msgid "%s - format set here will override the value set on the settings page"
446
  msgstr ""
447
 
448
- #: views/menu-general.php:57
449
  msgid "Defaults"
450
  msgstr ""
451
 
452
- #: views/menu-general.php:60
453
  msgid "Date Format"
454
  msgstr ""
455
 
456
- #: views/menu-general.php:63
457
- msgid ""
458
- "The default format to use when displaying the expiration date within a post "
459
- "using the shortcode or within the footer. For information on valid "
460
- "formatting options, see: %s."
461
  msgstr ""
462
 
463
- #: views/menu-general.php:67
464
  msgid "Time Format"
465
  msgstr ""
466
 
467
- #: views/menu-general.php:70
468
- msgid ""
469
- "The default format to use when displaying the expiration time within a post "
470
- "using the shortcode or within the footer. For information on valid "
471
- "formatting options, see: %s."
472
  msgstr ""
473
 
474
- #: views/menu-general.php:79
475
  msgid "Post/Page Publish Time"
476
  msgstr ""
477
 
478
- #: views/menu-general.php:81
479
- msgid ""
480
- "Set the default expiration date to be used when creating new posts and "
481
- "pages. Defaults to none."
482
  msgstr ""
483
 
484
- #: views/menu-general.php:92
485
  msgid "Default Expiration Category"
486
  msgstr ""
487
 
488
- #: views/menu-general.php:102
489
  msgid "Sets the default expiration category for the post."
490
  msgstr ""
491
 
492
- #: views/menu-general.php:107
493
  msgid "Expiration Email Notification"
494
  msgstr ""
495
 
496
- #: views/menu-general.php:108
497
- msgid ""
498
- "Whenever a post expires, an email can be sent to alert users of the "
499
- "expiration."
500
  msgstr ""
501
 
502
- #: views/menu-general.php:111
503
  msgid "Enable Email Notification?"
504
  msgstr ""
505
 
506
- #: views/menu-general.php:116
507
- msgid ""
508
- "This will enable or disable the send of email notification on post "
509
- "expiration."
510
  msgstr ""
511
 
512
- #: views/menu-general.php:120
513
  msgid "Include Blog Administrators?"
514
  msgstr ""
515
 
516
- #: views/menu-general.php:125
517
- msgid ""
518
- "This will include all users with the role of \"Administrator\" in the post "
519
- "expiration email."
520
  msgstr ""
521
 
522
- #: views/menu-general.php:132
523
- msgid ""
524
- "Enter a comma separate list of emails that you would like to be notified "
525
- "when the post expires. This will be applied to ALL post types. You can "
526
- "set post type specific emails on the Defaults tab."
527
  msgstr ""
528
 
529
- #: views/menu-general.php:137
530
  msgid "Post Footer Display"
531
  msgstr ""
532
 
533
- #: views/menu-general.php:138
534
- msgid ""
535
- "Enabling this below will display the expiration date automatically at the "
536
- "end of any post which is set to expire."
537
  msgstr ""
538
 
539
- #: views/menu-general.php:141
540
  msgid "Show in post footer?"
541
  msgstr ""
542
 
543
- #: views/menu-general.php:146
544
- msgid ""
545
- "This will enable or disable displaying the post expiration date in the post "
546
- "footer."
547
  msgstr ""
548
 
549
- #: views/menu-general.php:150
550
  msgid "Footer Contents"
551
  msgstr ""
552
 
553
- #: views/menu-general.php:153
554
- msgid ""
555
- "Enter the text you would like to appear at the bottom of every post that "
556
- "will expire. The following placeholders will be replaced with the post "
557
- "expiration date in the following format:"
558
  msgstr ""
559
 
560
- #: views/menu-general.php:162
561
  msgid "Footer Style"
562
  msgstr ""
563
 
564
- #: views/menu-general.php:165
565
  msgid "This post will expire on"
566
  msgstr ""
567
 
568
- #: views/menu-general.php:166
569
  msgid "The inline css which will be used to style the footer text."
570
  msgstr ""
571
 
572
- #: views/menu-general.php:171
573
  msgid "Advanced Options"
574
  msgstr ""
575
 
576
- #: views/menu-general.php:172
577
- msgid ""
578
- "Please do not update anything here unless you know what it entails. For "
579
- "advanced users only."
580
  msgstr ""
581
 
582
- #: views/menu-general.php:178
583
  msgid "Block Editor Support"
584
  msgstr ""
585
 
586
- #: views/menu-general.php:180
587
  msgid "Show Gutenberg style box"
588
  msgstr ""
589
 
590
- #: views/menu-general.php:182
591
  msgid "Show Classic Editor style box"
592
  msgstr ""
593
 
594
- #: views/menu-general.php:183
595
- msgid ""
596
- "Toggle between native support for the Block Editor or the backward "
597
- "compatible Classic Editor style metabox."
 
 
598
  msgstr ""
599
 
600
- #: views/tabs.php:9
601
  msgid "General Settings"
602
  msgstr ""
603
 
604
- #: views/tabs.php:10
605
  msgid "Post Types"
606
  msgstr ""
607
 
608
- #: views/tabs.php:11
609
  msgid "Diagnostics"
610
  msgstr ""
611
 
612
- #. Description of the plugin/theme
613
- msgid ""
614
- "Allows you to add an expiration date (minute) to posts which you can "
615
- "configure to either delete the post, change it to a draft, or update the "
616
- "post categories at expiration time."
617
- msgstr ""
1
+ # Copyright (C) 2021 PublishPress
2
+ # This file is distributed under the same license as the Post Expirator plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Post Expirator 2.6.2\n"
6
+ "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/publishpress-future\n"
7
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
+ "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "POT-Creation-Date: 2021-11-02T20:47:14-03:00\n"
13
+ "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
+ "X-Generator: WP-CLI 2.5.0\n"
15
+ "X-Domain: post-expirator\n"
16
 
17
+ #. Plugin Name of the plugin
18
+ #: classes/Display.class.php:50
19
+ #: post-expirator.php:350
20
+ #: views/bulk-edit.php:16
21
+ #: assets/jsx/block.jsx:164
22
+ msgid "Post Expirator"
23
+ msgstr ""
24
+
25
+ #. Plugin URI of the plugin
26
+ msgid "http://wordpress.org/extend/plugins/post-expirator/"
27
+ msgstr ""
28
+
29
+ #. Description of the plugin
30
+ msgid "Allows you to add an expiration date (minute) to posts which you can configure to either delete the post, change it to a draft, or update the post categories at expiration time."
31
+ msgstr ""
32
+
33
+ #. Author of the plugin
34
+ msgid "PublishPress"
35
+ msgstr ""
36
+
37
+ #. Author URI of the plugin
38
+ msgid "http://publishpress.com"
39
+ msgstr ""
40
+
41
+ #: classes/Display.class.php:49
42
+ #: views/tabs.php:8
43
  msgid "Post Expirator Options"
44
  msgstr ""
45
 
46
+ #: classes/Display.class.php:190
47
+ #: classes/Display.class.php:263
48
+ msgid "Saved Options!"
49
+ msgstr ""
50
+
51
+ #: classes/Display.class.php:289
52
  msgid "Debugging Disabled"
53
  msgstr ""
54
 
55
+ #: classes/Display.class.php:294
56
  msgid "Debugging Enabled"
57
  msgstr ""
58
 
59
+ #: classes/Display.class.php:301
60
  msgid "Debugging Table Emptied"
61
  msgstr ""
62
 
63
+ #: classes/Display.class.php:317
64
+ msgid "Below is a dump of the debugging table, this should be useful for troubleshooting."
 
 
 
 
 
 
65
  msgstr ""
66
 
67
+ #: post-expirator-debug.php:77
68
  msgid "Debugging table is currently empty."
69
  msgstr ""
70
 
71
+ #: post-expirator-debug.php:82
72
  msgid "Timestamp"
73
  msgstr ""
74
 
75
+ #: post-expirator-debug.php:83
76
  msgid "Message"
77
  msgstr ""
78
 
88
  msgid "Post expires at EXPIRATIONTIME on EXPIRATIONDATE"
89
  msgstr ""
90
 
91
+ #: post-expirator.php:44
92
  msgid "Settings"
93
  msgstr ""
94
 
95
+ #: post-expirator.php:86
96
+ #: post-expirator.php:172
97
  msgid "Expires"
98
  msgstr ""
99
 
100
+ #: post-expirator.php:808
101
+ #: post-expirator.php:830
102
+ #: post-expirator.php:852
103
+ #: post-expirator.php:874
104
+ msgid "%1$s (%2$s) has expired at %3$s. Post status has been successfully changed to \"%4$s\"."
105
  msgstr ""
106
 
107
+ #: post-expirator.php:896
108
+ msgid "%1$s (%2$s) has expired at %3$s. Post \"%4$s\" status has been successfully set."
 
 
109
  msgstr ""
110
 
111
+ #: post-expirator.php:915
112
+ msgid "%1$s (%2$s) has expired at %3$s. Post \"%4$s\" status has been successfully removed."
 
 
113
  msgstr ""
114
 
115
+ #: post-expirator.php:941
116
+ #: post-expirator.php:983
117
+ msgid "%1$s (%2$s) has expired at %3$s. Post \"%4$s\" have now been set to \"%5$s\"."
 
118
  msgstr ""
119
 
120
+ #: post-expirator.php:1041
121
+ #: post-expirator.php:1084
122
+ msgid "%1$s (%2$s) has expired at %3$s. The following post \"%4$s\" have now been added: \"%5$s\". The full list of categories on the post are: \"%6$s\"."
 
123
  msgstr ""
124
 
125
+ #: post-expirator.php:1149
126
+ #: post-expirator.php:1199
127
+ msgid "%1$s (%2$s) has expired at %3$s. The following post \"%4$s\" have now been removed: \"%5$s\". The full list of categories on the post are: \"%6$s\"."
 
128
  msgstr ""
129
 
130
+ #: post-expirator.php:1251
131
  msgid "Post Expiration Complete \"%s\""
132
  msgstr ""
133
 
134
+ #: post-expirator.php:1927
135
+ msgid "Select the hierarchical taxonomy to be used for \"category\" based expiration."
136
  msgstr ""
137
 
138
+ #: post-expirator.php:1932
139
+ msgid "No taxonomies found"
 
 
140
  msgstr ""
141
 
142
+ #: post-expirator.php:1979
143
+ msgid "You're not allowed to set posts to expire"
144
  msgstr ""
145
 
146
+ #: post-expirator.php:1980
147
+ msgid "Forbidden"
148
+ msgstr ""
149
+
150
+ #: views/bulk-edit.php:21
151
+ #: views/menu-diagnostics.php:64
152
+ #: views/quick-edit.php:14
153
  msgid "Date"
154
  msgstr ""
155
 
156
+ #: views/bulk-edit.php:24
157
+ #: views/classic-metabox.php:6
158
+ #: views/quick-edit.php:8
159
+ #: assets/jsx/block.jsx:168
160
  msgid "Enable Post Expiration"
161
  msgstr ""
162
 
163
+ #: views/bulk-edit.php:28
164
  msgid "No Change"
165
  msgstr ""
166
 
167
+ #: views/bulk-edit.php:32
168
  msgid "Change expiry date if enabled on posts"
169
  msgstr ""
170
 
171
+ #: views/bulk-edit.php:33
172
  msgid "Change on posts"
173
  msgstr ""
174
 
175
+ #: views/bulk-edit.php:36
176
  msgid "Add expiry date if not enabled on posts"
177
  msgstr ""
178
 
179
+ #: views/bulk-edit.php:37
180
  msgid "Add to posts"
181
  msgstr ""
182
 
183
+ #: views/bulk-edit.php:40
184
  msgid "Change & Add"
185
  msgstr ""
186
 
187
+ #: views/bulk-edit.php:43
188
  msgid "Remove from posts"
189
  msgstr ""
190
 
191
+ #: views/bulk-edit.php:49
192
+ #: views/classic-metabox.php:50
193
+ #: views/quick-edit.php:17
194
  msgid "Month"
195
  msgstr ""
196
 
197
+ #: views/bulk-edit.php:73
198
+ #: views/classic-metabox.php:71
199
+ #: views/quick-edit.php:39
200
  msgid "Day"
201
  msgstr ""
202
 
203
+ #: views/bulk-edit.php:80
204
+ #: views/classic-metabox.php:22
205
+ #: views/quick-edit.php:46
206
  msgid "Year"
207
  msgstr ""
208
 
209
+ #: views/bulk-edit.php:87
210
+ #: views/classic-metabox.php:78
211
+ #: views/quick-edit.php:53
212
  msgid "Hour"
213
  msgstr ""
214
 
215
+ #: views/bulk-edit.php:94
216
+ #: views/classic-metabox.php:102
217
+ #: views/quick-edit.php:59
218
  msgid "Minute"
219
  msgstr ""
220
 
221
+ #: views/bulk-edit.php:104
222
+ #: views/quick-edit.php:67
223
  msgid "Type"
224
  msgstr ""
225
 
226
+ #: views/bulk-edit.php:106
227
+ #: views/classic-metabox.php:109
228
+ #: views/menu-defaults.php:93
229
+ #: views/quick-edit.php:69
230
+ #: assets/jsx/block.jsx:185
231
  msgid "How to expire"
232
  msgstr ""
233
 
234
+ #: views/bulk-edit.php:124
235
+ #: views/classic-metabox.php:127
236
+ #: views/quick-edit.php:85
237
+ #: assets/jsx/block.jsx:203
238
  msgid "Expiration Categories"
239
  msgstr ""
240
 
241
+ #: views/classic-metabox.php:13
242
  msgid "The published date/time will be used as the expiration value"
243
  msgstr ""
244
 
245
+ #: views/classic-metabox.php:135
246
+ msgid "You must assign a heirarchical taxonomy to this post type to use this feature."
 
 
247
  msgstr ""
248
 
249
+ #: views/classic-metabox.php:140
250
+ msgid "More than 1 heirachical taxonomy detected. You must assign a default taxonomy on the settings screen."
 
 
251
  msgstr ""
252
 
253
+ #: views/classic-metabox.php:158
254
  msgid "Taxonomy Name"
255
  msgstr ""
256
 
257
+ #: views/expire-column.php:6
258
  msgid "Never"
259
  msgstr ""
260
 
261
+ #: views/how-to-expire.php:27
262
+ #: assets/jsx/block.jsx:142
263
  msgid "Draft"
264
  msgstr ""
265
 
266
+ #: views/how-to-expire.php:30
267
+ #: assets/jsx/block.jsx:143
268
  msgid "Delete"
269
  msgstr ""
270
 
271
+ #: views/how-to-expire.php:33
272
+ #: assets/jsx/block.jsx:144
273
  msgid "Trash"
274
  msgstr ""
275
 
276
+ #: views/how-to-expire.php:36
277
+ #: assets/jsx/block.jsx:145
278
  msgid "Private"
279
  msgstr ""
280
 
281
+ #: views/how-to-expire.php:39
282
+ #: assets/jsx/block.jsx:146
283
  msgid "Stick"
284
  msgstr ""
285
 
286
+ #: views/how-to-expire.php:42
287
+ #: assets/jsx/block.jsx:147
288
  msgid "Unstick"
289
  msgstr ""
290
 
291
+ #: views/how-to-expire.php:47
292
+ #: assets/jsx/block.jsx:152
293
  msgid "Category: Replace"
294
  msgstr ""
295
 
296
+ #: views/how-to-expire.php:50
297
+ #: assets/jsx/block.jsx:153
298
  msgid "Category: Add"
299
  msgstr ""
300
 
301
+ #: views/how-to-expire.php:53
302
+ #: assets/jsx/block.jsx:154
303
  msgid "Category: Remove"
304
  msgstr ""
305
 
306
+ #: views/menu-defaults.php:5
307
  msgid "Default Expiration Values"
308
  msgstr ""
309
 
310
+ #: views/menu-defaults.php:8
311
+ msgid "Use the values below to set the default actions/values to be used for each for the corresponding post types. These values can all be overwritten when creating/editing the post/page."
 
 
 
312
  msgstr ""
313
 
314
+ #: views/menu-defaults.php:60
315
+ #: views/menu-defaults.php:71
316
  msgid "Active"
317
  msgstr ""
318
 
319
+ #: views/menu-defaults.php:81
320
  msgid "Inactive"
321
  msgstr ""
322
 
323
+ #: views/menu-defaults.php:83
324
  msgid "Select whether the post expirator meta box is active for this post type."
325
  msgstr ""
326
 
327
+ #: views/menu-defaults.php:102
328
  msgid "Select the default expire action for the post type."
329
  msgstr ""
330
 
331
+ #: views/menu-defaults.php:109
332
  msgid "Auto-Enable?"
333
  msgstr ""
334
 
335
+ #: views/menu-defaults.php:120
336
+ #: views/menu-diagnostics.php:12
337
+ #: views/menu-diagnostics.php:35
338
+ #: views/menu-general.php:226
339
+ #: views/menu-general.php:249
340
+ #: views/menu-general.php:298
341
  msgid "Enabled"
342
  msgstr ""
343
 
344
+ #: views/menu-defaults.php:130
345
+ #: views/menu-diagnostics.php:16
346
+ #: views/menu-diagnostics.php:37
347
+ #: views/menu-general.php:232
348
+ #: views/menu-general.php:256
349
+ #: views/menu-general.php:304
350
  msgid "Disabled"
351
  msgstr ""
352
 
353
+ #: views/menu-defaults.php:132
354
  msgid "Select whether the post expirator is enabled for all new posts."
355
  msgstr ""
356
 
357
+ #: views/menu-defaults.php:139
358
  msgid "Taxonomy (hierarchical)"
359
  msgstr ""
360
 
361
+ #: views/menu-defaults.php:154
362
+ #: views/menu-general.php:267
363
  msgid "Who to notify"
364
  msgstr ""
365
 
366
+ #: views/menu-defaults.php:164
367
+ msgid "Enter a comma separate list of emails that you would like to be notified when the post expires."
 
 
368
  msgstr ""
369
 
370
+ #: views/menu-defaults.php:172
371
+ #: views/menu-general.php:146
372
  msgid "None"
373
  msgstr ""
374
 
375
+ #: views/menu-defaults.php:173
376
  msgid "Inherit from General Settings"
377
  msgstr ""
378
 
379
+ #: views/menu-defaults.php:174
380
+ #: views/menu-defaults.php:216
381
+ #: views/menu-general.php:149
382
+ #: views/menu-general.php:166
383
  msgid "Custom"
384
  msgstr ""
385
 
386
+ #: views/menu-defaults.php:175
387
  msgid "Publish Time"
388
  msgstr ""
389
 
390
+ #: views/menu-defaults.php:191
391
+ #: views/menu-general.php:139
392
  msgid "Default Date/Time Duration"
393
  msgstr ""
394
 
395
+ #: views/menu-defaults.php:226
396
+ #: views/menu-general.php:172
397
+ msgid "Set the custom value to use for the default expiration date. For information on formatting, see %1$s. For example, you could enter %2$s+1 month%3$s or %4$s+1 week 2 days 4 hours 2 seconds%5$s or %6$snext Thursday%7$s."
 
 
 
 
 
 
 
 
 
398
  msgstr ""
399
 
400
+ #: views/menu-defaults.php:250
401
+ #: views/menu-general.php:429
402
  msgid "Save Changes"
403
  msgstr ""
404
 
405
+ #: views/menu-diagnostics.php:4
406
  msgid "Advanced Diagnostics"
407
  msgstr ""
408
 
409
+ #: views/menu-diagnostics.php:8
410
  msgid "Debug Logging"
411
  msgstr ""
412
 
413
+ #: views/menu-diagnostics.php:13
 
 
 
 
414
  msgid "Disable Debugging"
415
  msgstr ""
416
 
 
 
 
 
417
  #: views/menu-diagnostics.php:14
418
+ #: views/tabs.php:32
419
+ msgid "View Debug Logs"
420
  msgstr ""
421
 
422
+ #: views/menu-diagnostics.php:17
423
  msgid "Enable Debugging"
424
  msgstr ""
425
 
426
+ #: views/menu-diagnostics.php:22
427
+ #: views/menu-diagnostics.php:28
428
  msgid "Purge Debug Log"
429
  msgstr ""
430
 
431
+ #: views/menu-diagnostics.php:32
432
  msgid "WP-Cron Status"
433
  msgstr ""
434
 
435
+ #: views/menu-diagnostics.php:43
436
+ msgid "Current Cron Schedule"
 
 
 
 
437
  msgstr ""
438
 
439
+ #: views/menu-diagnostics.php:51
440
+ msgid "No cron events found for the plugin."
441
  msgstr ""
442
 
443
+ #: views/menu-diagnostics.php:56
444
+ msgid "The below table will show all currently scheduled cron events for the plugin with the next run time."
 
 
445
  msgstr ""
446
 
447
+ #: views/menu-diagnostics.php:65
448
  msgid "Event"
449
  msgstr ""
450
 
451
+ #: views/menu-diagnostics.php:66
452
  msgid "Arguments / Schedule"
453
  msgstr ""
454
 
455
+ #: views/menu-diagnostics.php:67
456
+ msgid "Post"
457
+ msgstr ""
458
+
459
+ #: views/menu-diagnostics.php:84
460
  msgid "No Arguments"
461
  msgstr ""
462
 
463
+ #: views/menu-diagnostics.php:98
464
  msgid "Single Event"
465
  msgstr ""
466
 
467
+ #: views/menu-general.php:48
468
+ msgid "The post expirator plugin sets a custom meta value, and then optionally allows you to select if you want the post changed to a draft status or deleted when it expires."
 
 
 
469
  msgstr ""
470
 
471
+ #: views/menu-general.php:54
472
  msgid "Shortcode"
473
  msgstr ""
474
 
475
+ #: views/menu-general.php:56
476
  msgid "Valid %s attributes:"
477
  msgstr ""
478
 
479
+ #: views/menu-general.php:61
480
  msgid "%1$s - valid options are %2$sfull%3$s (default), %4$sdate%5$s, %6$stime%7$s"
481
  msgstr ""
482
 
483
+ #: views/menu-general.php:74
484
+ #: views/menu-general.php:81
485
  msgid "%s - format set here will override the value set on the settings page"
486
  msgstr ""
487
 
488
+ #: views/menu-general.php:92
489
  msgid "Defaults"
490
  msgstr ""
491
 
492
+ #: views/menu-general.php:97
493
  msgid "Date Format"
494
  msgstr ""
495
 
496
+ #: views/menu-general.php:107
497
+ msgid "The default format to use when displaying the expiration date within a post using the shortcode or within the footer. For information on valid formatting options, see: %s."
 
 
 
498
  msgstr ""
499
 
500
+ #: views/menu-general.php:118
501
  msgid "Time Format"
502
  msgstr ""
503
 
504
+ #: views/menu-general.php:128
505
+ msgid "The default format to use when displaying the expiration time within a post using the shortcode or within the footer. For information on valid formatting options, see: %s."
 
 
 
506
  msgstr ""
507
 
508
+ #: views/menu-general.php:152
509
  msgid "Post/Page Publish Time"
510
  msgstr ""
511
 
512
+ #: views/menu-general.php:155
513
+ msgid "Set the default expiration date to be used when creating new posts and pages. Defaults to none."
 
 
514
  msgstr ""
515
 
516
+ #: views/menu-general.php:189
517
  msgid "Default Expiration Category"
518
  msgstr ""
519
 
520
+ #: views/menu-general.php:205
521
  msgid "Sets the default expiration category for the post."
522
  msgstr ""
523
 
524
+ #: views/menu-general.php:211
525
  msgid "Expiration Email Notification"
526
  msgstr ""
527
 
528
+ #: views/menu-general.php:213
529
+ msgid "Whenever a post expires, an email can be sent to alert users of the expiration."
 
 
530
  msgstr ""
531
 
532
+ #: views/menu-general.php:220
533
  msgid "Enable Email Notification?"
534
  msgstr ""
535
 
536
+ #: views/menu-general.php:234
537
+ msgid "This will enable or disable the send of email notification on post expiration."
 
 
538
  msgstr ""
539
 
540
+ #: views/menu-general.php:242
541
  msgid "Include Blog Administrators?"
542
  msgstr ""
543
 
544
+ #: views/menu-general.php:258
545
+ msgid "This will include all users with the role of \"Administrator\" in the post expiration email."
 
 
546
  msgstr ""
547
 
548
+ #: views/menu-general.php:274
549
+ msgid "Enter a comma separate list of emails that you would like to be notified when the post expires. This will be applied to ALL post types. You can set post type specific emails on the Defaults tab."
 
 
 
550
  msgstr ""
551
 
552
+ #: views/menu-general.php:283
553
  msgid "Post Footer Display"
554
  msgstr ""
555
 
556
+ #: views/menu-general.php:285
557
+ msgid "Enabling this below will display the expiration date automatically at the end of any post which is set to expire."
 
 
558
  msgstr ""
559
 
560
+ #: views/menu-general.php:292
561
  msgid "Show in post footer?"
562
  msgstr ""
563
 
564
+ #: views/menu-general.php:306
565
+ msgid "This will enable or disable displaying the post expiration date in the post footer."
 
 
566
  msgstr ""
567
 
568
+ #: views/menu-general.php:315
569
  msgid "Footer Contents"
570
  msgstr ""
571
 
572
+ #: views/menu-general.php:322
573
+ msgid "Enter the text you would like to appear at the bottom of every post that will expire. The following placeholders will be replaced with the post expiration date in the following format:"
 
 
 
574
  msgstr ""
575
 
576
+ #: views/menu-general.php:345
577
  msgid "Footer Style"
578
  msgstr ""
579
 
580
+ #: views/menu-general.php:352
581
  msgid "This post will expire on"
582
  msgstr ""
583
 
584
+ #: views/menu-general.php:355
585
  msgid "The inline css which will be used to style the footer text."
586
  msgstr ""
587
 
588
+ #: views/menu-general.php:361
589
  msgid "Advanced Options"
590
  msgstr ""
591
 
592
+ #: views/menu-general.php:363
593
+ msgid "Please do not update anything here unless you know what it entails. For advanced users only."
 
 
594
  msgstr ""
595
 
596
+ #: views/menu-general.php:373
597
  msgid "Block Editor Support"
598
  msgstr ""
599
 
600
+ #: views/menu-general.php:379
601
  msgid "Show Gutenberg style box"
602
  msgstr ""
603
 
604
+ #: views/menu-general.php:385
605
  msgid "Show Classic Editor style box"
606
  msgstr ""
607
 
608
+ #: views/menu-general.php:387
609
+ msgid "Toggle between native support for the Block Editor or the backward compatible Classic Editor style metabox."
610
+ msgstr ""
611
+
612
+ #: views/menu-general.php:396
613
+ msgid "Choose which user roles can use Post Expirator"
614
  msgstr ""
615
 
616
+ #: views/tabs.php:15
617
  msgid "General Settings"
618
  msgstr ""
619
 
620
+ #: views/tabs.php:20
621
  msgid "Post Types"
622
  msgstr ""
623
 
624
+ #: views/tabs.php:25
625
  msgid "Diagnostics"
626
  msgstr ""
627
 
628
+ #: assets/jsx/block.jsx:196
629
+ msgid "Loading"
630
+ msgstr ""
 
 
 
post-expirator.php CHANGED
@@ -4,14 +4,14 @@ Plugin Name: Post Expirator
4
  Plugin URI: http://wordpress.org/extend/plugins/post-expirator/
5
  Description: Allows you to add an expiration date (minute) to posts which you can configure to either delete the post, change it to a draft, or update the post categories at expiration time.
6
  Author: PublishPress
7
- Version: 2.6.1
8
  Author URI: http://publishpress.com
9
  Text Domain: post-expirator
10
  Domain Path: /languages
11
  */
12
 
13
  // Default Values
14
- define('POSTEXPIRATOR_VERSION', '2.6.1');
15
  define('POSTEXPIRATOR_DATEFORMAT', __('l F jS, Y', 'post-expirator'));
16
  define('POSTEXPIRATOR_TIMEFORMAT', __('g:ia', 'post-expirator'));
17
  define('POSTEXPIRATOR_FOOTERCONTENTS', __('Post expires at EXPIRATIONTIME on EXPIRATIONDATE', 'post-expirator'));
@@ -58,7 +58,7 @@ add_filter('plugin_action_links', 'postexpirator_plugin_action_links', 10, 2);
58
  */
59
  function postexpirator_init()
60
  {
61
- $plugin_dir = basename(dirname(__FILE__));
62
  load_plugin_textdomain('post-expirator', null, $plugin_dir . '/languages/');
63
 
64
  PostExpirator_Reviews::init();
@@ -413,6 +413,7 @@ function postexpirator_meta_box($post)
413
  'post' => $post,
414
  'enabled' => $enabled,
415
  'default' => $default,
 
416
  'defaultmonth' => $defaultmonth,
417
  'defaultday' => $defaultday,
418
  'defaulthour' => $defaulthour,
@@ -614,9 +615,9 @@ function postexpirator_update_post_meta($id)
614
  }
615
 
616
  if (isset($payload['meta']['_expiration-date-type'])) {
617
- $opts[expireType] = $payload['meta']['_expiration-date-type'];
618
  } else {
619
- $opts[expireType] = get_post_meta($id, '_expiration-date-type', true);
620
  }
621
 
622
  if (isset($payload['meta']['_expiration-date-categories'])) {
@@ -1026,7 +1027,7 @@ function postexpirator_expire_post($id)
1026
  }
1027
  } elseif ($expireType === 'category-add') {
1028
  if (! empty($category)) {
1029
- if (! isset($categoryTaxonomy) || $categoryTaxonomy === 'category') {
1030
  $cats = wp_get_post_categories($id);
1031
  $merged = array_merge($cats, $category);
1032
  if (wp_update_post(array('ID' => $id, 'post_category' => $merged)) === 0) {
@@ -1089,7 +1090,7 @@ function postexpirator_expire_post($id)
1089
  '##EXPIRATIONDATE##',
1090
  'CATEGORIES',
1091
  implode(',', _postexpirator_get_cat_names($category)),
1092
- implode(',', _postexpirator_get_cat_names($merged))
1093
  );
1094
  if (POSTEXPIRATOR_DEBUG) {
1095
  $debug->save(
@@ -1128,7 +1129,7 @@ function postexpirator_expire_post($id)
1128
  }
1129
  } elseif ($expireType === 'category-remove') {
1130
  if (! empty($category)) {
1131
- if (! isset($categoryTaxonomy) || $categoryTaxonomy === 'category') {
1132
  $cats = wp_get_post_categories($id);
1133
  $merged = array();
1134
  foreach ($cats as $cat) {
4
  Plugin URI: http://wordpress.org/extend/plugins/post-expirator/
5
  Description: Allows you to add an expiration date (minute) to posts which you can configure to either delete the post, change it to a draft, or update the post categories at expiration time.
6
  Author: PublishPress
7
+ Version: 2.6.2
8
  Author URI: http://publishpress.com
9
  Text Domain: post-expirator
10
  Domain Path: /languages
11
  */
12
 
13
  // Default Values
14
+ define('POSTEXPIRATOR_VERSION', '2.6.2');
15
  define('POSTEXPIRATOR_DATEFORMAT', __('l F jS, Y', 'post-expirator'));
16
  define('POSTEXPIRATOR_TIMEFORMAT', __('g:ia', 'post-expirator'));
17
  define('POSTEXPIRATOR_FOOTERCONTENTS', __('Post expires at EXPIRATIONTIME on EXPIRATIONDATE', 'post-expirator'));
58
  */
59
  function postexpirator_init()
60
  {
61
+ $plugin_dir = plugin_basename(__DIR__);
62
  load_plugin_textdomain('post-expirator', null, $plugin_dir . '/languages/');
63
 
64
  PostExpirator_Reviews::init();
413
  'post' => $post,
414
  'enabled' => $enabled,
415
  'default' => $default,
416
+ 'defaults' => $defaults,
417
  'defaultmonth' => $defaultmonth,
418
  'defaultday' => $defaultday,
419
  'defaulthour' => $defaulthour,
615
  }
616
 
617
  if (isset($payload['meta']['_expiration-date-type'])) {
618
+ $opts['expireType'] = $payload['meta']['_expiration-date-type'];
619
  } else {
620
+ $opts['expireType'] = get_post_meta($id, '_expiration-date-type', true);
621
  }
622
 
623
  if (isset($payload['meta']['_expiration-date-categories'])) {
1027
  }
1028
  } elseif ($expireType === 'category-add') {
1029
  if (! empty($category)) {
1030
+ if (empty($categoryTaxonomy) || $categoryTaxonomy === 'category') {
1031
  $cats = wp_get_post_categories($id);
1032
  $merged = array_merge($cats, $category);
1033
  if (wp_update_post(array('ID' => $id, 'post_category' => $merged)) === 0) {
1090
  '##EXPIRATIONDATE##',
1091
  'CATEGORIES',
1092
  implode(',', _postexpirator_get_cat_names($category)),
1093
+ implode(',', _postexpirator_get_cat_names($terms))
1094
  );
1095
  if (POSTEXPIRATOR_DEBUG) {
1096
  $debug->save(
1129
  }
1130
  } elseif ($expireType === 'category-remove') {
1131
  if (! empty($category)) {
1132
+ if (empty($categoryTaxonomy) || $categoryTaxonomy === 'category') {
1133
  $cats = wp_get_post_categories($id);
1134
  $merged = array();
1135
  foreach ($cats as $cat) {
readme.txt CHANGED
@@ -5,7 +5,7 @@ Author URI: https://publishpress.com
5
  Tags: expire, posts, pages, schedule
6
  Requires at least: 5.0
7
  Tested up to: 5.8
8
- Stable tag: 2.6.1
9
 
10
  Add an expiration date to posts. When your post is automatically unpublished, you can delete the post, change the status, or update the post categories.
11
 
@@ -81,6 +81,17 @@ This section describes how to install the plugin and get it working.
81
 
82
  == Changelog ==
83
 
 
 
 
 
 
 
 
 
 
 
 
84
  = [2.6.1] - 27 Oct 2021 =
85
 
86
  * Fixed: Fix category replace not saving, #159;
5
  Tags: expire, posts, pages, schedule
6
  Requires at least: 5.0
7
  Tested up to: 5.8
8
+ Stable tag: 2.6.2
9
 
10
  Add an expiration date to posts. When your post is automatically unpublished, you can delete the post, change the status, or update the post categories.
11
 
81
 
82
  == Changelog ==
83
 
84
+ = [2.6.2] - 04 Nov 2021 =
85
+
86
+ * Fixed: Fix fatal error: Call to a member function add_cap() on null, #167;
87
+ * Fixed: Fix hierarchical taxonomy selection error for multiple taxonomies, #144;
88
+ * Fixed: Fix PHP warning: use of undefined constant - assumed 'expireType', #617;
89
+ * Fixed: Fix translation of strings in the block editor panel, #163;
90
+ * Fixed: Fix category not being added or removed when the post expires, #170;
91
+ * Fixed: Fix PHP notice: Undefined variable: merged, #174;
92
+ * Fixed: Fix category-based expiration for custom post types in classic editor, #179;
93
+ * Fixed: Fix expiration date being added to old posts when edited, #168;
94
+
95
  = [2.6.1] - 27 Oct 2021 =
96
 
97
  * Fixed: Fix category replace not saving, #159;
vendor/composer/installed.php CHANGED
@@ -5,7 +5,7 @@
5
  'type' => 'wordpress-plugin',
6
  'install_path' => __DIR__ . '/../../',
7
  'aliases' => array(),
8
- 'reference' => '2f5ba153bfa0d15e1a6a943866cf71f25ec1d5f2',
9
  'name' => 'publishpress/post-expirator',
10
  'dev' => false,
11
  ),
@@ -16,7 +16,7 @@
16
  'type' => 'wordpress-plugin',
17
  'install_path' => __DIR__ . '/../../',
18
  'aliases' => array(),
19
- 'reference' => '2f5ba153bfa0d15e1a6a943866cf71f25ec1d5f2',
20
  'dev_requirement' => false,
21
  ),
22
  'publishpress/wordpress-reviews' => array(
5
  'type' => 'wordpress-plugin',
6
  'install_path' => __DIR__ . '/../../',
7
  'aliases' => array(),
8
+ 'reference' => '6dc1ae2a3b8bebb24a1f7d7bd3ef20d95bb5b695',
9
  'name' => 'publishpress/post-expirator',
10
  'dev' => false,
11
  ),
16
  'type' => 'wordpress-plugin',
17
  'install_path' => __DIR__ . '/../../',
18
  'aliases' => array(),
19
+ 'reference' => '6dc1ae2a3b8bebb24a1f7d7bd3ef20d95bb5b695',
20
  'dev_requirement' => false,
21
  ),
22
  'publishpress/wordpress-reviews' => array(
views/expire-column.php CHANGED
@@ -3,13 +3,15 @@ echo esc_attr($id); ?>"
3
  data-expire-attributes="<?php
4
  echo esc_attr(json_encode($attributes)); ?>">
5
  <?php
6
- $display = __('Never', 'post-expirator');
7
- $ed = get_post_meta($id, '_expiration-date', true);
8
- if ($ed) {
9
  $display = date_i18n(
10
  get_option('date_format') . ' ' . get_option('time_format'),
11
- $ed + (get_option('gmt_offset') * HOUR_IN_SECONDS)
12
  );
 
 
13
  }
14
 
15
  $defaults = get_option('expirationdateDefaults' . ucfirst($post_type));
@@ -26,13 +28,12 @@ echo esc_attr($id); ?>"
26
  $day = $defaults['day'];
27
  $hour = $defaults['hour'];
28
  $minute = $defaults['minute'];
29
- $enabled = 'false';
30
  $categories = '';
31
 
32
  // Values for Quick Edit
33
- if ($ed) {
34
- $enabled = 'true';
35
- $date = gmdate('Y-m-d H:i:s', $ed);
36
  $year = get_date_from_gmt($date, 'Y');
37
  $month = get_date_from_gmt($date, 'm');
38
  $day = get_date_from_gmt($date, 'd');
3
  data-expire-attributes="<?php
4
  echo esc_attr(json_encode($attributes)); ?>">
5
  <?php
6
+ $expirationEnabled = get_post_meta($id, '_expiration-date-status', true) === 'saved';
7
+ $expirationDate = get_post_meta($id, '_expiration-date', true);
8
+ if ($expirationDate && $expirationEnabled) {
9
  $display = date_i18n(
10
  get_option('date_format') . ' ' . get_option('time_format'),
11
+ $expirationDate + (get_option('gmt_offset') * HOUR_IN_SECONDS)
12
  );
13
+ } else {
14
+ $display = __('Never', 'post-expirator');
15
  }
16
 
17
  $defaults = get_option('expirationdateDefaults' . ucfirst($post_type));
28
  $day = $defaults['day'];
29
  $hour = $defaults['hour'];
30
  $minute = $defaults['minute'];
31
+ $enabled = $expirationDate && $expirationEnabled ? 'true' : 'false';
32
  $categories = '';
33
 
34
  // Values for Quick Edit
35
+ if ($expirationDate) {
36
+ $date = gmdate('Y-m-d H:i:s', $expirationDate);
 
37
  $year = get_date_from_gmt($date, 'Y');
38
  $month = get_date_from_gmt($date, 'm');
39
  $day = get_date_from_gmt($date, 'd');