PluginProbe
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster / 1.1.4
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster v1.1.4
2.7.0 2.6.0 trunk 1.1.0 1.1.4 1.2.1 1.2.2 1.2.3 1.2.5 1.2.9 1.3.1 1.3.2 1.5.0 1.5.1 1.5.4 1.5.7 1.5.8 1.5.9 1.6.2 1.6.5 1.6.8 1.7.2 1.7.4 1.7.5 1.7.9 All 43 releases
sellkit / includes / dynamic-keywords / keywords / keyword-base.php

keyword-base.php in SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster 1.1.4, at includes/dynamic-keywords/keywords/keyword-base.php

109 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 defined( 'ABSPATH' ) || die();
4 /**
5 * Tag Base.
6 *
7 * @since 1.1.0
8 */
9 abstract class Tag_Base {
10
11 /**
12 * Order data.
13 *
14 * @var object
15 * @since 1.1.0
16 */
17 public static $order = null;
18
19 public function __construct() {
20 if ( ! is_wc_endpoint_url( 'order-received' ) ) {
21 return;
22 }
23 }
24
25 /**
26 * Get order data.
27 *
28 * @since 1.1.0
29 */
30 public function get_keyword_content() {
31 return $this->render_content();
32 }
33
34 /**
35 * Get shortcode default data.
36 *
37 * @since 1.1.0
38 * @param array $atts shortcode attributes.
39 */
40 public function shortcode_content( $atts ) {
41 $atts = shortcode_atts( [
42 'fallback' => '',
43 ], $atts );
44
45 return $atts['fallback'];
46 }
47
48 /**
49 * Get shortcode default data.
50 *
51 * @since 1.1.0
52 */
53 public function get_data() {
54 $order_key = filter_input( INPUT_GET, 'order-key', FILTER_SANITIZE_STRING );
55
56 if ( empty( $order_key ) ) {
57 return;
58 }
59
60 $order_id = wc_get_order_id_by_order_key( $order_key );
61
62 $this::$order = wc_get_order( $order_id );
63
64 return $this::$order;
65 }
66
67 /**
68 * Get Keywords type.
69 *
70 * @since 1.1.0
71 */
72 public static function get_keywords_type() {
73 return 'order_keyword';
74 }
75
76 /**
77 * Get keyword id.
78 *
79 * @since 1.1.0
80 * @access public
81 * @abstract
82 *
83 * @return string
84 */
85 abstract public function get_id();
86
87 /**
88 * Get keyword title.
89 *
90 * @since 1.1.0
91 * @access public
92 * @abstract
93 *
94 * @return string
95 */
96 abstract public function get_title();
97
98 /**
99 * Render content.
100 *
101 * @since 1.1.0
102 * @access public
103 * @abstract
104 *
105 * @return string
106 */
107 abstract public function render_content();
108 }
109