Changeset 3467136
- Timestamp:
- 02/22/2026 09:55:06 PM (5 weeks ago)
- Location:
- runthings-taxonomy-tags-to-checkboxes
- Files:
-
- 16 added
- 2 deleted
- 16 edited
- 1 copied
-
tags/1.4.0 (copied) (copied from runthings-taxonomy-tags-to-checkboxes/trunk)
-
tags/1.4.0/.editorconfig (added)
-
tags/1.4.0/.prettierrc.js (added)
-
tags/1.4.0/assets/css/admin.css (modified) (4 diffs)
-
tags/1.4.0/assets/css/classic-metabox.css (added)
-
tags/1.4.0/assets/js/admin.js (modified) (1 diff)
-
tags/1.4.0/assets/js/classic-metabox.js (added)
-
tags/1.4.0/assets/js/editor.js (modified) (1 diff)
-
tags/1.4.0/languages/runthings-taxonomy-tags-to-checkboxes.pot (modified) (3 diffs)
-
tags/1.4.0/lib/admin-options.php (modified) (9 diffs)
-
tags/1.4.0/lib/block-integration.php (added)
-
tags/1.4.0/lib/bootstrap.php (added)
-
tags/1.4.0/lib/classic-integration.php (added)
-
tags/1.4.0/lib/config.php (added)
-
tags/1.4.0/lib/replace-tags.php (deleted)
-
tags/1.4.0/readme.md (modified) (6 diffs)
-
tags/1.4.0/readme.txt (modified) (6 diffs)
-
tags/1.4.0/runthings-taxonomy-tags-to-checkboxes.php (modified) (5 diffs)
-
trunk/.editorconfig (added)
-
trunk/.prettierrc.js (added)
-
trunk/assets/css/admin.css (modified) (4 diffs)
-
trunk/assets/css/classic-metabox.css (added)
-
trunk/assets/js/admin.js (modified) (1 diff)
-
trunk/assets/js/classic-metabox.js (added)
-
trunk/assets/js/editor.js (modified) (1 diff)
-
trunk/languages/runthings-taxonomy-tags-to-checkboxes.pot (modified) (3 diffs)
-
trunk/lib/admin-options.php (modified) (9 diffs)
-
trunk/lib/block-integration.php (added)
-
trunk/lib/bootstrap.php (added)
-
trunk/lib/classic-integration.php (added)
-
trunk/lib/config.php (added)
-
trunk/lib/replace-tags.php (deleted)
-
trunk/readme.md (modified) (6 diffs)
-
trunk/readme.txt (modified) (6 diffs)
-
trunk/runthings-taxonomy-tags-to-checkboxes.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
runthings-taxonomy-tags-to-checkboxes/tags/1.4.0/assets/css/admin.css
r3461388 r3467136 57 57 } 58 58 #taxonomy-table th.column-height, 59 #taxonomy-table th.column-show-link { 59 #taxonomy-table th.column-show-link, 60 #taxonomy-table th.column-allow-create, 61 #taxonomy-table th.column-search { 60 62 padding: 8px; 61 63 } … … 68 70 width: 70px; 69 71 } 72 .min-terms-input { 73 display: flex; 74 align-items: center; 75 gap: 5px; 76 } 77 .min-terms-input input[type="number"] { 78 width: 70px; 79 } 70 80 71 81 /* Show Link Column */ … … 73 83 width: 100px; 74 84 text-align: center; 85 } 86 87 #taxonomy-table .column-allow-create { 88 width: 100px; 89 text-align: center; 90 } 91 #taxonomy-table .column-search { 92 width: 180px; 75 93 } 76 94 … … 159 177 160 178 /* Show link inline */ 161 #taxonomy-table .column-show-link { 179 #taxonomy-table .column-show-link, 180 #taxonomy-table .column-allow-create, 181 #taxonomy-table .column-search { 162 182 display: flex; 163 183 align-items: center; -
runthings-taxonomy-tags-to-checkboxes/tags/1.4.0/assets/js/admin.js
r3271144 r3467136 1 (function ($) { 2 "use strict"; 1 ( function ( $ ) { 2 'use strict'; 3 const taxonomyStats = window.taxonomyStats || { systemCount: 0 }; 3 4 4 $(document).ready(function () {5 // Table sorting functionality6 $(".sort-column").on("click", function (e) {7 e.preventDefault();5 $( document ).ready( function () { 6 // Table sorting functionality 7 $( '.sort-column' ).on( 'click', function ( e ) { 8 e.preventDefault(); 8 9 9 var $this = $(this);10 var column = $this.data("column");11 var $table = $("#taxonomy-table");12 var $rows = $table.find("tbody tr").toArray();13 var ascending = $this.closest("th").hasClass("desc");10 const $this = $( this ); 11 const column = $this.data( 'column' ); 12 const $table = $( '#taxonomy-table' ); 13 const $rows = $table.find( 'tbody tr' ).toArray(); 14 const ascending = $this.closest( 'th' ).hasClass( 'desc' ); 14 15 15 // Update sortable classes 16 $table.find("thead th, tfoot th").removeClass("sorted asc desc"); 16 // Update sortable classes 17 $table 18 .find( 'thead th, tfoot th' ) 19 .removeClass( 'sorted asc desc' ); 17 20 18 // Update the current column's sorting state19 var $currentHeader = $this.closest("th");20 $currentHeader.addClass("sorted");21 // Update the current column's sorting state 22 const $currentHeader = $this.closest( 'th' ); 23 $currentHeader.addClass( 'sorted' ); 21 24 22 if (ascending) {23 $currentHeader.removeClass("desc").addClass("asc");24 } else {25 $currentHeader.removeClass("asc").addClass("desc");26 }25 if ( ascending ) { 26 $currentHeader.removeClass( 'desc' ).addClass( 'asc' ); 27 } else { 28 $currentHeader.removeClass( 'asc' ).addClass( 'desc' ); 29 } 27 30 28 // Sort the rows29 $rows.sort(function (a, b) {30 varvalA, valB;31 // Sort the rows 32 $rows.sort( function ( a, b ) { 33 let valA, valB; 31 34 32 if (column === "name") {33 valA = $(a).data("name");34 valB = $(b).data("name");35 } else if (column === "post_types") {36 valA = $(a).data("post-types");37 valB = $(b).data("post-types");38 } else if (column === "type") {39 valA = $(a).data("type");40 valB = $(b).data("type");41 }35 if ( column === 'name' ) { 36 valA = $( a ).data( 'name' ); 37 valB = $( b ).data( 'name' ); 38 } else if ( column === 'post_types' ) { 39 valA = $( a ).data( 'post-types' ); 40 valB = $( b ).data( 'post-types' ); 41 } else if ( column === 'type' ) { 42 valA = $( a ).data( 'type' ); 43 valB = $( b ).data( 'type' ); 44 } 42 45 43 if (valA < valB) return ascending ? -1 : 1; 44 if (valA > valB) return ascending ? 1 : -1; 45 return 0; 46 }); 46 if ( valA < valB ) { 47 return ascending ? -1 : 1; 48 } 49 if ( valA > valB ) { 50 return ascending ? 1 : -1; 51 } 52 return 0; 53 } ); 47 54 48 // Append sorted rows to table49 $.each($rows, function (index, row) {50 $table.find("tbody").append(row);51 });55 // Append sorted rows to table 56 $.each( $rows, function ( index, row ) { 57 $table.find( 'tbody' ).append( row ); 58 } ); 52 59 53 return false;54 });60 return false; 61 } ); 55 62 56 // System taxonomy toggle57 $("#show-system-taxonomies").on("change", function () {58 if ($(this).is(":checked")) {59 $(".system-taxonomy").show();60 } else {61 $(".system-taxonomy").hide();62 }63 // System taxonomy toggle 64 $( '#show-system-taxonomies' ).on( 'change', function () { 65 if ( $( this ).is( ':checked' ) ) { 66 $( '.system-taxonomy' ).show(); 67 } else { 68 $( '.system-taxonomy' ).hide(); 69 } 63 70 64 updateNoItemsVisibility();65 });71 updateNoItemsVisibility(); 72 } ); 66 73 67 // Height type selection change handler68 $(".height-type-select").on("change", function () {69 var $this = $(this);70 var $row = $this.closest("tr");71 var $customField = $row.find(".custom-height-input");74 // Height type selection change handler 75 $( '.height-type-select' ).on( 'change', function () { 76 const $this = $( this ); 77 const $row = $this.closest( 'tr' ); 78 const $customField = $row.find( '.custom-height-input' ); 72 79 73 if ($this.val() === "custom") {74 $customField.show();75 } else {76 $customField.hide();77 }78 });80 if ( $this.val() === 'custom' ) { 81 $customField.show(); 82 } else { 83 $customField.hide(); 84 } 85 } ); 79 86 80 // Taxonomy checkbox change handler 81 $("input[name='runthings_ttc_selected_taxonomies[]']").on( 82 "change", 83 function () { 84 var $this = $(this); 85 var $row = $this.closest("tr"); 86 var $heightSelect = $row.find(".height-type-select"); 87 var $customHeight = $row.find(".custom-height-input input"); 88 var $showLinkCheckbox = $row.find( 89 "input[name='runthings_ttc_show_links[]']" 90 ); 87 // Search mode selection change handler 88 $( '.search-mode-select' ).on( 'change', function () { 89 const $this = $( this ); 90 const $row = $this.closest( 'tr' ); 91 const $minTermsField = $row.find( '.min-terms-input' ); 91 92 92 if ($this.is(":checked") && !$this.is(":disabled")) { 93 // Enable height controls and show link checkbox 94 $heightSelect.prop("disabled", false); 95 $customHeight.prop("disabled", false); 96 $showLinkCheckbox.prop("disabled", false); 97 } else { 98 // Disable height controls and show link checkbox 99 $heightSelect.prop("disabled", true); 100 $customHeight.prop("disabled", true); 101 $showLinkCheckbox.prop("disabled", true); 102 } 103 } 104 ); 93 if ( $this.val() === 'min_terms' ) { 94 $minTermsField.show(); 95 } else { 96 $minTermsField.hide(); 97 } 98 } ); 105 99 106 // Function to update the no-items message visibility 107 function updateNoItemsVisibility() { 108 var systemVisible = $("#show-system-taxonomies").is(":checked"); 100 // Taxonomy checkbox change handler 101 $( "input[name='runthings_ttc_selected_taxonomies[]']" ).on( 102 'change', 103 function () { 104 const $this = $( this ); 105 const $row = $this.closest( 'tr' ); 106 const $heightSelect = $row.find( '.height-type-select' ); 107 const $customHeight = $row.find( '.custom-height-input input' ); 108 const $showLinkCheckbox = $row.find( 109 "input[name='runthings_ttc_show_links[]']" 110 ); 111 const $allowCreateCheckbox = $row.find( 112 "input[name='runthings_ttc_allow_term_create[]']" 113 ); 114 const $searchModeSelect = $row.find( '.search-mode-select' ); 115 const $searchThreshold = $row.find( '.min-terms-input input' ); 109 116 110 var visibleRows = $("#taxonomy-table tbody tr:visible").not( 111 ".no-items" 112 ).length; 117 if ( $this.is( ':checked' ) && ! $this.is( ':disabled' ) ) { 118 // Enable height controls and show link checkbox 119 $heightSelect.prop( 'disabled', false ); 120 $customHeight.prop( 'disabled', false ); 121 $showLinkCheckbox.prop( 'disabled', false ); 122 $allowCreateCheckbox.prop( 'disabled', false ); 123 $searchModeSelect.prop( 'disabled', false ); 124 $searchThreshold.prop( 'disabled', false ); 125 } else { 126 // Disable height controls and show link checkbox 127 $heightSelect.prop( 'disabled', true ); 128 $customHeight.prop( 'disabled', true ); 129 $showLinkCheckbox.prop( 'disabled', true ); 130 $allowCreateCheckbox.prop( 'disabled', true ); 131 $searchModeSelect.prop( 'disabled', true ); 132 $searchThreshold.prop( 'disabled', true ); 133 } 134 } 135 ); 113 136 114 if (visibleRows === 0) { 115 // Show the no items message 116 $(".no-items").show(); 137 // Function to update the no-items message visibility 138 function updateNoItemsVisibility() { 139 const systemVisible = $( '#show-system-taxonomies' ).is( 140 ':checked' 141 ); 117 142 118 // If there are system taxonomies but they're hidden, show the hint 119 if (!systemVisible && taxonomyStats.systemCount > 0) { 120 $(".hidden-system-message").show(); 121 } else { 122 $(".hidden-system-message").hide(); 123 } 124 } else { 125 // Hide the no items message when there are visible rows 126 $(".no-items").hide(); 127 } 128 } 143 const visibleRows = $( '#taxonomy-table tbody tr:visible' ).not( 144 '.no-items' 145 ).length; 129 146 130 // Initialize height fields on load 131 $(".height-type-select").each(function () { 132 $(this).trigger("change"); 133 }); 147 if ( visibleRows === 0 ) { 148 // Show the no items message 149 $( '.no-items' ).show(); 134 150 135 // Initialize enabled/disabled state on load 136 $("input[name='runthings_ttc_selected_taxonomies[]']").each(function () { 137 $(this).trigger("change"); 138 }); 151 // If there are system taxonomies but they're hidden, show the hint 152 if ( ! systemVisible && taxonomyStats.systemCount > 0 ) { 153 $( '.hidden-system-message' ).show(); 154 } else { 155 $( '.hidden-system-message' ).hide(); 156 } 157 } else { 158 // Hide the no items message when there are visible rows 159 $( '.no-items' ).hide(); 160 } 161 } 139 162 140 // Initial setup - hide system taxonomies 141 $("#show-system-taxonomies").prop("checked", false).trigger("change"); 163 // Initialize height fields on load 164 $( '.height-type-select' ).each( function () { 165 $( this ).trigger( 'change' ); 166 } ); 167 $( '.search-mode-select' ).each( function () { 168 $( this ).trigger( 'change' ); 169 } ); 142 170 143 // Initial update of no-items visibility 144 updateNoItemsVisibility(); 145 }); 146 })(jQuery); 171 // Initialize enabled/disabled state on load 172 $( "input[name='runthings_ttc_selected_taxonomies[]']" ).each( 173 function () { 174 $( this ).trigger( 'change' ); 175 } 176 ); 177 178 // Initial setup - hide system taxonomies 179 $( '#show-system-taxonomies' ) 180 .prop( 'checked', false ) 181 .trigger( 'change' ); 182 183 // Initial update of no-items visibility 184 updateNoItemsVisibility(); 185 } ); 186 } )( window.jQuery ); -
runthings-taxonomy-tags-to-checkboxes/tags/1.4.0/assets/js/editor.js
r3455906 r3467136 1 ( function() { 2 var taxonomies = window.runthingsTtcEditor && window.runthingsTtcEditor.taxonomies; 3 if ( ! taxonomies || ! taxonomies.length ) { 4 return; 5 } 1 ( function () { 2 const taxonomies = 3 window.runthingsTtcEditor && window.runthingsTtcEditor.taxonomies; 4 if ( ! taxonomies || ! taxonomies.length ) { 5 return; 6 } 6 7 7 wp.domReady( function() { 8 taxonomies.forEach( function( taxonomy ) { 9 wp.data.dispatch( 'core/editor' ).removeEditorPanel( 'taxonomy-panel-' + taxonomy ); 10 } ); 11 } ); 8 wp.domReady( function () { 9 taxonomies.forEach( function ( taxonomy ) { 10 wp.data 11 .dispatch( 'core/editor' ) 12 .removeEditorPanel( 'taxonomy-panel-' + taxonomy ); 13 } ); 14 } ); 12 15 } )(); -
runthings-taxonomy-tags-to-checkboxes/tags/1.4.0/languages/runthings-taxonomy-tags-to-checkboxes.pot
r3464228 r3467136 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Taxonomy Tags to Checkboxes 1. 3.0\n"5 "Project-Id-Version: Taxonomy Tags to Checkboxes 1.4.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- 18T10:47:17+00:00\n"12 "POT-Creation-Date: 2026-02-22T21:54:20+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" … … 49 49 msgstr "" 50 50 51 #: lib/admin-options.php: 8051 #: lib/admin-options.php:92 52 52 msgid "Taxonomy Settings" 53 53 msgstr "" 54 54 55 #: lib/admin-options.php: 8755 #: lib/admin-options.php:99 56 56 msgid "Select Taxonomies" 57 57 msgstr "" 58 58 59 #: lib/admin-options.php:2 1259 #: lib/admin-options.php:287 60 60 msgid "Select which taxonomies should use checkboxes instead of tags UI." 61 61 msgstr "" 62 62 63 #: lib/admin-options.php:2 1763 #: lib/admin-options.php:292 64 64 msgid "Show system taxonomies" 65 65 msgstr "" 66 66 67 #: lib/admin-options.php: 22768 #: lib/admin-options.php: 38067 #: lib/admin-options.php:302 68 #: lib/admin-options.php:490 69 69 msgid "Select All" 70 70 msgstr "" 71 71 72 #: lib/admin-options.php: 23173 #: lib/admin-options.php: 38472 #: lib/admin-options.php:306 73 #: lib/admin-options.php:494 74 74 msgid "Name" 75 75 msgstr "" 76 76 77 #: lib/admin-options.php: 24078 #: lib/admin-options.php: 39377 #: lib/admin-options.php:315 78 #: lib/admin-options.php:503 79 79 msgid "Post Types" 80 80 msgstr "" 81 81 82 #: lib/admin-options.php: 24983 #: lib/admin-options.php: 40282 #: lib/admin-options.php:324 83 #: lib/admin-options.php:512 84 84 msgid "Type" 85 85 msgstr "" 86 86 87 #: lib/admin-options.php: 25788 #: lib/admin-options.php: 36089 #: lib/admin-options.php: 41087 #: lib/admin-options.php:332 88 #: lib/admin-options.php:455 89 #: lib/admin-options.php:520 90 90 msgid "Height" 91 91 msgstr "" 92 92 93 #: lib/admin-options.php:260 93 #: lib/admin-options.php:335 94 #: lib/admin-options.php:466 95 #: lib/admin-options.php:523 96 msgid "Allow Inline Add" 97 msgstr "" 98 99 #: lib/admin-options.php:338 100 #: lib/admin-options.php:469 101 #: lib/admin-options.php:526 102 msgid "Show Edit Link" 103 msgstr "" 104 105 #: lib/admin-options.php:341 106 #: lib/admin-options.php:472 107 #: lib/admin-options.php:529 108 msgid "Search Box" 109 msgstr "" 110 111 #: lib/admin-options.php:352 112 msgid "No taxonomies found." 113 msgstr "" 114 115 #: lib/admin-options.php:354 116 msgid "System taxonomies are currently hidden. Enable \"Show system taxonomies\" to see more options." 117 msgstr "" 118 94 119 #: lib/admin-options.php:371 95 #: lib/admin-options.php:413 96 msgid "Show Edit Link" 97 msgstr "" 98 99 #: lib/admin-options.php:271 100 msgid "No taxonomies found." 101 msgstr "" 102 103 #: lib/admin-options.php:273 104 msgid "System taxonomies are currently hidden. Enable \"Show system taxonomies\" to see more options." 105 msgstr "" 106 107 #: lib/admin-options.php:290 108 #: lib/admin-options.php:298 120 #: lib/admin-options.php:379 109 121 msgid "Taxonomy already uses checkboxes" 110 122 msgstr "" 111 123 112 #: lib/admin-options.php: 291124 #: lib/admin-options.php:372 113 125 msgid "Hierarchical" 114 126 msgstr "" 115 127 116 #: lib/admin-options.php: 293128 #: lib/admin-options.php:374 117 129 msgid "Uses tags interface by default" 118 130 msgstr "" 119 131 120 #: lib/admin-options.php: 294132 #: lib/admin-options.php:375 121 133 msgid "Non-hierarchical" 122 134 msgstr "" 123 135 124 #: lib/admin-options.php: 349136 #: lib/admin-options.php:444 125 137 msgid "Convert" 126 138 msgstr "" 127 139 128 #: lib/admin-options.php: 362140 #: lib/admin-options.php:457 129 141 msgid "Default" 130 142 msgstr "" 131 143 132 #: lib/admin-options.php: 363144 #: lib/admin-options.php:458 133 145 msgid "Full" 134 146 msgstr "" 135 147 136 #: lib/admin-options.php: 364148 #: lib/admin-options.php:459 137 149 msgid "Custom" 138 150 msgstr "" 139 151 140 #: lib/admin-options.php:478 152 #: lib/admin-options.php:474 153 msgid "Off" 154 msgstr "" 155 156 #: lib/admin-options.php:475 157 msgid "Always" 158 msgstr "" 159 160 #: lib/admin-options.php:476 161 msgid "Min Terms" 162 msgstr "" 163 164 #: lib/admin-options.php:479 165 msgid "Minimum terms" 166 msgstr "" 167 168 #: lib/admin-options.php:481 169 msgid "Terms" 170 msgstr "" 171 172 #: lib/admin-options.php:594 141 173 msgid "Settings" 142 174 msgstr "" 143 175 144 #: lib/replace-tags.php:233 145 #: src/components/TtcTaxonomyPanel.js:102 176 #: lib/classic-integration.php:100 177 #: src/components/TtcTaxonomyPanel.js:224 178 msgid "Search terms" 179 msgstr "" 180 181 #: lib/classic-integration.php:101 182 msgid "Search terms..." 183 msgstr "" 184 185 #: lib/classic-integration.php:102 186 #: src/components/TtcTaxonomyPanel.js:251 187 msgid "No matching terms." 188 msgstr "" 189 190 #. translators: %s: Add new taxonomy item label. 191 #: lib/classic-integration.php:227 192 #, php-format 193 msgid "+ %s" 194 msgstr "" 195 196 #. translators: %s: taxonomy label 197 #: lib/config.php:110 198 #, php-format 199 msgid "Edit %s" 200 msgstr "" 201 202 #: lib/config.php:113 203 msgid "Edit" 204 msgstr "" 205 206 #. translators: %s: taxonomy label 207 #: lib/config.php:119 208 #, php-format 209 msgid "Add / Edit %s" 210 msgstr "" 211 212 #: lib/config.php:122 213 #: src/components/TtcTaxonomyPanel.js:317 214 msgid "Add / Edit" 215 msgstr "" 216 217 #: runthings-taxonomy-tags-to-checkboxes.php:73 218 msgid "GitHub" 219 msgstr "" 220 221 #: src/components/TtcTaxonomyPanel.js:170 222 msgid "Could not add the term." 223 msgstr "" 224 225 #: src/components/TtcTaxonomyPanel.js:212 146 226 msgid "No terms available." 147 227 msgstr "" 148 228 149 #. translators: %s: Taxonomy label 150 #. translators: %s: taxonomy label 151 #: lib/replace-tags.php:297 152 #: src/components/TtcTaxonomyPanel.js:135 153 #, php-format,js-format 154 msgid "+ Add / Edit %s" 155 msgstr "" 156 157 #: runthings-taxonomy-tags-to-checkboxes.php:70 158 msgid "GitHub" 159 msgstr "" 160 161 #: src/components/TtcTaxonomyPanel.js:141 162 msgid "+ Add / Edit" 163 msgstr "" 229 #. translators: 1: visible terms count, 2: total terms count 230 #: src/components/TtcTaxonomyPanel.js:237 231 #, js-format 232 msgid "Showing %1$d of %2$d terms" 233 msgstr "" 234 235 #: src/components/TtcTaxonomyPanel.js:284 236 msgid "Add new term" 237 msgstr "" 238 239 #: src/components/TtcTaxonomyPanel.js:305 240 msgid "Add" 241 msgstr "" -
runthings-taxonomy-tags-to-checkboxes/tags/1.4.0/lib/admin-options.php
r3461388 r3467136 76 76 ); 77 77 78 register_setting( 79 'runthings_taxonomy_options_group', 80 'runthings_ttc_allow_term_create', 81 ['sanitize_callback' => [$this, 'sanitize_allow_term_create_settings']] 82 ); 83 84 register_setting( 85 'runthings_taxonomy_options_group', 86 'runthings_ttc_search_settings', 87 ['sanitize_callback' => [$this, 'sanitize_search_settings']] 88 ); 89 78 90 add_settings_section( 79 91 'runthings_taxonomy_section', … … 151 163 152 164 /** 165 * Sanitize allow inline term create settings 166 * 167 * @param array $input The input array. 168 * @return array The sanitized array. 169 */ 170 public function sanitize_allow_term_create_settings($input) { 171 if (!is_array($input)) { 172 return []; 173 } 174 return array_map('sanitize_text_field', $input); 175 } 176 177 /** 178 * Sanitize search settings. 179 * 180 * @param array $input The input array. 181 * @return array 182 */ 183 public function sanitize_search_settings($input) { 184 if (!is_array($input)) { 185 return []; 186 } 187 188 $sanitized = []; 189 $allowed_modes = [ 'off', 'always', 'min_terms' ]; 190 191 foreach ($input as $taxonomy => $settings) { 192 $taxonomy = sanitize_key((string) $taxonomy); 193 if ('' === $taxonomy || !is_array($settings)) { 194 continue; 195 } 196 197 $mode = isset($settings['mode']) ? sanitize_key((string) $settings['mode']) : 'off'; 198 if (!in_array($mode, $allowed_modes, true)) { 199 $mode = 'off'; 200 } 201 202 $threshold = isset($settings['threshold']) ? absint($settings['threshold']) : 20; 203 if ($threshold < 1) { 204 $threshold = 20; 205 } 206 $threshold = min(1000, $threshold); 207 208 $sanitized[$taxonomy] = [ 209 'mode' => $mode, 210 'threshold' => $threshold, 211 ]; 212 } 213 214 return $sanitized; 215 } 216 217 /** 153 218 * Enqueue admin scripts 154 219 * … … 192 257 $height_settings = get_option('runthings_ttc_height_settings', []); 193 258 $show_links = get_option('runthings_ttc_show_links', []); 259 $allow_term_create = get_option('runthings_ttc_allow_term_create', []); 260 $search_settings = get_option('runthings_ttc_search_settings', []); 194 261 195 262 if (!is_array($selected_taxonomies)) { … … 203 270 if (!is_array($show_links)) { 204 271 $show_links = []; 272 } 273 274 if (!is_array($allow_term_create)) { 275 $allow_term_create = []; 276 } 277 278 if (!is_array($search_settings)) { 279 $search_settings = []; 205 280 } 206 281 … … 257 332 <span><?php esc_html_e('Height', 'runthings-taxonomy-tags-to-checkboxes'); ?></span> 258 333 </th> 334 <th scope="col" class="manage-column column-allow-create"> 335 <span><?php esc_html_e('Allow Inline Add', 'runthings-taxonomy-tags-to-checkboxes'); ?></span> 336 </th> 259 337 <th scope="col" class="manage-column column-show-link"> 260 338 <span><?php esc_html_e('Show Edit Link', 'runthings-taxonomy-tags-to-checkboxes'); ?></span> 339 </th> 340 <th scope="col" class="manage-column column-search"> 341 <span><?php esc_html_e('Search Box', 'runthings-taxonomy-tags-to-checkboxes'); ?></span> 261 342 </th> 262 343 </tr> … … 267 348 ?> 268 349 <tr class="no-items" style="display: none;"> 269 <td class="colspanchange" colspan=" 6">350 <td class="colspanchange" colspan="8"> 270 351 <div class="no-taxonomy-items"> 271 352 <p><?php esc_html_e( 'No taxonomies found.', 'runthings-taxonomy-tags-to-checkboxes' ); ?></p> … … 341 422 // Disable show link checkbox for hierarchical or unselected taxonomies 342 423 $link_disabled = $taxonomy->hierarchical || !$is_selected ? 'disabled' : ''; 424 425 $allow_create_checked = in_array($taxonomy->name, $allow_term_create, true) ? 'checked' : ''; 426 $allow_create_disabled = $taxonomy->hierarchical || !$is_selected ? 'disabled' : ''; 427 428 $search_mode = isset($search_settings[$taxonomy->name]['mode']) ? sanitize_key((string) $search_settings[$taxonomy->name]['mode']) : 'off'; 429 if (!in_array($search_mode, ['off', 'always', 'min_terms'], true)) { 430 $search_mode = 'off'; 431 } 432 $search_threshold = isset($search_settings[$taxonomy->name]['threshold']) ? intval($search_settings[$taxonomy->name]['threshold']) : 20; 433 if ($search_threshold < 1) { 434 $search_threshold = 20; 435 } 436 $search_threshold = min(1000, $search_threshold); 437 $search_disabled = $taxonomy->hierarchical || !$is_selected ? 'disabled' : ''; 343 438 ?> 344 439 <tr data-name="<?php echo esc_attr( strtolower($taxonomy->label) ); ?>" … … 369 464 </div> 370 465 </td> 466 <td class="column-allow-create" data-colname="<?php esc_attr_e('Allow Inline Add', 'runthings-taxonomy-tags-to-checkboxes'); ?>"> 467 <input type="checkbox" name="runthings_ttc_allow_term_create[]" value="<?php echo esc_attr($taxonomy->name); ?>" <?php echo esc_attr($allow_create_checked); ?> <?php echo esc_attr($allow_create_disabled); ?>> 468 </td> 371 469 <td class="column-show-link" data-colname="<?php esc_attr_e('Show Edit Link', 'runthings-taxonomy-tags-to-checkboxes'); ?>"> 372 470 <input type="checkbox" name="runthings_ttc_show_links[]" value="<?php echo esc_attr($taxonomy->name); ?>" <?php echo esc_attr($show_link_checked); ?> <?php echo esc_attr($link_disabled); ?>> 471 </td> 472 <td class="column-search" data-colname="<?php esc_attr_e('Search Box', 'runthings-taxonomy-tags-to-checkboxes'); ?>"> 473 <select name="runthings_ttc_search_settings[<?php echo esc_attr($taxonomy->name); ?>][mode]" class="search-mode-select" <?php echo esc_attr($search_disabled); ?>> 474 <option value="off" <?php selected($search_mode, 'off'); ?>><?php esc_html_e('Off', 'runthings-taxonomy-tags-to-checkboxes'); ?></option> 475 <option value="always" <?php selected($search_mode, 'always'); ?>><?php esc_html_e('Always', 'runthings-taxonomy-tags-to-checkboxes'); ?></option> 476 <option value="min_terms" <?php selected($search_mode, 'min_terms'); ?>><?php esc_html_e('Min Terms', 'runthings-taxonomy-tags-to-checkboxes'); ?></option> 477 </select> 478 <div class="min-terms-input" style="margin-top: 5px; <?php echo esc_attr($search_mode !== 'min_terms' ? 'display: none;' : ''); ?>"> 479 <label class="screen-reader-text" for="runthings-ttc-min-terms-<?php echo esc_attr($taxonomy->name); ?>"><?php esc_html_e('Minimum terms', 'runthings-taxonomy-tags-to-checkboxes'); ?></label> 480 <input id="runthings-ttc-min-terms-<?php echo esc_attr($taxonomy->name); ?>" type="number" name="runthings_ttc_search_settings[<?php echo esc_attr($taxonomy->name); ?>][threshold]" value="<?php echo esc_attr($search_threshold); ?>" min="1" max="1000" step="1" <?php echo esc_attr($search_disabled); ?>> 481 <span><?php esc_html_e('Terms', 'runthings-taxonomy-tags-to-checkboxes'); ?></span> 482 </div> 373 483 </td> 374 484 </tr> … … 410 520 <span><?php esc_html_e('Height', 'runthings-taxonomy-tags-to-checkboxes'); ?></span> 411 521 </th> 522 <th scope="col" class="manage-column column-allow-create"> 523 <span><?php esc_html_e('Allow Inline Add', 'runthings-taxonomy-tags-to-checkboxes'); ?></span> 524 </th> 412 525 <th scope="col" class="manage-column column-show-link"> 413 526 <span><?php esc_html_e('Show Edit Link', 'runthings-taxonomy-tags-to-checkboxes'); ?></span> 527 </th> 528 <th scope="col" class="manage-column column-search"> 529 <span><?php esc_html_e('Search Box', 'runthings-taxonomy-tags-to-checkboxes'); ?></span> 414 530 </th> 415 531 </tr> -
runthings-taxonomy-tags-to-checkboxes/tags/1.4.0/readme.md
r3464228 r3467136 9 9 It allows you to pick from a list of the existing tags, so that admin users do not need to remember each tag. 10 10 11 It doesn't allow new tags to be created on the fly, which keeps the tags list under control, although you can optionally enablean add / edit link.11 By default it does not allow new tags to be created on the fly, which keeps the tags list under control. You can optionally enable inline add per taxonomy, and an add / edit link. 12 12 13 # Features13 ### Features 14 14 15 15 - Replace the tags ui with a checkbox list 16 16 - No alteration to front end functionality, or the underlying data / terms 17 - Option to control the height of the taxonomy metabox, between auto, full height, and custom (px) 18 - Show a link to the taxonomy edit screen via an `+ Add / Edit {taxononomy}` link 17 - Option to control the height of the taxonomy metabox, between default (200px max), full, and custom (px) 18 - Optional inline add control for new terms, enabled per taxonomy 19 - Optional link to the taxonomy edit screen via an `+ Add / Edit {taxonomy}` style link 20 - Optional per-taxonomy search box with `Off`, `Always`, and `Min Terms` modes 19 21 - Customization via filters 20 22 … … 41 43 ### What user capabilities are required? 42 44 43 The configuration screen needs a user with `manage_ settings` cap to edit it, but the changes are applied to anyone with editor access to post types that displaysthose taxonomies.45 The configuration screen needs a user with `manage_options` cap to edit it, but the changes are applied to anyone with editor access to post types that display those taxonomies. 44 46 45 47 ### I have a feature idea / I've found a bug … … 56 58 57 59 ## Changelog 60 61 ### v1.4.0 - 22nd February 2026 62 63 - Feature - Add optional inline term creation controls in both Classic and Gutenberg editors 64 - Feature - Add optional taxonomy search panel with `Off`, `Always`, and `Min Terms` display modes 65 - Improvement - Add `runthings_ttc_search_settings` filter for per-taxonomy search behavior overrides 58 66 59 67 ### v1.3.0 - 18th February 2026 … … 86 94 - Initial release 87 95 - Works with custom and built-in taxonomies 88 - Control the height of the outbox96 - Control the height of the metabox 89 97 - Optionally include an add/edit link 90 98 - Filter `runthings_ttc_selected_taxonomies` to short-circuit the override … … 101 109 add_filter( 'runthings_ttc_selected_taxonomies', function( $selected_taxonomies ) { 102 110 // Disable the override for the 'category' taxonomy. 103 unset( $selected_taxonomies['category'] ); 104 return $selected_taxonomies; 111 return array_values( array_diff( $selected_taxonomies, [ 'category' ] ) ); 105 112 } ); 106 113 ``` … … 108 115 #### Parameters: 109 116 110 - **`$selected_taxonomies`** (array): An array of taxonomy slugs. Unset an entry to disable the checkbox list override. 117 - **`$selected_taxonomies`** (array): An array of taxonomy slugs. Remove a slug value from the array to disable the checkbox list override. 118 119 ### runthings_ttc_search_settings 120 121 This filter allows developers to override per-taxonomy search UI behavior. 122 123 #### Usage Example 124 125 ```php 126 add_filter( 'runthings_ttc_search_settings', function( $search_settings ) { 127 $search_settings['post_tag'] = [ 128 'mode' => 'always', // valid values: off, always, min_terms 129 'threshold' => 20, // used when mode is min_terms 130 ]; 131 132 return $search_settings; 133 } ); 134 ``` 135 136 #### Parameters: 137 138 - **`$search_settings`** (array): A map of taxonomy slugs to search config arrays (`mode`, `threshold`). 111 139 112 140 ## Additional Notes -
runthings-taxonomy-tags-to-checkboxes/tags/1.4.0/readme.txt
r3464228 r3467136 4 4 Requires at least: 6.4 5 5 Tested up to: 6.9 6 Stable tag: 1. 3.06 Stable tag: 1.4.0 7 7 License: GPLv3 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 15 15 It allows you to pick from a list of the existing tags, so that admin users do not need to remember each tag. 16 16 17 It doesn't allow new tags to be created on the fly, which keeps the tags list under control, although you can optionally enable an add / edit link.17 It can optionally allow new terms to be added directly from the post editing UI, while still letting you keep this disabled by default. 18 18 19 19 = Features = 20 20 * Replace the tags ui with a checkbox list 21 21 * No alteration to front end functionality, or the underlying data / terms 22 * Option to control the height of the taxonomy metabox, between auto, full height, and custom (px) 23 * Show a link to the taxonomy edit screen via an "+ Add / Edit {taxononomy}" link 22 * Option to control the height of the taxonomy metabox, between default (200px max), full, and custom (px) 23 * Optional inline add control for new terms, enabled per taxonomy 24 * Optional link to the taxonomy edit screen via an "+ Add / Edit {taxonomy}" style link 25 * Optional per-taxonomy search box with Off, Always, and Min Terms modes 24 26 * Customization via filters 25 27 … … 40 42 41 43 = What user capabilities are required? = 42 The configuration screen needs a user with `manage_ settings` cap to edit it, but the changes are applied to anyone with editor access to post types that displaysthose taxonomies.44 The configuration screen needs a user with `manage_options` cap to edit it, but the changes are applied to anyone with editor access to post types that display those taxonomies. 43 45 44 46 = I have a feature idea / I've found a bug = … … 51 53 52 54 == Changelog == 55 56 = 1.4.0 - 22nd February 2026 = 57 * Feature - Add optional inline term creation controls in both Classic and Gutenberg editors 58 * Feature - Add optional taxonomy search panel with `Off`, `Always`, and `Min Terms` display modes 59 * Improvement - Add `runthings_ttc_search_settings` filter for per-taxonomy search behavior overrides 53 60 54 61 = 1.3.0 - 18th February 2026 = … … 75 82 * Initial release 76 83 * Works with custom and built-in taxonomies 77 * Control the height of the outbox84 * Control the height of the metabox 78 85 * Optionally include an add/edit link 79 86 * Filter `runthings_ttc_selected_taxonomies` to short-circuit the override 80 87 81 88 == Filters == 82 ### runthings_ttc_selected_taxonomies 89 For detailed documentation and examples, see the [full documentation on GitHub](https://github.com/runthings-dev/runthings-taxonomy-tags-to-checkboxes#filters). 90 91 #### runthings_ttc_selected_taxonomies 83 92 84 93 This filter allows developers to modify the array of taxonomies selected for the custom checkbox interface. 85 94 86 For detailed documentation and examples, see the [full documentation on GitHub](https://github.com/runthings-dev/runthings-taxonomy-tags-to-checkboxes#filters). 95 ##### Parameters: 96 1. **`$selected_taxonomies`** (`array`): An array of taxonomy slugs. Remove a slug value from the array to disable the checkbox list override. 87 97 88 #### Parameters: 89 1. **`$selected_taxonomies`** (`array`): An array of taxonomy slugs. Unset an entry to disable the checkbox list override. 98 #### runthings_ttc_search_settings 99 100 This filter allows developers to override per-taxonomy search UI behavior. 101 102 ##### Parameters: 103 1. **`$search_settings`** (`array`): A map of taxonomy slugs to search config arrays (`mode`, `threshold`). 90 104 91 105 == Upgrade Notice == 106 107 = 1.4.0 = 108 Adds optional inline term creation and taxonomy search panel controls. 92 109 93 110 = 1.3.0 = … … 96 113 = 1.2.0 = 97 114 Fixes fatal error when a configured taxonomy is deleted, improves panel height options. 98 99 = 1.1.1 =100 Fix duplicate taxonomy panels in the block editor for built-in taxonomies.101 115 102 116 == License == -
runthings-taxonomy-tags-to-checkboxes/tags/1.4.0/runthings-taxonomy-tags-to-checkboxes.php
r3464228 r3467136 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. 3.07 * Version: 1.4.0 8 8 * Author: runthingsdev 9 9 * Author URI: https://runthings.dev/ … … 38 38 } 39 39 40 define( 'RUNTHINGS_TTC_VERSION', '1. 3.0' );40 define( 'RUNTHINGS_TTC_VERSION', '1.4.0' ); 41 41 42 42 define( 'RUNTHINGS_TTC_BASENAME', plugin_basename( __FILE__ ) ); … … 45 45 46 46 require_once RUNTHINGS_TTC_DIR . 'lib/admin-options.php'; 47 require_once RUNTHINGS_TTC_DIR . 'lib/replace-tags.php'; 47 require_once RUNTHINGS_TTC_DIR . 'lib/config.php'; 48 require_once RUNTHINGS_TTC_DIR . 'lib/classic-integration.php'; 49 require_once RUNTHINGS_TTC_DIR . 'lib/block-integration.php'; 50 require_once RUNTHINGS_TTC_DIR . 'lib/bootstrap.php'; 48 51 49 52 class Taxonomy_Tags_To_Checkboxes { 50 53 public function __construct() { 51 54 new Admin_Options(); 52 new Replace_Tags();55 new Bootstrap(); 53 56 54 57 add_filter( … … 86 89 add_option( 'runthings_ttc_height_settings', [], '', $autoload ); 87 90 add_option( 'runthings_ttc_show_links', [], '', $autoload); 91 add_option( 'runthings_ttc_allow_term_create', [], '', $autoload ); 92 add_option( 'runthings_ttc_search_settings', [], '', $autoload ); 88 93 } 89 94 register_activation_hook( __FILE__, 'RunthingsTaxonomyTagsToCheckboxes\activate_runthings_ttc' ); … … 97 102 delete_option( 'runthings_ttc_height_settings' ); 98 103 delete_option( 'runthings_ttc_show_links' ); 104 delete_option( 'runthings_ttc_allow_term_create' ); 105 delete_option( 'runthings_ttc_search_settings' ); 99 106 } 100 107 register_uninstall_hook( __FILE__, 'RunthingsTaxonomyTagsToCheckboxes\uninstall_runthings_ttc' ); -
runthings-taxonomy-tags-to-checkboxes/trunk/assets/css/admin.css
r3461388 r3467136 57 57 } 58 58 #taxonomy-table th.column-height, 59 #taxonomy-table th.column-show-link { 59 #taxonomy-table th.column-show-link, 60 #taxonomy-table th.column-allow-create, 61 #taxonomy-table th.column-search { 60 62 padding: 8px; 61 63 } … … 68 70 width: 70px; 69 71 } 72 .min-terms-input { 73 display: flex; 74 align-items: center; 75 gap: 5px; 76 } 77 .min-terms-input input[type="number"] { 78 width: 70px; 79 } 70 80 71 81 /* Show Link Column */ … … 73 83 width: 100px; 74 84 text-align: center; 85 } 86 87 #taxonomy-table .column-allow-create { 88 width: 100px; 89 text-align: center; 90 } 91 #taxonomy-table .column-search { 92 width: 180px; 75 93 } 76 94 … … 159 177 160 178 /* Show link inline */ 161 #taxonomy-table .column-show-link { 179 #taxonomy-table .column-show-link, 180 #taxonomy-table .column-allow-create, 181 #taxonomy-table .column-search { 162 182 display: flex; 163 183 align-items: center; -
runthings-taxonomy-tags-to-checkboxes/trunk/assets/js/admin.js
r3271144 r3467136 1 (function ($) { 2 "use strict"; 1 ( function ( $ ) { 2 'use strict'; 3 const taxonomyStats = window.taxonomyStats || { systemCount: 0 }; 3 4 4 $(document).ready(function () {5 // Table sorting functionality6 $(".sort-column").on("click", function (e) {7 e.preventDefault();5 $( document ).ready( function () { 6 // Table sorting functionality 7 $( '.sort-column' ).on( 'click', function ( e ) { 8 e.preventDefault(); 8 9 9 var $this = $(this);10 var column = $this.data("column");11 var $table = $("#taxonomy-table");12 var $rows = $table.find("tbody tr").toArray();13 var ascending = $this.closest("th").hasClass("desc");10 const $this = $( this ); 11 const column = $this.data( 'column' ); 12 const $table = $( '#taxonomy-table' ); 13 const $rows = $table.find( 'tbody tr' ).toArray(); 14 const ascending = $this.closest( 'th' ).hasClass( 'desc' ); 14 15 15 // Update sortable classes 16 $table.find("thead th, tfoot th").removeClass("sorted asc desc"); 16 // Update sortable classes 17 $table 18 .find( 'thead th, tfoot th' ) 19 .removeClass( 'sorted asc desc' ); 17 20 18 // Update the current column's sorting state19 var $currentHeader = $this.closest("th");20 $currentHeader.addClass("sorted");21 // Update the current column's sorting state 22 const $currentHeader = $this.closest( 'th' ); 23 $currentHeader.addClass( 'sorted' ); 21 24 22 if (ascending) {23 $currentHeader.removeClass("desc").addClass("asc");24 } else {25 $currentHeader.removeClass("asc").addClass("desc");26 }25 if ( ascending ) { 26 $currentHeader.removeClass( 'desc' ).addClass( 'asc' ); 27 } else { 28 $currentHeader.removeClass( 'asc' ).addClass( 'desc' ); 29 } 27 30 28 // Sort the rows29 $rows.sort(function (a, b) {30 varvalA, valB;31 // Sort the rows 32 $rows.sort( function ( a, b ) { 33 let valA, valB; 31 34 32 if (column === "name") {33 valA = $(a).data("name");34 valB = $(b).data("name");35 } else if (column === "post_types") {36 valA = $(a).data("post-types");37 valB = $(b).data("post-types");38 } else if (column === "type") {39 valA = $(a).data("type");40 valB = $(b).data("type");41 }35 if ( column === 'name' ) { 36 valA = $( a ).data( 'name' ); 37 valB = $( b ).data( 'name' ); 38 } else if ( column === 'post_types' ) { 39 valA = $( a ).data( 'post-types' ); 40 valB = $( b ).data( 'post-types' ); 41 } else if ( column === 'type' ) { 42 valA = $( a ).data( 'type' ); 43 valB = $( b ).data( 'type' ); 44 } 42 45 43 if (valA < valB) return ascending ? -1 : 1; 44 if (valA > valB) return ascending ? 1 : -1; 45 return 0; 46 }); 46 if ( valA < valB ) { 47 return ascending ? -1 : 1; 48 } 49 if ( valA > valB ) { 50 return ascending ? 1 : -1; 51 } 52 return 0; 53 } ); 47 54 48 // Append sorted rows to table49 $.each($rows, function (index, row) {50 $table.find("tbody").append(row);51 });55 // Append sorted rows to table 56 $.each( $rows, function ( index, row ) { 57 $table.find( 'tbody' ).append( row ); 58 } ); 52 59 53 return false;54 });60 return false; 61 } ); 55 62 56 // System taxonomy toggle57 $("#show-system-taxonomies").on("change", function () {58 if ($(this).is(":checked")) {59 $(".system-taxonomy").show();60 } else {61 $(".system-taxonomy").hide();62 }63 // System taxonomy toggle 64 $( '#show-system-taxonomies' ).on( 'change', function () { 65 if ( $( this ).is( ':checked' ) ) { 66 $( '.system-taxonomy' ).show(); 67 } else { 68 $( '.system-taxonomy' ).hide(); 69 } 63 70 64 updateNoItemsVisibility();65 });71 updateNoItemsVisibility(); 72 } ); 66 73 67 // Height type selection change handler68 $(".height-type-select").on("change", function () {69 var $this = $(this);70 var $row = $this.closest("tr");71 var $customField = $row.find(".custom-height-input");74 // Height type selection change handler 75 $( '.height-type-select' ).on( 'change', function () { 76 const $this = $( this ); 77 const $row = $this.closest( 'tr' ); 78 const $customField = $row.find( '.custom-height-input' ); 72 79 73 if ($this.val() === "custom") {74 $customField.show();75 } else {76 $customField.hide();77 }78 });80 if ( $this.val() === 'custom' ) { 81 $customField.show(); 82 } else { 83 $customField.hide(); 84 } 85 } ); 79 86 80 // Taxonomy checkbox change handler 81 $("input[name='runthings_ttc_selected_taxonomies[]']").on( 82 "change", 83 function () { 84 var $this = $(this); 85 var $row = $this.closest("tr"); 86 var $heightSelect = $row.find(".height-type-select"); 87 var $customHeight = $row.find(".custom-height-input input"); 88 var $showLinkCheckbox = $row.find( 89 "input[name='runthings_ttc_show_links[]']" 90 ); 87 // Search mode selection change handler 88 $( '.search-mode-select' ).on( 'change', function () { 89 const $this = $( this ); 90 const $row = $this.closest( 'tr' ); 91 const $minTermsField = $row.find( '.min-terms-input' ); 91 92 92 if ($this.is(":checked") && !$this.is(":disabled")) { 93 // Enable height controls and show link checkbox 94 $heightSelect.prop("disabled", false); 95 $customHeight.prop("disabled", false); 96 $showLinkCheckbox.prop("disabled", false); 97 } else { 98 // Disable height controls and show link checkbox 99 $heightSelect.prop("disabled", true); 100 $customHeight.prop("disabled", true); 101 $showLinkCheckbox.prop("disabled", true); 102 } 103 } 104 ); 93 if ( $this.val() === 'min_terms' ) { 94 $minTermsField.show(); 95 } else { 96 $minTermsField.hide(); 97 } 98 } ); 105 99 106 // Function to update the no-items message visibility 107 function updateNoItemsVisibility() { 108 var systemVisible = $("#show-system-taxonomies").is(":checked"); 100 // Taxonomy checkbox change handler 101 $( "input[name='runthings_ttc_selected_taxonomies[]']" ).on( 102 'change', 103 function () { 104 const $this = $( this ); 105 const $row = $this.closest( 'tr' ); 106 const $heightSelect = $row.find( '.height-type-select' ); 107 const $customHeight = $row.find( '.custom-height-input input' ); 108 const $showLinkCheckbox = $row.find( 109 "input[name='runthings_ttc_show_links[]']" 110 ); 111 const $allowCreateCheckbox = $row.find( 112 "input[name='runthings_ttc_allow_term_create[]']" 113 ); 114 const $searchModeSelect = $row.find( '.search-mode-select' ); 115 const $searchThreshold = $row.find( '.min-terms-input input' ); 109 116 110 var visibleRows = $("#taxonomy-table tbody tr:visible").not( 111 ".no-items" 112 ).length; 117 if ( $this.is( ':checked' ) && ! $this.is( ':disabled' ) ) { 118 // Enable height controls and show link checkbox 119 $heightSelect.prop( 'disabled', false ); 120 $customHeight.prop( 'disabled', false ); 121 $showLinkCheckbox.prop( 'disabled', false ); 122 $allowCreateCheckbox.prop( 'disabled', false ); 123 $searchModeSelect.prop( 'disabled', false ); 124 $searchThreshold.prop( 'disabled', false ); 125 } else { 126 // Disable height controls and show link checkbox 127 $heightSelect.prop( 'disabled', true ); 128 $customHeight.prop( 'disabled', true ); 129 $showLinkCheckbox.prop( 'disabled', true ); 130 $allowCreateCheckbox.prop( 'disabled', true ); 131 $searchModeSelect.prop( 'disabled', true ); 132 $searchThreshold.prop( 'disabled', true ); 133 } 134 } 135 ); 113 136 114 if (visibleRows === 0) { 115 // Show the no items message 116 $(".no-items").show(); 137 // Function to update the no-items message visibility 138 function updateNoItemsVisibility() { 139 const systemVisible = $( '#show-system-taxonomies' ).is( 140 ':checked' 141 ); 117 142 118 // If there are system taxonomies but they're hidden, show the hint 119 if (!systemVisible && taxonomyStats.systemCount > 0) { 120 $(".hidden-system-message").show(); 121 } else { 122 $(".hidden-system-message").hide(); 123 } 124 } else { 125 // Hide the no items message when there are visible rows 126 $(".no-items").hide(); 127 } 128 } 143 const visibleRows = $( '#taxonomy-table tbody tr:visible' ).not( 144 '.no-items' 145 ).length; 129 146 130 // Initialize height fields on load 131 $(".height-type-select").each(function () { 132 $(this).trigger("change"); 133 }); 147 if ( visibleRows === 0 ) { 148 // Show the no items message 149 $( '.no-items' ).show(); 134 150 135 // Initialize enabled/disabled state on load 136 $("input[name='runthings_ttc_selected_taxonomies[]']").each(function () { 137 $(this).trigger("change"); 138 }); 151 // If there are system taxonomies but they're hidden, show the hint 152 if ( ! systemVisible && taxonomyStats.systemCount > 0 ) { 153 $( '.hidden-system-message' ).show(); 154 } else { 155 $( '.hidden-system-message' ).hide(); 156 } 157 } else { 158 // Hide the no items message when there are visible rows 159 $( '.no-items' ).hide(); 160 } 161 } 139 162 140 // Initial setup - hide system taxonomies 141 $("#show-system-taxonomies").prop("checked", false).trigger("change"); 163 // Initialize height fields on load 164 $( '.height-type-select' ).each( function () { 165 $( this ).trigger( 'change' ); 166 } ); 167 $( '.search-mode-select' ).each( function () { 168 $( this ).trigger( 'change' ); 169 } ); 142 170 143 // Initial update of no-items visibility 144 updateNoItemsVisibility(); 145 }); 146 })(jQuery); 171 // Initialize enabled/disabled state on load 172 $( "input[name='runthings_ttc_selected_taxonomies[]']" ).each( 173 function () { 174 $( this ).trigger( 'change' ); 175 } 176 ); 177 178 // Initial setup - hide system taxonomies 179 $( '#show-system-taxonomies' ) 180 .prop( 'checked', false ) 181 .trigger( 'change' ); 182 183 // Initial update of no-items visibility 184 updateNoItemsVisibility(); 185 } ); 186 } )( window.jQuery ); -
runthings-taxonomy-tags-to-checkboxes/trunk/assets/js/editor.js
r3455906 r3467136 1 ( function() { 2 var taxonomies = window.runthingsTtcEditor && window.runthingsTtcEditor.taxonomies; 3 if ( ! taxonomies || ! taxonomies.length ) { 4 return; 5 } 1 ( function () { 2 const taxonomies = 3 window.runthingsTtcEditor && window.runthingsTtcEditor.taxonomies; 4 if ( ! taxonomies || ! taxonomies.length ) { 5 return; 6 } 6 7 7 wp.domReady( function() { 8 taxonomies.forEach( function( taxonomy ) { 9 wp.data.dispatch( 'core/editor' ).removeEditorPanel( 'taxonomy-panel-' + taxonomy ); 10 } ); 11 } ); 8 wp.domReady( function () { 9 taxonomies.forEach( function ( taxonomy ) { 10 wp.data 11 .dispatch( 'core/editor' ) 12 .removeEditorPanel( 'taxonomy-panel-' + taxonomy ); 13 } ); 14 } ); 12 15 } )(); -
runthings-taxonomy-tags-to-checkboxes/trunk/languages/runthings-taxonomy-tags-to-checkboxes.pot
r3464228 r3467136 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Taxonomy Tags to Checkboxes 1. 3.0\n"5 "Project-Id-Version: Taxonomy Tags to Checkboxes 1.4.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- 18T10:47:17+00:00\n"12 "POT-Creation-Date: 2026-02-22T21:54:20+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" … … 49 49 msgstr "" 50 50 51 #: lib/admin-options.php: 8051 #: lib/admin-options.php:92 52 52 msgid "Taxonomy Settings" 53 53 msgstr "" 54 54 55 #: lib/admin-options.php: 8755 #: lib/admin-options.php:99 56 56 msgid "Select Taxonomies" 57 57 msgstr "" 58 58 59 #: lib/admin-options.php:2 1259 #: lib/admin-options.php:287 60 60 msgid "Select which taxonomies should use checkboxes instead of tags UI." 61 61 msgstr "" 62 62 63 #: lib/admin-options.php:2 1763 #: lib/admin-options.php:292 64 64 msgid "Show system taxonomies" 65 65 msgstr "" 66 66 67 #: lib/admin-options.php: 22768 #: lib/admin-options.php: 38067 #: lib/admin-options.php:302 68 #: lib/admin-options.php:490 69 69 msgid "Select All" 70 70 msgstr "" 71 71 72 #: lib/admin-options.php: 23173 #: lib/admin-options.php: 38472 #: lib/admin-options.php:306 73 #: lib/admin-options.php:494 74 74 msgid "Name" 75 75 msgstr "" 76 76 77 #: lib/admin-options.php: 24078 #: lib/admin-options.php: 39377 #: lib/admin-options.php:315 78 #: lib/admin-options.php:503 79 79 msgid "Post Types" 80 80 msgstr "" 81 81 82 #: lib/admin-options.php: 24983 #: lib/admin-options.php: 40282 #: lib/admin-options.php:324 83 #: lib/admin-options.php:512 84 84 msgid "Type" 85 85 msgstr "" 86 86 87 #: lib/admin-options.php: 25788 #: lib/admin-options.php: 36089 #: lib/admin-options.php: 41087 #: lib/admin-options.php:332 88 #: lib/admin-options.php:455 89 #: lib/admin-options.php:520 90 90 msgid "Height" 91 91 msgstr "" 92 92 93 #: lib/admin-options.php:260 93 #: lib/admin-options.php:335 94 #: lib/admin-options.php:466 95 #: lib/admin-options.php:523 96 msgid "Allow Inline Add" 97 msgstr "" 98 99 #: lib/admin-options.php:338 100 #: lib/admin-options.php:469 101 #: lib/admin-options.php:526 102 msgid "Show Edit Link" 103 msgstr "" 104 105 #: lib/admin-options.php:341 106 #: lib/admin-options.php:472 107 #: lib/admin-options.php:529 108 msgid "Search Box" 109 msgstr "" 110 111 #: lib/admin-options.php:352 112 msgid "No taxonomies found." 113 msgstr "" 114 115 #: lib/admin-options.php:354 116 msgid "System taxonomies are currently hidden. Enable \"Show system taxonomies\" to see more options." 117 msgstr "" 118 94 119 #: lib/admin-options.php:371 95 #: lib/admin-options.php:413 96 msgid "Show Edit Link" 97 msgstr "" 98 99 #: lib/admin-options.php:271 100 msgid "No taxonomies found." 101 msgstr "" 102 103 #: lib/admin-options.php:273 104 msgid "System taxonomies are currently hidden. Enable \"Show system taxonomies\" to see more options." 105 msgstr "" 106 107 #: lib/admin-options.php:290 108 #: lib/admin-options.php:298 120 #: lib/admin-options.php:379 109 121 msgid "Taxonomy already uses checkboxes" 110 122 msgstr "" 111 123 112 #: lib/admin-options.php: 291124 #: lib/admin-options.php:372 113 125 msgid "Hierarchical" 114 126 msgstr "" 115 127 116 #: lib/admin-options.php: 293128 #: lib/admin-options.php:374 117 129 msgid "Uses tags interface by default" 118 130 msgstr "" 119 131 120 #: lib/admin-options.php: 294132 #: lib/admin-options.php:375 121 133 msgid "Non-hierarchical" 122 134 msgstr "" 123 135 124 #: lib/admin-options.php: 349136 #: lib/admin-options.php:444 125 137 msgid "Convert" 126 138 msgstr "" 127 139 128 #: lib/admin-options.php: 362140 #: lib/admin-options.php:457 129 141 msgid "Default" 130 142 msgstr "" 131 143 132 #: lib/admin-options.php: 363144 #: lib/admin-options.php:458 133 145 msgid "Full" 134 146 msgstr "" 135 147 136 #: lib/admin-options.php: 364148 #: lib/admin-options.php:459 137 149 msgid "Custom" 138 150 msgstr "" 139 151 140 #: lib/admin-options.php:478 152 #: lib/admin-options.php:474 153 msgid "Off" 154 msgstr "" 155 156 #: lib/admin-options.php:475 157 msgid "Always" 158 msgstr "" 159 160 #: lib/admin-options.php:476 161 msgid "Min Terms" 162 msgstr "" 163 164 #: lib/admin-options.php:479 165 msgid "Minimum terms" 166 msgstr "" 167 168 #: lib/admin-options.php:481 169 msgid "Terms" 170 msgstr "" 171 172 #: lib/admin-options.php:594 141 173 msgid "Settings" 142 174 msgstr "" 143 175 144 #: lib/replace-tags.php:233 145 #: src/components/TtcTaxonomyPanel.js:102 176 #: lib/classic-integration.php:100 177 #: src/components/TtcTaxonomyPanel.js:224 178 msgid "Search terms" 179 msgstr "" 180 181 #: lib/classic-integration.php:101 182 msgid "Search terms..." 183 msgstr "" 184 185 #: lib/classic-integration.php:102 186 #: src/components/TtcTaxonomyPanel.js:251 187 msgid "No matching terms." 188 msgstr "" 189 190 #. translators: %s: Add new taxonomy item label. 191 #: lib/classic-integration.php:227 192 #, php-format 193 msgid "+ %s" 194 msgstr "" 195 196 #. translators: %s: taxonomy label 197 #: lib/config.php:110 198 #, php-format 199 msgid "Edit %s" 200 msgstr "" 201 202 #: lib/config.php:113 203 msgid "Edit" 204 msgstr "" 205 206 #. translators: %s: taxonomy label 207 #: lib/config.php:119 208 #, php-format 209 msgid "Add / Edit %s" 210 msgstr "" 211 212 #: lib/config.php:122 213 #: src/components/TtcTaxonomyPanel.js:317 214 msgid "Add / Edit" 215 msgstr "" 216 217 #: runthings-taxonomy-tags-to-checkboxes.php:73 218 msgid "GitHub" 219 msgstr "" 220 221 #: src/components/TtcTaxonomyPanel.js:170 222 msgid "Could not add the term." 223 msgstr "" 224 225 #: src/components/TtcTaxonomyPanel.js:212 146 226 msgid "No terms available." 147 227 msgstr "" 148 228 149 #. translators: %s: Taxonomy label 150 #. translators: %s: taxonomy label 151 #: lib/replace-tags.php:297 152 #: src/components/TtcTaxonomyPanel.js:135 153 #, php-format,js-format 154 msgid "+ Add / Edit %s" 155 msgstr "" 156 157 #: runthings-taxonomy-tags-to-checkboxes.php:70 158 msgid "GitHub" 159 msgstr "" 160 161 #: src/components/TtcTaxonomyPanel.js:141 162 msgid "+ Add / Edit" 163 msgstr "" 229 #. translators: 1: visible terms count, 2: total terms count 230 #: src/components/TtcTaxonomyPanel.js:237 231 #, js-format 232 msgid "Showing %1$d of %2$d terms" 233 msgstr "" 234 235 #: src/components/TtcTaxonomyPanel.js:284 236 msgid "Add new term" 237 msgstr "" 238 239 #: src/components/TtcTaxonomyPanel.js:305 240 msgid "Add" 241 msgstr "" -
runthings-taxonomy-tags-to-checkboxes/trunk/lib/admin-options.php
r3461388 r3467136 76 76 ); 77 77 78 register_setting( 79 'runthings_taxonomy_options_group', 80 'runthings_ttc_allow_term_create', 81 ['sanitize_callback' => [$this, 'sanitize_allow_term_create_settings']] 82 ); 83 84 register_setting( 85 'runthings_taxonomy_options_group', 86 'runthings_ttc_search_settings', 87 ['sanitize_callback' => [$this, 'sanitize_search_settings']] 88 ); 89 78 90 add_settings_section( 79 91 'runthings_taxonomy_section', … … 151 163 152 164 /** 165 * Sanitize allow inline term create settings 166 * 167 * @param array $input The input array. 168 * @return array The sanitized array. 169 */ 170 public function sanitize_allow_term_create_settings($input) { 171 if (!is_array($input)) { 172 return []; 173 } 174 return array_map('sanitize_text_field', $input); 175 } 176 177 /** 178 * Sanitize search settings. 179 * 180 * @param array $input The input array. 181 * @return array 182 */ 183 public function sanitize_search_settings($input) { 184 if (!is_array($input)) { 185 return []; 186 } 187 188 $sanitized = []; 189 $allowed_modes = [ 'off', 'always', 'min_terms' ]; 190 191 foreach ($input as $taxonomy => $settings) { 192 $taxonomy = sanitize_key((string) $taxonomy); 193 if ('' === $taxonomy || !is_array($settings)) { 194 continue; 195 } 196 197 $mode = isset($settings['mode']) ? sanitize_key((string) $settings['mode']) : 'off'; 198 if (!in_array($mode, $allowed_modes, true)) { 199 $mode = 'off'; 200 } 201 202 $threshold = isset($settings['threshold']) ? absint($settings['threshold']) : 20; 203 if ($threshold < 1) { 204 $threshold = 20; 205 } 206 $threshold = min(1000, $threshold); 207 208 $sanitized[$taxonomy] = [ 209 'mode' => $mode, 210 'threshold' => $threshold, 211 ]; 212 } 213 214 return $sanitized; 215 } 216 217 /** 153 218 * Enqueue admin scripts 154 219 * … … 192 257 $height_settings = get_option('runthings_ttc_height_settings', []); 193 258 $show_links = get_option('runthings_ttc_show_links', []); 259 $allow_term_create = get_option('runthings_ttc_allow_term_create', []); 260 $search_settings = get_option('runthings_ttc_search_settings', []); 194 261 195 262 if (!is_array($selected_taxonomies)) { … … 203 270 if (!is_array($show_links)) { 204 271 $show_links = []; 272 } 273 274 if (!is_array($allow_term_create)) { 275 $allow_term_create = []; 276 } 277 278 if (!is_array($search_settings)) { 279 $search_settings = []; 205 280 } 206 281 … … 257 332 <span><?php esc_html_e('Height', 'runthings-taxonomy-tags-to-checkboxes'); ?></span> 258 333 </th> 334 <th scope="col" class="manage-column column-allow-create"> 335 <span><?php esc_html_e('Allow Inline Add', 'runthings-taxonomy-tags-to-checkboxes'); ?></span> 336 </th> 259 337 <th scope="col" class="manage-column column-show-link"> 260 338 <span><?php esc_html_e('Show Edit Link', 'runthings-taxonomy-tags-to-checkboxes'); ?></span> 339 </th> 340 <th scope="col" class="manage-column column-search"> 341 <span><?php esc_html_e('Search Box', 'runthings-taxonomy-tags-to-checkboxes'); ?></span> 261 342 </th> 262 343 </tr> … … 267 348 ?> 268 349 <tr class="no-items" style="display: none;"> 269 <td class="colspanchange" colspan=" 6">350 <td class="colspanchange" colspan="8"> 270 351 <div class="no-taxonomy-items"> 271 352 <p><?php esc_html_e( 'No taxonomies found.', 'runthings-taxonomy-tags-to-checkboxes' ); ?></p> … … 341 422 // Disable show link checkbox for hierarchical or unselected taxonomies 342 423 $link_disabled = $taxonomy->hierarchical || !$is_selected ? 'disabled' : ''; 424 425 $allow_create_checked = in_array($taxonomy->name, $allow_term_create, true) ? 'checked' : ''; 426 $allow_create_disabled = $taxonomy->hierarchical || !$is_selected ? 'disabled' : ''; 427 428 $search_mode = isset($search_settings[$taxonomy->name]['mode']) ? sanitize_key((string) $search_settings[$taxonomy->name]['mode']) : 'off'; 429 if (!in_array($search_mode, ['off', 'always', 'min_terms'], true)) { 430 $search_mode = 'off'; 431 } 432 $search_threshold = isset($search_settings[$taxonomy->name]['threshold']) ? intval($search_settings[$taxonomy->name]['threshold']) : 20; 433 if ($search_threshold < 1) { 434 $search_threshold = 20; 435 } 436 $search_threshold = min(1000, $search_threshold); 437 $search_disabled = $taxonomy->hierarchical || !$is_selected ? 'disabled' : ''; 343 438 ?> 344 439 <tr data-name="<?php echo esc_attr( strtolower($taxonomy->label) ); ?>" … … 369 464 </div> 370 465 </td> 466 <td class="column-allow-create" data-colname="<?php esc_attr_e('Allow Inline Add', 'runthings-taxonomy-tags-to-checkboxes'); ?>"> 467 <input type="checkbox" name="runthings_ttc_allow_term_create[]" value="<?php echo esc_attr($taxonomy->name); ?>" <?php echo esc_attr($allow_create_checked); ?> <?php echo esc_attr($allow_create_disabled); ?>> 468 </td> 371 469 <td class="column-show-link" data-colname="<?php esc_attr_e('Show Edit Link', 'runthings-taxonomy-tags-to-checkboxes'); ?>"> 372 470 <input type="checkbox" name="runthings_ttc_show_links[]" value="<?php echo esc_attr($taxonomy->name); ?>" <?php echo esc_attr($show_link_checked); ?> <?php echo esc_attr($link_disabled); ?>> 471 </td> 472 <td class="column-search" data-colname="<?php esc_attr_e('Search Box', 'runthings-taxonomy-tags-to-checkboxes'); ?>"> 473 <select name="runthings_ttc_search_settings[<?php echo esc_attr($taxonomy->name); ?>][mode]" class="search-mode-select" <?php echo esc_attr($search_disabled); ?>> 474 <option value="off" <?php selected($search_mode, 'off'); ?>><?php esc_html_e('Off', 'runthings-taxonomy-tags-to-checkboxes'); ?></option> 475 <option value="always" <?php selected($search_mode, 'always'); ?>><?php esc_html_e('Always', 'runthings-taxonomy-tags-to-checkboxes'); ?></option> 476 <option value="min_terms" <?php selected($search_mode, 'min_terms'); ?>><?php esc_html_e('Min Terms', 'runthings-taxonomy-tags-to-checkboxes'); ?></option> 477 </select> 478 <div class="min-terms-input" style="margin-top: 5px; <?php echo esc_attr($search_mode !== 'min_terms' ? 'display: none;' : ''); ?>"> 479 <label class="screen-reader-text" for="runthings-ttc-min-terms-<?php echo esc_attr($taxonomy->name); ?>"><?php esc_html_e('Minimum terms', 'runthings-taxonomy-tags-to-checkboxes'); ?></label> 480 <input id="runthings-ttc-min-terms-<?php echo esc_attr($taxonomy->name); ?>" type="number" name="runthings_ttc_search_settings[<?php echo esc_attr($taxonomy->name); ?>][threshold]" value="<?php echo esc_attr($search_threshold); ?>" min="1" max="1000" step="1" <?php echo esc_attr($search_disabled); ?>> 481 <span><?php esc_html_e('Terms', 'runthings-taxonomy-tags-to-checkboxes'); ?></span> 482 </div> 373 483 </td> 374 484 </tr> … … 410 520 <span><?php esc_html_e('Height', 'runthings-taxonomy-tags-to-checkboxes'); ?></span> 411 521 </th> 522 <th scope="col" class="manage-column column-allow-create"> 523 <span><?php esc_html_e('Allow Inline Add', 'runthings-taxonomy-tags-to-checkboxes'); ?></span> 524 </th> 412 525 <th scope="col" class="manage-column column-show-link"> 413 526 <span><?php esc_html_e('Show Edit Link', 'runthings-taxonomy-tags-to-checkboxes'); ?></span> 527 </th> 528 <th scope="col" class="manage-column column-search"> 529 <span><?php esc_html_e('Search Box', 'runthings-taxonomy-tags-to-checkboxes'); ?></span> 414 530 </th> 415 531 </tr> -
runthings-taxonomy-tags-to-checkboxes/trunk/readme.md
r3464228 r3467136 9 9 It allows you to pick from a list of the existing tags, so that admin users do not need to remember each tag. 10 10 11 It doesn't allow new tags to be created on the fly, which keeps the tags list under control, although you can optionally enablean add / edit link.11 By default it does not allow new tags to be created on the fly, which keeps the tags list under control. You can optionally enable inline add per taxonomy, and an add / edit link. 12 12 13 # Features13 ### Features 14 14 15 15 - Replace the tags ui with a checkbox list 16 16 - No alteration to front end functionality, or the underlying data / terms 17 - Option to control the height of the taxonomy metabox, between auto, full height, and custom (px) 18 - Show a link to the taxonomy edit screen via an `+ Add / Edit {taxononomy}` link 17 - Option to control the height of the taxonomy metabox, between default (200px max), full, and custom (px) 18 - Optional inline add control for new terms, enabled per taxonomy 19 - Optional link to the taxonomy edit screen via an `+ Add / Edit {taxonomy}` style link 20 - Optional per-taxonomy search box with `Off`, `Always`, and `Min Terms` modes 19 21 - Customization via filters 20 22 … … 41 43 ### What user capabilities are required? 42 44 43 The configuration screen needs a user with `manage_ settings` cap to edit it, but the changes are applied to anyone with editor access to post types that displaysthose taxonomies.45 The configuration screen needs a user with `manage_options` cap to edit it, but the changes are applied to anyone with editor access to post types that display those taxonomies. 44 46 45 47 ### I have a feature idea / I've found a bug … … 56 58 57 59 ## Changelog 60 61 ### v1.4.0 - 22nd February 2026 62 63 - Feature - Add optional inline term creation controls in both Classic and Gutenberg editors 64 - Feature - Add optional taxonomy search panel with `Off`, `Always`, and `Min Terms` display modes 65 - Improvement - Add `runthings_ttc_search_settings` filter for per-taxonomy search behavior overrides 58 66 59 67 ### v1.3.0 - 18th February 2026 … … 86 94 - Initial release 87 95 - Works with custom and built-in taxonomies 88 - Control the height of the outbox96 - Control the height of the metabox 89 97 - Optionally include an add/edit link 90 98 - Filter `runthings_ttc_selected_taxonomies` to short-circuit the override … … 101 109 add_filter( 'runthings_ttc_selected_taxonomies', function( $selected_taxonomies ) { 102 110 // Disable the override for the 'category' taxonomy. 103 unset( $selected_taxonomies['category'] ); 104 return $selected_taxonomies; 111 return array_values( array_diff( $selected_taxonomies, [ 'category' ] ) ); 105 112 } ); 106 113 ``` … … 108 115 #### Parameters: 109 116 110 - **`$selected_taxonomies`** (array): An array of taxonomy slugs. Unset an entry to disable the checkbox list override. 117 - **`$selected_taxonomies`** (array): An array of taxonomy slugs. Remove a slug value from the array to disable the checkbox list override. 118 119 ### runthings_ttc_search_settings 120 121 This filter allows developers to override per-taxonomy search UI behavior. 122 123 #### Usage Example 124 125 ```php 126 add_filter( 'runthings_ttc_search_settings', function( $search_settings ) { 127 $search_settings['post_tag'] = [ 128 'mode' => 'always', // valid values: off, always, min_terms 129 'threshold' => 20, // used when mode is min_terms 130 ]; 131 132 return $search_settings; 133 } ); 134 ``` 135 136 #### Parameters: 137 138 - **`$search_settings`** (array): A map of taxonomy slugs to search config arrays (`mode`, `threshold`). 111 139 112 140 ## Additional Notes -
runthings-taxonomy-tags-to-checkboxes/trunk/readme.txt
r3464228 r3467136 4 4 Requires at least: 6.4 5 5 Tested up to: 6.9 6 Stable tag: 1. 3.06 Stable tag: 1.4.0 7 7 License: GPLv3 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 15 15 It allows you to pick from a list of the existing tags, so that admin users do not need to remember each tag. 16 16 17 It doesn't allow new tags to be created on the fly, which keeps the tags list under control, although you can optionally enable an add / edit link.17 It can optionally allow new terms to be added directly from the post editing UI, while still letting you keep this disabled by default. 18 18 19 19 = Features = 20 20 * Replace the tags ui with a checkbox list 21 21 * No alteration to front end functionality, or the underlying data / terms 22 * Option to control the height of the taxonomy metabox, between auto, full height, and custom (px) 23 * Show a link to the taxonomy edit screen via an "+ Add / Edit {taxononomy}" link 22 * Option to control the height of the taxonomy metabox, between default (200px max), full, and custom (px) 23 * Optional inline add control for new terms, enabled per taxonomy 24 * Optional link to the taxonomy edit screen via an "+ Add / Edit {taxonomy}" style link 25 * Optional per-taxonomy search box with Off, Always, and Min Terms modes 24 26 * Customization via filters 25 27 … … 40 42 41 43 = What user capabilities are required? = 42 The configuration screen needs a user with `manage_ settings` cap to edit it, but the changes are applied to anyone with editor access to post types that displaysthose taxonomies.44 The configuration screen needs a user with `manage_options` cap to edit it, but the changes are applied to anyone with editor access to post types that display those taxonomies. 43 45 44 46 = I have a feature idea / I've found a bug = … … 51 53 52 54 == Changelog == 55 56 = 1.4.0 - 22nd February 2026 = 57 * Feature - Add optional inline term creation controls in both Classic and Gutenberg editors 58 * Feature - Add optional taxonomy search panel with `Off`, `Always`, and `Min Terms` display modes 59 * Improvement - Add `runthings_ttc_search_settings` filter for per-taxonomy search behavior overrides 53 60 54 61 = 1.3.0 - 18th February 2026 = … … 75 82 * Initial release 76 83 * Works with custom and built-in taxonomies 77 * Control the height of the outbox84 * Control the height of the metabox 78 85 * Optionally include an add/edit link 79 86 * Filter `runthings_ttc_selected_taxonomies` to short-circuit the override 80 87 81 88 == Filters == 82 ### runthings_ttc_selected_taxonomies 89 For detailed documentation and examples, see the [full documentation on GitHub](https://github.com/runthings-dev/runthings-taxonomy-tags-to-checkboxes#filters). 90 91 #### runthings_ttc_selected_taxonomies 83 92 84 93 This filter allows developers to modify the array of taxonomies selected for the custom checkbox interface. 85 94 86 For detailed documentation and examples, see the [full documentation on GitHub](https://github.com/runthings-dev/runthings-taxonomy-tags-to-checkboxes#filters). 95 ##### Parameters: 96 1. **`$selected_taxonomies`** (`array`): An array of taxonomy slugs. Remove a slug value from the array to disable the checkbox list override. 87 97 88 #### Parameters: 89 1. **`$selected_taxonomies`** (`array`): An array of taxonomy slugs. Unset an entry to disable the checkbox list override. 98 #### runthings_ttc_search_settings 99 100 This filter allows developers to override per-taxonomy search UI behavior. 101 102 ##### Parameters: 103 1. **`$search_settings`** (`array`): A map of taxonomy slugs to search config arrays (`mode`, `threshold`). 90 104 91 105 == Upgrade Notice == 106 107 = 1.4.0 = 108 Adds optional inline term creation and taxonomy search panel controls. 92 109 93 110 = 1.3.0 = … … 96 113 = 1.2.0 = 97 114 Fixes fatal error when a configured taxonomy is deleted, improves panel height options. 98 99 = 1.1.1 =100 Fix duplicate taxonomy panels in the block editor for built-in taxonomies.101 115 102 116 == License == -
runthings-taxonomy-tags-to-checkboxes/trunk/runthings-taxonomy-tags-to-checkboxes.php
r3464228 r3467136 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. 3.07 * Version: 1.4.0 8 8 * Author: runthingsdev 9 9 * Author URI: https://runthings.dev/ … … 38 38 } 39 39 40 define( 'RUNTHINGS_TTC_VERSION', '1. 3.0' );40 define( 'RUNTHINGS_TTC_VERSION', '1.4.0' ); 41 41 42 42 define( 'RUNTHINGS_TTC_BASENAME', plugin_basename( __FILE__ ) ); … … 45 45 46 46 require_once RUNTHINGS_TTC_DIR . 'lib/admin-options.php'; 47 require_once RUNTHINGS_TTC_DIR . 'lib/replace-tags.php'; 47 require_once RUNTHINGS_TTC_DIR . 'lib/config.php'; 48 require_once RUNTHINGS_TTC_DIR . 'lib/classic-integration.php'; 49 require_once RUNTHINGS_TTC_DIR . 'lib/block-integration.php'; 50 require_once RUNTHINGS_TTC_DIR . 'lib/bootstrap.php'; 48 51 49 52 class Taxonomy_Tags_To_Checkboxes { 50 53 public function __construct() { 51 54 new Admin_Options(); 52 new Replace_Tags();55 new Bootstrap(); 53 56 54 57 add_filter( … … 86 89 add_option( 'runthings_ttc_height_settings', [], '', $autoload ); 87 90 add_option( 'runthings_ttc_show_links', [], '', $autoload); 91 add_option( 'runthings_ttc_allow_term_create', [], '', $autoload ); 92 add_option( 'runthings_ttc_search_settings', [], '', $autoload ); 88 93 } 89 94 register_activation_hook( __FILE__, 'RunthingsTaxonomyTagsToCheckboxes\activate_runthings_ttc' ); … … 97 102 delete_option( 'runthings_ttc_height_settings' ); 98 103 delete_option( 'runthings_ttc_show_links' ); 104 delete_option( 'runthings_ttc_allow_term_create' ); 105 delete_option( 'runthings_ttc_search_settings' ); 99 106 } 100 107 register_uninstall_hook( __FILE__, 'RunthingsTaxonomyTagsToCheckboxes\uninstall_runthings_ttc' );
Note: See TracChangeset
for help on using the changeset viewer.