| @@ -41,12 +41,12 @@ | ||
| 41 | 41 | /** |
| 42 | 42 | * The controller data. It will handle the options from multiple instances of the controller |
| 43 | 43 | * |
| 44 | 44 | * @var array Option data { |
| 45 | + * | |
| 45 | 46 | * @type array $options_data[ '[instance1-option_name_provided_via-->config-option-name]' ] { |
| 46 | 47 | * @type string $execution-frequency Values example: '1 day' | '10 days' | '1 week' | '10 weeks' | '1 month' | '10 months' | '1 year' | '10 years' |
| 47 | 48 | * } |
| 48 | - * | |
| 49 | 49 | * @type array $options_data[ '[instance2-option_name_provided_via-->config-option-name]' ] { |
| 50 | 50 | * @type string $execution-frequency Values example: '1 day' | '10 days' | '1 week' | '10 weeks' | '1 month' | '10 months' | '1 year' | '10 years' |
| 51 | 51 | * } |
| 52 | 52 | * } |
| @@ -52,8 +52,11 @@ | ||
| 52 | 52 | * } |
| 53 | 53 | */ |
| 54 | 54 | private $options_data = array(); |
| 55 | 55 | |
| 56 | + /** | |
| 57 | + * @param array $config | |
| 58 | + */ | |
| 56 | 59 | public function __construct( $config = array() ) { |
| 57 | 60 | if ( ! isset( $config['config-option-name'] ) || ! isset( $config['execution-frequency'] ) ) { |
| 58 | 61 | return; |
| 59 | 62 | } |
| @@ -127,9 +130,9 @@ | ||
| 127 | 130 | * |
| 128 | 131 | * @return void |
| 129 | 132 | */ |
| 130 | 133 | private function update_options_data() { |
| 131 | - update_option( $this->option_meta_name, $this->options_data, 'no' ); | |
| 134 | + update_option( $this->option_meta_name, $this->options_data, false ); | |
| 132 | 135 | } |
| 133 | 136 | |
| 134 | 137 | /** |
| 135 | 138 | * Open overlay. |
| @@ -144,8 +147,9 @@ | ||
| 144 | 147 | * @type string $buttons[]['url'] URL for the button. |
| 145 | 148 | * @type string $buttons[]['target'] Target attribute for the button link. |
| 146 | 149 | * @type string $buttons[]['label'] Label/text of the button. |
| 147 | 150 | * } |
| 151 | + * | |
| 148 | 152 | * @return bool |
| 149 | 153 | */ |
| 150 | 154 | public function open_overlay( $data = array() ) { |
| 151 | 155 | if ( true === $this->recurring_execution ) { |