|
|
@ -22,22 +22,17 @@ class Stepper |
|
|
add_action('wp_enqueue_scripts', [$this, 'enqueue']); |
|
|
add_action('wp_enqueue_scripts', [$this, 'enqueue']); |
|
|
add_action('wp_ajax_nopriv_stepper_submit', [$this, 'onSubmit']); |
|
|
add_action('wp_ajax_nopriv_stepper_submit', [$this, 'onSubmit']); |
|
|
add_action('wp_ajax_stepper_submit', [$this, 'onSubmit']); |
|
|
add_action('wp_ajax_stepper_submit', [$this, 'onSubmit']); |
|
|
add_action('wp_footer', [$this, 'enqueueOverwrite']); |
|
|
|
|
|
|
|
|
|
|
|
if (!is_admin()) { |
|
|
if (!is_admin()) { |
|
|
|
|
|
add_action('wp_footer', [$this, 'enqueueOverwrite']); |
|
|
add_shortcode('stepper', [$this, 'handle']); |
|
|
add_shortcode('stepper', [$this, 'handle']); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function enqueueOverwrite(): void |
|
|
public function enqueueOverwrite(): void |
|
|
{ |
|
|
{ |
|
|
if (is_admin()) { |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ob_start(); |
|
|
ob_start(); |
|
|
require(__DIR__ . '/../templates/overwrite.htm'); |
|
|
require(__DIR__ . '/../templates/overwrite.htm'); |
|
|
|
|
|
|
|
|
echo ob_get_clean(); |
|
|
echo ob_get_clean(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -49,7 +44,9 @@ class Stepper |
|
|
|
|
|
|
|
|
public function handle() |
|
|
public function handle() |
|
|
{ |
|
|
{ |
|
|
|
|
|
ob_start(); |
|
|
require(__DIR__ . '/../templates/stepper.htm'); |
|
|
require(__DIR__ . '/../templates/stepper.htm'); |
|
|
|
|
|
return ob_get_clean(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function validate($payload) |
|
|
public function validate($payload) |
|
|
|