PluginProbe
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster / 2.7.0
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster v2.7.0
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
← All changes | includes/contact-segmentation/functions.php +27 -0 1.3.22.7.0 View file →
@@ -1,5 +1,6 @@
1 1 <?php
2 +defined( 'ABSPATH' ) || exit;
2 3
3 4 use Sellkit\Contact_Segmentation\Conditions;
4 5
5 6 /**
@@ -12,8 +13,12 @@
12 13 */
13 14 function sellkit_condition_match( $condition_name, $operator_name, $condition_value ) {
14 15 $condition_value = apply_filters( "sellkit_cs_conditions_value_{$condition_name}", $condition_value );
15 16
17 + if ( ! class_exists( 'Conditions' ) ) {
18 + require_once __DIR__ . '/conditions.php';
19 + new Conditions();
20 + }
16 21 return Conditions::match( $condition_name, $operator_name, $condition_value );
17 22 }
18 23
19 24 /**
@@ -107,5 +112,27 @@
107 112 return $_SERVER['HTTP_X_FORWARDED_FOR'];
108 113 }
109 114
110 115 return $_SERVER['REMOTE_ADDR'];
116 +}
117 +
118 +/**
119 + * Gets contact's column value.
120 + *
121 + * @since 1.5.0
122 + * @param string $column Column name.
123 + * @return mixed|string|void
124 + */
125 +function sellkit_get_funnel_contact_value_by_column( $column ) {
126 + $results = [];
127 + $contacts = sellkit()->db->get( 'funnel_contact', [
128 + 'user_id' => get_current_user_id()
129 + ] );
130 +
131 + foreach ( $contacts as $contact ) {
132 + if ( ! empty( $contact[ $column ] ) ) {
133 + $results[] = unserialize( $contact[ $column ] )[0]; // phpcs:ignore
134 + }
135 + }
136 +
137 + return $results;
111 138 }