| @@ -102,13 +102,15 @@ | ||
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | $this->set_db_row(); |
| 105 | 105 | |
| 106 | - if ( $this->has_db_row() ) { | |
| 107 | - $this->set_field_key(); | |
| 108 | - $this->set_field_settings(); | |
| 109 | - $this->set_options(); | |
| 106 | + if ( ! $this->has_db_row() ) { | |
| 107 | + return; | |
| 110 | 108 | } |
| 109 | + | |
| 110 | + $this->set_field_key(); | |
| 111 | + $this->set_field_settings(); | |
| 112 | + $this->set_options(); | |
| 111 | 113 | } |
| 112 | 114 | |
| 113 | 115 | /** |
| 114 | 116 | * Set the db_row property |
| @@ -279,9 +281,9 @@ | ||
| 279 | 281 | protected function display_dropdown() { |
| 280 | 282 | echo '<select name="' . esc_attr( $this->html_name ) . '">'; |
| 281 | 283 | echo '<option value="">' . esc_html( $this->blank_option_label ) . '</option>'; |
| 282 | 284 | |
| 283 | - if ( ! empty( $this->options ) ) { | |
| 285 | + if ( $this->options ) { | |
| 284 | 286 | $truncate = $this->truncate ?? 25; |
| 285 | 287 | |
| 286 | 288 | foreach ( $this->options as $key => $value ) { |
| 287 | 289 | // phpcs:ignore Universal.Operators.StrictComparisons |