Changeset 3437610
- Timestamp:
- 01/12/2026 10:57:18 AM (3 months ago)
- Location:
- dashi
- Files:
-
- 1 deleted
- 13 edited
- 28 copied
-
tags/3.3.1 (copied) (copied from dashi/trunk)
-
tags/3.3.1/classes/Alias.php (copied) (copied from dashi/trunk/classes/Alias.php)
-
tags/3.3.1/classes/Field.php (copied) (copied from dashi/trunk/classes/Field.php)
-
tags/3.3.1/classes/Posttype/Another.php (copied) (copied from dashi/trunk/classes/Posttype/Another.php)
-
tags/3.3.1/classes/Posttype/Base.php (copied) (copied from dashi/trunk/classes/Posttype/Base.php) (2 diffs)
-
tags/3.3.1/classes/Posttype/Copy.php (copied) (copied from dashi/trunk/classes/Posttype/Copy.php)
-
tags/3.3.1/classes/Posttype/Csv.php (copied) (copied from dashi/trunk/classes/Posttype/Csv.php) (1 diff)
-
tags/3.3.1/classes/Posttype/CustomFields.php (copied) (copied from dashi/trunk/classes/Posttype/CustomFields.php) (4 diffs)
-
tags/3.3.1/classes/Posttype/CustomFieldsCategories.php (copied) (copied from dashi/trunk/classes/Posttype/CustomFieldsCategories.php) (3 diffs)
-
tags/3.3.1/classes/Posttype/CustomFieldsGoogleMap.php (copied) (copied from dashi/trunk/classes/Posttype/CustomFieldsGoogleMap.php)
-
tags/3.3.1/classes/Posttype/Index.php (copied) (copied from dashi/trunk/classes/Posttype/Index.php) (4 diffs)
-
tags/3.3.1/classes/Posttype/Posttype.php (copied) (copied from dashi/trunk/classes/Posttype/Posttype.php)
-
tags/3.3.1/classes/Posttype/PublicForm.php (copied) (copied from dashi/trunk/classes/Posttype/PublicForm.php) (4 diffs)
-
tags/3.3.1/classes/Posttype/Redirect.php (copied) (copied from dashi/trunk/classes/Posttype/Redirect.php)
-
tags/3.3.1/classes/Posttype/Revisions.php (modified) (1 diff)
-
tags/3.3.1/classes/Posttype/Save.php (copied) (copied from dashi/trunk/classes/Posttype/Save.php) (1 diff)
-
tags/3.3.1/classes/Posttype/Search.php (copied) (copied from dashi/trunk/classes/Posttype/Search.php)
-
tags/3.3.1/classes/Posttype/Virtual.php (copied) (copied from dashi/trunk/classes/Posttype/Virtual.php)
-
tags/3.3.1/classes/Save.php (deleted)
-
tags/3.3.1/classes/Security.php (copied) (copied from dashi/trunk/classes/Security.php)
-
tags/3.3.1/classes/Util.php (modified) (1 diff)
-
tags/3.3.1/dashi.php (copied) (copied from dashi/trunk/dashi.php) (1 diff)
-
tags/3.3.1/file.php (copied) (copied from dashi/trunk/file.php)
-
tags/3.3.1/languages/dashi-ja.mo (copied) (copied from dashi/trunk/languages/dashi-ja.mo)
-
tags/3.3.1/languages/dashi-ja.po (copied) (copied from dashi/trunk/languages/dashi-ja.po)
-
tags/3.3.1/posttype/Crawlsearch.php (copied) (copied from dashi/trunk/posttype/Crawlsearch.php)
-
tags/3.3.1/posttype/Editablehelp.php (copied) (copied from dashi/trunk/posttype/Editablehelp.php)
-
tags/3.3.1/posttype/Pagepart.php (copied) (copied from dashi/trunk/posttype/Pagepart.php)
-
tags/3.3.1/readme.txt (copied) (copied from dashi/trunk/readme.txt) (2 diffs)
-
tags/3.3.1/templates/base.php (copied) (copied from dashi/trunk/templates/base.php)
-
tags/3.3.1/templates/search.php (copied) (copied from dashi/trunk/templates/search.php)
-
trunk/classes/Posttype/Base.php (modified) (2 diffs)
-
trunk/classes/Posttype/Csv.php (modified) (1 diff)
-
trunk/classes/Posttype/CustomFields.php (modified) (4 diffs)
-
trunk/classes/Posttype/CustomFieldsCategories.php (modified) (3 diffs)
-
trunk/classes/Posttype/Index.php (modified) (4 diffs)
-
trunk/classes/Posttype/PublicForm.php (modified) (4 diffs)
-
trunk/classes/Posttype/Revisions.php (modified) (1 diff)
-
trunk/classes/Posttype/Save.php (modified) (1 diff)
-
trunk/classes/Util.php (modified) (1 diff)
-
trunk/dashi.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dashi/tags/3.3.1/classes/Posttype/Base.php
r3265039 r3437610 358 358 { 359 359 $custom_fields = static::get('custom_fields'); 360 361 $opts = false; 362 if (isset($custom_fields[$key])) 363 { 364 $opts = isset($custom_fields[$key]['options']) ? $custom_fields[$key]['options'] : false; 365 } 360 $opts = null; 361 362 if (isset($custom_fields[$key]['options'])) { 363 $opts = Util::resolveOptions($custom_fields[$key]['options']); 364 } 365 366 // $opts = false; 367 // if (isset($custom_fields[$key])) 368 // { 369 // $opts = isset($custom_fields[$key]['options']) ? $custom_fields[$key]['options'] : false; 370 // } 366 371 367 372 // optsが見つかってないので、fieldsを疑う … … 370 375 foreach ($custom_fields as $field => $v) 371 376 { 372 if ( ! isset($v['fields'][$key])) continue; 373 374 $opts = isset($custom_fields['fields'][$key]['options']) ? 375 $custom_fields['fields'][$key]['options'] : 376 false; 377 if (!isset($v['fields'][$key]['options'])) continue; 378 $opts = Util::resolveOptions($v['fields'][$key]['options']); 379 break; 380 381 // if ( ! isset($v['fields'][$key])) continue; 382 383 // $opts = isset($custom_fields['fields'][$key]['options']) ? 384 // $custom_fields['fields'][$key]['options'] : 385 // false; 377 386 } 378 387 } 379 388 380 389 // ここまで見つかっていないということは、妥当でない値を尋ねているか、設定値が妥当でないので、例外をスローする 381 if ( ! $opts)390 if (!is_array($opts)) 382 391 { 383 392 throw new \Exception (sprintf(__('%s is incorrect argument or setting of custom_fields of %s is wrong.', 'dashi'), $key, get_called_class())); -
dashi/tags/3.3.1/classes/Posttype/Csv.php
r3265039 r3437610 114 114 { 115 115 $value = $post->$k ?: '' ; 116 117 // ★ options の解決(Closure / array / null) 118 $options = \Dashi\Core\Util::resolveOptions($v['options'] ?? null); 119 116 120 if ( 117 121 in_array($v['type'], array('select', 'radio', 'checkbox')) && 118 isset($ v['options'][$value])122 isset($options[$value]) 119 123 ) 120 124 { 121 $value = $ v['options'][$value];125 $value = $options[$value]; 122 126 } 123 127 if ($excel_compati) -
dashi/tags/3.3.1/classes/Posttype/CustomFields.php
r3268587 r3437610 364 364 if (isset($value['args']['type'])) 365 365 { 366 // ★ options の正規化 367 $options = $value['args']['options'] ?? null; 368 $options = Util::resolveOptions($options); 369 366 370 $html = ''; 367 371 switch ($value['args']['type']) … … 452 456 $key, 453 457 $val, 454 $ value['args']['options'],458 $options, 455 459 $description, 456 460 $attrs, … … 463 467 $key, 464 468 $val, 465 $ value['args']['options'],469 $options, 466 470 $description, 467 471 $attrs, … … 475 479 $key, 476 480 $val, 477 $ value['args']['options'],481 $options, 478 482 $description, 479 483 $attrs, -
dashi/tags/3.3.1/classes/Posttype/CustomFieldsCategories.php
r3265039 r3437610 28 28 $description = isset($custom_field['description']) ? $custom_field['description'] : ''; 29 29 $attrs = isset($custom_field['attrs']) ? $custom_field['attrs'] : array(); 30 $options = isset($custom_field['options']) ? $custom_field['options'] : array(); 30 // $options = isset($custom_field['options']) ? $custom_field['options'] : array(); 31 $options = []; 32 if (isset($custom_field['options'])) { 33 $options = \Dashi\Core\Util::resolveOptions($custom_field['options']); 34 } 31 35 $label = isset($custom_field['label']) ? $custom_field['label'] : $key; 32 36 $id = 'upload_field_'.$key; … … 121 125 foreach ($custom_fields as $key => $val) { 122 126 $new_value = Input::post($key); 123 $new_value = Input::post($key);124 127 if (is_array($new_value)) { 125 128 $new_value = array_map('sanitize_text_field', $new_value); … … 127 130 $new_value = sanitize_text_field($new_value); 128 131 } 129 $new_value = maybe_serialize($new_value); 130 $old_value = isset($old_values[$key]) ? $old_values[$key] : '';131 if ( trim($new_value) === '') {132 133 // $new_value = maybe_serialize($new_value); 134 if ($new_value === '' || $new_value === []) { 132 135 $new_values[$key] = ''; 133 136 } else { 134 $new_values[$key] = $new_value;137 $new_values[$key] = maybe_serialize($new_value); 135 138 } 139 140 // $old_value = isset($old_values[$key]) ? $old_values[$key] : ''; 141 // if (trim($new_value) === '') { 142 // $new_values[$key] = ''; 143 // } else { 144 // $new_values[$key] = $new_value; 145 // } 136 146 } 137 147 } -
dashi/tags/3.3.1/classes/Posttype/Index.php
r3343992 r3437610 57 57 if ($column_name != $key) continue; 58 58 59 if ( 60 $field['type'] == 'taxonomy' 61 ) 59 if (isset($field['type']) && $field['type'] === 'taxonomy') 62 60 { 63 61 $terms = wp_get_post_terms( $post_id, $key, array("fields" => "names") ); … … 66 64 // checkbox or multiple 67 65 else if ( 68 $field['type'] == 'checkbox' || 69 ($field['type'] == 'select' && isset($field['multiple'])) 66 isset($field['type']) && 67 ( 68 $field['type'] == 'checkbox' || 69 ($field['type'] == 'select' && isset($field['multiple'])) 70 ) 70 71 ) 71 72 { … … 92 93 private static function displayValue($v, $field) 93 94 { 95 $options = $field['options'] ?? null; 96 $options = Util::resolveOptions($options); 97 94 98 // 値がない 95 99 // 文字列の0が来る場合があるのでstrlen()もかける … … 102 106 } 103 107 // そのまま表示 104 elseif ( ! isset($ field['options']) && $v)108 elseif ( ! isset($options) && $v) 105 109 { 106 110 echo esc_html($v); 107 111 } 108 112 // 配列&複数 109 elseif (isset($ field['options']) && is_array($v))113 elseif (isset($options) && is_array($v)) 110 114 { 111 115 $arr = array(); 112 116 foreach ($v as $vv) 113 117 { 114 $arr[] = $ field['options'][$vv];118 $arr[] = $options[$vv]; 115 119 } 116 120 echo esc_html(join(',', $arr)); 117 121 } 118 122 // 選択式 119 elseif (isset($ field['options']) && ! is_array($v))120 { 121 echo esc_html($ field['options'][$v]);123 elseif (isset($options) && ! is_array($v)) 124 { 125 echo esc_html($options[$v]); 122 126 } 123 127 } -
dashi/tags/3.3.1/classes/Posttype/PublicForm.php
r3262717 r3437610 720 720 { 721 721 if (isset($v['private_form_only']) && $v['private_form_only'] == true) continue; 722 723 if (isset($v['options'])) { 724 $v['options'] = \Dashi\Core\Util::resolveOptions($v['options']); 725 } 722 726 723 727 $html.= '<dt>'.esc_html($v['label']).'</dt>'; … … 1059 1063 if ($is_admin && isset($fields[$k]['public_form_allow_send_by_mail']) && $fields[$k]['public_form_allow_send_by_mail'] === false) continue; 1060 1064 1065 $field = $fields[$k]; 1066 if (isset($field['options'])) { 1067 $field['options'] = \Dashi\Core\Util::resolveOptions($field['options']); 1068 } 1069 1061 1070 // taxonomies 1062 1071 $terms = array(); … … 1101 1110 foreach ($v as $vv) 1102 1111 { 1103 if (isset($field s[$k]['options']) && isset($fields[$k]['options'][$vv]))1112 if (isset($field['options']) && isset($field['options'][$vv])) 1104 1113 { 1105 $tmps[] = esc_html($field s[$k]['options'][$vv]).'('.esc_html($vv).')';1114 $tmps[] = esc_html($field['options'][$vv]).'('.esc_html($vv).')'; 1106 1115 } 1107 1116 elseif (isset($terms[$vv])) … … 1123 1132 else 1124 1133 { 1125 if (isset($field s[$k]['options']) && isset($fields[$k]['options'][$v]))1126 { 1127 $body.= esc_html($field s[$k]['options'][$v]).'('.esc_html($v).")\n\n";1134 if (isset($field['options']) && isset($field['options'][$v])) 1135 { 1136 $body.= esc_html($field['options'][$v]).'('.esc_html($v).")\n\n"; 1128 1137 } 1129 1138 elseif (isset($terms[$v])) -
dashi/tags/3.3.1/classes/Posttype/Revisions.php
r2269647 r3437610 150 150 } 151 151 152 if (isset($current_custom_field['options'])) { 153 $current_custom_field['options'] 154 = \Dashi\Core\Util::resolveOptions($current_custom_field['options']); 155 } 156 152 157 // array 153 158 $type = isset($current_custom_field['type']) ? $current_custom_field['type'] : ''; -
dashi/tags/3.3.1/classes/Posttype/Save.php
r3304628 r3437610 525 525 $genStr = function ($post_id, $field_name, $fields, $strs) 526 526 { 527 // ★ options を解決 528 if (isset($fields['options'])) { 529 $fields['options'] = \Dashi\Core\Util::resolveOptions($fields['options']); 530 } 531 527 532 // stored value 528 533 $val = get_post_meta($post_id, $field_name); -
dashi/tags/3.3.1/classes/Util.php
r2008902 r3437610 319 319 die(Util::s($message)); 320 320 } 321 322 /** 323 * resolveOptions 324 * 325 * @param array|callable | function $options 326 * @return array 327 */ 328 public static function resolveOptions($options) 329 { 330 return is_callable($options) ? call_user_func($options) : $options; 331 } 321 332 } -
dashi/tags/3.3.1/dashi.php
r3358366 r3437610 7 7 Text Domain: dashi 8 8 Domain Path: /languages/ 9 Version: 3.3. 09 Version: 3.3.1 10 10 Author URI: http://www.jidaikobo.com/ 11 11 thx: https://github.com/trentrichardson/jQuery-Timepicker-Addon/tree/master/src 12 12 License: GPL2 13 13 14 Copyright 202 5jidaikobo (email: support@jidaikobo.com)14 Copyright 2026 jidaikobo (email: support@jidaikobo.com) 15 15 16 16 This program is free software; you can redistribute it and/or modify -
dashi/tags/3.3.1/readme.txt
r3358366 r3437610 3 3 Donate link: http://www.jidaikobo.com/donate.html 4 4 Tags: custom field, custom post type 5 Tested up to: 6. 8.26 Stable tag: 3.3. 05 Tested up to: 6.9.0 6 Stable tag: 3.3.1 7 7 License: GPLv2 or later 8 8 License URI: https://www.gnu.org/licenses/gpl-2.0.html 9 Requires PHP: 5.49 Requires PHP: 7.0 10 10 11 11 Useful classes for creating a custom post type. Creates Page Parts custom post type. Designed for theme developers. … … 43 43 == Changelog == 44 44 45 = 3.3.1 = 46 fix: resolve custom field options lazily to avoid undefined array key warnings 47 fix: stabilize handling of options in select / radio / checkbox fields 48 note: minimum required PHP version is now 7.0 49 45 50 = 3.3.0 = 46 51 add tiny class to seach template -
dashi/trunk/classes/Posttype/Base.php
r3265039 r3437610 358 358 { 359 359 $custom_fields = static::get('custom_fields'); 360 361 $opts = false; 362 if (isset($custom_fields[$key])) 363 { 364 $opts = isset($custom_fields[$key]['options']) ? $custom_fields[$key]['options'] : false; 365 } 360 $opts = null; 361 362 if (isset($custom_fields[$key]['options'])) { 363 $opts = Util::resolveOptions($custom_fields[$key]['options']); 364 } 365 366 // $opts = false; 367 // if (isset($custom_fields[$key])) 368 // { 369 // $opts = isset($custom_fields[$key]['options']) ? $custom_fields[$key]['options'] : false; 370 // } 366 371 367 372 // optsが見つかってないので、fieldsを疑う … … 370 375 foreach ($custom_fields as $field => $v) 371 376 { 372 if ( ! isset($v['fields'][$key])) continue; 373 374 $opts = isset($custom_fields['fields'][$key]['options']) ? 375 $custom_fields['fields'][$key]['options'] : 376 false; 377 if (!isset($v['fields'][$key]['options'])) continue; 378 $opts = Util::resolveOptions($v['fields'][$key]['options']); 379 break; 380 381 // if ( ! isset($v['fields'][$key])) continue; 382 383 // $opts = isset($custom_fields['fields'][$key]['options']) ? 384 // $custom_fields['fields'][$key]['options'] : 385 // false; 377 386 } 378 387 } 379 388 380 389 // ここまで見つかっていないということは、妥当でない値を尋ねているか、設定値が妥当でないので、例外をスローする 381 if ( ! $opts)390 if (!is_array($opts)) 382 391 { 383 392 throw new \Exception (sprintf(__('%s is incorrect argument or setting of custom_fields of %s is wrong.', 'dashi'), $key, get_called_class())); -
dashi/trunk/classes/Posttype/Csv.php
r3265039 r3437610 114 114 { 115 115 $value = $post->$k ?: '' ; 116 117 // ★ options の解決(Closure / array / null) 118 $options = \Dashi\Core\Util::resolveOptions($v['options'] ?? null); 119 116 120 if ( 117 121 in_array($v['type'], array('select', 'radio', 'checkbox')) && 118 isset($ v['options'][$value])122 isset($options[$value]) 119 123 ) 120 124 { 121 $value = $ v['options'][$value];125 $value = $options[$value]; 122 126 } 123 127 if ($excel_compati) -
dashi/trunk/classes/Posttype/CustomFields.php
r3268587 r3437610 364 364 if (isset($value['args']['type'])) 365 365 { 366 // ★ options の正規化 367 $options = $value['args']['options'] ?? null; 368 $options = Util::resolveOptions($options); 369 366 370 $html = ''; 367 371 switch ($value['args']['type']) … … 452 456 $key, 453 457 $val, 454 $ value['args']['options'],458 $options, 455 459 $description, 456 460 $attrs, … … 463 467 $key, 464 468 $val, 465 $ value['args']['options'],469 $options, 466 470 $description, 467 471 $attrs, … … 475 479 $key, 476 480 $val, 477 $ value['args']['options'],481 $options, 478 482 $description, 479 483 $attrs, -
dashi/trunk/classes/Posttype/CustomFieldsCategories.php
r3265039 r3437610 28 28 $description = isset($custom_field['description']) ? $custom_field['description'] : ''; 29 29 $attrs = isset($custom_field['attrs']) ? $custom_field['attrs'] : array(); 30 $options = isset($custom_field['options']) ? $custom_field['options'] : array(); 30 // $options = isset($custom_field['options']) ? $custom_field['options'] : array(); 31 $options = []; 32 if (isset($custom_field['options'])) { 33 $options = \Dashi\Core\Util::resolveOptions($custom_field['options']); 34 } 31 35 $label = isset($custom_field['label']) ? $custom_field['label'] : $key; 32 36 $id = 'upload_field_'.$key; … … 121 125 foreach ($custom_fields as $key => $val) { 122 126 $new_value = Input::post($key); 123 $new_value = Input::post($key);124 127 if (is_array($new_value)) { 125 128 $new_value = array_map('sanitize_text_field', $new_value); … … 127 130 $new_value = sanitize_text_field($new_value); 128 131 } 129 $new_value = maybe_serialize($new_value); 130 $old_value = isset($old_values[$key]) ? $old_values[$key] : '';131 if ( trim($new_value) === '') {132 133 // $new_value = maybe_serialize($new_value); 134 if ($new_value === '' || $new_value === []) { 132 135 $new_values[$key] = ''; 133 136 } else { 134 $new_values[$key] = $new_value;137 $new_values[$key] = maybe_serialize($new_value); 135 138 } 139 140 // $old_value = isset($old_values[$key]) ? $old_values[$key] : ''; 141 // if (trim($new_value) === '') { 142 // $new_values[$key] = ''; 143 // } else { 144 // $new_values[$key] = $new_value; 145 // } 136 146 } 137 147 } -
dashi/trunk/classes/Posttype/Index.php
r3343992 r3437610 57 57 if ($column_name != $key) continue; 58 58 59 if ( 60 $field['type'] == 'taxonomy' 61 ) 59 if (isset($field['type']) && $field['type'] === 'taxonomy') 62 60 { 63 61 $terms = wp_get_post_terms( $post_id, $key, array("fields" => "names") ); … … 66 64 // checkbox or multiple 67 65 else if ( 68 $field['type'] == 'checkbox' || 69 ($field['type'] == 'select' && isset($field['multiple'])) 66 isset($field['type']) && 67 ( 68 $field['type'] == 'checkbox' || 69 ($field['type'] == 'select' && isset($field['multiple'])) 70 ) 70 71 ) 71 72 { … … 92 93 private static function displayValue($v, $field) 93 94 { 95 $options = $field['options'] ?? null; 96 $options = Util::resolveOptions($options); 97 94 98 // 値がない 95 99 // 文字列の0が来る場合があるのでstrlen()もかける … … 102 106 } 103 107 // そのまま表示 104 elseif ( ! isset($ field['options']) && $v)108 elseif ( ! isset($options) && $v) 105 109 { 106 110 echo esc_html($v); 107 111 } 108 112 // 配列&複数 109 elseif (isset($ field['options']) && is_array($v))113 elseif (isset($options) && is_array($v)) 110 114 { 111 115 $arr = array(); 112 116 foreach ($v as $vv) 113 117 { 114 $arr[] = $ field['options'][$vv];118 $arr[] = $options[$vv]; 115 119 } 116 120 echo esc_html(join(',', $arr)); 117 121 } 118 122 // 選択式 119 elseif (isset($ field['options']) && ! is_array($v))120 { 121 echo esc_html($ field['options'][$v]);123 elseif (isset($options) && ! is_array($v)) 124 { 125 echo esc_html($options[$v]); 122 126 } 123 127 } -
dashi/trunk/classes/Posttype/PublicForm.php
r3262717 r3437610 720 720 { 721 721 if (isset($v['private_form_only']) && $v['private_form_only'] == true) continue; 722 723 if (isset($v['options'])) { 724 $v['options'] = \Dashi\Core\Util::resolveOptions($v['options']); 725 } 722 726 723 727 $html.= '<dt>'.esc_html($v['label']).'</dt>'; … … 1059 1063 if ($is_admin && isset($fields[$k]['public_form_allow_send_by_mail']) && $fields[$k]['public_form_allow_send_by_mail'] === false) continue; 1060 1064 1065 $field = $fields[$k]; 1066 if (isset($field['options'])) { 1067 $field['options'] = \Dashi\Core\Util::resolveOptions($field['options']); 1068 } 1069 1061 1070 // taxonomies 1062 1071 $terms = array(); … … 1101 1110 foreach ($v as $vv) 1102 1111 { 1103 if (isset($field s[$k]['options']) && isset($fields[$k]['options'][$vv]))1112 if (isset($field['options']) && isset($field['options'][$vv])) 1104 1113 { 1105 $tmps[] = esc_html($field s[$k]['options'][$vv]).'('.esc_html($vv).')';1114 $tmps[] = esc_html($field['options'][$vv]).'('.esc_html($vv).')'; 1106 1115 } 1107 1116 elseif (isset($terms[$vv])) … … 1123 1132 else 1124 1133 { 1125 if (isset($field s[$k]['options']) && isset($fields[$k]['options'][$v]))1126 { 1127 $body.= esc_html($field s[$k]['options'][$v]).'('.esc_html($v).")\n\n";1134 if (isset($field['options']) && isset($field['options'][$v])) 1135 { 1136 $body.= esc_html($field['options'][$v]).'('.esc_html($v).")\n\n"; 1128 1137 } 1129 1138 elseif (isset($terms[$v])) -
dashi/trunk/classes/Posttype/Revisions.php
r2269647 r3437610 150 150 } 151 151 152 if (isset($current_custom_field['options'])) { 153 $current_custom_field['options'] 154 = \Dashi\Core\Util::resolveOptions($current_custom_field['options']); 155 } 156 152 157 // array 153 158 $type = isset($current_custom_field['type']) ? $current_custom_field['type'] : ''; -
dashi/trunk/classes/Posttype/Save.php
r3304628 r3437610 525 525 $genStr = function ($post_id, $field_name, $fields, $strs) 526 526 { 527 // ★ options を解決 528 if (isset($fields['options'])) { 529 $fields['options'] = \Dashi\Core\Util::resolveOptions($fields['options']); 530 } 531 527 532 // stored value 528 533 $val = get_post_meta($post_id, $field_name); -
dashi/trunk/classes/Util.php
r2008902 r3437610 319 319 die(Util::s($message)); 320 320 } 321 322 /** 323 * resolveOptions 324 * 325 * @param array|callable | function $options 326 * @return array 327 */ 328 public static function resolveOptions($options) 329 { 330 return is_callable($options) ? call_user_func($options) : $options; 331 } 321 332 } -
dashi/trunk/dashi.php
r3358366 r3437610 7 7 Text Domain: dashi 8 8 Domain Path: /languages/ 9 Version: 3.3. 09 Version: 3.3.1 10 10 Author URI: http://www.jidaikobo.com/ 11 11 thx: https://github.com/trentrichardson/jQuery-Timepicker-Addon/tree/master/src 12 12 License: GPL2 13 13 14 Copyright 202 5jidaikobo (email: support@jidaikobo.com)14 Copyright 2026 jidaikobo (email: support@jidaikobo.com) 15 15 16 16 This program is free software; you can redistribute it and/or modify -
dashi/trunk/readme.txt
r3358366 r3437610 3 3 Donate link: http://www.jidaikobo.com/donate.html 4 4 Tags: custom field, custom post type 5 Tested up to: 6. 8.26 Stable tag: 3.3. 05 Tested up to: 6.9.0 6 Stable tag: 3.3.1 7 7 License: GPLv2 or later 8 8 License URI: https://www.gnu.org/licenses/gpl-2.0.html 9 Requires PHP: 5.49 Requires PHP: 7.0 10 10 11 11 Useful classes for creating a custom post type. Creates Page Parts custom post type. Designed for theme developers. … … 43 43 == Changelog == 44 44 45 = 3.3.1 = 46 fix: resolve custom field options lazily to avoid undefined array key warnings 47 fix: stabilize handling of options in select / radio / checkbox fields 48 note: minimum required PHP version is now 7.0 49 45 50 = 3.3.0 = 46 51 add tiny class to seach template
Note: See TracChangeset
for help on using the changeset viewer.