Changeset 3399601
- Timestamp:
- 11/20/2025 10:26:38 AM (4 months ago)
- Location:
- colored-admin-post-list
- Files:
-
- 24 added
- 14 deleted
- 18 edited
- 1 copied
-
tags/3.1.1 (copied) (copied from colored-admin-post-list/trunk)
-
tags/3.1.1/.git/FETCH_HEAD (modified) (1 diff)
-
tags/3.1.1/.git/HEAD (modified) (1 diff)
-
tags/3.1.1/.git/config (modified) (1 diff)
-
tags/3.1.1/.git/index (modified) (previous)
-
tags/3.1.1/.git/logs/HEAD (modified) (1 diff)
-
tags/3.1.1/.git/objects/09 (added)
-
tags/3.1.1/.git/objects/09/b4abb3469ede5282e8efdbed150ceee2424153 (added)
-
tags/3.1.1/.git/objects/2c (added)
-
tags/3.1.1/.git/objects/2c/386de3f4c31a3769a5aac274f5dd811c386289 (added)
-
tags/3.1.1/.git/objects/2d (added)
-
tags/3.1.1/.git/objects/2d/f138520caddc3a50cef2e14a56ca13b116d11a (added)
-
tags/3.1.1/.git/objects/47 (added)
-
tags/3.1.1/.git/objects/47/c6faae4c67f4f821791c8baad731fb5e708f59 (added)
-
tags/3.1.1/.git/objects/5c/f995b795678a0177d8935de0d31744ec3736c3 (deleted)
-
tags/3.1.1/.git/objects/8e (deleted)
-
tags/3.1.1/.git/objects/9c (added)
-
tags/3.1.1/.git/objects/9c/6ad4964ceffd5ff485bf2e51c48af8dad8172b (added)
-
tags/3.1.1/.git/objects/a0 (deleted)
-
tags/3.1.1/.git/objects/b1 (deleted)
-
tags/3.1.1/.git/objects/b7 (deleted)
-
tags/3.1.1/.git/objects/dc (deleted)
-
tags/3.1.1/.git/objects/e7/708dbd56626d1a41a464e6a5f3adc6aa708de8 (added)
-
tags/3.1.1/.git/refs/tags/3.1.0 (deleted)
-
tags/3.1.1/.git/refs/tags/3.1.1 (added)
-
tags/3.1.1/.git/shallow (modified) (1 diff)
-
tags/3.1.1/colored-admin-post-list.php (modified) (1 diff)
-
tags/3.1.1/src/Controller/PluginController.php (modified) (3 diffs)
-
tags/3.1.1/src/Controller/SettingsController.php (modified) (6 diffs)
-
trunk/.git/FETCH_HEAD (modified) (1 diff)
-
trunk/.git/HEAD (modified) (1 diff)
-
trunk/.git/config (modified) (1 diff)
-
trunk/.git/index (modified) (previous)
-
trunk/.git/logs/HEAD (modified) (1 diff)
-
trunk/.git/objects/09 (added)
-
trunk/.git/objects/09/b4abb3469ede5282e8efdbed150ceee2424153 (added)
-
trunk/.git/objects/2c (added)
-
trunk/.git/objects/2c/386de3f4c31a3769a5aac274f5dd811c386289 (added)
-
trunk/.git/objects/2d (added)
-
trunk/.git/objects/2d/f138520caddc3a50cef2e14a56ca13b116d11a (added)
-
trunk/.git/objects/47 (added)
-
trunk/.git/objects/47/c6faae4c67f4f821791c8baad731fb5e708f59 (added)
-
trunk/.git/objects/5c/f995b795678a0177d8935de0d31744ec3736c3 (deleted)
-
trunk/.git/objects/8e (deleted)
-
trunk/.git/objects/9c (added)
-
trunk/.git/objects/9c/6ad4964ceffd5ff485bf2e51c48af8dad8172b (added)
-
trunk/.git/objects/a0 (deleted)
-
trunk/.git/objects/b1 (deleted)
-
trunk/.git/objects/b7 (deleted)
-
trunk/.git/objects/dc (deleted)
-
trunk/.git/objects/e7/708dbd56626d1a41a464e6a5f3adc6aa708de8 (added)
-
trunk/.git/refs/tags/3.1.0 (deleted)
-
trunk/.git/refs/tags/3.1.1 (added)
-
trunk/.git/shallow (modified) (1 diff)
-
trunk/colored-admin-post-list.php (modified) (1 diff)
-
trunk/src/Controller/PluginController.php (modified) (3 diffs)
-
trunk/src/Controller/SettingsController.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
colored-admin-post-list/tags/3.1.1/.git/FETCH_HEAD
r3399282 r3399601 1 b19b23e3e9b86c45035b4d1390892c3ebf8a78d7 'b19b23e3e9b86c45035b4d1390892c3ebf8a78d7' of https://github.com/rockschtar/colored-admin-post-list1 2df138520caddc3a50cef2e14a56ca13b116d11a '2df138520caddc3a50cef2e14a56ca13b116d11a' of https://github.com/rockschtar/colored-admin-post-list -
colored-admin-post-list/tags/3.1.1/.git/HEAD
r3399282 r3399601 1 b19b23e3e9b86c45035b4d1390892c3ebf8a78d7 1 2df138520caddc3a50cef2e14a56ca13b116d11a -
colored-admin-post-list/tags/3.1.1/.git/config
r3399282 r3399601 10 10 auto = 0 11 11 [includeIf "gitdir:/home/runner/work/colored-admin-post-list/colored-admin-post-list/.git"] 12 path = /home/runner/work/_temp/git-credentials- 9944e622-f16b-49fd-9a73-176c46209a90.config12 path = /home/runner/work/_temp/git-credentials-f424d726-e97d-472b-8a9d-341fec284ee9.config 13 13 [includeIf "gitdir:/github/workspace/.git"] 14 path = /github/runner_temp/git-credentials- 9944e622-f16b-49fd-9a73-176c46209a90.config14 path = /github/runner_temp/git-credentials-f424d726-e97d-472b-8a9d-341fec284ee9.config -
colored-admin-post-list/tags/3.1.1/.git/logs/HEAD
r3399282 r3399601 1 0000000000000000000000000000000000000000 b19b23e3e9b86c45035b4d1390892c3ebf8a78d7 runner <runner@runnervmg1sw1.kgil3twzltkufo2gekkesmjjke.dx.internal.cloudapp.net> 1763584622 +0000 checkout: moving from master to refs/tags/3.1.01 0000000000000000000000000000000000000000 2df138520caddc3a50cef2e14a56ca13b116d11a runner <runner@runnervmg1sw1.yuqz1jw5yhjepgxuxy13g0zykh.bx.internal.cloudapp.net> 1763634356 +0000 checkout: moving from master to refs/tags/3.1.1 -
colored-admin-post-list/tags/3.1.1/.git/shallow
r3399282 r3399601 1 b19b23e3e9b86c45035b4d1390892c3ebf8a78d7 1 2df138520caddc3a50cef2e14a56ca13b116d11a -
colored-admin-post-list/tags/3.1.1/colored-admin-post-list.php
r3399282 r3399601 7 7 * Author: rockschtar 8 8 * Author URI: http://www.eracer.de 9 * Version: 3.1. 09 * Version: 3.1.1 10 10 * Requires at least: 6.2 11 11 * Requires PHP: 8.3 -
colored-admin-post-list/tags/3.1.1/src/Controller/PluginController.php
r3399282 r3399601 3 3 namespace Rockschtar\WordPress\ColoredAdminPostList\Controller; 4 4 5 use Rockschtar\WordPress\ColoredAdminPostList\Enums\DefaultColor;6 5 use Rockschtar\WordPress\ColoredAdminPostList\Enums\Option; 7 use Rockschtar\WordPress\ColoredAdminPostList\Enums\Setting;8 6 use Rockschtar\WordPress\ColoredAdminPostList\Utils\PluginVersion; 7 use Rockschtar\WordPress\ColoredAdminPostList\Utils\PostStati; 9 8 10 9 class PluginController … … 18 17 register_uninstall_hook(CAPL_PLUGIN_FILE, [__CLASS__, "onUninstall"]); 19 18 add_action('plugins_loaded', $this->pluginsLoaded(...)); 20 add_action("init", $this->loadPluginTextdomain(...));21 19 22 20 SettingsController::init(); 23 21 StyleController::init(); 24 }25 26 private function loadPluginTextdomain(): void27 {28 load_plugin_textdomain("colored-admin-post-list", true, CAPL_PLUGIN_RELATIVE_DIR . '/languages/');29 22 } 30 23 … … 51 44 public static function onUninstall(): void 52 45 { 53 delete_option(Option::INSTALLED->value);46 $postStati = PostStati::get(); 54 47 55 global $wpdb; 56 57 $options = $wpdb->get_results("SELECT option_name FROM $wpdb->options WHERE option_name LIKE 'capl-%'"); 58 foreach ($options as $option) { 59 delete_option($option->option_name); 48 foreach ($postStati as $postStatus) { 49 delete_option($postStatus->getOptionKey()); 60 50 } 61 51 -
colored-admin-post-list/tags/3.1.1/src/Controller/SettingsController.php
r3399282 r3399601 16 16 { 17 17 add_action("admin_init", $this->registerSettings(...)); 18 ;19 18 add_action("admin_menu", $this->adminMenu(...)); 20 ;21 19 add_action('admin_print_scripts-settings_page_' . AdminPage::ADMIN_PAGE_OPTIONS, $this->adminPrintScriptsSettings(...)); 22 20 add_action('admin_print_scripts-posts_page_' . AdminPage::ADMIN_PAGE_OPTIONS, $this->adminPrintScriptsSettings(...)); 23 ;24 21 add_filter("plugin_action_links_" . CAPL_PLUGIN, $this->pluginActionLinks(...)); 25 ;26 22 } 27 23 … … 53 49 private function registerSettings(): void 54 50 { 55 $dummyCallback = static function () { 56 }; 51 register_setting( 52 Setting::PAGE_DEFAULT, 53 Option::ENABLED->value 54 ); 57 55 58 56 add_settings_section( 59 57 Setting::SECTION_GENERAL, 60 58 __("General", "colored-admin-post-list"), 61 $dummyCallback,59 static fn() => '', 62 60 Setting::PAGE_DEFAULT 63 61 ); … … 66 64 Setting::SECTION_COLORS_DEFAULT, 67 65 __("Default Post Statuses", "colored-admin-post-list"), 68 $dummyCallback,66 static fn() => '', 69 67 Setting::PAGE_DEFAULT 70 68 ); … … 85 83 $postStatus->getLabel(), 86 84 static function () use ($postStatus) { 87 $setting = get_option($postStatus->getOptionKey()); 88 echo '<input class="capl-wp-color-picker" type="text" id="' . $postStatus->getOptionKey() . '" class="regular-text" name="' . $postStatus->getOptionKey() . '" value="' . $setting . '" />'; 85 $setting = esc_attr(get_option($postStatus->getOptionKey())); 86 $optionId = esc_attr($postStatus->getOptionKey()); 87 88 echo <<<HTML 89 <input class="capl-wp-color-picker" type="text" id="$optionId" name="$optionId" class="regular-text" value="{$setting}" /> 90 HTML; 89 91 }, 90 92 Setting::PAGE_DEFAULT, … … 113 115 Setting::SECTION_COLORS_CUSTOM, 114 116 __("Custom Post Statuses", "colored-admin-post-list"), 115 $dummyCallback,117 static fn() => '', 116 118 Setting::PAGE_DEFAULT 117 119 ); … … 121 123 private function settingEnabled(): void 122 124 { 123 $checked = checked(get_option(Option::ENABLED->value, false), true, false); 124 echo '<input type="checkbox" name="' . Option::ENABLED->value . '" value="1"' . $checked . ' />'; 125 126 $checked = checked(get_option(Option::ENABLED->value) === '1', true, false); 127 $name = esc_attr(Option::ENABLED->value); 128 129 echo <<<HTML 130 <input type="checkbox" name="$name" value="1" $checked /> 131 HTML; 125 132 } 126 133 -
colored-admin-post-list/trunk/.git/FETCH_HEAD
r3399282 r3399601 1 b19b23e3e9b86c45035b4d1390892c3ebf8a78d7 'b19b23e3e9b86c45035b4d1390892c3ebf8a78d7' of https://github.com/rockschtar/colored-admin-post-list1 2df138520caddc3a50cef2e14a56ca13b116d11a '2df138520caddc3a50cef2e14a56ca13b116d11a' of https://github.com/rockschtar/colored-admin-post-list -
colored-admin-post-list/trunk/.git/HEAD
r3399282 r3399601 1 b19b23e3e9b86c45035b4d1390892c3ebf8a78d7 1 2df138520caddc3a50cef2e14a56ca13b116d11a -
colored-admin-post-list/trunk/.git/config
r3399282 r3399601 10 10 auto = 0 11 11 [includeIf "gitdir:/home/runner/work/colored-admin-post-list/colored-admin-post-list/.git"] 12 path = /home/runner/work/_temp/git-credentials- 9944e622-f16b-49fd-9a73-176c46209a90.config12 path = /home/runner/work/_temp/git-credentials-f424d726-e97d-472b-8a9d-341fec284ee9.config 13 13 [includeIf "gitdir:/github/workspace/.git"] 14 path = /github/runner_temp/git-credentials- 9944e622-f16b-49fd-9a73-176c46209a90.config14 path = /github/runner_temp/git-credentials-f424d726-e97d-472b-8a9d-341fec284ee9.config -
colored-admin-post-list/trunk/.git/logs/HEAD
r3399282 r3399601 1 0000000000000000000000000000000000000000 b19b23e3e9b86c45035b4d1390892c3ebf8a78d7 runner <runner@runnervmg1sw1.kgil3twzltkufo2gekkesmjjke.dx.internal.cloudapp.net> 1763584622 +0000 checkout: moving from master to refs/tags/3.1.01 0000000000000000000000000000000000000000 2df138520caddc3a50cef2e14a56ca13b116d11a runner <runner@runnervmg1sw1.yuqz1jw5yhjepgxuxy13g0zykh.bx.internal.cloudapp.net> 1763634356 +0000 checkout: moving from master to refs/tags/3.1.1 -
colored-admin-post-list/trunk/.git/shallow
r3399282 r3399601 1 b19b23e3e9b86c45035b4d1390892c3ebf8a78d7 1 2df138520caddc3a50cef2e14a56ca13b116d11a -
colored-admin-post-list/trunk/colored-admin-post-list.php
r3399282 r3399601 7 7 * Author: rockschtar 8 8 * Author URI: http://www.eracer.de 9 * Version: 3.1. 09 * Version: 3.1.1 10 10 * Requires at least: 6.2 11 11 * Requires PHP: 8.3 -
colored-admin-post-list/trunk/src/Controller/PluginController.php
r3399282 r3399601 3 3 namespace Rockschtar\WordPress\ColoredAdminPostList\Controller; 4 4 5 use Rockschtar\WordPress\ColoredAdminPostList\Enums\DefaultColor;6 5 use Rockschtar\WordPress\ColoredAdminPostList\Enums\Option; 7 use Rockschtar\WordPress\ColoredAdminPostList\Enums\Setting;8 6 use Rockschtar\WordPress\ColoredAdminPostList\Utils\PluginVersion; 7 use Rockschtar\WordPress\ColoredAdminPostList\Utils\PostStati; 9 8 10 9 class PluginController … … 18 17 register_uninstall_hook(CAPL_PLUGIN_FILE, [__CLASS__, "onUninstall"]); 19 18 add_action('plugins_loaded', $this->pluginsLoaded(...)); 20 add_action("init", $this->loadPluginTextdomain(...));21 19 22 20 SettingsController::init(); 23 21 StyleController::init(); 24 }25 26 private function loadPluginTextdomain(): void27 {28 load_plugin_textdomain("colored-admin-post-list", true, CAPL_PLUGIN_RELATIVE_DIR . '/languages/');29 22 } 30 23 … … 51 44 public static function onUninstall(): void 52 45 { 53 delete_option(Option::INSTALLED->value);46 $postStati = PostStati::get(); 54 47 55 global $wpdb; 56 57 $options = $wpdb->get_results("SELECT option_name FROM $wpdb->options WHERE option_name LIKE 'capl-%'"); 58 foreach ($options as $option) { 59 delete_option($option->option_name); 48 foreach ($postStati as $postStatus) { 49 delete_option($postStatus->getOptionKey()); 60 50 } 61 51 -
colored-admin-post-list/trunk/src/Controller/SettingsController.php
r3399282 r3399601 16 16 { 17 17 add_action("admin_init", $this->registerSettings(...)); 18 ;19 18 add_action("admin_menu", $this->adminMenu(...)); 20 ;21 19 add_action('admin_print_scripts-settings_page_' . AdminPage::ADMIN_PAGE_OPTIONS, $this->adminPrintScriptsSettings(...)); 22 20 add_action('admin_print_scripts-posts_page_' . AdminPage::ADMIN_PAGE_OPTIONS, $this->adminPrintScriptsSettings(...)); 23 ;24 21 add_filter("plugin_action_links_" . CAPL_PLUGIN, $this->pluginActionLinks(...)); 25 ;26 22 } 27 23 … … 53 49 private function registerSettings(): void 54 50 { 55 $dummyCallback = static function () { 56 }; 51 register_setting( 52 Setting::PAGE_DEFAULT, 53 Option::ENABLED->value 54 ); 57 55 58 56 add_settings_section( 59 57 Setting::SECTION_GENERAL, 60 58 __("General", "colored-admin-post-list"), 61 $dummyCallback,59 static fn() => '', 62 60 Setting::PAGE_DEFAULT 63 61 ); … … 66 64 Setting::SECTION_COLORS_DEFAULT, 67 65 __("Default Post Statuses", "colored-admin-post-list"), 68 $dummyCallback,66 static fn() => '', 69 67 Setting::PAGE_DEFAULT 70 68 ); … … 85 83 $postStatus->getLabel(), 86 84 static function () use ($postStatus) { 87 $setting = get_option($postStatus->getOptionKey()); 88 echo '<input class="capl-wp-color-picker" type="text" id="' . $postStatus->getOptionKey() . '" class="regular-text" name="' . $postStatus->getOptionKey() . '" value="' . $setting . '" />'; 85 $setting = esc_attr(get_option($postStatus->getOptionKey())); 86 $optionId = esc_attr($postStatus->getOptionKey()); 87 88 echo <<<HTML 89 <input class="capl-wp-color-picker" type="text" id="$optionId" name="$optionId" class="regular-text" value="{$setting}" /> 90 HTML; 89 91 }, 90 92 Setting::PAGE_DEFAULT, … … 113 115 Setting::SECTION_COLORS_CUSTOM, 114 116 __("Custom Post Statuses", "colored-admin-post-list"), 115 $dummyCallback,117 static fn() => '', 116 118 Setting::PAGE_DEFAULT 117 119 ); … … 121 123 private function settingEnabled(): void 122 124 { 123 $checked = checked(get_option(Option::ENABLED->value, false), true, false); 124 echo '<input type="checkbox" name="' . Option::ENABLED->value . '" value="1"' . $checked . ' />'; 125 126 $checked = checked(get_option(Option::ENABLED->value) === '1', true, false); 127 $name = esc_attr(Option::ENABLED->value); 128 129 echo <<<HTML 130 <input type="checkbox" name="$name" value="1" $checked /> 131 HTML; 125 132 } 126 133
Note: See TracChangeset
for help on using the changeset viewer.