/var/www/html_uk/wp-content/plugins/automatewoo/includes/Variables/Order_Meta_Date.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php

namespace AutomateWoo;

defined'ABSPATH' ) || exit;

/**
 * @class Variable_Order_Meta_Date
 */
class Variable_Order_Meta_Date extends Variable_Abstract_Datetime {

    
/**
     * Load admin details.
     */
    
public function load_admin_details() {
        
$this->add_parameter_text_field'key'__'The meta_key of the field you would like to display.''automatewoo' ), true );
        
parent::load_admin_details();
        
$this->description  _x"Displays the value of a date-based meta field in your site's timezone. The meta field must be stored in UTC time in MYSQL or UNIX timestamp format."'data type e.g. order, product''automatewoo' );
        
$this->description .= ' ' $this->_desc_format_tip;
    }


    
/**
     * @param \WC_Order $order
     * @param array     $parameters
     * @return string|bool
     */
    
public function get_value$order$parameters ) {
        if ( ! 
$parameters['key'] ) {
            return 
false;
        }

        
$value Clean::string$order->get_meta$parameters['key'] ) );

        return 
$this->format_datetime$value$parameterstrue );
    }
}