Changeset 3464228
- Timestamp:
- 02/18/2026 10:47:57 AM (6 weeks ago)
- Location:
- runthings-taxonomy-tags-to-checkboxes
- Files:
-
- 10 edited
- 1 copied
-
tags/1.3.0 (copied) (copied from runthings-taxonomy-tags-to-checkboxes/trunk)
-
tags/1.3.0/languages/runthings-taxonomy-tags-to-checkboxes.pot (modified) (4 diffs)
-
tags/1.3.0/lib/replace-tags.php (modified) (5 diffs)
-
tags/1.3.0/readme.md (modified) (1 diff)
-
tags/1.3.0/readme.txt (modified) (4 diffs)
-
tags/1.3.0/runthings-taxonomy-tags-to-checkboxes.php (modified) (2 diffs)
-
trunk/languages/runthings-taxonomy-tags-to-checkboxes.pot (modified) (4 diffs)
-
trunk/lib/replace-tags.php (modified) (5 diffs)
-
trunk/readme.md (modified) (1 diff)
-
trunk/readme.txt (modified) (4 diffs)
-
trunk/runthings-taxonomy-tags-to-checkboxes.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
runthings-taxonomy-tags-to-checkboxes/tags/1.3.0/languages/runthings-taxonomy-tags-to-checkboxes.pot
r3461388 r3464228 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Taxonomy Tags to Checkboxes 1. 2.0\n"5 "Project-Id-Version: Taxonomy Tags to Checkboxes 1.3.0\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/runthings-taxonomy-tags-to-checkboxes\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2026-02-1 4T15:01:15+00:00\n"12 "POT-Creation-Date: 2026-02-18T10:47:17+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.12.0\n" … … 142 142 msgstr "" 143 143 144 #: lib/replace-tags.php:175 144 #: lib/replace-tags.php:233 145 #: src/components/TtcTaxonomyPanel.js:102 145 146 msgid "No terms available." 146 147 msgstr "" 147 148 148 149 #. translators: %s: Taxonomy label 149 #: lib/replace-tags.php:239 150 #, php-format 150 #. translators: %s: taxonomy label 151 #: lib/replace-tags.php:297 152 #: src/components/TtcTaxonomyPanel.js:135 153 #, php-format,js-format 151 154 msgid "+ Add / Edit %s" 152 155 msgstr "" … … 155 158 msgid "GitHub" 156 159 msgstr "" 160 161 #: src/components/TtcTaxonomyPanel.js:141 162 msgid "+ Add / Edit" 163 msgstr "" -
runthings-taxonomy-tags-to-checkboxes/tags/1.3.0/lib/replace-tags.php
r3461388 r3464228 33 33 add_action( 'add_meta_boxes', function ( $post_type, $post ) use ( $taxonomy ) { 34 34 $this->remove_default_taxonomy_metabox( $post_type, $post, $taxonomy ); 35 if ( $this->should_use_classic_metabox( $post_type, $post ) ) { 36 $this->add_taxonomy_metabox( $post_type, $taxonomy ); 37 } 35 38 }, 10, 2 ); 36 37 add_action( 'add_meta_boxes', function ( $post_type ) use ( $taxonomy ) {38 $this->add_taxonomy_metabox( $post_type, $taxonomy );39 });40 39 41 40 add_action( 'save_post', function ( $post_id ) use ( $taxonomy ) { … … 46 45 47 46 /** 48 * Enqueue block editor assets to remove default taxonomy panels in Gutenberg47 * Enqueue block editor assets — native Gutenberg sidebar panels 49 48 */ 50 49 public function enqueue_block_editor_assets() { … … 53 52 } 54 53 54 $asset_file = RUNTHINGS_TTC_DIR . 'build/index.asset.php'; 55 if ( ! file_exists( $asset_file ) ) { 56 return; 57 } 58 59 $asset = include $asset_file; 60 55 61 wp_enqueue_script( 56 62 'runthings-ttc-editor', 57 RUNTHINGS_TTC_URL . ' assets/js/editor.js',58 [ 'wp-data', 'wp-dom-ready', 'wp-editor'],59 RUNTHINGS_TTC_VERSION,63 RUNTHINGS_TTC_URL . 'build/index.js', 64 $asset['dependencies'], 65 $asset['version'], 60 66 true 61 67 ); 62 68 63 wp_localize_script( 69 $height_settings = get_option( 'runthings_ttc_height_settings', [] ); 70 $show_links = get_option( 'runthings_ttc_show_links', [] ); 71 72 $taxonomy_configs = []; 73 foreach ( $this->selected_taxonomies as $taxonomy ) { 74 $taxonomy_object = get_taxonomy( $taxonomy ); 75 if ( ! $taxonomy_object || ! $taxonomy_object->show_in_rest ) { 76 continue; 77 } 78 79 $height_type = isset( $height_settings[ $taxonomy ]['type'] ) ? $height_settings[ $taxonomy ]['type'] : 'auto'; 80 $max_height = 'auto'; 81 if ( 'full' === $height_type ) { 82 $max_height = 'none'; 83 } elseif ( 'custom' === $height_type && isset( $height_settings[ $taxonomy ]['value'] ) ) { 84 $max_height = absint( $height_settings[ $taxonomy ]['value'] ) . 'px'; 85 } 86 87 $show_edit_link = is_array( $show_links ) && in_array( $taxonomy, $show_links, true ); 88 $edit_url = ''; 89 if ( $show_edit_link && current_user_can( $taxonomy_object->cap->manage_terms ) ) { 90 $edit_url = admin_url( 'edit-tags.php?taxonomy=' . $taxonomy ); 91 } 92 93 $taxonomy_configs[] = [ 94 'slug' => $taxonomy, 95 'restBase' => $taxonomy_object->rest_base ?: $taxonomy, 96 'label' => $taxonomy_object->label, 97 'postTypes' => array_values( $taxonomy_object->object_type ), 98 'maxHeight' => $max_height, 99 'showEditLink' => $show_edit_link && ! empty( $edit_url ), 100 'editUrl' => $edit_url, 101 ]; 102 } 103 104 wp_add_inline_script( 64 105 'runthings-ttc-editor', 65 'runthingsTtcEditor', 66 [ 67 'taxonomies' => array_values( $this->selected_taxonomies ), 68 ] 106 'window.runthingsTtcEditor = ' . wp_json_encode( [ 'taxonomies' => $taxonomy_configs ] ) . ';', 107 'before' 69 108 ); 70 109 } … … 116 155 remove_meta_box( 'tagsdiv-' . $taxonomy, $post_type, 'side' ); 117 156 } 157 } 158 159 /** 160 * Determines whether the custom classic metabox should be used. 161 * 162 * @param string $post_type The post type. 163 * @param \WP_Post $post The current post object. 164 * @return bool 165 */ 166 private function should_use_classic_metabox( $post_type, $post ) { 167 if ( function_exists( 'use_block_editor_for_post' ) && $post instanceof \WP_Post ) { 168 return ! use_block_editor_for_post( $post ); 169 } 170 171 if ( function_exists( 'use_block_editor_for_post_type' ) ) { 172 return ! use_block_editor_for_post_type( $post_type ); 173 } 174 175 return true; 118 176 } 119 177 … … 271 329 } 272 330 } 273 -
runthings-taxonomy-tags-to-checkboxes/tags/1.3.0/readme.md
r3461388 r3464228 56 56 57 57 ## Changelog 58 59 ### v1.3.0 - 18th February 2026 60 61 - Feature - Add Gutenberg (block editor) support for taxonomy meta boxes instead of using compatibility mode 58 62 59 63 ### v1.2.0 - 14th February 2026 -
runthings-taxonomy-tags-to-checkboxes/tags/1.3.0/readme.txt
r3461388 r3464228 4 4 Requires at least: 6.4 5 5 Tested up to: 6.9 6 Stable tag: 1. 2.06 Stable tag: 1.3.0 7 7 License: GPLv3 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 52 52 == Changelog == 53 53 54 = 1.3.0 - 18th February 2026 = 55 * Feature - Add Gutenberg (block editor) support for taxonomy meta boxes instead of using compatibility mode 56 54 57 = 1.2.0 - 14th February 2026 = 55 58 * Improvement - Rename "Auto" height option to "Default" for clarity … … 88 91 == Upgrade Notice == 89 92 93 = 1.3.0 = 94 Adds Gutenberg support for taxonomy meta boxes. 95 90 96 = 1.2.0 = 91 97 Fixes fatal error when a configured taxonomy is deleted, improves panel height options. … … 93 99 = 1.1.1 = 94 100 Fix duplicate taxonomy panels in the block editor for built-in taxonomies. 95 96 = 1.1.0 =97 Bug fix for admin options table display on mobile devices.98 101 99 102 == License == -
runthings-taxonomy-tags-to-checkboxes/tags/1.3.0/runthings-taxonomy-tags-to-checkboxes.php
r3461388 r3464228 5 5 * Plugin URI: https://runthings.dev/wordpress-plugins/taxonomy-tags-to-checkboxes/ 6 6 * Description: Convert taxonomy tags to checkboxes in the WordPress admin. 7 * Version: 1. 2.07 * Version: 1.3.0 8 8 * Author: runthingsdev 9 9 * Author URI: https://runthings.dev/ … … 38 38 } 39 39 40 define( 'RUNTHINGS_TTC_VERSION', '1. 2.0' );40 define( 'RUNTHINGS_TTC_VERSION', '1.3.0' ); 41 41 42 42 define( 'RUNTHINGS_TTC_BASENAME', plugin_basename( __FILE__ ) ); -
runthings-taxonomy-tags-to-checkboxes/trunk/languages/runthings-taxonomy-tags-to-checkboxes.pot
r3461388 r3464228 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Taxonomy Tags to Checkboxes 1. 2.0\n"5 "Project-Id-Version: Taxonomy Tags to Checkboxes 1.3.0\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/runthings-taxonomy-tags-to-checkboxes\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2026-02-1 4T15:01:15+00:00\n"12 "POT-Creation-Date: 2026-02-18T10:47:17+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.12.0\n" … … 142 142 msgstr "" 143 143 144 #: lib/replace-tags.php:175 144 #: lib/replace-tags.php:233 145 #: src/components/TtcTaxonomyPanel.js:102 145 146 msgid "No terms available." 146 147 msgstr "" 147 148 148 149 #. translators: %s: Taxonomy label 149 #: lib/replace-tags.php:239 150 #, php-format 150 #. translators: %s: taxonomy label 151 #: lib/replace-tags.php:297 152 #: src/components/TtcTaxonomyPanel.js:135 153 #, php-format,js-format 151 154 msgid "+ Add / Edit %s" 152 155 msgstr "" … … 155 158 msgid "GitHub" 156 159 msgstr "" 160 161 #: src/components/TtcTaxonomyPanel.js:141 162 msgid "+ Add / Edit" 163 msgstr "" -
runthings-taxonomy-tags-to-checkboxes/trunk/lib/replace-tags.php
r3461388 r3464228 33 33 add_action( 'add_meta_boxes', function ( $post_type, $post ) use ( $taxonomy ) { 34 34 $this->remove_default_taxonomy_metabox( $post_type, $post, $taxonomy ); 35 if ( $this->should_use_classic_metabox( $post_type, $post ) ) { 36 $this->add_taxonomy_metabox( $post_type, $taxonomy ); 37 } 35 38 }, 10, 2 ); 36 37 add_action( 'add_meta_boxes', function ( $post_type ) use ( $taxonomy ) {38 $this->add_taxonomy_metabox( $post_type, $taxonomy );39 });40 39 41 40 add_action( 'save_post', function ( $post_id ) use ( $taxonomy ) { … … 46 45 47 46 /** 48 * Enqueue block editor assets to remove default taxonomy panels in Gutenberg47 * Enqueue block editor assets — native Gutenberg sidebar panels 49 48 */ 50 49 public function enqueue_block_editor_assets() { … … 53 52 } 54 53 54 $asset_file = RUNTHINGS_TTC_DIR . 'build/index.asset.php'; 55 if ( ! file_exists( $asset_file ) ) { 56 return; 57 } 58 59 $asset = include $asset_file; 60 55 61 wp_enqueue_script( 56 62 'runthings-ttc-editor', 57 RUNTHINGS_TTC_URL . ' assets/js/editor.js',58 [ 'wp-data', 'wp-dom-ready', 'wp-editor'],59 RUNTHINGS_TTC_VERSION,63 RUNTHINGS_TTC_URL . 'build/index.js', 64 $asset['dependencies'], 65 $asset['version'], 60 66 true 61 67 ); 62 68 63 wp_localize_script( 69 $height_settings = get_option( 'runthings_ttc_height_settings', [] ); 70 $show_links = get_option( 'runthings_ttc_show_links', [] ); 71 72 $taxonomy_configs = []; 73 foreach ( $this->selected_taxonomies as $taxonomy ) { 74 $taxonomy_object = get_taxonomy( $taxonomy ); 75 if ( ! $taxonomy_object || ! $taxonomy_object->show_in_rest ) { 76 continue; 77 } 78 79 $height_type = isset( $height_settings[ $taxonomy ]['type'] ) ? $height_settings[ $taxonomy ]['type'] : 'auto'; 80 $max_height = 'auto'; 81 if ( 'full' === $height_type ) { 82 $max_height = 'none'; 83 } elseif ( 'custom' === $height_type && isset( $height_settings[ $taxonomy ]['value'] ) ) { 84 $max_height = absint( $height_settings[ $taxonomy ]['value'] ) . 'px'; 85 } 86 87 $show_edit_link = is_array( $show_links ) && in_array( $taxonomy, $show_links, true ); 88 $edit_url = ''; 89 if ( $show_edit_link && current_user_can( $taxonomy_object->cap->manage_terms ) ) { 90 $edit_url = admin_url( 'edit-tags.php?taxonomy=' . $taxonomy ); 91 } 92 93 $taxonomy_configs[] = [ 94 'slug' => $taxonomy, 95 'restBase' => $taxonomy_object->rest_base ?: $taxonomy, 96 'label' => $taxonomy_object->label, 97 'postTypes' => array_values( $taxonomy_object->object_type ), 98 'maxHeight' => $max_height, 99 'showEditLink' => $show_edit_link && ! empty( $edit_url ), 100 'editUrl' => $edit_url, 101 ]; 102 } 103 104 wp_add_inline_script( 64 105 'runthings-ttc-editor', 65 'runthingsTtcEditor', 66 [ 67 'taxonomies' => array_values( $this->selected_taxonomies ), 68 ] 106 'window.runthingsTtcEditor = ' . wp_json_encode( [ 'taxonomies' => $taxonomy_configs ] ) . ';', 107 'before' 69 108 ); 70 109 } … … 116 155 remove_meta_box( 'tagsdiv-' . $taxonomy, $post_type, 'side' ); 117 156 } 157 } 158 159 /** 160 * Determines whether the custom classic metabox should be used. 161 * 162 * @param string $post_type The post type. 163 * @param \WP_Post $post The current post object. 164 * @return bool 165 */ 166 private function should_use_classic_metabox( $post_type, $post ) { 167 if ( function_exists( 'use_block_editor_for_post' ) && $post instanceof \WP_Post ) { 168 return ! use_block_editor_for_post( $post ); 169 } 170 171 if ( function_exists( 'use_block_editor_for_post_type' ) ) { 172 return ! use_block_editor_for_post_type( $post_type ); 173 } 174 175 return true; 118 176 } 119 177 … … 271 329 } 272 330 } 273 -
runthings-taxonomy-tags-to-checkboxes/trunk/readme.md
r3461388 r3464228 56 56 57 57 ## Changelog 58 59 ### v1.3.0 - 18th February 2026 60 61 - Feature - Add Gutenberg (block editor) support for taxonomy meta boxes instead of using compatibility mode 58 62 59 63 ### v1.2.0 - 14th February 2026 -
runthings-taxonomy-tags-to-checkboxes/trunk/readme.txt
r3461388 r3464228 4 4 Requires at least: 6.4 5 5 Tested up to: 6.9 6 Stable tag: 1. 2.06 Stable tag: 1.3.0 7 7 License: GPLv3 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 52 52 == Changelog == 53 53 54 = 1.3.0 - 18th February 2026 = 55 * Feature - Add Gutenberg (block editor) support for taxonomy meta boxes instead of using compatibility mode 56 54 57 = 1.2.0 - 14th February 2026 = 55 58 * Improvement - Rename "Auto" height option to "Default" for clarity … … 88 91 == Upgrade Notice == 89 92 93 = 1.3.0 = 94 Adds Gutenberg support for taxonomy meta boxes. 95 90 96 = 1.2.0 = 91 97 Fixes fatal error when a configured taxonomy is deleted, improves panel height options. … … 93 99 = 1.1.1 = 94 100 Fix duplicate taxonomy panels in the block editor for built-in taxonomies. 95 96 = 1.1.0 =97 Bug fix for admin options table display on mobile devices.98 101 99 102 == License == -
runthings-taxonomy-tags-to-checkboxes/trunk/runthings-taxonomy-tags-to-checkboxes.php
r3461388 r3464228 5 5 * Plugin URI: https://runthings.dev/wordpress-plugins/taxonomy-tags-to-checkboxes/ 6 6 * Description: Convert taxonomy tags to checkboxes in the WordPress admin. 7 * Version: 1. 2.07 * Version: 1.3.0 8 8 * Author: runthingsdev 9 9 * Author URI: https://runthings.dev/ … … 38 38 } 39 39 40 define( 'RUNTHINGS_TTC_VERSION', '1. 2.0' );40 define( 'RUNTHINGS_TTC_VERSION', '1.3.0' ); 41 41 42 42 define( 'RUNTHINGS_TTC_BASENAME', plugin_basename( __FILE__ ) );
Note: See TracChangeset
for help on using the changeset viewer.