/** * 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(); } } } } }
public function init_admin_menu() { $this->_menu_under_settings = $this->bridge->apply_filters('bwp_menus_under_settings', false); $this->bridge->add_filter('plugin_action_links', array($this, 'plugin_action_links'), 10, 2); if ($this->is_admin_page()) { // build tabs $this->build_tabs(); $asset_url = $this->plugin_wp_url . 'vendor/kminh/bwp-framework/assets/option-page'; // enqueue style sheets and scripts for the option page $this->enqueue_media_file('bwp-option-page', $asset_url . '/css/style.css', self::is_multisite() || class_exists('JCP_UseGoogleLibraries') ? array('wp-admin') : array(), $this->revision, $asset_url . '/dist/css/op.min.css'); $this->enqueue_media_file('bwp-paypal-js', $asset_url . '/js/paypal.js', array('jquery'), $this->revision, $asset_url . '/js/paypal.js'); } $this->build_menus(); }