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
sellkit / includes / dynamic-keywords / keywords / order-custom-billing-field.php

order-custom-billing-field.php in SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster 2.7.0, at includes/dynamic-keywords/keywords/order-custom-billing-field.php

51 lines 911 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 class Order_Custom_Billing_Field extends Tag_Base {
4 /**
5 * Get class id.
6 *
7 * @return string
8 * @since 1.8.9
9 */
10 public function get_id() {
11 return '_order_custom_billing_field';
12 }
13
14 /**
15 * Get class title.
16 *
17 * @return string
18 * @since 1.8.9
19 */
20 public function get_title() {
21 return esc_html__( 'Custom Billing Field', 'sellkit' );
22 }
23
24 /**
25 * Render true content.
26 *
27 * @param array $atts Shortcode attributes.
28 * @return string
29 * @since 1.8.9
30 */
31 public function render_content( $atts ) {
32 $this->get_data();
33
34 if ( empty( self::$order ) ) {
35 return $this->shortcode_content( $atts );
36 }
37
38 $attributes = shortcode_atts( [
39 'field' => '',
40 ], $atts );
41
42 if ( empty( $attributes['field'] ) ) {
43 return $this->shortcode_content( $atts );
44 }
45
46 $meta_key = 'billing_' . $attributes['field'];
47
48 return get_post_meta( self::$order->get_id(), $meta_key, true );
49 }
50 }
51