| 1 |
<?php |
| 2 |
/** |
| 3 |
* CartFlows Step Meta Base |
| 4 |
* |
| 5 |
* @package CartFlows |
| 6 |
* @since 1.0.0 |
| 7 |
*/ |
| 8 |
|
| 9 |
// Exit if accessed directly. |
| 10 |
if ( ! defined( 'ABSPATH' ) ) { |
| 11 |
exit; |
| 12 |
} |
| 13 |
/** |
| 14 |
* CartFlows_Meta |
| 15 |
* |
| 16 |
* @since 1.0.0 |
| 17 |
*/ |
| 18 |
abstract class Cartflows_Step_Meta_Base { |
| 19 |
|
| 20 |
/** |
| 21 |
* Step ID |
| 22 |
* |
| 23 |
* @var $step_id |
| 24 |
*/ |
| 25 |
private $step_id; |
| 26 |
|
| 27 |
/** |
| 28 |
* Options |
| 29 |
* |
| 30 |
* @var $options |
| 31 |
*/ |
| 32 |
private $options; |
| 33 |
|
| 34 |
/** |
| 35 |
* Constructor |
| 36 |
* |
| 37 |
* @since 1.0.0 |
| 38 |
*/ |
| 39 |
public function __construct() { |
| 40 |
} |
| 41 |
|
| 42 |
/** |
| 43 |
* Get step settings |
| 44 |
* |
| 45 |
* @param int $step_id post ID. |
| 46 |
* @param array $options options. |
| 47 |
*/ |
| 48 |
abstract public function get_settings( $step_id, $options = array() ); |
| 49 |
|
| 50 |
|
| 51 |
/** |
| 52 |
* Get Common Tabs. |
| 53 |
*/ |
| 54 |
public function common_tabs() { |
| 55 |
|
| 56 |
$tabs = array( |
| 57 |
'design' => array( |
| 58 |
'title' => __( 'Design', 'cartflows' ), |
| 59 |
'id' => 'design', |
| 60 |
'class' => '', |
| 61 |
'icon' => 'dashicons-info', |
| 62 |
'priority' => 60, |
| 63 |
), |
| 64 |
); |
| 65 |
|
| 66 |
return $tabs; |
| 67 |
|
| 68 |
} |
| 69 |
|
| 70 |
/** |
| 71 |
* Script Settings |
| 72 |
* |
| 73 |
* @param array $options options. |
| 74 |
* @param int $post_id post ID. |
| 75 |
*/ |
| 76 |
public function custom_script( $options, $post_id ) { |
| 77 |
|
| 78 |
$fields = array( |
| 79 |
'custom-script' => array( |
| 80 |
'label' => __( 'Custom Script', 'cartflows' ), |
| 81 |
'name' => 'custom-script', |
| 82 |
'help' => esc_html__( 'Custom script lets you add your own custom script on front end of this flow page.', 'cartflows' ), |
| 83 |
), |
| 84 |
); |
| 85 |
|
| 86 |
return $fields; |
| 87 |
|
| 88 |
} |
| 89 |
} |
| 90 |
|