getSettings(); $settings = apply_filters( 'f12_cf7_doubleoptin_ui_' . $this->slug . '_before_on_save', $settings ); $settings = $this->onSave( $settings ); $settings = apply_filters( 'f12_cf7_doubleoptin_ui_' . $this->slug . '_after_on_save', $settings ); $this->save( $settings ); Messages::getInstance()->add( __( 'Settings updated', 'double-opt-in' ), 'success' ); } } /** * Save the settings. * * @param array $settings The settings to be saved. * * @return void * @private WordPress HOOK */ protected function save( array $settings ) { update_option( 'f12-doi-settings', $settings ); do_action( 'f12_cf7_doubleoptin_ui_' . $this->slug . '_after_save', $settings ); } /** * Option to hide the submit button * * @param bool $hide * * @return void */ protected function hideSubmitButton( $hide ) { $this->hide_submit_button = $hide; } /** * Returns true if the button should be hidden. * * @return bool */ protected function isSubmitButtonHidden() { return $this->hide_submit_button; } /** * Update the settings and return them * * @param $settings * * @return array */ protected abstract function onSave( $settings ); /** * @return void * @private WordPress HOOK */ public function renderContent( $slug, $page ) { if ( $this->slug != $page ) { return; } $this->maybeSave(); $settings = CF7DoubleOptIn::getInstance()->getSettings(); echo Messages::getInstance()->getAll(); ?>