Changeset 3238917
- Timestamp:
- 02/11/2025 07:28:24 PM (12 months ago)
- Location:
- post-types-unlimited
- Files:
-
- 1 deleted
- 4 edited
- 8 copied
-
tags/1.2.4 (copied) (copied from post-types-unlimited/trunk)
-
tags/1.2.4/assets/css/ptu-metaboxes.css (copied) (copied from post-types-unlimited/trunk/assets/css/ptu-metaboxes.css)
-
tags/1.2.4/assets/css/sass (deleted)
-
tags/1.2.4/inc/Metaboxes.php (copied) (copied from post-types-unlimited/trunk/inc/Metaboxes.php) (5 diffs)
-
tags/1.2.4/inc/PostTypes.php (copied) (copied from post-types-unlimited/trunk/inc/PostTypes.php)
-
tags/1.2.4/inc/Taxonomies.php (copied) (copied from post-types-unlimited/trunk/inc/Taxonomies.php)
-
tags/1.2.4/languages/post-types-unlimited.pot (copied) (copied from post-types-unlimited/trunk/languages/post-types-unlimited.pot) (4 diffs)
-
tags/1.2.4/post-types-unlimited.php (copied) (copied from post-types-unlimited/trunk/post-types-unlimited.php) (2 diffs)
-
tags/1.2.4/readme.txt (copied) (copied from post-types-unlimited/trunk/readme.txt) (2 diffs)
-
trunk/inc/Metaboxes.php (modified) (5 diffs)
-
trunk/languages/post-types-unlimited.pot (modified) (4 diffs)
-
trunk/post-types-unlimited.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
post-types-unlimited/tags/1.2.4/inc/Metaboxes.php
r3140072 r3238917 19 19 * @since 1.0 20 20 */ 21 public $version = '1.2. 3';21 public $version = '1.2.4'; 22 22 23 23 /** … … 435 435 'name' => $this->parse_field_id( $field['id'] ), 436 436 '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' ), 438 438 'option_none_value' => '', 439 439 ) ); … … 464 464 protected function field_image_size( $field, $value ) { 465 465 $choices = [ 466 '' => \esc_html__( ' - Select -', 'post-types-unlimited' ),466 '' => \esc_html__( '— Select —', 'post-types-unlimited' ), 467 467 ]; 468 468 $image_sizes = \get_intermediate_image_sizes(); … … 480 480 protected function field_taxonomy( $field, $value ) { 481 481 $choices = [ 482 '' => \esc_html__( ' - Select -', 'post-types-unlimited' ),482 '' => \esc_html__( '— Select —', 'post-types-unlimited' ), 483 483 ]; 484 484 $taxonomies = \get_taxonomies( [ … … 513 513 514 514 $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>'; 518 543 } 519 $output .= '</select>'; 520 521 return $output; 544 } 545 return $options; 522 546 } 523 547 -
post-types-unlimited/tags/1.2.4/languages/post-types-unlimited.pot
r3140072 r3238917 4 4 "Project-Id-Version: Post Types Unlimited\n" 5 5 "Report-Msgid-Bugs-To: \n" 6 "POT-Creation-Date: 202 4-08-22 18:28-0700\n"6 "POT-Creation-Date: 2025-02-07 14:03-0800\n" 7 7 "PO-Revision-Date: 2016-08-09 12:06-0800\n" 8 8 "Last-Translator: AJ Clarke <[email protected]>\n" … … 18 18 "esc_attr__;_x\n" 19 19 "X-Poedit-Basepath: ..\n" 20 "X-Generator: Poedit 3. 4.1\n"20 "X-Generator: Poedit 3.5\n" 21 21 "X-Poedit-SourceCharset: UTF-8\n" 22 22 "X-Poedit-SearchPath-0: .\n" 23 23 "X-Poedit-SearchPathExcluded-0: vendor\n" 24 24 25 #: inc/Metaboxes.php:437 26 msgid " - None -"25 #: inc/Metaboxes.php:437 inc/Metaboxes.php:466 inc/Metaboxes.php:482 26 msgid "— Select —" 27 27 msgstr "" 28 28 … … 32 32 msgstr "" 33 33 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 39 35 msgid "Select Icon" 40 36 msgstr "" 41 37 42 #: inc/Metaboxes.php: 58538 #: inc/Metaboxes.php:609 43 39 msgid "Search for an icon" 44 40 msgstr "" 45 41 46 #: inc/Metaboxes.php: 58742 #: inc/Metaboxes.php:611 47 43 msgid "Close dialog" 48 44 msgstr "" … … 812 808 msgstr "" 813 809 814 #: inc/PostTypes.php:7 85 inc/PostTypes.php:799 inc/PostTypes.php:813815 #: inc/Taxonomies.php:6 73 inc/Taxonomies.php:687810 #: inc/PostTypes.php:772 inc/PostTypes.php:782 inc/PostTypes.php:792 811 #: inc/Taxonomies.php:665 inc/Taxonomies.php:675 816 812 msgid "yes" 817 813 msgstr "" 818 814 819 #: inc/PostTypes.php:7 88 inc/PostTypes.php:802 inc/PostTypes.php:816820 #: inc/Taxonomies.php:6 76 inc/Taxonomies.php:690815 #: inc/PostTypes.php:775 inc/PostTypes.php:785 inc/PostTypes.php:795 816 #: inc/Taxonomies.php:668 inc/Taxonomies.php:678 821 817 msgid "no" 822 818 msgstr "" -
post-types-unlimited/tags/1.2.4/post-types-unlimited.php
r3140072 r3238917 4 4 * Plugin URI: https://wordpress.org/plugins/post-types-unlimited/ 5 5 * Description: Create unlimited custom post types and custom taxonomies. 6 * Version: 1.2. 36 * Version: 1.2.4 7 7 * Requires at least: 5.7 8 8 * Requires PHP: 7.4 … … 44 44 * Curent plugin version. 45 45 */ 46 public const VERSION = '1.2. 3';46 public const VERSION = '1.2.4'; 47 47 48 48 /** -
post-types-unlimited/tags/1.2.4/readme.txt
r3140072 r3238917 5 5 Requires at least: 5.2.0 6 6 Requires PHP: 7.4 7 Tested up to: 6. 68 Stable Tag: 1.2. 37 Tested up to: 6.7 8 Stable Tag: 1.2.4 9 9 License: GPL v2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 50 50 51 51 == 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. 52 57 53 58 = 1.2.3 = -
post-types-unlimited/trunk/inc/Metaboxes.php
r3140072 r3238917 19 19 * @since 1.0 20 20 */ 21 public $version = '1.2. 3';21 public $version = '1.2.4'; 22 22 23 23 /** … … 435 435 'name' => $this->parse_field_id( $field['id'] ), 436 436 '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' ), 438 438 'option_none_value' => '', 439 439 ) ); … … 464 464 protected function field_image_size( $field, $value ) { 465 465 $choices = [ 466 '' => \esc_html__( ' - Select -', 'post-types-unlimited' ),466 '' => \esc_html__( '— Select —', 'post-types-unlimited' ), 467 467 ]; 468 468 $image_sizes = \get_intermediate_image_sizes(); … … 480 480 protected function field_taxonomy( $field, $value ) { 481 481 $choices = [ 482 '' => \esc_html__( ' - Select -', 'post-types-unlimited' ),482 '' => \esc_html__( '— Select —', 'post-types-unlimited' ), 483 483 ]; 484 484 $taxonomies = \get_taxonomies( [ … … 513 513 514 514 $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>'; 518 543 } 519 $output .= '</select>'; 520 521 return $output; 544 } 545 return $options; 522 546 } 523 547 -
post-types-unlimited/trunk/languages/post-types-unlimited.pot
r3140072 r3238917 4 4 "Project-Id-Version: Post Types Unlimited\n" 5 5 "Report-Msgid-Bugs-To: \n" 6 "POT-Creation-Date: 202 4-08-22 18:28-0700\n"6 "POT-Creation-Date: 2025-02-07 14:03-0800\n" 7 7 "PO-Revision-Date: 2016-08-09 12:06-0800\n" 8 8 "Last-Translator: AJ Clarke <[email protected]>\n" … … 18 18 "esc_attr__;_x\n" 19 19 "X-Poedit-Basepath: ..\n" 20 "X-Generator: Poedit 3. 4.1\n"20 "X-Generator: Poedit 3.5\n" 21 21 "X-Poedit-SourceCharset: UTF-8\n" 22 22 "X-Poedit-SearchPath-0: .\n" 23 23 "X-Poedit-SearchPathExcluded-0: vendor\n" 24 24 25 #: inc/Metaboxes.php:437 26 msgid " - None -"25 #: inc/Metaboxes.php:437 inc/Metaboxes.php:466 inc/Metaboxes.php:482 26 msgid "— Select —" 27 27 msgstr "" 28 28 … … 32 32 msgstr "" 33 33 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 39 35 msgid "Select Icon" 40 36 msgstr "" 41 37 42 #: inc/Metaboxes.php: 58538 #: inc/Metaboxes.php:609 43 39 msgid "Search for an icon" 44 40 msgstr "" 45 41 46 #: inc/Metaboxes.php: 58742 #: inc/Metaboxes.php:611 47 43 msgid "Close dialog" 48 44 msgstr "" … … 812 808 msgstr "" 813 809 814 #: inc/PostTypes.php:7 85 inc/PostTypes.php:799 inc/PostTypes.php:813815 #: inc/Taxonomies.php:6 73 inc/Taxonomies.php:687810 #: inc/PostTypes.php:772 inc/PostTypes.php:782 inc/PostTypes.php:792 811 #: inc/Taxonomies.php:665 inc/Taxonomies.php:675 816 812 msgid "yes" 817 813 msgstr "" 818 814 819 #: inc/PostTypes.php:7 88 inc/PostTypes.php:802 inc/PostTypes.php:816820 #: inc/Taxonomies.php:6 76 inc/Taxonomies.php:690815 #: inc/PostTypes.php:775 inc/PostTypes.php:785 inc/PostTypes.php:795 816 #: inc/Taxonomies.php:668 inc/Taxonomies.php:678 821 817 msgid "no" 822 818 msgstr "" -
post-types-unlimited/trunk/post-types-unlimited.php
r3140072 r3238917 4 4 * Plugin URI: https://wordpress.org/plugins/post-types-unlimited/ 5 5 * Description: Create unlimited custom post types and custom taxonomies. 6 * Version: 1.2. 36 * Version: 1.2.4 7 7 * Requires at least: 5.7 8 8 * Requires PHP: 7.4 … … 44 44 * Curent plugin version. 45 45 */ 46 public const VERSION = '1.2. 3';46 public const VERSION = '1.2.4'; 47 47 48 48 /** -
post-types-unlimited/trunk/readme.txt
r3140072 r3238917 5 5 Requires at least: 5.2.0 6 6 Requires PHP: 7.4 7 Tested up to: 6. 68 Stable Tag: 1.2. 37 Tested up to: 6.7 8 Stable Tag: 1.2.4 9 9 License: GPL v2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 50 50 51 51 == 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. 52 57 53 58 = 1.2.3 =
Note: See TracChangeset
for help on using the changeset viewer.