Changeset 3253378
- Timestamp:
- 03/10/2025 02:23:53 PM (13 months ago)
- Location:
- post-lockdown
- Files:
-
- 8 added
- 4 deleted
- 10 edited
- 1 copied
-
tags/4.0.3 (copied) (copied from post-lockdown/trunk)
-
tags/4.0.3/package-lock.json (added)
-
tags/4.0.3/post-lockdown.php (modified) (1 diff)
-
tags/4.0.3/readme.txt (modified) (2 diffs)
-
tags/4.0.3/src/PostLockdown/OptionsPage.php (modified) (4 diffs)
-
tags/4.0.3/src/PostLockdown/PostLockdown.php (modified) (1 diff)
-
tags/4.0.3/view/assets/css (deleted)
-
tags/4.0.3/view/assets/js (deleted)
-
tags/4.0.3/view/assets/postlockdown.css (added)
-
tags/4.0.3/view/assets/postlockdown.js (added)
-
tags/4.0.3/view/options-page.php (modified) (1 diff)
-
tags/4.0.3/vite.config.js (added)
-
trunk/package-lock.json (added)
-
trunk/post-lockdown.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/src/PostLockdown/OptionsPage.php (modified) (4 diffs)
-
trunk/src/PostLockdown/PostLockdown.php (modified) (1 diff)
-
trunk/view/assets/css (deleted)
-
trunk/view/assets/js (deleted)
-
trunk/view/assets/postlockdown.css (added)
-
trunk/view/assets/postlockdown.js (added)
-
trunk/view/options-page.php (modified) (1 diff)
-
trunk/vite.config.js (added)
Legend:
- Unmodified
- Added
- Removed
-
post-lockdown/tags/4.0.3/post-lockdown.php
r3197624 r3253378 4 4 * Plugin URI: https://github.com/andyexeter/post-lockdown 5 5 * Description: Allows admins to protect selected posts and pages so they cannot be trashed or deleted by non-admin users. 6 * Version: 4.0. 26 * Version: 4.0.3 7 7 * Requires at least: 4.6 8 8 * Requires PHP: 7.4 -
post-lockdown/tags/4.0.3/readme.txt
r3197624 r3253378 5 5 Requires at least: 4.6 6 6 Tested up to: 6.7 7 Stable tag: 4.0. 27 Stable tag: 4.0.3 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 69 69 70 70 = 4.0.2 = 71 72 * Fixed a warning in WordPress 6.7 related to loading translations to early 71 * Fixed a warning in WordPress 6.7 related to loading translations too early 73 72 74 73 = 4.0 = -
post-lockdown/tags/4.0.3/src/PostLockdown/OptionsPage.php
r3076973 r3253378 5 5 class OptionsPage 6 6 { 7 public const PAGE_TITLE = 'Post Lockdown'; 7 public const PAGE_TITLE = 'Post Lockdown'; 8 public const AJAX_ACTION = 'pl_autocomplete'; 8 9 /** @var string Page hook returned by add_options_page(). */ 9 10 private $page_hook; … … 19 20 20 21 add_action('admin_enqueue_scripts', [$this, '_enqueue_scripts']); 21 add_action( 'wp_ajax_pl_autocomplete', [$this, '_ajax_autocomplete']);22 add_action(sprintf('wp_ajax_%s', self::AJAX_ACTION), [$this, '_ajax_autocomplete']); 22 23 23 24 add_filter('option_page_capability_' . PostLockdown::KEY, [$this->postlockdown, 'get_admin_cap']); … … 87 88 public function _ajax_autocomplete() 88 89 { 90 check_ajax_referer(self::AJAX_ACTION); 91 92 if (!current_user_can($this->postlockdown->get_admin_cap())) { 93 wp_send_json_error(null, 403); 94 } 95 89 96 $posts = $this->postlockdown->get_posts([ 90 97 's' => $_REQUEST['term'], … … 111 118 112 119 $assets_path = $this->postlockdown->plugin_url . 'view/assets/'; 113 $extension = (\defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';114 120 115 wp_enqueue_style(PostLockdown::KEY, $assets_path . ' css/postlockdown' . $extension . '.css', null, null);116 wp_enqueue_script(PostLockdown::KEY, $assets_path . ' js/postlockdown' . $extension . '.js', ['jquery-ui-autocomplete'], null, true);121 wp_enqueue_style(PostLockdown::KEY, $assets_path . 'postlockdown.css', null, null); 122 wp_enqueue_script(PostLockdown::KEY, $assets_path . 'postlockdown.js', ['jquery-ui-autocomplete'], null, true); 117 123 118 124 $posts = $this->postlockdown->get_posts([ -
post-lockdown/tags/4.0.3/src/PostLockdown/PostLockdown.php
r3197624 r3253378 7 7 /** Plugin key for options and the option page. */ 8 8 public const KEY = 'postlockdown'; 9 public const VERSION = '4.0. 2';9 public const VERSION = '4.0.3'; 10 10 11 11 /** @var array List of post IDs which cannot be edited, trashed or deleted. */ -
post-lockdown/tags/4.0.3/view/options-page.php
r3076973 r3253378 6 6 <?php esc_html_e('Select locked and protected posts by adding them to the boxes on the right. Use the search field to filter the list of posts.', 'post-lockdown'); ?> 7 7 </p> 8 <table class="form-table" >8 <table class="form-table" data-ajax_action="<?= PostLockdown\OptionsPage::AJAX_ACTION; ?>" data-ajax_nonce="<?= esc_attr(wp_create_nonce(PostLockdown\OptionsPage::AJAX_ACTION)); ?>"> 9 9 <tbody> 10 10 <?php foreach ($blocks as $block): ?> -
post-lockdown/trunk/post-lockdown.php
r3197624 r3253378 4 4 * Plugin URI: https://github.com/andyexeter/post-lockdown 5 5 * Description: Allows admins to protect selected posts and pages so they cannot be trashed or deleted by non-admin users. 6 * Version: 4.0. 26 * Version: 4.0.3 7 7 * Requires at least: 4.6 8 8 * Requires PHP: 7.4 -
post-lockdown/trunk/readme.txt
r3197624 r3253378 5 5 Requires at least: 4.6 6 6 Tested up to: 6.7 7 Stable tag: 4.0. 27 Stable tag: 4.0.3 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 69 69 70 70 = 4.0.2 = 71 72 * Fixed a warning in WordPress 6.7 related to loading translations to early 71 * Fixed a warning in WordPress 6.7 related to loading translations too early 73 72 74 73 = 4.0 = -
post-lockdown/trunk/src/PostLockdown/OptionsPage.php
r3076973 r3253378 5 5 class OptionsPage 6 6 { 7 public const PAGE_TITLE = 'Post Lockdown'; 7 public const PAGE_TITLE = 'Post Lockdown'; 8 public const AJAX_ACTION = 'pl_autocomplete'; 8 9 /** @var string Page hook returned by add_options_page(). */ 9 10 private $page_hook; … … 19 20 20 21 add_action('admin_enqueue_scripts', [$this, '_enqueue_scripts']); 21 add_action( 'wp_ajax_pl_autocomplete', [$this, '_ajax_autocomplete']);22 add_action(sprintf('wp_ajax_%s', self::AJAX_ACTION), [$this, '_ajax_autocomplete']); 22 23 23 24 add_filter('option_page_capability_' . PostLockdown::KEY, [$this->postlockdown, 'get_admin_cap']); … … 87 88 public function _ajax_autocomplete() 88 89 { 90 check_ajax_referer(self::AJAX_ACTION); 91 92 if (!current_user_can($this->postlockdown->get_admin_cap())) { 93 wp_send_json_error(null, 403); 94 } 95 89 96 $posts = $this->postlockdown->get_posts([ 90 97 's' => $_REQUEST['term'], … … 111 118 112 119 $assets_path = $this->postlockdown->plugin_url . 'view/assets/'; 113 $extension = (\defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';114 120 115 wp_enqueue_style(PostLockdown::KEY, $assets_path . ' css/postlockdown' . $extension . '.css', null, null);116 wp_enqueue_script(PostLockdown::KEY, $assets_path . ' js/postlockdown' . $extension . '.js', ['jquery-ui-autocomplete'], null, true);121 wp_enqueue_style(PostLockdown::KEY, $assets_path . 'postlockdown.css', null, null); 122 wp_enqueue_script(PostLockdown::KEY, $assets_path . 'postlockdown.js', ['jquery-ui-autocomplete'], null, true); 117 123 118 124 $posts = $this->postlockdown->get_posts([ -
post-lockdown/trunk/src/PostLockdown/PostLockdown.php
r3197624 r3253378 7 7 /** Plugin key for options and the option page. */ 8 8 public const KEY = 'postlockdown'; 9 public const VERSION = '4.0. 2';9 public const VERSION = '4.0.3'; 10 10 11 11 /** @var array List of post IDs which cannot be edited, trashed or deleted. */ -
post-lockdown/trunk/view/options-page.php
r3076973 r3253378 6 6 <?php esc_html_e('Select locked and protected posts by adding them to the boxes on the right. Use the search field to filter the list of posts.', 'post-lockdown'); ?> 7 7 </p> 8 <table class="form-table" >8 <table class="form-table" data-ajax_action="<?= PostLockdown\OptionsPage::AJAX_ACTION; ?>" data-ajax_nonce="<?= esc_attr(wp_create_nonce(PostLockdown\OptionsPage::AJAX_ACTION)); ?>"> 9 9 <tbody> 10 10 <?php foreach ($blocks as $block): ?>
Note: See TracChangeset
for help on using the changeset viewer.