/** * Handles all kinds of form actions, including the default submit action * * @since rev 144 */ public function handle_form_actions() { // handle the default submit action if (isset($_POST['submit_' . $this->get_form_name()])) { // add a notice and allow redirection only when the form is // submitted successully if ($this->submit_html_form()) { // allow plugin to choose to not redirect $redirect = $this->bridge->apply_filters('bwp_option_page_action_submitted', true); if ($redirect !== false) { $this->plugin->add_notice_flash($this->bridge->t('All options have been saved.', $this->domain)); $this->plugin->safe_redirect(); } } } else { foreach ($this->form_actions as $action) { if (isset($_POST[$action])) { // basic security check $this->bridge->check_admin_referer($this->form_name); $redirect = $this->bridge->apply_filters('bwp_option_page_custom_action_' . $action, true, $action); if ($redirect !== false) { $this->plugin->safe_redirect(); } } } } }