| @@ 74-83 (lines=10) @@ | ||
| 71 | * @param bool $load Should the value be loaded from the database or use the value from the current instance. |
|
| 72 | * @return array |
|
| 73 | */ |
|
| 74 | public function to_json( $load ) { |
|
| 75 | $field_data = parent::to_json( $load ); |
|
| 76 | ||
| 77 | $field_data = array_merge( $field_data, array( |
|
| 78 | 'limit_options' => $this->limit_options, |
|
| 79 | 'options' => $this->parse_options( $this->get_options() ), |
|
| 80 | ) ); |
|
| 81 | ||
| 82 | return $field_data; |
|
| 83 | } |
|
| 84 | /** |
|
| 85 | * Changes the options array structure. This is needed to keep the array items order when it is JSON encoded. |
|
| 86 | * Will also work with a callable that returns an array. |
|
| @@ 74-83 (lines=10) @@ | ||
| 71 | * @param bool $load Should the value be loaded from the database or use the value from the current instance. |
|
| 72 | * @return array |
|
| 73 | */ |
|
| 74 | public function to_json( $load ) { |
|
| 75 | $field_data = parent::to_json( $load ); |
|
| 76 | ||
| 77 | $field_data = array_merge( $field_data, array( |
|
| 78 | 'limit_options' => $this->limit_options, |
|
| 79 | 'options' => $this->parse_options( $this->get_options() ), |
|
| 80 | ) ); |
|
| 81 | ||
| 82 | return $field_data; |
|
| 83 | } |
|
| 84 | } |
|
| 85 | ||