| @@ 91-106 (lines=16) @@ | ||
| 88 | * @param array|callable $options |
|
| 89 | * @return array |
|
| 90 | */ |
|
| 91 | protected function parse_options( $options ) { |
|
| 92 | $parsed = array(); |
|
| 93 | ||
| 94 | if ( is_callable( $options ) ) { |
|
| 95 | $options = call_user_func( $options ); |
|
| 96 | } |
|
| 97 | ||
| 98 | foreach ( $options as $key => $value ) { |
|
| 99 | $parsed[] = array( |
|
| 100 | 'label' => $value, |
|
| 101 | 'value' => $key, |
|
| 102 | ); |
|
| 103 | } |
|
| 104 | ||
| 105 | return $parsed; |
|
| 106 | } |
|
| 107 | } |
|
| 108 | ||
| @@ 107-122 (lines=16) @@ | ||
| 104 | * @param array|callable $options |
|
| 105 | * @return array |
|
| 106 | */ |
|
| 107 | protected function parse_options( $options ) { |
|
| 108 | $parsed = array(); |
|
| 109 | ||
| 110 | if ( is_callable( $options ) ) { |
|
| 111 | $options = call_user_func( $options ); |
|
| 112 | } |
|
| 113 | ||
| 114 | foreach ( $options as $key => $value ) { |
|
| 115 | $parsed[] = array( |
|
| 116 | 'name' => $value, |
|
| 117 | 'value' => $key, |
|
| 118 | ); |
|
| 119 | } |
|
| 120 | ||
| 121 | return $parsed; |
|
| 122 | } |
|
| 123 | } |
|
| 124 | ||