Changeset 2097005
- Timestamp:
- 05/29/2019 08:30:55 AM (7 years ago)
- Location:
- wp-post-expires
- Files:
-
- 21 added
- 6 edited
-
tags/1.2.4 (added)
-
tags/1.2.4/assets (added)
-
tags/1.2.4/assets/css (added)
-
tags/1.2.4/assets/css/images (added)
-
tags/1.2.4/assets/css/images/ui-icons_454545_256x240.png (added)
-
tags/1.2.4/assets/css/latoja.datepicker.css (added)
-
tags/1.2.4/assets/css/plugin-style.css (added)
-
tags/1.2.4/assets/js (added)
-
tags/1.2.4/assets/js/plugin-scripts-classic.js (added)
-
tags/1.2.4/assets/js/plugin-scripts.js (added)
-
tags/1.2.4/languages (added)
-
tags/1.2.4/languages/wp-post-expires-it_IT-xn-plugin-js.json (added)
-
tags/1.2.4/languages/wp-post-expires-it_IT.mo (added)
-
tags/1.2.4/languages/wp-post-expires-it_IT.po (added)
-
tags/1.2.4/languages/wp-post-expires-ru_RU-xn-plugin-js.json (added)
-
tags/1.2.4/languages/wp-post-expires-ru_RU.mo (added)
-
tags/1.2.4/languages/wp-post-expires-ru_RU.po (added)
-
tags/1.2.4/languages/wp-post-expires.pot (added)
-
tags/1.2.4/readme.txt (added)
-
tags/1.2.4/uninstall.php (added)
-
tags/1.2.4/wp-post-expires.php (added)
-
trunk/assets/css/latoja.datepicker.css (modified) (1 diff)
-
trunk/assets/js/plugin-scripts-classic.js (modified) (1 diff)
-
trunk/assets/js/plugin-scripts.js (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/uninstall.php (modified) (1 diff)
-
trunk/wp-post-expires.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-post-expires/trunk/assets/css/latoja.datepicker.css
r2045296 r2097005 1 .ll-skin-latoja { 2 font-size: 90%; 3 } 4 5 .ll-skin-latoja .ui-widget { 6 font-family: "Helvetica Neue","Trebuchet MS",Tahoma,Verdana,Arial,sans-serif; 7 background: #fff; 8 } 9 10 .ll-skin-latoja .ui-datepicker { 11 padding: 0; 12 } 13 14 .ll-skin-latoja .ui-datepicker-header { 15 border: none; 16 font-size: 80%; 17 -moz-border-radius: 4px 4px 0 0; 18 -webkit-border-radius: 4px 4px 0 0; 19 border-radius: 4px 4px 0 0; /* border radius */ 20 -moz-background-clip: padding; 21 -webkit-background-clip: padding-box; 22 background-clip: padding-box; /* prevents bg color from leaking outside the border */ 23 background-color: #e0e8ec; /* layer fill content */ 24 -moz-box-shadow: 0 1px 0 rgba(255,255,255,.53), inset 0 -1px 0 rgba(0,0,0,.12); /* drop shadow and inner shadow */ 25 -webkit-box-shadow: 0 1px 0 rgba(255,255,255,.53), inset 0 -1px 0 rgba(0,0,0,.12); /* drop shadow and inner shadow */ 26 box-shadow: 0 1px 0 rgba(255,255,255,.53), inset 0 -1px 0 rgba(0,0,0,.12); /* drop shadow and inner shadow */ 27 background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEwMCAxMDAiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPjxsaW5lYXJHcmFkaWVudCBpZD0iaGF0MCIgZ3JhZGllbnRVbml0cz0ib2JqZWN0Qm91bmRpbmdCb3giIHgxPSI1MCUiIHkxPSIxMDAlIiB4Mj0iNTAlIiB5Mj0iLTEuNDIxMDg1NDcxNTIwMmUtMTQlIj4KPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzAwMCIgc3RvcC1vcGFjaXR5PSIwLjIxIi8+CjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2ZmZiIgc3RvcC1vcGFjaXR5PSIwLjIxIi8+CiAgIDwvbGluZWFyR3JhZGllbnQ+Cgo8cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgZmlsbD0idXJsKCNoYXQwKSIgLz4KPC9zdmc+); /* gradient overlay */ 28 background-image: -moz-linear-gradient(bottom, rgba(0,0,0,.21) 0%, rgba(255,255,255,.21) 100%); /* gradient overlay */ 29 background-image: -o-linear-gradient(bottom, rgba(0,0,0,.21) 0%, rgba(255,255,255,.21) 100%); /* gradient overlay */ 30 background-image: -webkit-linear-gradient(bottom, rgba(0,0,0,.21) 0%, rgba(255,255,255,.21) 100%); /* gradient overlay */ 31 background-image: linear-gradient(bottom, rgba(0,0,0,.21) 0%, rgba(255,255,255,.21) 100%); /* gradient overlay */ 32 } 33 34 .ll-skin-latoja .ui-datepicker-title { 35 color: #515d65; /* text color */ 36 font-size: 13px; 37 font-weight: bold; 38 text-shadow: 0 1px 1px rgba(255,255,255,.8); /* drop shadow */ 39 40 } 41 42 .ll-skin-latoja .ui-icon-circle-triangle-e { 43 background-image: url(images/ui-icons_454545_256x240.png); 44 background-position: -32px -16px; 45 } 46 47 .ll-skin-latoja .ui-icon-circle-triangle-w { 48 background-image: url(images/ui-icons_454545_256x240.png); 49 background-position: -96px -16px; 50 } 51 52 .ll-skin-latoja .ui-datepicker .ui-datepicker-prev, 53 .ll-skin-latoja .ui-datepicker .ui-datepicker-next { 54 border-color: transparent; 55 } 56 57 .ll-skin-latoja .ui-state-default { 58 background: transparent; 59 border: none; 60 color: #2b2b2b; 61 font-family: "Myriad Pro"; 62 font-weight: normal; 63 text-align: center; 64 } 65 66 .ll-skin-latoja .ui-datepicker-header .ui-state-hover { 67 background: #bdc5c9; 68 } 69 70 .ll-skin-latoja .ui-datepicker table { 71 margin: 0; 72 } 73 74 .ll-skin-latoja .ui-datepicker th { 75 color: #9da7af; 76 font-size: 12px; 77 font-weight: normal; 78 -moz-border-radius: 216px 0 0 0 / 0 0 0 0; 79 -webkit-border-radius: 216px 0 0 0 / 0 0 0 0; 80 border-radius: 216px 0 0 0 / 0 0 0 0; 81 -moz-background-clip: padding; 82 -webkit-background-clip: padding-box; 83 background-clip: padding-box; 84 background-color: rgba(0,0,0,.08); 85 86 } 87 88 .ll-skin-latoja .ui-datepicker td { 89 border-top: 1px solid #ddd; 90 border-right: 1px solid #ddd; 91 padding: 0; 92 -moz-box-shadow: inset 0 1px 0 rgba(255,255,255,.4); 93 -webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.4); 94 box-shadow: inset 0 1px 0 rgba(255,255,255,.4); 95 background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEwMCAxMDAiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPjxsaW5lYXJHcmFkaWVudCBpZD0iaGF0MCIgZ3JhZGllbnRVbml0cz0ib2JqZWN0Qm91bmRpbmdCb3giIHgxPSI1MCUiIHkxPSIxMDAlIiB4Mj0iNTAlIiB5Mj0iLTEuNDIxMDg1NDcxNTIwMmUtMTQlIj4KPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzAwMCIgc3RvcC1vcGFjaXR5PSIwLjA2Ii8+CjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2ZmZiIgc3RvcC1vcGFjaXR5PSIwLjA2Ii8+CiAgIDwvbGluZWFyR3JhZGllbnQ+Cgo8cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgZmlsbD0idXJsKCNoYXQwKSIgLz4KPC9zdmc+); 96 background-image: -moz-linear-gradient(bottom, rgba(0,0,0,.06) 0%, rgba(255,255,255,.06) 100%); 97 background-image: -o-linear-gradient(bottom, rgba(0,0,0,.06) 0%, rgba(255,255,255,.06) 100%); 98 background-image: -webkit-linear-gradient(bottom, rgba(0,0,0,.06) 0%, rgba(255,255,255,.06) 100%); 99 background-image: linear-gradient(bottom, rgba(0,0,0,.06) 0%, rgba(255,255,255,.06) 100%); 100 101 } 102 103 .ll-skin-latoja .ui-datepicker td:last-child { 104 border-right: none; 105 } 106 107 .ll-skin-latoja .ui-datepicker td span, 108 .ll-skin-latoja .ui-datepicker td a { 109 padding: .7em 0; 110 color: #6a747a; 111 font-size: 12px; 112 font-weight: bold; 113 font-family: Arial; 114 } 115 116 .ll-skin-latoja .ui-datepicker-calendar .ui-state-hover { 117 background-image: -moz-linear-gradient(bottom, rgba(0,0,0,.12) 0%, rgba(255,255,255,.06) 100%); 118 background-image: -o-linear-gradient(bottom, rgba(0,0,0,.12) 0%, rgba(255,255,255,.06) 100%); 119 background-image: -webkit-linear-gradient(bottom, rgba(0,0,0,.12) 0%, rgba(255,255,255,.06) 100%); 120 background-image: -webkit-linear-gradient(bottom, rgba(0,0,0,.12) 0%, rgba(255,255,255,.06) 100%); 121 } 122 123 .ll-skin-latoja td a.ui-state-active, 124 .ll-skin-latoja td a.ui-state-active.ui-state-hover { 125 color: #fff; 126 background-color: #8ab8ed; 127 text-shadow: 0 1px 0 rgba(0,0,0,.26); 128 -moz-box-shadow: inset 0 4px 9px rgba(0,0,0,.24); 129 -webkit-box-shadow: inset 0 4px 9px rgba(0,0,0,.24); 130 box-shadow: inset 0 4px 9px rgba(0,0,0,.24); 131 } 132 133 1 .ll-skin-latoja{font-size:90%}.ll-skin-latoja .ui-widget{font-family:"Helvetica Neue","Trebuchet MS",Tahoma,Verdana,Arial,sans-serif;background:#fff}.ll-skin-latoja .ui-datepicker{padding:0}.ll-skin-latoja .ui-datepicker-header{border:none;font-size:80%;-moz-border-radius:4px 4px 0 0;-webkit-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0;-moz-background-clip:padding;-webkit-background-clip:padding-box;background-clip:padding-box;background-color:#e0e8ec;-moz-box-shadow:0 1px 0 rgba(255,255,255,.53),inset 0 -1px 0 rgba(0,0,0,.12);-webkit-box-shadow:0 1px 0 rgba(255,255,255,.53),inset 0 -1px 0 rgba(0,0,0,.12);box-shadow:0 1px 0 rgba(255,255,255,.53),inset 0 -1px 0 rgba(0,0,0,.12);background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEwMCAxMDAiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPjxsaW5lYXJHcmFkaWVudCBpZD0iaGF0MCIgZ3JhZGllbnRVbml0cz0ib2JqZWN0Qm91bmRpbmdCb3giIHgxPSI1MCUiIHkxPSIxMDAlIiB4Mj0iNTAlIiB5Mj0iLTEuNDIxMDg1NDcxNTIwMmUtMTQlIj4KPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzAwMCIgc3RvcC1vcGFjaXR5PSIwLjIxIi8+CjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2ZmZiIgc3RvcC1vcGFjaXR5PSIwLjIxIi8+CiAgIDwvbGluZWFyR3JhZGllbnQ+Cgo8cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgZmlsbD0idXJsKCNoYXQwKSIgLz4KPC9zdmc+);background-image:-moz-linear-gradient(bottom,rgba(0,0,0,.21) 0%,rgba(255,255,255,.21) 100%);background-image:-o-linear-gradient(bottom,rgba(0,0,0,.21) 0%,rgba(255,255,255,.21) 100%);background-image:-webkit-linear-gradient(bottom,rgba(0,0,0,.21) 0%,rgba(255,255,255,.21) 100%);background-image:linear-gradient(bottom,rgba(0,0,0,.21) 0%,rgba(255,255,255,.21) 100%)}.ll-skin-latoja .ui-datepicker-title{color:#515d65;font-size:13px;font-weight:700;text-shadow:0 1px 1px rgba(255,255,255,.8)}.ll-skin-latoja .ui-icon-circle-triangle-e{background-image:url(images/ui-icons_454545_256x240.png);background-position:-32px -16px}.ll-skin-latoja .ui-icon-circle-triangle-w{background-image:url(images/ui-icons_454545_256x240.png);background-position:-96px -16px}.ll-skin-latoja .ui-datepicker .ui-datepicker-prev,.ll-skin-latoja .ui-datepicker .ui-datepicker-next{border-color:transparent}.ll-skin-latoja .ui-state-default{background:transparent;border:none;color:#2b2b2b;font-family:"Myriad Pro";font-weight:400;text-align:center}.ll-skin-latoja .ui-datepicker-header .ui-state-hover{background:#bdc5c9}.ll-skin-latoja .ui-datepicker table{margin:0}.ll-skin-latoja .ui-datepicker th{color:#9da7af;font-size:12px;font-weight:400;-moz-border-radius:216px 0 0 0 / 0 0 0 0;-webkit-border-radius:216px 0 0 0 / 0 0 0 0;border-radius:216px 0 0 0 / 0 0 0 0;-moz-background-clip:padding;-webkit-background-clip:padding-box;background-clip:padding-box;background-color:rgba(0,0,0,.08)}.ll-skin-latoja .ui-datepicker td{border-top:1px solid #ddd;border-right:1px solid #ddd;padding:0;-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,.4);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.4);box-shadow:inset 0 1px 0 rgba(255,255,255,.4);background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEwMCAxMDAiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPjxsaW5lYXJHcmFkaWVudCBpZD0iaGF0MCIgZ3JhZGllbnRVbml0cz0ib2JqZWN0Qm91bmRpbmdCb3giIHgxPSI1MCUiIHkxPSIxMDAlIiB4Mj0iNTAlIiB5Mj0iLTEuNDIxMDg1NDcxNTIwMmUtMTQlIj4KPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzAwMCIgc3RvcC1vcGFjaXR5PSIwLjA2Ii8+CjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2ZmZiIgc3RvcC1vcGFjaXR5PSIwLjA2Ii8+CiAgIDwvbGluZWFyR3JhZGllbnQ+Cgo8cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgZmlsbD0idXJsKCNoYXQwKSIgLz4KPC9zdmc+);background-image:-moz-linear-gradient(bottom,rgba(0,0,0,.06) 0%,rgba(255,255,255,.06) 100%);background-image:-o-linear-gradient(bottom,rgba(0,0,0,.06) 0%,rgba(255,255,255,.06) 100%);background-image:-webkit-linear-gradient(bottom,rgba(0,0,0,.06) 0%,rgba(255,255,255,.06) 100%);background-image:linear-gradient(bottom,rgba(0,0,0,.06) 0%,rgba(255,255,255,.06) 100%)}.ll-skin-latoja .ui-datepicker td:last-child{border-right:none}.ll-skin-latoja .ui-datepicker td span,.ll-skin-latoja .ui-datepicker td a{padding:.7em 0;color:#6a747a;font-size:12px;font-weight:700;font-family:Arial}.ll-skin-latoja .ui-datepicker-calendar .ui-state-hover{background-image:-moz-linear-gradient(bottom,rgba(0,0,0,.12) 0%,rgba(255,255,255,.06) 100%);background-image:-o-linear-gradient(bottom,rgba(0,0,0,.12) 0%,rgba(255,255,255,.06) 100%);background-image:-webkit-linear-gradient(bottom,rgba(0,0,0,.12) 0%,rgba(255,255,255,.06) 100%);background-image:-webkit-linear-gradient(bottom,rgba(0,0,0,.12) 0%,rgba(255,255,255,.06) 100%)}.ll-skin-latoja td a.ui-state-active,.ll-skin-latoja td a.ui-state-active.ui-state-hover{color:#fff;background-color:#8ab8ed;text-shadow:0 1px 0 rgba(0,0,0,.26);-moz-box-shadow:inset 0 4px 9px rgba(0,0,0,.24);-webkit-box-shadow:inset 0 4px 9px rgba(0,0,0,.24);box-shadow:inset 0 4px 9px rgba(0,0,0,.24)} -
wp-post-expires/trunk/assets/js/plugin-scripts-classic.js
r2095669 r2097005 28 28 }); 29 29 }); 30 31 /* FUTURE32 ( function( wp ) {33 let el = wp.element.createElement;34 function Component() {35 let meta = wp.data.select('core/editor').getEditedPostAttribute('meta');36 if(meta['xn-wppe-expiration'].length > 0) {37 return el(wp.element.Fragment, {},38 el(wp.editPost.PluginPostStatusInfo, {},39 wp.i18n.__('Expires', 'wp-post-expires') + ' ' + meta['xn-wppe-expiration'],40 )41 );42 }43 44 return '';45 }46 47 wp.plugins.registerPlugin('xn-wppe', {48 render: Component49 });50 51 } )( window.wp );52 */ -
wp-post-expires/trunk/assets/js/plugin-scripts.js
r2095669 r2097005 3 3 function Component() { 4 4 let meta = wp.data.select('core/editor').getEditedPostAttribute('meta'); 5 if(meta ['xn-wppe-expiration'].length > 0) {5 if(meta && meta['xn-wppe-expiration'].length > 0) { 6 6 return el(wp.element.Fragment, {}, 7 7 el(wp.editPost.PluginPostStatusInfo, null, [ … … 9 9 el('div', null, [ 10 10 el(wp.components.Dashicon, {icon: 'clock', className: 'xn-clock-icon'}, null), 11 wp.date.dateI18n(wp.date.__experimentalGetSettings()['formats']['datetime'], meta['xn-wppe-expiration']) 11 wp.date.dateI18n(wp.date.__experimentalGetSettings()['formats']['datetime'], 12 meta['xn-wppe-expiration'] + ':00') 12 13 ]) 13 14 ] -
wp-post-expires/trunk/readme.txt
r2095669 r2097005 5 5 Requires at least: 5.0 6 6 Tested up to: 5.2.1 7 Stable tag: 1.2. 37 Stable tag: 1.2.4 8 8 License: GPLv2 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 42 42 == Changelog == 43 43 44 = 1.2.4 = 45 46 fix bugs classic editor/gutenberg js, tnx @micahjsharp 47 44 48 = 1.2.3 = 45 49 46 fix bugs 50 add status in post state 51 change logic for draft and trash, tnx @micahjsharp 52 use local wp timezone 47 53 48 54 = 1.2.2 = -
wp-post-expires/trunk/uninstall.php
r1475897 r2097005 2 2 3 3 if(!defined('WP_UNINSTALL_PLUGIN')) { 4 exit ();4 exit; 5 5 } 6 6 -
wp-post-expires/trunk/wp-post-expires.php
r2095669 r2097005 3 3 Plugin Name: WP Post Expires 4 4 Description: A simple plugin allow to set the posts, the time after which will be performed one of 3 actions: "Add prefix to title", "Move to drafts", "Move to trash". 5 Version: 1.2. 35 Version: 1.2.4 6 6 Author: XNicON 7 7 Author URI: https://xnicon.ru … … 28 28 29 29 class XNPostExpires { 30 private $plugin_version = '1.2. 3';30 private $plugin_version = '1.2.4'; 31 31 private $url_assets; 32 32 private static $timezone; 33 p ublic$settings = [];33 private $settings = []; 34 34 35 35 public static function init() { … … 46 46 add_action('the_post', [$this, 'expiredPost']); 47 47 48 if (current_user_can('manage_options')) {48 if (current_user_can('manage_options')) { 49 49 add_action('admin_init', [$this, 'registerSettings']); 50 50 } 51 51 52 if (current_user_can('edit_posts')) {53 add_action('admin_ init', [$this, 'gutenbergOrClassic']);52 if (current_user_can('edit_posts')) { 53 add_action('admin_enqueue_scripts', [$this, 'gutenbergOrClassic']); 54 54 55 55 add_action('add_meta_boxes', [$this, 'addMetaBox']); … … 57 57 } 58 58 59 register_meta('post', 'xn-wppe-expiration', ['show_in_rest' => true]); 60 register_meta('post', 'xn-wppe-expiration-action', ['show_in_rest' => true]); 61 register_meta('post', 'xn-wppe-expiration-prefix', ['show_in_rest' => true]); 59 foreach (array_keys($this->settings['post_types']) as $type) { 60 register_meta($type, 'xn-wppe-expiration', ['show_in_rest' => true]); 61 register_meta($type, 'xn-wppe-expiration-action', ['show_in_rest' => true]); 62 register_meta($type, 'xn-wppe-expiration-prefix', ['show_in_rest' => true]); 63 } 62 64 } 63 65 … … 71 73 if(!isset($settings_load['post_types'])) { 72 74 $settings_load['post_types']['post'] = 1; 73 $settings_load['post_types']['page'] = 0;74 75 } 75 76 … … 87 88 } 88 89 89 public function gutenbergOrClassic() { 90 if(!is_plugin_active('classic-editor/classic-editor.php')) { 91 add_action('enqueue_block_editor_assets', [$this, 'loadScripts']); 92 } elseif(is_admin()) { 93 $this->loadScriptsClassic(); 90 public function gutenbergOrClassic( $hook ) { 91 global $post; 92 93 if (($hook == 'post-new.php' || $hook == 'post.php') 94 && in_array($post->post_type, array_keys($this->settings['post_types']))) { 95 96 if (use_block_editor_for_post($post->ID)) { 97 $this->loadScripts(); 98 } else { 99 $this->loadScriptsClassic(); 100 } 94 101 } 95 102 } … … 112 119 113 120 public function addMetaBox() { 114 add_meta_box('xn_box_expiration', 115 __('Expires', 'wp-post-expires'), 116 [$this, 'addBoxFields'], 117 array_keys($this->settings['post_types']), 118 'side', 119 'default', 120 [ 121 '__back_compat_meta_box' => false 122 ] 121 add_meta_box('xn_box_expiration', __('Expires', 'wp-post-expires'), 122 [$this, 'addBoxFields'], array_keys($this->settings['post_types']), 123 'side', 'default', ['__back_compat_meta_box' => false] 123 124 ); 124 125 } … … 144 145 <div class="components-panel__row"> 145 146 <div><?php _e('DateTime', 'wp-post-expires'); ?></div> 146 <div><input type="text" name="xn-wppe-expiration" id="xn-wppe-datetime" style="width:100%" value="<?php echo $date; ?>" placeholder="<?php _e('yyyy-mm-dd h:i', 'wp-post-expires'); ?>"></div>147 <div><input type="text" name="xn-wppe-expiration" id="xn-wppe-datetime" style="width:100%" value="<?php echo $date; ?>" placeholder="<?php _e('yyyy-mm-dd h:i', 'wp-post-expires'); ?>"></div> 147 148 </div> 148 149
Note: See TracChangeset
for help on using the changeset viewer.