PluginProbe ʕ •ᴥ•ʔ
Robin Image Optimizer – Unlimited Image Optimization, WebP & AVIF / trunk
Robin Image Optimizer – Unlimited Image Optimization, WebP & AVIF vtrunk
2.0.5 trunk 1.3.7 1.4.0 1.4.1 1.4.2 1.4.6 1.5.0 1.5.3 1.5.6 1.5.8 1.6.5 1.6.6 1.6.9 1.7.0 1.7.4 1.8.1 1.8.2 1.9.0 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4
robin-image-optimizer / libs / factory / templates / pages / setup-parts / class-step.php
robin-image-optimizer / libs / factory / templates / pages / setup-parts Last commit date
class-step-custom.php 5 months ago class-step-form.php 5 months ago class-step.php 5 months ago
class-step.php
73 lines
1 <?php
2
3 namespace WBCR\Factory_Templates_759\Pages;
4
5 /**
6 * Step
7 *
8 * @version 1.0
9 */
10 abstract class Step {
11
12 protected $id;
13
14 protected $prev_id = false;
15 protected $next_id = false;
16
17 /**
18 * @var \WBCR\Factory_Templates_759\Pages\Setup
19 */
20 protected $page;
21
22 /**
23 * @var \Wbcr_Factory600_Plugin
24 */
25 protected $plugin;
26
27 public function __construct( \WBCR\Factory_Templates_759\Pages\Setup $page ) {
28 $this->page = $page;
29 $this->plugin = $page->plugin;
30 // $this->form_handler();
31 }
32
33 public function get_id() {
34 if ( empty( $this->id ) ) {
35 throw new \Exception( 'Step ID setting is required for the {' . static::class . '} class!' );
36 }
37
38 return $this->id;
39 }
40
41 public function get_next_id() {
42 return $this->next_id;
43 }
44
45 /**
46 * Requests assets (js and css) for the page.
47 *
48 * @return void
49 * @since 1.0.0
50 * @see FactoryPages600_AdminPage
51 */
52 public function assets( $scripts, $styles ) {
53 // nothing
54 }
55
56 protected function continue_step( $skip = false ) {
57 $next_id = $this->get_next_id();
58 if ( ! $next_id ) {
59 $next_id = $this->get_id();
60 }
61 wp_safe_redirect( $this->page->getActionUrl( $next_id ) );
62 die();
63 }
64
65 protected function skip_step() {
66 $this->continue_step( true );
67 }
68
69 abstract public function get_title();
70
71 abstract public function html();
72 }
73