Plugin Directory

Changeset 3464228


Ignore:
Timestamp:
02/18/2026 10:47:57 AM (6 weeks ago)
Author:
runthingsdev
Message:

Update to version 1.3.0 from GitHub

Location:
runthings-taxonomy-tags-to-checkboxes
Files:
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • runthings-taxonomy-tags-to-checkboxes/tags/1.3.0/languages/runthings-taxonomy-tags-to-checkboxes.pot

    r3461388 r3464228  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Taxonomy Tags to Checkboxes 1.2.0\n"
     5"Project-Id-Version: Taxonomy Tags to Checkboxes 1.3.0\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/runthings-taxonomy-tags-to-checkboxes\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2026-02-14T15:01:15+00:00\n"
     12"POT-Creation-Date: 2026-02-18T10:47:17+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.12.0\n"
     
    142142msgstr ""
    143143
    144 #: lib/replace-tags.php:175
     144#: lib/replace-tags.php:233
     145#: src/components/TtcTaxonomyPanel.js:102
    145146msgid "No terms available."
    146147msgstr ""
    147148
    148149#. 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
    151154msgid "+ Add / Edit %s"
    152155msgstr ""
     
    155158msgid "GitHub"
    156159msgstr ""
     160
     161#: src/components/TtcTaxonomyPanel.js:141
     162msgid "+ Add / Edit"
     163msgstr ""
  • runthings-taxonomy-tags-to-checkboxes/tags/1.3.0/lib/replace-tags.php

    r3461388 r3464228  
    3333            add_action( 'add_meta_boxes', function ( $post_type, $post ) use ( $taxonomy ) {
    3434                $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                }
    3538            }, 10, 2 );
    36 
    37             add_action( 'add_meta_boxes', function ( $post_type ) use ( $taxonomy ) {
    38                 $this->add_taxonomy_metabox( $post_type, $taxonomy );
    39             });
    4039
    4140            add_action( 'save_post', function ( $post_id ) use ( $taxonomy ) {
     
    4645
    4746    /**
    48      * Enqueue block editor assets to remove default taxonomy panels in Gutenberg
     47     * Enqueue block editor assets — native Gutenberg sidebar panels
    4948     */
    5049    public function enqueue_block_editor_assets() {
     
    5352        }
    5453
     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
    5561        wp_enqueue_script(
    5662            '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'],
    6066            true
    6167        );
    6268
    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(
    64105            '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'
    69108        );
    70109    }
     
    116155            remove_meta_box( 'tagsdiv-' . $taxonomy, $post_type, 'side' );
    117156        }
     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;
    118176    }
    119177
     
    271329    }
    272330}
    273 
  • runthings-taxonomy-tags-to-checkboxes/tags/1.3.0/readme.md

    r3461388 r3464228  
    5656
    5757## 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
    5862
    5963### v1.2.0 - 14th February 2026
  • runthings-taxonomy-tags-to-checkboxes/tags/1.3.0/readme.txt

    r3461388 r3464228  
    44Requires at least: 6.4
    55Tested up to: 6.9
    6 Stable tag: 1.2.0
     6Stable tag: 1.3.0
    77License: GPLv3 or later
    88License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    5252== Changelog ==
    5353
     54= 1.3.0 - 18th February 2026 =
     55* Feature - Add Gutenberg (block editor) support for taxonomy meta boxes instead of using compatibility mode
     56
    5457= 1.2.0 - 14th February 2026 =
    5558* Improvement - Rename "Auto" height option to "Default" for clarity
     
    8891== Upgrade Notice ==
    8992
     93= 1.3.0 =
     94Adds Gutenberg support for taxonomy meta boxes.
     95
    9096= 1.2.0 =
    9197Fixes fatal error when a configured taxonomy is deleted, improves panel height options.
     
    9399= 1.1.1 =
    94100Fix 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.
    98101
    99102== License ==
  • runthings-taxonomy-tags-to-checkboxes/tags/1.3.0/runthings-taxonomy-tags-to-checkboxes.php

    r3461388 r3464228  
    55 * Plugin URI: https://runthings.dev/wordpress-plugins/taxonomy-tags-to-checkboxes/
    66 * Description: Convert taxonomy tags to checkboxes in the WordPress admin.
    7  * Version: 1.2.0
     7 * Version: 1.3.0
    88 * Author: runthingsdev
    99 * Author URI: https://runthings.dev/
     
    3838}
    3939
    40 define( 'RUNTHINGS_TTC_VERSION', '1.2.0' );
     40define( 'RUNTHINGS_TTC_VERSION', '1.3.0' );
    4141
    4242define( 'RUNTHINGS_TTC_BASENAME', plugin_basename( __FILE__ ) );
  • runthings-taxonomy-tags-to-checkboxes/trunk/languages/runthings-taxonomy-tags-to-checkboxes.pot

    r3461388 r3464228  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Taxonomy Tags to Checkboxes 1.2.0\n"
     5"Project-Id-Version: Taxonomy Tags to Checkboxes 1.3.0\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/runthings-taxonomy-tags-to-checkboxes\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2026-02-14T15:01:15+00:00\n"
     12"POT-Creation-Date: 2026-02-18T10:47:17+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.12.0\n"
     
    142142msgstr ""
    143143
    144 #: lib/replace-tags.php:175
     144#: lib/replace-tags.php:233
     145#: src/components/TtcTaxonomyPanel.js:102
    145146msgid "No terms available."
    146147msgstr ""
    147148
    148149#. 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
    151154msgid "+ Add / Edit %s"
    152155msgstr ""
     
    155158msgid "GitHub"
    156159msgstr ""
     160
     161#: src/components/TtcTaxonomyPanel.js:141
     162msgid "+ Add / Edit"
     163msgstr ""
  • runthings-taxonomy-tags-to-checkboxes/trunk/lib/replace-tags.php

    r3461388 r3464228  
    3333            add_action( 'add_meta_boxes', function ( $post_type, $post ) use ( $taxonomy ) {
    3434                $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                }
    3538            }, 10, 2 );
    36 
    37             add_action( 'add_meta_boxes', function ( $post_type ) use ( $taxonomy ) {
    38                 $this->add_taxonomy_metabox( $post_type, $taxonomy );
    39             });
    4039
    4140            add_action( 'save_post', function ( $post_id ) use ( $taxonomy ) {
     
    4645
    4746    /**
    48      * Enqueue block editor assets to remove default taxonomy panels in Gutenberg
     47     * Enqueue block editor assets — native Gutenberg sidebar panels
    4948     */
    5049    public function enqueue_block_editor_assets() {
     
    5352        }
    5453
     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
    5561        wp_enqueue_script(
    5662            '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'],
    6066            true
    6167        );
    6268
    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(
    64105            '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'
    69108        );
    70109    }
     
    116155            remove_meta_box( 'tagsdiv-' . $taxonomy, $post_type, 'side' );
    117156        }
     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;
    118176    }
    119177
     
    271329    }
    272330}
    273 
  • runthings-taxonomy-tags-to-checkboxes/trunk/readme.md

    r3461388 r3464228  
    5656
    5757## 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
    5862
    5963### v1.2.0 - 14th February 2026
  • runthings-taxonomy-tags-to-checkboxes/trunk/readme.txt

    r3461388 r3464228  
    44Requires at least: 6.4
    55Tested up to: 6.9
    6 Stable tag: 1.2.0
     6Stable tag: 1.3.0
    77License: GPLv3 or later
    88License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    5252== Changelog ==
    5353
     54= 1.3.0 - 18th February 2026 =
     55* Feature - Add Gutenberg (block editor) support for taxonomy meta boxes instead of using compatibility mode
     56
    5457= 1.2.0 - 14th February 2026 =
    5558* Improvement - Rename "Auto" height option to "Default" for clarity
     
    8891== Upgrade Notice ==
    8992
     93= 1.3.0 =
     94Adds Gutenberg support for taxonomy meta boxes.
     95
    9096= 1.2.0 =
    9197Fixes fatal error when a configured taxonomy is deleted, improves panel height options.
     
    9399= 1.1.1 =
    94100Fix 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.
    98101
    99102== License ==
  • runthings-taxonomy-tags-to-checkboxes/trunk/runthings-taxonomy-tags-to-checkboxes.php

    r3461388 r3464228  
    55 * Plugin URI: https://runthings.dev/wordpress-plugins/taxonomy-tags-to-checkboxes/
    66 * Description: Convert taxonomy tags to checkboxes in the WordPress admin.
    7  * Version: 1.2.0
     7 * Version: 1.3.0
    88 * Author: runthingsdev
    99 * Author URI: https://runthings.dev/
     
    3838}
    3939
    40 define( 'RUNTHINGS_TTC_VERSION', '1.2.0' );
     40define( 'RUNTHINGS_TTC_VERSION', '1.3.0' );
    4141
    4242define( 'RUNTHINGS_TTC_BASENAME', plugin_basename( __FILE__ ) );
Note: See TracChangeset for help on using the changeset viewer.