/** * Listen for POST requests and process them * * @action admin_init */ public function submit() { $nonce = filter_input(INPUT_POST, 'wpem_step_nonce'); $name = filter_input(INPUT_POST, 'wpem_step_name'); if (false === wp_verify_nonce($nonce, sprintf('wpem_step_nonce-%s-%d', $name, get_current_user_id()))) { return; } $step = $this->get_step_by('name', $name); if (!$step) { return; } $took = filter_input(INPUT_POST, 'wpem_step_took'); if ($took) { $log = new WPEM_Log(); $log->add_step_time($took); } $step->callback(); $next_step = wpem_get_next_step(); if ($next_step) { update_option('wpem_last_viewed', $next_step->name); wp_safe_redirect($next_step->url); exit; } new WPEM_Done(); wp_safe_redirect(wpem_get_customizer_url()); exit; }
/** * Step actions */ public function actions() { ?> <a href="<?php echo esc_url(wpem_get_next_step()->url); ?> " type="submit" class="button button-secondary"><?php _e('Skip', 'wp-easy-mode'); ?> </a> <input type="submit" class="button button-primary" value="<?php esc_attr_e('Continue', 'wp-easy-mode'); ?> "> <?php }