@@ -14,87 +14,87 @@ |
||
14 | 14 | { |
15 | 15 | |
16 | 16 | |
17 | - /** |
|
18 | - * @deprecated 4.9.53 |
|
19 | - * @param EE_Request $request |
|
20 | - * @param EE_Response $response |
|
21 | - * @return EE_Response |
|
22 | - */ |
|
23 | - public function handle_request(EE_Request $request, EE_Response $response) |
|
24 | - { |
|
25 | - $this->_request = $request; |
|
26 | - $this->_response = $response; |
|
27 | - $this->display_alpha_banner_warning(); |
|
28 | - $this->_response = $this->process_request_stack($this->_request, $this->_response); |
|
29 | - return $this->_response; |
|
30 | - } |
|
17 | + /** |
|
18 | + * @deprecated 4.9.53 |
|
19 | + * @param EE_Request $request |
|
20 | + * @param EE_Response $response |
|
21 | + * @return EE_Response |
|
22 | + */ |
|
23 | + public function handle_request(EE_Request $request, EE_Response $response) |
|
24 | + { |
|
25 | + $this->_request = $request; |
|
26 | + $this->_response = $response; |
|
27 | + $this->display_alpha_banner_warning(); |
|
28 | + $this->_response = $this->process_request_stack($this->_request, $this->_response); |
|
29 | + return $this->_response; |
|
30 | + } |
|
31 | 31 | |
32 | 32 | |
33 | - /** |
|
34 | - * @deprecated |
|
35 | - * @return string |
|
36 | - */ |
|
37 | - public function display_alpha_banner_warning() |
|
38 | - { |
|
39 | - EE_Error::doing_it_wrong( |
|
40 | - __METHOD__, |
|
41 | - sprintf( |
|
42 | - esc_html__( |
|
43 | - 'This method is deprecated. Please use %1$s instead. All Event Espresso request stack classes have been moved to %2$s and are now under the %3$s namespace', |
|
44 | - 'event_espresso' |
|
45 | - ), |
|
46 | - 'EventEspresso\core\services\request\middleware\PreProductionVersionWarning::displayPreProductionVersionWarning()', |
|
47 | - '\core\services\request', |
|
48 | - 'EventEspresso\core\services\request' |
|
49 | - ), |
|
50 | - '4.9.52', |
|
51 | - '4.10.0' |
|
52 | - ); |
|
53 | - } |
|
33 | + /** |
|
34 | + * @deprecated |
|
35 | + * @return string |
|
36 | + */ |
|
37 | + public function display_alpha_banner_warning() |
|
38 | + { |
|
39 | + EE_Error::doing_it_wrong( |
|
40 | + __METHOD__, |
|
41 | + sprintf( |
|
42 | + esc_html__( |
|
43 | + 'This method is deprecated. Please use %1$s instead. All Event Espresso request stack classes have been moved to %2$s and are now under the %3$s namespace', |
|
44 | + 'event_espresso' |
|
45 | + ), |
|
46 | + 'EventEspresso\core\services\request\middleware\PreProductionVersionWarning::displayPreProductionVersionWarning()', |
|
47 | + '\core\services\request', |
|
48 | + 'EventEspresso\core\services\request' |
|
49 | + ), |
|
50 | + '4.9.52', |
|
51 | + '4.10.0' |
|
52 | + ); |
|
53 | + } |
|
54 | 54 | |
55 | 55 | |
56 | - /** |
|
57 | - * @deprecated |
|
58 | - * @return void |
|
59 | - */ |
|
60 | - public function alpha_banner_admin_notice() |
|
61 | - { |
|
62 | - EE_Error::doing_it_wrong( |
|
63 | - __METHOD__, |
|
64 | - sprintf( |
|
65 | - esc_html__( |
|
66 | - 'This method is deprecated. Please use %1$s instead. All Event Espresso request stack classes have been moved to %2$s and are now under the %3$s namespace', |
|
67 | - 'event_espresso' |
|
68 | - ), |
|
69 | - 'EventEspresso\core\services\request\middleware\PreProductionVersionWarning::preProductionVersionAdminNotice()', |
|
70 | - '\core\services\request', |
|
71 | - 'EventEspresso\core\services\request' |
|
72 | - ), |
|
73 | - '4.9.52', |
|
74 | - '4.10.0' |
|
75 | - ); |
|
76 | - } |
|
56 | + /** |
|
57 | + * @deprecated |
|
58 | + * @return void |
|
59 | + */ |
|
60 | + public function alpha_banner_admin_notice() |
|
61 | + { |
|
62 | + EE_Error::doing_it_wrong( |
|
63 | + __METHOD__, |
|
64 | + sprintf( |
|
65 | + esc_html__( |
|
66 | + 'This method is deprecated. Please use %1$s instead. All Event Espresso request stack classes have been moved to %2$s and are now under the %3$s namespace', |
|
67 | + 'event_espresso' |
|
68 | + ), |
|
69 | + 'EventEspresso\core\services\request\middleware\PreProductionVersionWarning::preProductionVersionAdminNotice()', |
|
70 | + '\core\services\request', |
|
71 | + 'EventEspresso\core\services\request' |
|
72 | + ), |
|
73 | + '4.9.52', |
|
74 | + '4.10.0' |
|
75 | + ); |
|
76 | + } |
|
77 | 77 | |
78 | 78 | |
79 | - /** |
|
80 | - * @deprecated |
|
81 | - * @return void |
|
82 | - */ |
|
83 | - public function alpha_banner_warning_notice() |
|
84 | - { |
|
85 | - EE_Error::doing_it_wrong( |
|
86 | - __METHOD__, |
|
87 | - sprintf( |
|
88 | - esc_html__( |
|
89 | - 'This method is deprecated. Please use %1$s instead. All Event Espresso request stack classes have been moved to %2$s and are now under the %3$s namespace', |
|
90 | - 'event_espresso' |
|
91 | - ), |
|
92 | - 'EventEspresso\core\services\request\middleware\PreProductionVersionWarning::preProductionVersionWarningNotice()', |
|
93 | - '\core\services\request', |
|
94 | - 'EventEspresso\core\services\request' |
|
95 | - ), |
|
96 | - '4.9.52', |
|
97 | - '4.10.0' |
|
98 | - ); |
|
99 | - } |
|
79 | + /** |
|
80 | + * @deprecated |
|
81 | + * @return void |
|
82 | + */ |
|
83 | + public function alpha_banner_warning_notice() |
|
84 | + { |
|
85 | + EE_Error::doing_it_wrong( |
|
86 | + __METHOD__, |
|
87 | + sprintf( |
|
88 | + esc_html__( |
|
89 | + 'This method is deprecated. Please use %1$s instead. All Event Espresso request stack classes have been moved to %2$s and are now under the %3$s namespace', |
|
90 | + 'event_espresso' |
|
91 | + ), |
|
92 | + 'EventEspresso\core\services\request\middleware\PreProductionVersionWarning::preProductionVersionWarningNotice()', |
|
93 | + '\core\services\request', |
|
94 | + 'EventEspresso\core\services\request' |
|
95 | + ), |
|
96 | + '4.9.52', |
|
97 | + '4.10.0' |
|
98 | + ); |
|
99 | + } |
|
100 | 100 | } |
@@ -14,78 +14,78 @@ |
||
14 | 14 | { |
15 | 15 | |
16 | 16 | |
17 | - /** |
|
18 | - * load_espresso_addons |
|
19 | - * runs during the WP 'plugins_loaded' action at priority 1 |
|
20 | - * and is the initial loading phase for EE addons |
|
21 | - * no other logic should be performed at this point |
|
22 | - */ |
|
23 | - public static function load_espresso_addons() |
|
24 | - { |
|
25 | - do_action('AHEE__EE_Bootstrap__load_espresso_addons'); |
|
26 | - } |
|
17 | + /** |
|
18 | + * load_espresso_addons |
|
19 | + * runs during the WP 'plugins_loaded' action at priority 1 |
|
20 | + * and is the initial loading phase for EE addons |
|
21 | + * no other logic should be performed at this point |
|
22 | + */ |
|
23 | + public static function load_espresso_addons() |
|
24 | + { |
|
25 | + do_action('AHEE__EE_Bootstrap__load_espresso_addons'); |
|
26 | + } |
|
27 | 27 | |
28 | 28 | |
29 | - /** |
|
30 | - * detect_activations_or_upgrades |
|
31 | - * runs during the WP 'plugins_loaded' action at priority 3 |
|
32 | - * Now that all of the addons have been loaded, |
|
33 | - * we can determine if anything needs activating or upgrading |
|
34 | - */ |
|
35 | - public static function detect_activations_or_upgrades() |
|
36 | - { |
|
37 | - do_action('AHEE__EE_Bootstrap__detect_activations_or_upgrades'); |
|
38 | - } |
|
29 | + /** |
|
30 | + * detect_activations_or_upgrades |
|
31 | + * runs during the WP 'plugins_loaded' action at priority 3 |
|
32 | + * Now that all of the addons have been loaded, |
|
33 | + * we can determine if anything needs activating or upgrading |
|
34 | + */ |
|
35 | + public static function detect_activations_or_upgrades() |
|
36 | + { |
|
37 | + do_action('AHEE__EE_Bootstrap__detect_activations_or_upgrades'); |
|
38 | + } |
|
39 | 39 | |
40 | 40 | |
41 | - /** |
|
42 | - * load_core_configuration |
|
43 | - * runs during the WP 'plugins_loaded' action at priority 5 |
|
44 | - * Now that the database is assumed to be at the correct version |
|
45 | - * we can load and set all of the system configurations |
|
46 | - */ |
|
47 | - public static function load_core_configuration() |
|
48 | - { |
|
49 | - do_action('AHEE__EE_Bootstrap__load_core_configuration'); |
|
50 | - } |
|
41 | + /** |
|
42 | + * load_core_configuration |
|
43 | + * runs during the WP 'plugins_loaded' action at priority 5 |
|
44 | + * Now that the database is assumed to be at the correct version |
|
45 | + * we can load and set all of the system configurations |
|
46 | + */ |
|
47 | + public static function load_core_configuration() |
|
48 | + { |
|
49 | + do_action('AHEE__EE_Bootstrap__load_core_configuration'); |
|
50 | + } |
|
51 | 51 | |
52 | 52 | |
53 | - /** |
|
54 | - * register_shortcodes_modules_and_widgets |
|
55 | - * runs during the WP 'plugins_loaded' action at priority 7 |
|
56 | - * and handles registering all o four shortcodes, modules and widgets |
|
57 | - * so that they are ready to be used throughout the system |
|
58 | - */ |
|
59 | - public static function register_shortcodes_modules_and_widgets() |
|
60 | - { |
|
61 | - do_action('AHEE__EE_Bootstrap__register_shortcodes_modules_and_widgets'); |
|
62 | - } |
|
53 | + /** |
|
54 | + * register_shortcodes_modules_and_widgets |
|
55 | + * runs during the WP 'plugins_loaded' action at priority 7 |
|
56 | + * and handles registering all o four shortcodes, modules and widgets |
|
57 | + * so that they are ready to be used throughout the system |
|
58 | + */ |
|
59 | + public static function register_shortcodes_modules_and_widgets() |
|
60 | + { |
|
61 | + do_action('AHEE__EE_Bootstrap__register_shortcodes_modules_and_widgets'); |
|
62 | + } |
|
63 | 63 | |
64 | 64 | |
65 | - /** |
|
66 | - * brew_espresso |
|
67 | - * runs during the WP 'plugins_loaded' action at priority 9 |
|
68 | - * bootstrapping is considered complete at this point, |
|
69 | - * so let the fun begin... |
|
70 | - */ |
|
71 | - public static function brew_espresso() |
|
72 | - { |
|
73 | - do_action('AHEE__EE_Bootstrap__brew_espresso'); |
|
74 | - } |
|
65 | + /** |
|
66 | + * brew_espresso |
|
67 | + * runs during the WP 'plugins_loaded' action at priority 9 |
|
68 | + * bootstrapping is considered complete at this point, |
|
69 | + * so let the fun begin... |
|
70 | + */ |
|
71 | + public static function brew_espresso() |
|
72 | + { |
|
73 | + do_action('AHEE__EE_Bootstrap__brew_espresso'); |
|
74 | + } |
|
75 | 75 | |
76 | 76 | |
77 | - /** |
|
78 | - * @deprecated 4.9.53 |
|
79 | - */ |
|
80 | - public function run_request_stack() |
|
81 | - { |
|
82 | - } |
|
77 | + /** |
|
78 | + * @deprecated 4.9.53 |
|
79 | + */ |
|
80 | + public function run_request_stack() |
|
81 | + { |
|
82 | + } |
|
83 | 83 | |
84 | 84 | |
85 | - /** |
|
86 | - * @deprecated 4.9.53 |
|
87 | - */ |
|
88 | - public function build_request_stack() |
|
89 | - { |
|
90 | - } |
|
85 | + /** |
|
86 | + * @deprecated 4.9.53 |
|
87 | + */ |
|
88 | + public function build_request_stack() |
|
89 | + { |
|
90 | + } |
|
91 | 91 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | return htmlspecialchars($string); |
47 | 47 | } else { |
48 | 48 | if ($translate === false) { |
49 | - return self::ee_tep_parse_input_field_data($string, array( '"' => '"' )); |
|
49 | + return self::ee_tep_parse_input_field_data($string, array('"' => '"')); |
|
50 | 50 | } else { |
51 | 51 | return self::ee_tep_parse_input_field_data($string, $translate); |
52 | 52 | } |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | return false; |
85 | 85 | } |
86 | 86 | } else { |
87 | - if (( $value !== '' ) && ( strtolower($value) !== 'null' ) && ( strlen(trim($value)) > 0 )) { |
|
87 | + if (($value !== '') && (strtolower($value) !== 'null') && (strlen(trim($value)) > 0)) { |
|
88 | 88 | return true; |
89 | 89 | } else { |
90 | 90 | return false; |
@@ -12,108 +12,108 @@ |
||
12 | 12 | { |
13 | 13 | |
14 | 14 | |
15 | - /** |
|
16 | - * _admin_format_content |
|
17 | - * Text formatting function for wp_editor. |
|
18 | - * This should fix all of the formatting issues of text output from the database. |
|
19 | - * |
|
20 | - * @static |
|
21 | - * @access public |
|
22 | - * @param string $content content to format |
|
23 | - * @return string formatted content |
|
24 | - */ |
|
25 | - public static function admin_format_content($content = '') |
|
26 | - { |
|
27 | - return wpautop(stripslashes_deep(html_entity_decode($content, ENT_QUOTES, "UTF-8"))); |
|
28 | - } |
|
15 | + /** |
|
16 | + * _admin_format_content |
|
17 | + * Text formatting function for wp_editor. |
|
18 | + * This should fix all of the formatting issues of text output from the database. |
|
19 | + * |
|
20 | + * @static |
|
21 | + * @access public |
|
22 | + * @param string $content content to format |
|
23 | + * @return string formatted content |
|
24 | + */ |
|
25 | + public static function admin_format_content($content = '') |
|
26 | + { |
|
27 | + return wpautop(stripslashes_deep(html_entity_decode($content, ENT_QUOTES, "UTF-8"))); |
|
28 | + } |
|
29 | 29 | |
30 | 30 | |
31 | 31 | |
32 | - /** |
|
33 | - * ee_tep_output_string |
|
34 | - * todo: we need a description for this. |
|
35 | - * |
|
36 | - * @static |
|
37 | - * @access public |
|
38 | - * @param string $string string to handle |
|
39 | - * @param boolean $translate //todo what is this for? |
|
40 | - * @param boolean $protected true then we run htmlspecialchars and return |
|
41 | - * @return string |
|
42 | - */ |
|
43 | - public static function ee_tep_output_string($string, $translate = false, $protected = false) |
|
44 | - { |
|
45 | - if ($protected === true) { |
|
46 | - return htmlspecialchars($string); |
|
47 | - } else { |
|
48 | - if ($translate === false) { |
|
49 | - return self::ee_tep_parse_input_field_data($string, array( '"' => '"' )); |
|
50 | - } else { |
|
51 | - return self::ee_tep_parse_input_field_data($string, $translate); |
|
52 | - } |
|
53 | - } |
|
54 | - } |
|
32 | + /** |
|
33 | + * ee_tep_output_string |
|
34 | + * todo: we need a description for this. |
|
35 | + * |
|
36 | + * @static |
|
37 | + * @access public |
|
38 | + * @param string $string string to handle |
|
39 | + * @param boolean $translate //todo what is this for? |
|
40 | + * @param boolean $protected true then we run htmlspecialchars and return |
|
41 | + * @return string |
|
42 | + */ |
|
43 | + public static function ee_tep_output_string($string, $translate = false, $protected = false) |
|
44 | + { |
|
45 | + if ($protected === true) { |
|
46 | + return htmlspecialchars($string); |
|
47 | + } else { |
|
48 | + if ($translate === false) { |
|
49 | + return self::ee_tep_parse_input_field_data($string, array( '"' => '"' )); |
|
50 | + } else { |
|
51 | + return self::ee_tep_parse_input_field_data($string, $translate); |
|
52 | + } |
|
53 | + } |
|
54 | + } |
|
55 | 55 | |
56 | 56 | |
57 | 57 | |
58 | - /** |
|
59 | - * ee_tep_parse_input_field_data |
|
60 | - * |
|
61 | - * @param string $data string to be "translated" |
|
62 | - * @param array ] $parse array in the form array( 'from' => 'to', ... ) |
|
63 | - * @return string |
|
64 | - */ |
|
65 | - public static function ee_tep_parse_input_field_data($data, $parse) |
|
66 | - { |
|
67 | - return strtr(trim($data), $parse); |
|
68 | - } |
|
58 | + /** |
|
59 | + * ee_tep_parse_input_field_data |
|
60 | + * |
|
61 | + * @param string $data string to be "translated" |
|
62 | + * @param array ] $parse array in the form array( 'from' => 'to', ... ) |
|
63 | + * @return string |
|
64 | + */ |
|
65 | + public static function ee_tep_parse_input_field_data($data, $parse) |
|
66 | + { |
|
67 | + return strtr(trim($data), $parse); |
|
68 | + } |
|
69 | 69 | |
70 | 70 | |
71 | 71 | |
72 | - /** |
|
73 | - * [ee_tep_not_null description] |
|
74 | - * |
|
75 | - * @param string | array $value [description] |
|
76 | - * @return bool [description] |
|
77 | - */ |
|
78 | - public static function ee_tep_not_null($value) |
|
79 | - { |
|
80 | - if (is_array($value)) { |
|
81 | - if (count($value) > 0) { |
|
82 | - return true; |
|
83 | - } else { |
|
84 | - return false; |
|
85 | - } |
|
86 | - } else { |
|
87 | - if (( $value !== '' ) && ( strtolower($value) !== 'null' ) && ( strlen(trim($value)) > 0 )) { |
|
88 | - return true; |
|
89 | - } else { |
|
90 | - return false; |
|
91 | - } |
|
92 | - } |
|
93 | - } |
|
72 | + /** |
|
73 | + * [ee_tep_not_null description] |
|
74 | + * |
|
75 | + * @param string | array $value [description] |
|
76 | + * @return bool [description] |
|
77 | + */ |
|
78 | + public static function ee_tep_not_null($value) |
|
79 | + { |
|
80 | + if (is_array($value)) { |
|
81 | + if (count($value) > 0) { |
|
82 | + return true; |
|
83 | + } else { |
|
84 | + return false; |
|
85 | + } |
|
86 | + } else { |
|
87 | + if (( $value !== '' ) && ( strtolower($value) !== 'null' ) && ( strlen(trim($value)) > 0 )) { |
|
88 | + return true; |
|
89 | + } else { |
|
90 | + return false; |
|
91 | + } |
|
92 | + } |
|
93 | + } |
|
94 | 94 | |
95 | 95 | |
96 | 96 | |
97 | - /** |
|
98 | - * Formats a date |
|
99 | - * |
|
100 | - * @param string $date |
|
101 | - * @param string $format - format for the date |
|
102 | - * @deprecated 4.6.12 Note, a search revealed this was not used anywhere in core or in our |
|
103 | - * addons at time of writing this. So just deprecated in case of third party use. |
|
104 | - * @return string |
|
105 | - * @deprecated v4.6.21 |
|
106 | - */ |
|
107 | - public static function event_date_display($date, $format = '') |
|
108 | - { |
|
109 | - EE_Error::doing_it_wrong( |
|
110 | - __METHOD__, |
|
111 | - esc_html__( |
|
112 | - 'This method is deprecated as of EE 4.6.12. Currently it does not reformat as with prior behaviour but just returns the incoming string. Please use the EE_Datetime helpers for Datetime on the event to display as desired.', |
|
113 | - 'event_espresso' |
|
114 | - ), |
|
115 | - '4.6.21' |
|
116 | - ); |
|
117 | - return $date; |
|
118 | - } |
|
97 | + /** |
|
98 | + * Formats a date |
|
99 | + * |
|
100 | + * @param string $date |
|
101 | + * @param string $format - format for the date |
|
102 | + * @deprecated 4.6.12 Note, a search revealed this was not used anywhere in core or in our |
|
103 | + * addons at time of writing this. So just deprecated in case of third party use. |
|
104 | + * @return string |
|
105 | + * @deprecated v4.6.21 |
|
106 | + */ |
|
107 | + public static function event_date_display($date, $format = '') |
|
108 | + { |
|
109 | + EE_Error::doing_it_wrong( |
|
110 | + __METHOD__, |
|
111 | + esc_html__( |
|
112 | + 'This method is deprecated as of EE 4.6.12. Currently it does not reformat as with prior behaviour but just returns the incoming string. Please use the EE_Datetime helpers for Datetime on the event to display as desired.', |
|
113 | + 'event_espresso' |
|
114 | + ), |
|
115 | + '4.6.21' |
|
116 | + ); |
|
117 | + return $date; |
|
118 | + } |
|
119 | 119 | } |
@@ -11,42 +11,42 @@ |
||
11 | 11 | class EEH_Base |
12 | 12 | { |
13 | 13 | |
14 | - /** |
|
15 | - * @var array $uri_segment_array URL segments |
|
16 | - * @access private |
|
17 | - */ |
|
14 | + /** |
|
15 | + * @var array $uri_segment_array URL segments |
|
16 | + * @access private |
|
17 | + */ |
|
18 | 18 | // final private function __construct() {} |
19 | 19 | |
20 | - /** |
|
21 | - * @ override magic methods |
|
22 | - * @ return void |
|
23 | - */ |
|
24 | - public function __set($a, $b) |
|
25 | - { |
|
26 | - return false; |
|
27 | - } |
|
28 | - public function __get($a) |
|
29 | - { |
|
30 | - return false; |
|
31 | - } |
|
32 | - public function __isset($a) |
|
33 | - { |
|
34 | - return false; |
|
35 | - } |
|
36 | - public function __unset($a) |
|
37 | - { |
|
38 | - return false; |
|
39 | - } |
|
40 | - public function __clone() |
|
41 | - { |
|
42 | - return false; |
|
43 | - } |
|
44 | - public function __wakeup() |
|
45 | - { |
|
46 | - return false; |
|
47 | - } |
|
48 | - public function __destruct() |
|
49 | - { |
|
50 | - return false; |
|
51 | - } |
|
20 | + /** |
|
21 | + * @ override magic methods |
|
22 | + * @ return void |
|
23 | + */ |
|
24 | + public function __set($a, $b) |
|
25 | + { |
|
26 | + return false; |
|
27 | + } |
|
28 | + public function __get($a) |
|
29 | + { |
|
30 | + return false; |
|
31 | + } |
|
32 | + public function __isset($a) |
|
33 | + { |
|
34 | + return false; |
|
35 | + } |
|
36 | + public function __unset($a) |
|
37 | + { |
|
38 | + return false; |
|
39 | + } |
|
40 | + public function __clone() |
|
41 | + { |
|
42 | + return false; |
|
43 | + } |
|
44 | + public function __wakeup() |
|
45 | + { |
|
46 | + return false; |
|
47 | + } |
|
48 | + public function __destruct() |
|
49 | + { |
|
50 | + return false; |
|
51 | + } |
|
52 | 52 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | ), |
38 | 38 | $money_value |
39 | 39 | ); |
40 | - $money_value = filter_var( |
|
40 | + $money_value = filter_var( |
|
41 | 41 | $money_value, |
42 | 42 | FILTER_SANITIZE_NUMBER_FLOAT, |
43 | 43 | FILTER_FLAG_ALLOW_FRACTION |
@@ -165,9 +165,9 @@ discard block |
||
165 | 165 | $format = 'f'; |
166 | 166 | $currency_config = $currency_config = EEH_Money::get_currency_config($CNT_ISO); |
167 | 167 | // first get the decimal place and number of places |
168 | - $format = "%'." . $currency_config->dec_plc . $format; |
|
168 | + $format = "%'.".$currency_config->dec_plc.$format; |
|
169 | 169 | // currency symbol on right side. |
170 | - $format = $currency_config->sign_b4 ? $currency_config->sign . $format : $format . $currency_config->sign; |
|
170 | + $format = $currency_config->sign_b4 ? $currency_config->sign.$format : $format.$currency_config->sign; |
|
171 | 171 | return $format; |
172 | 172 | } |
173 | 173 | |
@@ -187,10 +187,10 @@ discard block |
||
187 | 187 | $currency_config = EEH_Money::get_currency_config($CNT_ISO); |
188 | 188 | $decimal_places_placeholder = str_pad('', $currency_config->dec_plc, '0'); |
189 | 189 | // first get the decimal place and number of places |
190 | - $format = '#,##0.' . $decimal_places_placeholder; |
|
190 | + $format = '#,##0.'.$decimal_places_placeholder; |
|
191 | 191 | // currency symbol on right side. |
192 | - $format = $currency_config->sign_b4 |
|
193 | - ? $currency_config->sign . $format |
|
192 | + $format = $currency_config->sign_b4 |
|
193 | + ? $currency_config->sign.$format |
|
194 | 194 | : $format |
195 | 195 | . $currency_config->sign; |
196 | 196 | $formatterObject = array( |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | ? new EE_Currency_Config($CNT_ISO) |
223 | 223 | : null; |
224 | 224 | // default currency settings for site if not set |
225 | - if (! $currency_config instanceof EE_Currency_Config) { |
|
225 | + if ( ! $currency_config instanceof EE_Currency_Config) { |
|
226 | 226 | $currency_config = EE_Registry::instance()->CFG->currency instanceof EE_Currency_Config |
227 | 227 | ? EE_Registry::instance()->CFG->currency |
228 | 228 | : new EE_Currency_Config(); |
@@ -12,221 +12,221 @@ |
||
12 | 12 | class EEH_Money extends EEH_Base |
13 | 13 | { |
14 | 14 | |
15 | - /** |
|
16 | - * This removes all localized money formatting from the incoming value |
|
17 | - * Note: uses this site's currency settings for deciding what is considered a |
|
18 | - * "thousands separator" (usually the character "," ) |
|
19 | - * and what is a "decimal mark" (usually the character ".") |
|
20 | - * |
|
21 | - * @param int|float|string $money_value |
|
22 | - * @param string $CNT_ISO |
|
23 | - * @return float |
|
24 | - * @throws EE_Error |
|
25 | - */ |
|
26 | - public static function strip_localized_money_formatting($money_value, $CNT_ISO = '') |
|
27 | - { |
|
28 | - $currency_config = EEH_Money::get_currency_config($CNT_ISO); |
|
29 | - $money_value = str_replace( |
|
30 | - array( |
|
31 | - $currency_config->thsnds, |
|
32 | - $currency_config->dec_mrk, |
|
33 | - ), |
|
34 | - array( |
|
35 | - '', // remove thousands separator |
|
36 | - '.', // convert decimal mark to what PHP expects |
|
37 | - ), |
|
38 | - $money_value |
|
39 | - ); |
|
40 | - $money_value = filter_var( |
|
41 | - $money_value, |
|
42 | - FILTER_SANITIZE_NUMBER_FLOAT, |
|
43 | - FILTER_FLAG_ALLOW_FRACTION |
|
44 | - ); |
|
45 | - return $money_value; |
|
46 | - } |
|
15 | + /** |
|
16 | + * This removes all localized money formatting from the incoming value |
|
17 | + * Note: uses this site's currency settings for deciding what is considered a |
|
18 | + * "thousands separator" (usually the character "," ) |
|
19 | + * and what is a "decimal mark" (usually the character ".") |
|
20 | + * |
|
21 | + * @param int|float|string $money_value |
|
22 | + * @param string $CNT_ISO |
|
23 | + * @return float |
|
24 | + * @throws EE_Error |
|
25 | + */ |
|
26 | + public static function strip_localized_money_formatting($money_value, $CNT_ISO = '') |
|
27 | + { |
|
28 | + $currency_config = EEH_Money::get_currency_config($CNT_ISO); |
|
29 | + $money_value = str_replace( |
|
30 | + array( |
|
31 | + $currency_config->thsnds, |
|
32 | + $currency_config->dec_mrk, |
|
33 | + ), |
|
34 | + array( |
|
35 | + '', // remove thousands separator |
|
36 | + '.', // convert decimal mark to what PHP expects |
|
37 | + ), |
|
38 | + $money_value |
|
39 | + ); |
|
40 | + $money_value = filter_var( |
|
41 | + $money_value, |
|
42 | + FILTER_SANITIZE_NUMBER_FLOAT, |
|
43 | + FILTER_FLAG_ALLOW_FRACTION |
|
44 | + ); |
|
45 | + return $money_value; |
|
46 | + } |
|
47 | 47 | |
48 | 48 | |
49 | - /** |
|
50 | - * This converts an incoming localized money value into a standard float item (to three decimal places) |
|
51 | - * Only use this if you know the $money_value follows your currency configuration's |
|
52 | - * settings. Note: this uses this site's currency settings for deciding what is considered a |
|
53 | - * "thousands separator" (usually the character "," ) |
|
54 | - * and what is a "decimal mark" (usually the character ".") |
|
55 | - * |
|
56 | - * @param int|string $money_value |
|
57 | - * @return float |
|
58 | - * @throws EE_Error |
|
59 | - */ |
|
60 | - public static function convert_to_float_from_localized_money($money_value) |
|
61 | - { |
|
62 | - // float it! and round to three decimal places |
|
63 | - return round((float) EEH_Money::strip_localized_money_formatting($money_value), 3); |
|
64 | - } |
|
49 | + /** |
|
50 | + * This converts an incoming localized money value into a standard float item (to three decimal places) |
|
51 | + * Only use this if you know the $money_value follows your currency configuration's |
|
52 | + * settings. Note: this uses this site's currency settings for deciding what is considered a |
|
53 | + * "thousands separator" (usually the character "," ) |
|
54 | + * and what is a "decimal mark" (usually the character ".") |
|
55 | + * |
|
56 | + * @param int|string $money_value |
|
57 | + * @return float |
|
58 | + * @throws EE_Error |
|
59 | + */ |
|
60 | + public static function convert_to_float_from_localized_money($money_value) |
|
61 | + { |
|
62 | + // float it! and round to three decimal places |
|
63 | + return round((float) EEH_Money::strip_localized_money_formatting($money_value), 3); |
|
64 | + } |
|
65 | 65 | |
66 | 66 | |
67 | - /** |
|
68 | - * For comparing floats. Default operator is '=', but see the $operator below for all options. |
|
69 | - * This should be used to compare floats instead of normal '==' because floats |
|
70 | - * are inherently imprecise, and so you can sometimes have two floats that appear to be identical |
|
71 | - * but actually differ by 0.00000001. |
|
72 | - * |
|
73 | - * @see http://biostall.com/php-function-to-compare-floating-point-numbers |
|
74 | - * @param float $float1 |
|
75 | - * @param float $float2 |
|
76 | - * @param string $operator The operator. Valid options are =, <=, <, >=, >, <>, eq, lt, lte, gt, gte, ne |
|
77 | - * @return bool whether the equation is true or false |
|
78 | - * @throws EE_Error |
|
79 | - */ |
|
80 | - public static function compare_floats($float1, $float2, $operator = '=') |
|
81 | - { |
|
82 | - // Check numbers to 5 digits of precision |
|
83 | - $epsilon = 0.00001; |
|
84 | - $float1 = (float) $float1; |
|
85 | - $float2 = (float) $float2; |
|
86 | - switch ($operator) { |
|
87 | - // equal |
|
88 | - case "=": |
|
89 | - case "==": |
|
90 | - case "===": |
|
91 | - case "eq": |
|
92 | - if (abs($float1 - $float2) < $epsilon) { |
|
93 | - return true; |
|
94 | - } |
|
95 | - break; |
|
96 | - // less than |
|
97 | - case "<": |
|
98 | - case "lt": |
|
99 | - if (abs($float1 - $float2) < $epsilon) { |
|
100 | - return false; |
|
101 | - } else { |
|
102 | - if ($float1 < $float2) { |
|
103 | - return true; |
|
104 | - } |
|
105 | - } |
|
106 | - break; |
|
107 | - // less than or equal |
|
108 | - case "<=": |
|
109 | - case "lte": |
|
110 | - if (self::compare_floats($float1, $float2, '<') || self::compare_floats($float1, $float2, '=')) { |
|
111 | - return true; |
|
112 | - } |
|
113 | - break; |
|
114 | - // greater than |
|
115 | - case ">": |
|
116 | - case "gt": |
|
117 | - if (abs($float1 - $float2) < $epsilon) { |
|
118 | - return false; |
|
119 | - } else { |
|
120 | - if ($float1 > $float2) { |
|
121 | - return true; |
|
122 | - } |
|
123 | - } |
|
124 | - break; |
|
125 | - // greater than or equal |
|
126 | - case ">=": |
|
127 | - case "gte": |
|
128 | - if (self::compare_floats($float1, $float2, '>') || self::compare_floats($float1, $float2, '=')) { |
|
129 | - return true; |
|
130 | - } |
|
131 | - break; |
|
132 | - case "<>": |
|
133 | - case "!=": |
|
134 | - case "ne": |
|
135 | - if (abs($float1 - $float2) > $epsilon) { |
|
136 | - return true; |
|
137 | - } |
|
138 | - break; |
|
139 | - default: |
|
140 | - throw new EE_Error( |
|
141 | - sprintf( |
|
142 | - esc_html__( |
|
143 | - "Unknown operator %s in EEH_Money::compare_floats()", |
|
144 | - 'event_espresso' |
|
145 | - ), |
|
146 | - $operator |
|
147 | - ) |
|
148 | - ); |
|
149 | - } |
|
150 | - return false; |
|
151 | - } |
|
67 | + /** |
|
68 | + * For comparing floats. Default operator is '=', but see the $operator below for all options. |
|
69 | + * This should be used to compare floats instead of normal '==' because floats |
|
70 | + * are inherently imprecise, and so you can sometimes have two floats that appear to be identical |
|
71 | + * but actually differ by 0.00000001. |
|
72 | + * |
|
73 | + * @see http://biostall.com/php-function-to-compare-floating-point-numbers |
|
74 | + * @param float $float1 |
|
75 | + * @param float $float2 |
|
76 | + * @param string $operator The operator. Valid options are =, <=, <, >=, >, <>, eq, lt, lte, gt, gte, ne |
|
77 | + * @return bool whether the equation is true or false |
|
78 | + * @throws EE_Error |
|
79 | + */ |
|
80 | + public static function compare_floats($float1, $float2, $operator = '=') |
|
81 | + { |
|
82 | + // Check numbers to 5 digits of precision |
|
83 | + $epsilon = 0.00001; |
|
84 | + $float1 = (float) $float1; |
|
85 | + $float2 = (float) $float2; |
|
86 | + switch ($operator) { |
|
87 | + // equal |
|
88 | + case "=": |
|
89 | + case "==": |
|
90 | + case "===": |
|
91 | + case "eq": |
|
92 | + if (abs($float1 - $float2) < $epsilon) { |
|
93 | + return true; |
|
94 | + } |
|
95 | + break; |
|
96 | + // less than |
|
97 | + case "<": |
|
98 | + case "lt": |
|
99 | + if (abs($float1 - $float2) < $epsilon) { |
|
100 | + return false; |
|
101 | + } else { |
|
102 | + if ($float1 < $float2) { |
|
103 | + return true; |
|
104 | + } |
|
105 | + } |
|
106 | + break; |
|
107 | + // less than or equal |
|
108 | + case "<=": |
|
109 | + case "lte": |
|
110 | + if (self::compare_floats($float1, $float2, '<') || self::compare_floats($float1, $float2, '=')) { |
|
111 | + return true; |
|
112 | + } |
|
113 | + break; |
|
114 | + // greater than |
|
115 | + case ">": |
|
116 | + case "gt": |
|
117 | + if (abs($float1 - $float2) < $epsilon) { |
|
118 | + return false; |
|
119 | + } else { |
|
120 | + if ($float1 > $float2) { |
|
121 | + return true; |
|
122 | + } |
|
123 | + } |
|
124 | + break; |
|
125 | + // greater than or equal |
|
126 | + case ">=": |
|
127 | + case "gte": |
|
128 | + if (self::compare_floats($float1, $float2, '>') || self::compare_floats($float1, $float2, '=')) { |
|
129 | + return true; |
|
130 | + } |
|
131 | + break; |
|
132 | + case "<>": |
|
133 | + case "!=": |
|
134 | + case "ne": |
|
135 | + if (abs($float1 - $float2) > $epsilon) { |
|
136 | + return true; |
|
137 | + } |
|
138 | + break; |
|
139 | + default: |
|
140 | + throw new EE_Error( |
|
141 | + sprintf( |
|
142 | + esc_html__( |
|
143 | + "Unknown operator %s in EEH_Money::compare_floats()", |
|
144 | + 'event_espresso' |
|
145 | + ), |
|
146 | + $operator |
|
147 | + ) |
|
148 | + ); |
|
149 | + } |
|
150 | + return false; |
|
151 | + } |
|
152 | 152 | |
153 | 153 | |
154 | - /** |
|
155 | - * This returns a localized format string suitable for jQplot. |
|
156 | - * |
|
157 | - * @param string $CNT_ISO If this is provided, then will attempt to get the currency settings for the country. |
|
158 | - * Otherwise will use currency settings for current active country on site. |
|
159 | - * @return string |
|
160 | - * @throws EE_Error |
|
161 | - */ |
|
162 | - public static function get_format_for_jqplot($CNT_ISO = '') |
|
163 | - { |
|
164 | - // default format |
|
165 | - $format = 'f'; |
|
166 | - $currency_config = $currency_config = EEH_Money::get_currency_config($CNT_ISO); |
|
167 | - // first get the decimal place and number of places |
|
168 | - $format = "%'." . $currency_config->dec_plc . $format; |
|
169 | - // currency symbol on right side. |
|
170 | - $format = $currency_config->sign_b4 ? $currency_config->sign . $format : $format . $currency_config->sign; |
|
171 | - return $format; |
|
172 | - } |
|
154 | + /** |
|
155 | + * This returns a localized format string suitable for jQplot. |
|
156 | + * |
|
157 | + * @param string $CNT_ISO If this is provided, then will attempt to get the currency settings for the country. |
|
158 | + * Otherwise will use currency settings for current active country on site. |
|
159 | + * @return string |
|
160 | + * @throws EE_Error |
|
161 | + */ |
|
162 | + public static function get_format_for_jqplot($CNT_ISO = '') |
|
163 | + { |
|
164 | + // default format |
|
165 | + $format = 'f'; |
|
166 | + $currency_config = $currency_config = EEH_Money::get_currency_config($CNT_ISO); |
|
167 | + // first get the decimal place and number of places |
|
168 | + $format = "%'." . $currency_config->dec_plc . $format; |
|
169 | + // currency symbol on right side. |
|
170 | + $format = $currency_config->sign_b4 ? $currency_config->sign . $format : $format . $currency_config->sign; |
|
171 | + return $format; |
|
172 | + } |
|
173 | 173 | |
174 | 174 | |
175 | - /** |
|
176 | - * This returns a localized format string suitable for usage with the Google Charts API format param. |
|
177 | - * |
|
178 | - * @param string $CNT_ISO If this is provided, then will attempt to get the currency settings for the country. |
|
179 | - * Otherwise will use currency settings for current active country on site. |
|
180 | - * Note: GoogleCharts uses ICU pattern set |
|
181 | - * (@see http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details) |
|
182 | - * @return string |
|
183 | - * @throws EE_Error |
|
184 | - */ |
|
185 | - public static function get_format_for_google_charts($CNT_ISO = '') |
|
186 | - { |
|
187 | - $currency_config = EEH_Money::get_currency_config($CNT_ISO); |
|
188 | - $decimal_places_placeholder = str_pad('', $currency_config->dec_plc, '0'); |
|
189 | - // first get the decimal place and number of places |
|
190 | - $format = '#,##0.' . $decimal_places_placeholder; |
|
191 | - // currency symbol on right side. |
|
192 | - $format = $currency_config->sign_b4 |
|
193 | - ? $currency_config->sign . $format |
|
194 | - : $format |
|
195 | - . $currency_config->sign; |
|
196 | - $formatterObject = array( |
|
197 | - 'decimalSymbol' => $currency_config->dec_mrk, |
|
198 | - 'groupingSymbol' => $currency_config->thsnds, |
|
199 | - 'fractionDigits' => $currency_config->dec_plc, |
|
200 | - ); |
|
201 | - if ($currency_config->sign_b4) { |
|
202 | - $formatterObject['prefix'] = $currency_config->sign; |
|
203 | - } else { |
|
204 | - $formatterObject['suffix'] = $currency_config->sign; |
|
205 | - } |
|
206 | - return array( |
|
207 | - 'format' => $format, |
|
208 | - 'formatterObject' => $formatterObject, |
|
209 | - ); |
|
210 | - } |
|
175 | + /** |
|
176 | + * This returns a localized format string suitable for usage with the Google Charts API format param. |
|
177 | + * |
|
178 | + * @param string $CNT_ISO If this is provided, then will attempt to get the currency settings for the country. |
|
179 | + * Otherwise will use currency settings for current active country on site. |
|
180 | + * Note: GoogleCharts uses ICU pattern set |
|
181 | + * (@see http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details) |
|
182 | + * @return string |
|
183 | + * @throws EE_Error |
|
184 | + */ |
|
185 | + public static function get_format_for_google_charts($CNT_ISO = '') |
|
186 | + { |
|
187 | + $currency_config = EEH_Money::get_currency_config($CNT_ISO); |
|
188 | + $decimal_places_placeholder = str_pad('', $currency_config->dec_plc, '0'); |
|
189 | + // first get the decimal place and number of places |
|
190 | + $format = '#,##0.' . $decimal_places_placeholder; |
|
191 | + // currency symbol on right side. |
|
192 | + $format = $currency_config->sign_b4 |
|
193 | + ? $currency_config->sign . $format |
|
194 | + : $format |
|
195 | + . $currency_config->sign; |
|
196 | + $formatterObject = array( |
|
197 | + 'decimalSymbol' => $currency_config->dec_mrk, |
|
198 | + 'groupingSymbol' => $currency_config->thsnds, |
|
199 | + 'fractionDigits' => $currency_config->dec_plc, |
|
200 | + ); |
|
201 | + if ($currency_config->sign_b4) { |
|
202 | + $formatterObject['prefix'] = $currency_config->sign; |
|
203 | + } else { |
|
204 | + $formatterObject['suffix'] = $currency_config->sign; |
|
205 | + } |
|
206 | + return array( |
|
207 | + 'format' => $format, |
|
208 | + 'formatterObject' => $formatterObject, |
|
209 | + ); |
|
210 | + } |
|
211 | 211 | |
212 | 212 | |
213 | - /** |
|
214 | - * @param string $CNT_ISO |
|
215 | - * @return EE_Currency_Config|null |
|
216 | - * @throws EE_Error |
|
217 | - */ |
|
218 | - public static function get_currency_config($CNT_ISO = '') |
|
219 | - { |
|
220 | - // if CNT_ISO passed lets try to get currency settings for it. |
|
221 | - $currency_config = $CNT_ISO !== '' |
|
222 | - ? new EE_Currency_Config($CNT_ISO) |
|
223 | - : null; |
|
224 | - // default currency settings for site if not set |
|
225 | - if (! $currency_config instanceof EE_Currency_Config) { |
|
226 | - $currency_config = EE_Registry::instance()->CFG->currency instanceof EE_Currency_Config |
|
227 | - ? EE_Registry::instance()->CFG->currency |
|
228 | - : new EE_Currency_Config(); |
|
229 | - } |
|
230 | - return $currency_config; |
|
231 | - } |
|
213 | + /** |
|
214 | + * @param string $CNT_ISO |
|
215 | + * @return EE_Currency_Config|null |
|
216 | + * @throws EE_Error |
|
217 | + */ |
|
218 | + public static function get_currency_config($CNT_ISO = '') |
|
219 | + { |
|
220 | + // if CNT_ISO passed lets try to get currency settings for it. |
|
221 | + $currency_config = $CNT_ISO !== '' |
|
222 | + ? new EE_Currency_Config($CNT_ISO) |
|
223 | + : null; |
|
224 | + // default currency settings for site if not set |
|
225 | + if (! $currency_config instanceof EE_Currency_Config) { |
|
226 | + $currency_config = EE_Registry::instance()->CFG->currency instanceof EE_Currency_Config |
|
227 | + ? EE_Registry::instance()->CFG->currency |
|
228 | + : new EE_Currency_Config(); |
|
229 | + } |
|
230 | + return $currency_config; |
|
231 | + } |
|
232 | 232 | } |
@@ -13,70 +13,70 @@ |
||
13 | 13 | { |
14 | 14 | |
15 | 15 | |
16 | - /** |
|
17 | - * $CPT - the current page, if it utilizes CPTs |
|
18 | - * |
|
19 | - * @var object |
|
20 | - * @access protected |
|
21 | - */ |
|
22 | - protected $CPT = null; |
|
16 | + /** |
|
17 | + * $CPT - the current page, if it utilizes CPTs |
|
18 | + * |
|
19 | + * @var object |
|
20 | + * @access protected |
|
21 | + */ |
|
22 | + protected $CPT = null; |
|
23 | 23 | |
24 | 24 | |
25 | - /** |
|
26 | - * class constructor |
|
27 | - * |
|
28 | - * @access private |
|
29 | - * @param array $arguments |
|
30 | - * @return \EE_CPT_Default_Strategy |
|
31 | - */ |
|
32 | - public function __construct($arguments = array()) |
|
33 | - { |
|
34 | - $this->CPT = isset($arguments['CPT']) ? $arguments['CPT'] : null; |
|
35 | - } |
|
25 | + /** |
|
26 | + * class constructor |
|
27 | + * |
|
28 | + * @access private |
|
29 | + * @param array $arguments |
|
30 | + * @return \EE_CPT_Default_Strategy |
|
31 | + */ |
|
32 | + public function __construct($arguments = array()) |
|
33 | + { |
|
34 | + $this->CPT = isset($arguments['CPT']) ? $arguments['CPT'] : null; |
|
35 | + } |
|
36 | 36 | |
37 | 37 | |
38 | - /** |
|
39 | - * pre_get_posts |
|
40 | - * |
|
41 | - * @access public |
|
42 | - * @param \WP_Query $WP_Query |
|
43 | - * @return \WP_Query |
|
44 | - */ |
|
45 | - public function pre_get_posts(WP_Query $WP_Query) |
|
46 | - { |
|
47 | - if (! $WP_Query->is_main_query() && ! $WP_Query->is_archive()) { |
|
48 | - return $WP_Query; |
|
49 | - } |
|
50 | - return $WP_Query; |
|
51 | - } |
|
38 | + /** |
|
39 | + * pre_get_posts |
|
40 | + * |
|
41 | + * @access public |
|
42 | + * @param \WP_Query $WP_Query |
|
43 | + * @return \WP_Query |
|
44 | + */ |
|
45 | + public function pre_get_posts(WP_Query $WP_Query) |
|
46 | + { |
|
47 | + if (! $WP_Query->is_main_query() && ! $WP_Query->is_archive()) { |
|
48 | + return $WP_Query; |
|
49 | + } |
|
50 | + return $WP_Query; |
|
51 | + } |
|
52 | 52 | |
53 | 53 | |
54 | - /** |
|
55 | - * wp |
|
56 | - * |
|
57 | - * @access public |
|
58 | - * @param \WP_Post[] $posts |
|
59 | - * @param \WP_Query $WP_Query |
|
60 | - * @return \WP_Post[] |
|
61 | - */ |
|
62 | - public function the_posts($posts, WP_Query $WP_Query) |
|
63 | - { |
|
64 | - return $posts; |
|
65 | - } |
|
54 | + /** |
|
55 | + * wp |
|
56 | + * |
|
57 | + * @access public |
|
58 | + * @param \WP_Post[] $posts |
|
59 | + * @param \WP_Query $WP_Query |
|
60 | + * @return \WP_Post[] |
|
61 | + */ |
|
62 | + public function the_posts($posts, WP_Query $WP_Query) |
|
63 | + { |
|
64 | + return $posts; |
|
65 | + } |
|
66 | 66 | |
67 | 67 | |
68 | - /** |
|
69 | - * get_EE_post_type_metadata |
|
70 | - * |
|
71 | - * @access public |
|
72 | - * @param mixed $meta_value |
|
73 | - * @param int $post_id |
|
74 | - * @param string $meta_key |
|
75 | - * @param string $single |
|
76 | - * @return mixed |
|
77 | - */ |
|
78 | - public function get_EE_post_type_metadata($meta_value = null, $post_id, $meta_key, $single) |
|
79 | - { |
|
80 | - return $meta_value; |
|
81 | - } |
|
68 | + /** |
|
69 | + * get_EE_post_type_metadata |
|
70 | + * |
|
71 | + * @access public |
|
72 | + * @param mixed $meta_value |
|
73 | + * @param int $post_id |
|
74 | + * @param string $meta_key |
|
75 | + * @param string $single |
|
76 | + * @return mixed |
|
77 | + */ |
|
78 | + public function get_EE_post_type_metadata($meta_value = null, $post_id, $meta_key, $single) |
|
79 | + { |
|
80 | + return $meta_value; |
|
81 | + } |
|
82 | 82 | } |
@@ -44,7 +44,7 @@ |
||
44 | 44 | */ |
45 | 45 | public function pre_get_posts(WP_Query $WP_Query) |
46 | 46 | { |
47 | - if (! $WP_Query->is_main_query() && ! $WP_Query->is_archive()) { |
|
47 | + if ( ! $WP_Query->is_main_query() && ! $WP_Query->is_archive()) { |
|
48 | 48 | return $WP_Query; |
49 | 49 | } |
50 | 50 | return $WP_Query; |
@@ -24,39 +24,39 @@ |
||
24 | 24 | class EE_CPT_Attendee_Strategy |
25 | 25 | { |
26 | 26 | |
27 | - /** |
|
28 | - * $CPT - the current page, if it utilizes CPTs |
|
29 | - * |
|
30 | - * @var array |
|
31 | - * @access protected |
|
32 | - */ |
|
33 | - protected $CPT = null; |
|
27 | + /** |
|
28 | + * $CPT - the current page, if it utilizes CPTs |
|
29 | + * |
|
30 | + * @var array |
|
31 | + * @access protected |
|
32 | + */ |
|
33 | + protected $CPT = null; |
|
34 | 34 | |
35 | 35 | |
36 | - /** |
|
37 | - * class constructor |
|
38 | - * |
|
39 | - * @access public |
|
40 | - * @param array $arguments |
|
41 | - * @return \EE_CPT_Attendee_Strategy |
|
42 | - */ |
|
43 | - public function __construct($arguments = array()) |
|
44 | - { |
|
45 | - $this->CPT = isset($arguments['CPT']) ? $arguments['CPT'] : null; |
|
46 | - $WP_Query = isset($arguments['WP_Query']) ? $arguments['WP_Query'] : null; |
|
47 | - } |
|
36 | + /** |
|
37 | + * class constructor |
|
38 | + * |
|
39 | + * @access public |
|
40 | + * @param array $arguments |
|
41 | + * @return \EE_CPT_Attendee_Strategy |
|
42 | + */ |
|
43 | + public function __construct($arguments = array()) |
|
44 | + { |
|
45 | + $this->CPT = isset($arguments['CPT']) ? $arguments['CPT'] : null; |
|
46 | + $WP_Query = isset($arguments['WP_Query']) ? $arguments['WP_Query'] : null; |
|
47 | + } |
|
48 | 48 | |
49 | 49 | |
50 | - /** |
|
51 | - * the_posts |
|
52 | - * |
|
53 | - * @access public |
|
54 | - * @param $posts |
|
55 | - * @param WP_Query $wp_query |
|
56 | - * @return void |
|
57 | - */ |
|
58 | - public function the_posts($posts, WP_Query $wp_query) |
|
59 | - { |
|
60 | - return $posts; |
|
61 | - } |
|
50 | + /** |
|
51 | + * the_posts |
|
52 | + * |
|
53 | + * @access public |
|
54 | + * @param $posts |
|
55 | + * @param WP_Query $wp_query |
|
56 | + * @return void |
|
57 | + */ |
|
58 | + public function the_posts($posts, WP_Query $wp_query) |
|
59 | + { |
|
60 | + return $posts; |
|
61 | + } |
|
62 | 62 | } |
@@ -60,7 +60,7 @@ |
||
60 | 60 | */ |
61 | 61 | public static function getInvalidCheckoutAccess() |
62 | 62 | { |
63 | - if (! self::$invalid_checkout_access_form instanceof InvalidCheckoutAccess) { |
|
63 | + if ( ! self::$invalid_checkout_access_form instanceof InvalidCheckoutAccess) { |
|
64 | 64 | self::$invalid_checkout_access_form = new InvalidCheckoutAccess(); |
65 | 65 | } |
66 | 66 | return self::$invalid_checkout_access_form; |
@@ -13,84 +13,84 @@ |
||
13 | 13 | class EED_Invalid_Checkout_Access extends EED_Module |
14 | 14 | { |
15 | 15 | |
16 | - /** |
|
17 | - * @var InvalidCheckoutAccess $invalid_checkout_access_form |
|
18 | - */ |
|
19 | - private static $invalid_checkout_access_form; |
|
16 | + /** |
|
17 | + * @var InvalidCheckoutAccess $invalid_checkout_access_form |
|
18 | + */ |
|
19 | + private static $invalid_checkout_access_form; |
|
20 | 20 | |
21 | - /** |
|
22 | - * set_hooks - for hooking into EE Core, other modules, etc |
|
23 | - */ |
|
24 | - public static function set_hooks() |
|
25 | - { |
|
26 | - } |
|
21 | + /** |
|
22 | + * set_hooks - for hooking into EE Core, other modules, etc |
|
23 | + */ |
|
24 | + public static function set_hooks() |
|
25 | + { |
|
26 | + } |
|
27 | 27 | |
28 | 28 | |
29 | - /** |
|
30 | - * set_hooks_admin - for hooking into EE Admin Core, other modules, etc |
|
31 | - */ |
|
32 | - public static function set_hooks_admin() |
|
33 | - { |
|
34 | - add_action( |
|
35 | - 'AHEE__Extend_Registration_Form_Admin_Page___reg_form_settings_template', |
|
36 | - array('EED_Invalid_Checkout_Access', 'display_invalid_checkout_access_form'), |
|
37 | - 15 |
|
38 | - ); |
|
39 | - add_filter( |
|
40 | - 'FHEE__Extend_Registration_Form_Admin_Page___update_reg_form_settings__CFG_registration', |
|
41 | - array('EED_Invalid_Checkout_Access', 'process_invalid_checkout_access_form') |
|
42 | - ); |
|
43 | - } |
|
29 | + /** |
|
30 | + * set_hooks_admin - for hooking into EE Admin Core, other modules, etc |
|
31 | + */ |
|
32 | + public static function set_hooks_admin() |
|
33 | + { |
|
34 | + add_action( |
|
35 | + 'AHEE__Extend_Registration_Form_Admin_Page___reg_form_settings_template', |
|
36 | + array('EED_Invalid_Checkout_Access', 'display_invalid_checkout_access_form'), |
|
37 | + 15 |
|
38 | + ); |
|
39 | + add_filter( |
|
40 | + 'FHEE__Extend_Registration_Form_Admin_Page___update_reg_form_settings__CFG_registration', |
|
41 | + array('EED_Invalid_Checkout_Access', 'process_invalid_checkout_access_form') |
|
42 | + ); |
|
43 | + } |
|
44 | 44 | |
45 | 45 | |
46 | - /** |
|
47 | - * run - initial module setup |
|
48 | - * this method is primarily used for activating resources in the EE_Front_Controller thru the use of filters |
|
49 | - * |
|
50 | - * @var WP $WP |
|
51 | - */ |
|
52 | - public function run($WP) |
|
53 | - { |
|
54 | - // TODO: Implement run() method. |
|
55 | - } |
|
46 | + /** |
|
47 | + * run - initial module setup |
|
48 | + * this method is primarily used for activating resources in the EE_Front_Controller thru the use of filters |
|
49 | + * |
|
50 | + * @var WP $WP |
|
51 | + */ |
|
52 | + public function run($WP) |
|
53 | + { |
|
54 | + // TODO: Implement run() method. |
|
55 | + } |
|
56 | 56 | |
57 | 57 | |
58 | - /** |
|
59 | - * @return InvalidCheckoutAccess |
|
60 | - */ |
|
61 | - public static function getInvalidCheckoutAccess() |
|
62 | - { |
|
63 | - if (! self::$invalid_checkout_access_form instanceof InvalidCheckoutAccess) { |
|
64 | - self::$invalid_checkout_access_form = new InvalidCheckoutAccess(); |
|
65 | - } |
|
66 | - return self::$invalid_checkout_access_form; |
|
67 | - } |
|
58 | + /** |
|
59 | + * @return InvalidCheckoutAccess |
|
60 | + */ |
|
61 | + public static function getInvalidCheckoutAccess() |
|
62 | + { |
|
63 | + if (! self::$invalid_checkout_access_form instanceof InvalidCheckoutAccess) { |
|
64 | + self::$invalid_checkout_access_form = new InvalidCheckoutAccess(); |
|
65 | + } |
|
66 | + return self::$invalid_checkout_access_form; |
|
67 | + } |
|
68 | 68 | |
69 | 69 | |
70 | - /** |
|
71 | - * email_validation_settings_form |
|
72 | - * |
|
73 | - * @return void |
|
74 | - * @throws EE_Error |
|
75 | - */ |
|
76 | - public static function display_invalid_checkout_access_form() |
|
77 | - { |
|
78 | - $invalid_checkout_access_form = EED_Invalid_Checkout_Access::getInvalidCheckoutAccess(); |
|
79 | - echo $invalid_checkout_access_form->getForm()->get_html(); // already escaped |
|
80 | - } |
|
70 | + /** |
|
71 | + * email_validation_settings_form |
|
72 | + * |
|
73 | + * @return void |
|
74 | + * @throws EE_Error |
|
75 | + */ |
|
76 | + public static function display_invalid_checkout_access_form() |
|
77 | + { |
|
78 | + $invalid_checkout_access_form = EED_Invalid_Checkout_Access::getInvalidCheckoutAccess(); |
|
79 | + echo $invalid_checkout_access_form->getForm()->get_html(); // already escaped |
|
80 | + } |
|
81 | 81 | |
82 | 82 | |
83 | - /** |
|
84 | - * email_validation_settings_form |
|
85 | - * |
|
86 | - * @param EE_Registration_Config $EE_Registration_Config |
|
87 | - * @return EE_Registration_Config |
|
88 | - * @throws EE_Error |
|
89 | - * @throws ReflectionException |
|
90 | - */ |
|
91 | - public static function process_invalid_checkout_access_form(EE_Registration_Config $EE_Registration_Config) |
|
92 | - { |
|
93 | - $invalid_checkout_access_form = EED_Invalid_Checkout_Access::getInvalidCheckoutAccess(); |
|
94 | - return $invalid_checkout_access_form->processForm($EE_Registration_Config); |
|
95 | - } |
|
83 | + /** |
|
84 | + * email_validation_settings_form |
|
85 | + * |
|
86 | + * @param EE_Registration_Config $EE_Registration_Config |
|
87 | + * @return EE_Registration_Config |
|
88 | + * @throws EE_Error |
|
89 | + * @throws ReflectionException |
|
90 | + */ |
|
91 | + public static function process_invalid_checkout_access_form(EE_Registration_Config $EE_Registration_Config) |
|
92 | + { |
|
93 | + $invalid_checkout_access_form = EED_Invalid_Checkout_Access::getInvalidCheckoutAccess(); |
|
94 | + return $invalid_checkout_access_form->processForm($EE_Registration_Config); |
|
95 | + } |
|
96 | 96 | } |
@@ -12,69 +12,69 @@ |
||
12 | 12 | { |
13 | 13 | |
14 | 14 | |
15 | - /** |
|
16 | - * @return EED_Csv |
|
17 | - */ |
|
18 | - public static function instance() |
|
19 | - { |
|
20 | - return parent::get_instance(__CLASS__); |
|
21 | - } |
|
15 | + /** |
|
16 | + * @return EED_Csv |
|
17 | + */ |
|
18 | + public static function instance() |
|
19 | + { |
|
20 | + return parent::get_instance(__CLASS__); |
|
21 | + } |
|
22 | 22 | |
23 | 23 | |
24 | - /** |
|
25 | - * set_hooks - for hooking into EE Core, other modules, etc |
|
26 | - * |
|
27 | - * @access public |
|
28 | - * @return void |
|
29 | - */ |
|
30 | - public static function set_hooks() |
|
31 | - { |
|
32 | - } |
|
24 | + /** |
|
25 | + * set_hooks - for hooking into EE Core, other modules, etc |
|
26 | + * |
|
27 | + * @access public |
|
28 | + * @return void |
|
29 | + */ |
|
30 | + public static function set_hooks() |
|
31 | + { |
|
32 | + } |
|
33 | 33 | |
34 | - /** |
|
35 | - * set_hooks_admin - for hooking into EE Admin Core, other modules, etc |
|
36 | - * |
|
37 | - * @access public |
|
38 | - * @return void |
|
39 | - */ |
|
40 | - public static function set_hooks_admin() |
|
41 | - { |
|
42 | - } |
|
34 | + /** |
|
35 | + * set_hooks_admin - for hooking into EE Admin Core, other modules, etc |
|
36 | + * |
|
37 | + * @access public |
|
38 | + * @return void |
|
39 | + */ |
|
40 | + public static function set_hooks_admin() |
|
41 | + { |
|
42 | + } |
|
43 | 43 | |
44 | 44 | |
45 | - /** |
|
46 | - * run - initial module setup |
|
47 | - * |
|
48 | - * @access public |
|
49 | - * @return void |
|
50 | - */ |
|
51 | - public function run($WP) |
|
52 | - { |
|
53 | - } |
|
45 | + /** |
|
46 | + * run - initial module setup |
|
47 | + * |
|
48 | + * @access public |
|
49 | + * @return void |
|
50 | + */ |
|
51 | + public function run($WP) |
|
52 | + { |
|
53 | + } |
|
54 | 54 | |
55 | 55 | |
56 | - /** |
|
57 | - * export |
|
58 | - * |
|
59 | - * @access public |
|
60 | - * @return void |
|
61 | - */ |
|
62 | - public function export() |
|
63 | - { |
|
64 | - $Export = EE_Registry::instance()->load_class('Export'); |
|
65 | - $Export->export(); |
|
66 | - } |
|
56 | + /** |
|
57 | + * export |
|
58 | + * |
|
59 | + * @access public |
|
60 | + * @return void |
|
61 | + */ |
|
62 | + public function export() |
|
63 | + { |
|
64 | + $Export = EE_Registry::instance()->load_class('Export'); |
|
65 | + $Export->export(); |
|
66 | + } |
|
67 | 67 | |
68 | 68 | |
69 | - /** |
|
70 | - * import |
|
71 | - * |
|
72 | - * @access public |
|
73 | - * @return void |
|
74 | - */ |
|
75 | - public function import() |
|
76 | - { |
|
77 | - $Import = EE_Registry::instance()->load_class('Import'); |
|
78 | - $Import->import(); |
|
79 | - } |
|
69 | + /** |
|
70 | + * import |
|
71 | + * |
|
72 | + * @access public |
|
73 | + * @return void |
|
74 | + */ |
|
75 | + public function import() |
|
76 | + { |
|
77 | + $Import = EE_Registry::instance()->load_class('Import'); |
|
78 | + $Import->import(); |
|
79 | + } |
|
80 | 80 | } |