Plugin Directory

Changeset 3238917


Ignore:
Timestamp:
02/11/2025 07:28:24 PM (12 months ago)
Author:
WPExplorer
Message:

version 1.2.4

Location:
post-types-unlimited
Files:
1 deleted
4 edited
8 copied

Legend:

Unmodified
Added
Removed
  • post-types-unlimited/tags/1.2.4/inc/Metaboxes.php

    r3140072 r3238917  
    1919     * @since 1.0
    2020     */
    21     public $version = '1.2.3';
     21    public $version = '1.2.4';
    2222
    2323    /**
     
    435435            'name'              => $this->parse_field_id( $field['id'] ),
    436436            'id'                => "ptu-metabox-field--{$field['id']}",
    437             'show_option_none'  => \esc_html__( '- None -', 'post-types-unlimited' ),
     437            'show_option_none'  => \esc_html__( '— Select —', 'post-types-unlimited' ),
    438438            'option_none_value' => '',
    439439        ) );
     
    464464    protected function field_image_size( $field, $value ) {
    465465        $choices = [
    466             '' => \esc_html__( '- Select -', 'post-types-unlimited' ),
     466            '' => \esc_html__( '— Select —', 'post-types-unlimited' ),
    467467        ];
    468468        $image_sizes = \get_intermediate_image_sizes();
     
    480480    protected function field_taxonomy( $field, $value ) {
    481481        $choices = [
    482             '' => \esc_html__( '- Select -', 'post-types-unlimited' ),
     482            '' => \esc_html__( '— Select —', 'post-types-unlimited' ),
    483483        ];
    484484        $taxonomies = \get_taxonomies( [
     
    513513
    514514        $output = '<select id="ptu-metabox-field--' . \esc_attr( $field['id'] ) . '" name="' . \esc_attr( $this->parse_field_id( $field['id'] ) ) . '">';
    515             foreach ( $choices as $choice_v => $name ) {
    516                 $selected = \selected( $value, $choice_v, false );
    517                 $output .= '<option value="' .  \esc_attr( $choice_v ) . '" ' . $selected . '>' . \esc_attr( $name ) . '</option>';
     515            $output .= $this->select_field_options( $choices, $value );
     516        $output .= '</select>';
     517
     518        return $output;
     519    }
     520
     521    /**
     522     * Renders select field options.
     523     *
     524     * @access protected
     525     * @since 1.2.4
     526     */
     527    protected function select_field_options( $choices, $value ): string {
     528        $options = '';
     529        foreach ( $choices as $choice_k => $choice_v ) {
     530            if ( is_array( $choice_v ) ) {
     531                $sub_choices = $choice_v['choices'] ?? $choice_v['options'] ?? [];
     532                if ( $sub_choices ) {
     533                    if ( ! empty( $choice_v['label'] ) ) {
     534                        $options .= '<optgroup label="' . esc_attr( $choice_v['label'] ) . '">';
     535                            $options .= $this->select_field_options( $sub_choices, $value );
     536                        $options .= '</optgroup>';
     537                    } else {
     538                        $options .= $this->select_field_options( $sub_choices, $value );
     539                    }
     540                }
     541            } else {
     542                $options .= '<option value="' .  \esc_attr( $choice_k ) . '" ' . \selected( $value, $choice_k, false ) . '>' . \esc_attr( $choice_v ) . '</option>';
    518543            }
    519         $output .= '</select>';
    520 
    521         return $output;
     544        }
     545        return $options;
    522546    }
    523547
  • post-types-unlimited/tags/1.2.4/languages/post-types-unlimited.pot

    r3140072 r3238917  
    44"Project-Id-Version: Post Types Unlimited\n"
    55"Report-Msgid-Bugs-To: \n"
    6 "POT-Creation-Date: 2024-08-22 18:28-0700\n"
     6"POT-Creation-Date: 2025-02-07 14:03-0800\n"
    77"PO-Revision-Date: 2016-08-09 12:06-0800\n"
    88"Last-Translator: AJ Clarke <[email protected]>\n"
     
    1818"esc_attr__;_x\n"
    1919"X-Poedit-Basepath: ..\n"
    20 "X-Generator: Poedit 3.4.1\n"
     20"X-Generator: Poedit 3.5\n"
    2121"X-Poedit-SourceCharset: UTF-8\n"
    2222"X-Poedit-SearchPath-0: .\n"
    2323"X-Poedit-SearchPathExcluded-0: vendor\n"
    2424
    25 #: inc/Metaboxes.php:437
    26 msgid "- None -"
     25#: inc/Metaboxes.php:437 inc/Metaboxes.php:466 inc/Metaboxes.php:482
     26msgid "— Select —"
    2727msgstr ""
    2828
     
    3232msgstr ""
    3333
    34 #: inc/Metaboxes.php:466 inc/Metaboxes.php:482
    35 msgid "- Select -"
    36 msgstr ""
    37 
    38 #: inc/Metaboxes.php:572
     34#: inc/Metaboxes.php:596
    3935msgid "Select Icon"
    4036msgstr ""
    4137
    42 #: inc/Metaboxes.php:585
     38#: inc/Metaboxes.php:609
    4339msgid "Search for an icon"
    4440msgstr ""
    4541
    46 #: inc/Metaboxes.php:587
     42#: inc/Metaboxes.php:611
    4743msgid "Close dialog"
    4844msgstr ""
     
    812808msgstr ""
    813809
    814 #: inc/PostTypes.php:785 inc/PostTypes.php:799 inc/PostTypes.php:813
    815 #: inc/Taxonomies.php:673 inc/Taxonomies.php:687
     810#: inc/PostTypes.php:772 inc/PostTypes.php:782 inc/PostTypes.php:792
     811#: inc/Taxonomies.php:665 inc/Taxonomies.php:675
    816812msgid "yes"
    817813msgstr ""
    818814
    819 #: inc/PostTypes.php:788 inc/PostTypes.php:802 inc/PostTypes.php:816
    820 #: inc/Taxonomies.php:676 inc/Taxonomies.php:690
     815#: inc/PostTypes.php:775 inc/PostTypes.php:785 inc/PostTypes.php:795
     816#: inc/Taxonomies.php:668 inc/Taxonomies.php:678
    821817msgid "no"
    822818msgstr ""
  • post-types-unlimited/tags/1.2.4/post-types-unlimited.php

    r3140072 r3238917  
    44 * Plugin URI:        https://wordpress.org/plugins/post-types-unlimited/
    55 * Description:       Create unlimited custom post types and custom taxonomies.
    6  * Version:           1.2.3
     6 * Version:           1.2.4
    77 * Requires at least: 5.7
    88 * Requires PHP:      7.4
     
    4444         * Curent plugin version.
    4545         */
    46         public const VERSION = '1.2.3';
     46        public const VERSION = '1.2.4';
    4747
    4848        /**
  • post-types-unlimited/tags/1.2.4/readme.txt

    r3140072 r3238917  
    55Requires at least: 5.2.0
    66Requires PHP: 7.4
    7 Tested up to: 6.6
    8 Stable Tag: 1.2.3
     7Tested up to: 6.7
     8Stable Tag: 1.2.4
    99License: GPL v2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    5050
    5151== Changelog ==
     52
     53= 1.2.4 =
     54* Updated the tested up to version to 6.7
     55* Updated the metabox class to support option groups for select fields.
     56* Updated the page and taxonomy select fields to both use "Select" for the empty option for consistency.
    5257
    5358= 1.2.3 =
  • post-types-unlimited/trunk/inc/Metaboxes.php

    r3140072 r3238917  
    1919     * @since 1.0
    2020     */
    21     public $version = '1.2.3';
     21    public $version = '1.2.4';
    2222
    2323    /**
     
    435435            'name'              => $this->parse_field_id( $field['id'] ),
    436436            'id'                => "ptu-metabox-field--{$field['id']}",
    437             'show_option_none'  => \esc_html__( '- None -', 'post-types-unlimited' ),
     437            'show_option_none'  => \esc_html__( '— Select —', 'post-types-unlimited' ),
    438438            'option_none_value' => '',
    439439        ) );
     
    464464    protected function field_image_size( $field, $value ) {
    465465        $choices = [
    466             '' => \esc_html__( '- Select -', 'post-types-unlimited' ),
     466            '' => \esc_html__( '— Select —', 'post-types-unlimited' ),
    467467        ];
    468468        $image_sizes = \get_intermediate_image_sizes();
     
    480480    protected function field_taxonomy( $field, $value ) {
    481481        $choices = [
    482             '' => \esc_html__( '- Select -', 'post-types-unlimited' ),
     482            '' => \esc_html__( '— Select —', 'post-types-unlimited' ),
    483483        ];
    484484        $taxonomies = \get_taxonomies( [
     
    513513
    514514        $output = '<select id="ptu-metabox-field--' . \esc_attr( $field['id'] ) . '" name="' . \esc_attr( $this->parse_field_id( $field['id'] ) ) . '">';
    515             foreach ( $choices as $choice_v => $name ) {
    516                 $selected = \selected( $value, $choice_v, false );
    517                 $output .= '<option value="' .  \esc_attr( $choice_v ) . '" ' . $selected . '>' . \esc_attr( $name ) . '</option>';
     515            $output .= $this->select_field_options( $choices, $value );
     516        $output .= '</select>';
     517
     518        return $output;
     519    }
     520
     521    /**
     522     * Renders select field options.
     523     *
     524     * @access protected
     525     * @since 1.2.4
     526     */
     527    protected function select_field_options( $choices, $value ): string {
     528        $options = '';
     529        foreach ( $choices as $choice_k => $choice_v ) {
     530            if ( is_array( $choice_v ) ) {
     531                $sub_choices = $choice_v['choices'] ?? $choice_v['options'] ?? [];
     532                if ( $sub_choices ) {
     533                    if ( ! empty( $choice_v['label'] ) ) {
     534                        $options .= '<optgroup label="' . esc_attr( $choice_v['label'] ) . '">';
     535                            $options .= $this->select_field_options( $sub_choices, $value );
     536                        $options .= '</optgroup>';
     537                    } else {
     538                        $options .= $this->select_field_options( $sub_choices, $value );
     539                    }
     540                }
     541            } else {
     542                $options .= '<option value="' .  \esc_attr( $choice_k ) . '" ' . \selected( $value, $choice_k, false ) . '>' . \esc_attr( $choice_v ) . '</option>';
    518543            }
    519         $output .= '</select>';
    520 
    521         return $output;
     544        }
     545        return $options;
    522546    }
    523547
  • post-types-unlimited/trunk/languages/post-types-unlimited.pot

    r3140072 r3238917  
    44"Project-Id-Version: Post Types Unlimited\n"
    55"Report-Msgid-Bugs-To: \n"
    6 "POT-Creation-Date: 2024-08-22 18:28-0700\n"
     6"POT-Creation-Date: 2025-02-07 14:03-0800\n"
    77"PO-Revision-Date: 2016-08-09 12:06-0800\n"
    88"Last-Translator: AJ Clarke <[email protected]>\n"
     
    1818"esc_attr__;_x\n"
    1919"X-Poedit-Basepath: ..\n"
    20 "X-Generator: Poedit 3.4.1\n"
     20"X-Generator: Poedit 3.5\n"
    2121"X-Poedit-SourceCharset: UTF-8\n"
    2222"X-Poedit-SearchPath-0: .\n"
    2323"X-Poedit-SearchPathExcluded-0: vendor\n"
    2424
    25 #: inc/Metaboxes.php:437
    26 msgid "- None -"
     25#: inc/Metaboxes.php:437 inc/Metaboxes.php:466 inc/Metaboxes.php:482
     26msgid "— Select —"
    2727msgstr ""
    2828
     
    3232msgstr ""
    3333
    34 #: inc/Metaboxes.php:466 inc/Metaboxes.php:482
    35 msgid "- Select -"
    36 msgstr ""
    37 
    38 #: inc/Metaboxes.php:572
     34#: inc/Metaboxes.php:596
    3935msgid "Select Icon"
    4036msgstr ""
    4137
    42 #: inc/Metaboxes.php:585
     38#: inc/Metaboxes.php:609
    4339msgid "Search for an icon"
    4440msgstr ""
    4541
    46 #: inc/Metaboxes.php:587
     42#: inc/Metaboxes.php:611
    4743msgid "Close dialog"
    4844msgstr ""
     
    812808msgstr ""
    813809
    814 #: inc/PostTypes.php:785 inc/PostTypes.php:799 inc/PostTypes.php:813
    815 #: inc/Taxonomies.php:673 inc/Taxonomies.php:687
     810#: inc/PostTypes.php:772 inc/PostTypes.php:782 inc/PostTypes.php:792
     811#: inc/Taxonomies.php:665 inc/Taxonomies.php:675
    816812msgid "yes"
    817813msgstr ""
    818814
    819 #: inc/PostTypes.php:788 inc/PostTypes.php:802 inc/PostTypes.php:816
    820 #: inc/Taxonomies.php:676 inc/Taxonomies.php:690
     815#: inc/PostTypes.php:775 inc/PostTypes.php:785 inc/PostTypes.php:795
     816#: inc/Taxonomies.php:668 inc/Taxonomies.php:678
    821817msgid "no"
    822818msgstr ""
  • post-types-unlimited/trunk/post-types-unlimited.php

    r3140072 r3238917  
    44 * Plugin URI:        https://wordpress.org/plugins/post-types-unlimited/
    55 * Description:       Create unlimited custom post types and custom taxonomies.
    6  * Version:           1.2.3
     6 * Version:           1.2.4
    77 * Requires at least: 5.7
    88 * Requires PHP:      7.4
     
    4444         * Curent plugin version.
    4545         */
    46         public const VERSION = '1.2.3';
     46        public const VERSION = '1.2.4';
    4747
    4848        /**
  • post-types-unlimited/trunk/readme.txt

    r3140072 r3238917  
    55Requires at least: 5.2.0
    66Requires PHP: 7.4
    7 Tested up to: 6.6
    8 Stable Tag: 1.2.3
     7Tested up to: 6.7
     8Stable Tag: 1.2.4
    99License: GPL v2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    5050
    5151== Changelog ==
     52
     53= 1.2.4 =
     54* Updated the tested up to version to 6.7
     55* Updated the metabox class to support option groups for select fields.
     56* Updated the page and taxonomy select fields to both use "Select" for the empty option for consistency.
    5257
    5358= 1.2.3 =
Note: See TracChangeset for help on using the changeset viewer.