| @@ -1,8 +1,5 @@ | ||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 3 | - die( 'You are not allowed to call this page directly.' ); | |
| 4 | -} | |
| 5 | 2 | |
| 6 | 3 | /** |
| 7 | 4 | * @since 2.03.05 |
| 8 | 5 | */ |
| @@ -35,9 +32,9 @@ | ||
| 35 | 32 | protected $option_label = ''; |
| 36 | 33 | |
| 37 | 34 | public function __construct( $option_key, $option, $args = array() ) { |
| 38 | 35 | $this->option_key = $option_key; |
| 39 | - $this->option = $option; | |
| 36 | + $this->option = $option; | |
| 40 | 37 | $this->set_option_label(); |
| 41 | 38 | $this->set_saved_value(); |
| 42 | 39 | } |
| 43 | 40 | |
| @@ -44,10 +41,8 @@ | ||
| 44 | 41 | /** |
| 45 | 42 | * Set the option label |
| 46 | 43 | * |
| 47 | 44 | * @since 2.03.05 |
| 48 | - * | |
| 49 | - * @return void | |
| 50 | 45 | */ |
| 51 | 46 | private function set_option_label() { |
| 52 | 47 | if ( is_array( $this->option ) ) { |
| 53 | 48 | $this->option_label = ( isset( $this->option['label'] ) ? $this->option['label'] : reset( $this->option ) ); |
| @@ -59,10 +54,8 @@ | ||
| 59 | 54 | /** |
| 60 | 55 | * Set the saved value |
| 61 | 56 | * |
| 62 | 57 | * @since 2.03.05 |
| 63 | - * | |
| 64 | - * @return void | |
| 65 | 58 | */ |
| 66 | 59 | protected function set_saved_value() { |
| 67 | 60 | $this->saved_value = $this->option_label; |
| 68 | 61 | } |
| @@ -73,10 +66,8 @@ | ||
| 73 | 66 | * @since 2.03.05 |
| 74 | 67 | * |
| 75 | 68 | * @param string $selected_value |
| 76 | 69 | * @param int $truncate |
| 77 | - * | |
| 78 | - * @return void | |
| 79 | 70 | */ |
| 80 | 71 | public function print_single_option( $selected_value, $truncate ) { |
| 81 | 72 | if ( '' !== $this->saved_value ) { |
| 82 | 73 | echo '<option value="' . esc_attr( $this->saved_value ) . '"'; |