@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | */ |
62 | 62 | public static function instance() { |
63 | 63 | // check if class object is instantiated, and instantiated properly |
64 | - if ( self::$_instance === NULL or ! is_object( self::$_instance ) or ! ( self::$_instance instanceof EE_Front_Controller )) { |
|
64 | + if (self::$_instance === NULL or ! is_object(self::$_instance) or ! (self::$_instance instanceof EE_Front_Controller)) { |
|
65 | 65 | self::$_instance = new self(); |
66 | 66 | } |
67 | 67 | return self::$_instance; |
@@ -79,37 +79,37 @@ discard block |
||
79 | 79 | */ |
80 | 80 | private function __construct() { |
81 | 81 | // make sure template tags are loaded immediately so that themes don't break |
82 | - add_action( 'AHEE__EE_System__core_loaded_and_ready', array( $this, 'load_espresso_template_tags' ), 10 ); |
|
82 | + add_action('AHEE__EE_System__core_loaded_and_ready', array($this, 'load_espresso_template_tags'), 10); |
|
83 | 83 | // determine how to integrate WP_Query with the EE models |
84 | - add_action( 'AHEE__EE_System__initialize', array( $this, 'employ_CPT_Strategy' )); |
|
84 | + add_action('AHEE__EE_System__initialize', array($this, 'employ_CPT_Strategy')); |
|
85 | 85 | // load other resources and begin to actually run shortcodes and modules |
86 | - add_action( 'wp_loaded', array( $this, 'wp_loaded' ), 5 ); |
|
86 | + add_action('wp_loaded', array($this, 'wp_loaded'), 5); |
|
87 | 87 | // analyse the incoming WP request |
88 | - add_action( 'parse_request', array( $this, 'get_request' ), 1, 1 ); |
|
88 | + add_action('parse_request', array($this, 'get_request'), 1, 1); |
|
89 | 89 | // process any content shortcodes |
90 | - add_action( 'parse_request', array( $this, '_initialize_shortcodes' ), 5 ); |
|
90 | + add_action('parse_request', array($this, '_initialize_shortcodes'), 5); |
|
91 | 91 | // process request with module factory |
92 | - add_action( 'pre_get_posts', array( $this, 'pre_get_posts' ), 10, 1 ); |
|
92 | + add_action('pre_get_posts', array($this, 'pre_get_posts'), 10, 1); |
|
93 | 93 | // before headers sent |
94 | - add_action( 'wp', array( $this, 'wp' ), 5 ); |
|
94 | + add_action('wp', array($this, 'wp'), 5); |
|
95 | 95 | // load css and js |
96 | - add_action('wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ), 1 ); |
|
96 | + add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts'), 1); |
|
97 | 97 | // header |
98 | - add_action('wp_head', array( $this, 'header_meta_tag' ), 5 ); |
|
99 | - add_filter( 'template_include', array( $this, 'template_include' ), 1 ); |
|
98 | + add_action('wp_head', array($this, 'header_meta_tag'), 5); |
|
99 | + add_filter('template_include', array($this, 'template_include'), 1); |
|
100 | 100 | // display errors |
101 | - add_action('loop_start', array( $this, 'display_errors' ), 2 ); |
|
101 | + add_action('loop_start', array($this, 'display_errors'), 2); |
|
102 | 102 | // the content |
103 | - add_filter( 'the_content', array( $this, 'the_content' ), 5, 1 ); |
|
103 | + add_filter('the_content', array($this, 'the_content'), 5, 1); |
|
104 | 104 | //exclude our private cpt comments |
105 | - add_filter( 'comments_clauses', array( $this, 'filter_wp_comments'), 10, 1 ); |
|
105 | + add_filter('comments_clauses', array($this, 'filter_wp_comments'), 10, 1); |
|
106 | 106 | //make sure any ajax requests will respect the url schema when requests are made against admin-ajax.php (http:// or https://) |
107 | - add_filter( 'admin_url', array( $this, 'maybe_force_admin_ajax_ssl' ), 200, 1 ); |
|
107 | + add_filter('admin_url', array($this, 'maybe_force_admin_ajax_ssl'), 200, 1); |
|
108 | 108 | // action hook EE |
109 | - do_action( 'AHEE__EE_Front_Controller__construct__done',$this ); |
|
109 | + do_action('AHEE__EE_Front_Controller__construct__done', $this); |
|
110 | 110 | // for checking that browser cookies are enabled |
111 | - if ( apply_filters( 'FHEE__EE_Front_Controller____construct__set_test_cookie', true )) { |
|
112 | - setcookie( 'ee_cookie_test', uniqid(), time() + 24 * HOUR_IN_SECONDS, '/' ); |
|
111 | + if (apply_filters('FHEE__EE_Front_Controller____construct__set_test_cookie', true)) { |
|
112 | + setcookie('ee_cookie_test', uniqid(), time() + 24 * HOUR_IN_SECONDS, '/'); |
|
113 | 113 | } |
114 | 114 | } |
115 | 115 | |
@@ -129,8 +129,8 @@ discard block |
||
129 | 129 | * @return void |
130 | 130 | */ |
131 | 131 | public function load_espresso_template_tags() { |
132 | - if ( is_readable( EE_PUBLIC . 'template_tags.php' )) { |
|
133 | - require_once( EE_PUBLIC . 'template_tags.php' ); |
|
132 | + if (is_readable(EE_PUBLIC.'template_tags.php')) { |
|
133 | + require_once(EE_PUBLIC.'template_tags.php'); |
|
134 | 134 | } |
135 | 135 | } |
136 | 136 | |
@@ -145,12 +145,12 @@ discard block |
||
145 | 145 | * @param array $clauses array of comment clauses setup by WP_Comment_Query |
146 | 146 | * @return array array of comment clauses with modifications. |
147 | 147 | */ |
148 | - public function filter_wp_comments( $clauses ) { |
|
148 | + public function filter_wp_comments($clauses) { |
|
149 | 149 | global $wpdb; |
150 | - if ( strpos( $clauses['join'], $wpdb->posts ) !== FALSE ) { |
|
150 | + if (strpos($clauses['join'], $wpdb->posts) !== FALSE) { |
|
151 | 151 | $cpts = EE_Register_CPTs::get_private_CPTs(); |
152 | - foreach ( $cpts as $cpt => $details ) { |
|
153 | - $clauses['where'] .= $wpdb->prepare( " AND $wpdb->posts.post_type != %s", $cpt ); |
|
152 | + foreach ($cpts as $cpt => $details) { |
|
153 | + $clauses['where'] .= $wpdb->prepare(" AND $wpdb->posts.post_type != %s", $cpt); |
|
154 | 154 | } |
155 | 155 | } |
156 | 156 | return $clauses; |
@@ -167,8 +167,8 @@ discard block |
||
167 | 167 | * @return void |
168 | 168 | */ |
169 | 169 | public function employ_CPT_Strategy() { |
170 | - if ( apply_filters( 'FHEE__EE_Front_Controller__employ_CPT_Strategy',true) ){ |
|
171 | - EE_Registry::instance()->load_core( 'CPT_Strategy' ); |
|
170 | + if (apply_filters('FHEE__EE_Front_Controller__employ_CPT_Strategy', true)) { |
|
171 | + EE_Registry::instance()->load_core('CPT_Strategy'); |
|
172 | 172 | } |
173 | 173 | } |
174 | 174 | |
@@ -180,9 +180,9 @@ discard block |
||
180 | 180 | * @param string $url incoming url |
181 | 181 | * @return string final assembled url |
182 | 182 | */ |
183 | - public function maybe_force_admin_ajax_ssl( $url ) { |
|
184 | - if ( is_ssl() && preg_match( '/admin-ajax.php/', $url )) { |
|
185 | - $url = str_replace( 'http://', 'https://', $url ); |
|
183 | + public function maybe_force_admin_ajax_ssl($url) { |
|
184 | + if (is_ssl() && preg_match('/admin-ajax.php/', $url)) { |
|
185 | + $url = str_replace('http://', 'https://', $url); |
|
186 | 186 | } |
187 | 187 | return $url; |
188 | 188 | } |
@@ -219,12 +219,12 @@ discard block |
||
219 | 219 | * @param WP $WP |
220 | 220 | * @return void |
221 | 221 | */ |
222 | - public function get_request( WP $WP ) { |
|
223 | - do_action( 'AHEE__EE_Front_Controller__get_request__start' ); |
|
222 | + public function get_request(WP $WP) { |
|
223 | + do_action('AHEE__EE_Front_Controller__get_request__start'); |
|
224 | 224 | /** @var EE_Request_Handler $Request_Handler */ |
225 | - $Request_Handler = EE_Registry::instance()->load_core( 'Request_Handler' ); |
|
226 | - $Request_Handler->parse_request( $WP ); |
|
227 | - do_action( 'AHEE__EE_Front_Controller__get_request__complete' ); |
|
225 | + $Request_Handler = EE_Registry::instance()->load_core('Request_Handler'); |
|
226 | + $Request_Handler->parse_request($WP); |
|
227 | + do_action('AHEE__EE_Front_Controller__get_request__complete'); |
|
228 | 228 | } |
229 | 229 | |
230 | 230 | |
@@ -236,18 +236,18 @@ discard block |
||
236 | 236 | * @param WP $WP |
237 | 237 | * @return void |
238 | 238 | */ |
239 | - public function _initialize_shortcodes( WP $WP ) { |
|
240 | - do_action( 'AHEE__EE_Front_Controller__initialize_shortcodes__begin', $WP, $this ); |
|
239 | + public function _initialize_shortcodes(WP $WP) { |
|
240 | + do_action('AHEE__EE_Front_Controller__initialize_shortcodes__begin', $WP, $this); |
|
241 | 241 | // grab post_name from request |
242 | - $current_post = apply_filters( 'FHEE__EE_Front_Controller__initialize_shortcodes__current_post_name', EE_Registry::instance()->REQ->get( 'post_name' )); |
|
242 | + $current_post = apply_filters('FHEE__EE_Front_Controller__initialize_shortcodes__current_post_name', EE_Registry::instance()->REQ->get('post_name')); |
|
243 | 243 | // if it's not set, then check if frontpage is blog |
244 | - if ( empty( $current_post ) && get_option( 'show_on_front' ) == 'posts' ) { |
|
244 | + if (empty($current_post) && get_option('show_on_front') == 'posts') { |
|
245 | 245 | // yup.. this is the posts page, prepare to load all shortcode modules |
246 | 246 | $current_post = 'posts'; |
247 | - } else if ( empty( $current_post ) && get_option( 'show_on_front' ) == 'page' ) { |
|
247 | + } else if (empty($current_post) && get_option('show_on_front') == 'page') { |
|
248 | 248 | // some other page is set as the homepage |
249 | - $page_on_front = get_option( 'page_on_front' ); |
|
250 | - if ( $page_on_front ) { |
|
249 | + $page_on_front = get_option('page_on_front'); |
|
250 | + if ($page_on_front) { |
|
251 | 251 | // k now we need to find the post_name for this page |
252 | 252 | global $wpdb; |
253 | 253 | $page_on_front = $wpdb->get_var( |
@@ -263,22 +263,22 @@ discard block |
||
263 | 263 | // where are posts being displayed ? |
264 | 264 | $page_for_posts = EE_Config::get_page_for_posts(); |
265 | 265 | // in case $current_post is hierarchical like: /parent-page/current-page |
266 | - $current_post = basename( $current_post ); |
|
266 | + $current_post = basename($current_post); |
|
267 | 267 | // are we on a category page? |
268 | - $term_exists = is_array( term_exists( $current_post, 'category' )) || array_key_exists( 'category_name', $WP->query_vars ); |
|
268 | + $term_exists = is_array(term_exists($current_post, 'category')) || array_key_exists('category_name', $WP->query_vars); |
|
269 | 269 | // make sure shortcodes are set |
270 | - if ( isset( EE_Registry::CFG()->core->post_shortcodes )) { |
|
271 | - if ( ! isset( EE_Registry::CFG()->core->post_shortcodes[ $page_for_posts ] ) ) { |
|
272 | - EE_Registry::CFG()->core->post_shortcodes[ $page_for_posts ] = array(); |
|
270 | + if (isset(EE_Registry::CFG()->core->post_shortcodes)) { |
|
271 | + if ( ! isset(EE_Registry::CFG()->core->post_shortcodes[$page_for_posts])) { |
|
272 | + EE_Registry::CFG()->core->post_shortcodes[$page_for_posts] = array(); |
|
273 | 273 | } |
274 | 274 | // cycle thru all posts with shortcodes set |
275 | - foreach ( EE_Registry::CFG()->core->post_shortcodes as $post_name => $post_shortcodes ) { |
|
275 | + foreach (EE_Registry::CFG()->core->post_shortcodes as $post_name => $post_shortcodes) { |
|
276 | 276 | // filter shortcodes so |
277 | - $post_shortcodes = apply_filters( 'FHEE__Front_Controller__initialize_shortcodes__post_shortcodes', $post_shortcodes ); |
|
277 | + $post_shortcodes = apply_filters('FHEE__Front_Controller__initialize_shortcodes__post_shortcodes', $post_shortcodes); |
|
278 | 278 | // now cycle thru shortcodes |
279 | - foreach ( $post_shortcodes as $shortcode_class => $post_id ) { |
|
279 | + foreach ($post_shortcodes as $shortcode_class => $post_id) { |
|
280 | 280 | // are we on this page, or on the blog page, or an EE CPT category page ? |
281 | - if ( $current_post == $post_name || $term_exists ) { |
|
281 | + if ($current_post == $post_name || $term_exists) { |
|
282 | 282 | // maybe init the shortcode |
283 | 283 | $this->initialize_shortcode_if_active_on_page( |
284 | 284 | $shortcode_class, |
@@ -293,16 +293,16 @@ discard block |
||
293 | 293 | // but the shortcode is not being tracked for this page |
294 | 294 | } else if ( |
295 | 295 | $post_name != $page_for_posts |
296 | - && isset( EE_Registry::CFG()->core->post_shortcodes[ $page_for_posts ] ) |
|
297 | - && ! isset( EE_Registry::CFG()->core->post_shortcodes[ $page_for_posts ][ $shortcode_class ] ) |
|
296 | + && isset(EE_Registry::CFG()->core->post_shortcodes[$page_for_posts]) |
|
297 | + && ! isset(EE_Registry::CFG()->core->post_shortcodes[$page_for_posts][$shortcode_class]) |
|
298 | 298 | ) { |
299 | 299 | // then remove the "fallback" shortcode processor |
300 | - remove_shortcode( $shortcode_class ); |
|
300 | + remove_shortcode($shortcode_class); |
|
301 | 301 | } |
302 | 302 | } |
303 | 303 | } |
304 | 304 | } |
305 | - do_action( 'AHEE__EE_Front_Controller__initialize_shortcodes__end', $this ); |
|
305 | + do_action('AHEE__EE_Front_Controller__initialize_shortcodes__end', $this); |
|
306 | 306 | } |
307 | 307 | |
308 | 308 | |
@@ -324,8 +324,8 @@ discard block |
||
324 | 324 | $WP |
325 | 325 | ) { |
326 | 326 | // verify shortcode is in list of registered shortcodes |
327 | - if ( ! isset( EE_Registry::instance()->shortcodes->{$shortcode_class} ) ) { |
|
328 | - if ( $current_post != $page_for_posts && current_user_can( 'edit_post', $post_id ) ) { |
|
327 | + if ( ! isset(EE_Registry::instance()->shortcodes->{$shortcode_class} )) { |
|
328 | + if ($current_post != $page_for_posts && current_user_can('edit_post', $post_id)) { |
|
329 | 329 | EE_Error::add_error( |
330 | 330 | sprintf( |
331 | 331 | __( |
@@ -338,23 +338,23 @@ discard block |
||
338 | 338 | __FUNCTION__, |
339 | 339 | __LINE__ |
340 | 340 | ); |
341 | - add_filter( 'FHEE_run_EE_the_content', '__return_true' ); |
|
341 | + add_filter('FHEE_run_EE_the_content', '__return_true'); |
|
342 | 342 | } |
343 | - add_shortcode( $shortcode_class, array( 'EES_Shortcode', 'invalid_shortcode_processor' ) ); |
|
343 | + add_shortcode($shortcode_class, array('EES_Shortcode', 'invalid_shortcode_processor')); |
|
344 | 344 | return; |
345 | 345 | } |
346 | 346 | // is this : a shortcodes set exclusively for this post, or for the home page, or a category, or a taxonomy ? |
347 | 347 | if ( |
348 | - isset( EE_Registry::CFG()->core->post_shortcodes[ $current_post ] ) |
|
348 | + isset(EE_Registry::CFG()->core->post_shortcodes[$current_post]) |
|
349 | 349 | || $term_exists |
350 | 350 | || $current_post == $page_for_posts |
351 | 351 | ) { |
352 | 352 | // let's pause to reflect on this... |
353 | - $sc_reflector = new ReflectionClass( 'EES_' . $shortcode_class ); |
|
353 | + $sc_reflector = new ReflectionClass('EES_'.$shortcode_class); |
|
354 | 354 | // ensure that class is actually a shortcode |
355 | 355 | if ( |
356 | - ! $sc_reflector->isSubclassOf( 'EES_Shortcode' ) |
|
357 | - && defined( 'WP_DEBUG' ) |
|
356 | + ! $sc_reflector->isSubclassOf('EES_Shortcode') |
|
357 | + && defined('WP_DEBUG') |
|
358 | 358 | && WP_DEBUG === true |
359 | 359 | ) { |
360 | 360 | EE_Error::add_error( |
@@ -369,13 +369,13 @@ discard block |
||
369 | 369 | __FUNCTION__, |
370 | 370 | __LINE__ |
371 | 371 | ); |
372 | - add_filter( 'FHEE_run_EE_the_content', '__return_true' ); |
|
372 | + add_filter('FHEE_run_EE_the_content', '__return_true'); |
|
373 | 373 | return; |
374 | 374 | } |
375 | 375 | // and pass the request object to the run method |
376 | 376 | EE_Registry::instance()->shortcodes->{$shortcode_class} = $sc_reflector->newInstance(); |
377 | 377 | // fire the shortcode class's run method, so that it can activate resources |
378 | - EE_Registry::instance()->shortcodes->{$shortcode_class}->run( $WP ); |
|
378 | + EE_Registry::instance()->shortcodes->{$shortcode_class}->run($WP); |
|
379 | 379 | } |
380 | 380 | } |
381 | 381 | |
@@ -388,20 +388,20 @@ discard block |
||
388 | 388 | * @param WP_Query $WP_Query |
389 | 389 | * @return void |
390 | 390 | */ |
391 | - public function pre_get_posts( $WP_Query ) { |
|
391 | + public function pre_get_posts($WP_Query) { |
|
392 | 392 | // only load Module_Request_Router if this is the main query |
393 | - if ( $WP_Query->is_main_query() ) { |
|
393 | + if ($WP_Query->is_main_query()) { |
|
394 | 394 | // load module request router |
395 | - $Module_Request_Router = EE_Registry::instance()->load_core( 'Module_Request_Router' ); |
|
395 | + $Module_Request_Router = EE_Registry::instance()->load_core('Module_Request_Router'); |
|
396 | 396 | // verify object |
397 | - if ( $Module_Request_Router instanceof EE_Module_Request_Router ) { |
|
397 | + if ($Module_Request_Router instanceof EE_Module_Request_Router) { |
|
398 | 398 | // cycle thru module routes |
399 | - while ( $route = $Module_Request_Router->get_route( $WP_Query )) { |
|
399 | + while ($route = $Module_Request_Router->get_route($WP_Query)) { |
|
400 | 400 | // determine module and method for route |
401 | - $module = $Module_Request_Router->resolve_route( $route[0], $route[1] ); |
|
402 | - if( $module instanceof EED_Module ) { |
|
401 | + $module = $Module_Request_Router->resolve_route($route[0], $route[1]); |
|
402 | + if ($module instanceof EED_Module) { |
|
403 | 403 | // get registered view for route |
404 | - $this->_template_path = $Module_Request_Router->get_view( $route ); |
|
404 | + $this->_template_path = $Module_Request_Router->get_view($route); |
|
405 | 405 | // grab module name |
406 | 406 | $module_name = $module->module_name(); |
407 | 407 | // map the module to the module objects |
@@ -428,7 +428,7 @@ discard block |
||
428 | 428 | * @return void |
429 | 429 | */ |
430 | 430 | public function wp() { |
431 | - EE_Registry::instance()->load_helper( 'Template' ); |
|
431 | + EE_Registry::instance()->load_helper('Template'); |
|
432 | 432 | } |
433 | 433 | |
434 | 434 | |
@@ -446,30 +446,30 @@ discard block |
||
446 | 446 | public function wp_enqueue_scripts() { |
447 | 447 | |
448 | 448 | // css is turned ON by default, but prior to the wp_enqueue_scripts hook, can be turned OFF via: add_filter( 'FHEE_load_css', '__return_false' ); |
449 | - if ( apply_filters( 'FHEE_load_css', TRUE ) ) { |
|
449 | + if (apply_filters('FHEE_load_css', TRUE)) { |
|
450 | 450 | |
451 | 451 | EE_Registry::instance()->CFG->template_settings->enable_default_style = TRUE; |
452 | 452 | //Load the ThemeRoller styles if enabled |
453 | - if ( isset( EE_Registry::instance()->CFG->template_settings->enable_default_style ) && EE_Registry::instance()->CFG->template_settings->enable_default_style ) { |
|
453 | + if (isset(EE_Registry::instance()->CFG->template_settings->enable_default_style) && EE_Registry::instance()->CFG->template_settings->enable_default_style) { |
|
454 | 454 | |
455 | 455 | //Load custom style sheet if available |
456 | - if ( isset( EE_Registry::instance()->CFG->template_settings->custom_style_sheet )) { |
|
457 | - wp_register_style('espresso_custom_css', EVENT_ESPRESSO_UPLOAD_URL . 'css/' . EE_Registry::instance()->CFG->template_settings->custom_style_sheet, EVENT_ESPRESSO_VERSION ); |
|
456 | + if (isset(EE_Registry::instance()->CFG->template_settings->custom_style_sheet)) { |
|
457 | + wp_register_style('espresso_custom_css', EVENT_ESPRESSO_UPLOAD_URL.'css/'.EE_Registry::instance()->CFG->template_settings->custom_style_sheet, EVENT_ESPRESSO_VERSION); |
|
458 | 458 | wp_enqueue_style('espresso_custom_css'); |
459 | 459 | } |
460 | 460 | |
461 | - EE_Registry::instance()->load_helper( 'File' ); |
|
462 | - if ( is_readable( EVENT_ESPRESSO_UPLOAD_DIR . 'css/style.css' )) { |
|
463 | - wp_register_style( 'espresso_default', EVENT_ESPRESSO_UPLOAD_DIR . 'css/espresso_default.css', array( 'dashicons' ), EVENT_ESPRESSO_VERSION ); |
|
461 | + EE_Registry::instance()->load_helper('File'); |
|
462 | + if (is_readable(EVENT_ESPRESSO_UPLOAD_DIR.'css/style.css')) { |
|
463 | + wp_register_style('espresso_default', EVENT_ESPRESSO_UPLOAD_DIR.'css/espresso_default.css', array('dashicons'), EVENT_ESPRESSO_VERSION); |
|
464 | 464 | } else { |
465 | - wp_register_style( 'espresso_default', EE_GLOBAL_ASSETS_URL . 'css/espresso_default.css', array( 'dashicons' ), EVENT_ESPRESSO_VERSION ); |
|
465 | + wp_register_style('espresso_default', EE_GLOBAL_ASSETS_URL.'css/espresso_default.css', array('dashicons'), EVENT_ESPRESSO_VERSION); |
|
466 | 466 | } |
467 | 467 | wp_enqueue_style('espresso_default'); |
468 | 468 | |
469 | - if ( is_readable( get_stylesheet_directory() . EE_Config::get_current_theme() . DS . 'style.css' )) { |
|
470 | - wp_register_style( 'espresso_style', get_stylesheet_directory_uri() . EE_Config::get_current_theme() . DS . 'style.css', array( 'dashicons', 'espresso_default' ) ); |
|
469 | + if (is_readable(get_stylesheet_directory().EE_Config::get_current_theme().DS.'style.css')) { |
|
470 | + wp_register_style('espresso_style', get_stylesheet_directory_uri().EE_Config::get_current_theme().DS.'style.css', array('dashicons', 'espresso_default')); |
|
471 | 471 | } else { |
472 | - wp_register_style( 'espresso_style', EE_TEMPLATES_URL . EE_Config::get_current_theme() . DS . 'style.css', array( 'dashicons', 'espresso_default' ) ); |
|
472 | + wp_register_style('espresso_style', EE_TEMPLATES_URL.EE_Config::get_current_theme().DS.'style.css', array('dashicons', 'espresso_default')); |
|
473 | 473 | } |
474 | 474 | |
475 | 475 | } |
@@ -477,29 +477,29 @@ discard block |
||
477 | 477 | } |
478 | 478 | |
479 | 479 | // js is turned ON by default, but prior to the wp_enqueue_scripts hook, can be turned OFF via: add_filter( 'FHEE_load_js', '__return_false' ); |
480 | - if ( apply_filters( 'FHEE_load_js', TRUE ) ) { |
|
480 | + if (apply_filters('FHEE_load_js', TRUE)) { |
|
481 | 481 | |
482 | - wp_enqueue_script( 'jquery' ); |
|
482 | + wp_enqueue_script('jquery'); |
|
483 | 483 | //let's make sure that all required scripts have been setup |
484 | - if ( function_exists( 'wp_script_is' )) { |
|
485 | - if ( ! wp_script_is( 'jquery' )) { |
|
484 | + if (function_exists('wp_script_is')) { |
|
485 | + if ( ! wp_script_is('jquery')) { |
|
486 | 486 | $msg = sprintf( |
487 | - __( '%sJquery is not loaded!%sEvent Espresso is unable to load Jquery due to a conflict with your theme or another plugin.', 'event_espresso' ), |
|
487 | + __('%sJquery is not loaded!%sEvent Espresso is unable to load Jquery due to a conflict with your theme or another plugin.', 'event_espresso'), |
|
488 | 488 | '<em><br />', |
489 | 489 | '</em>' |
490 | 490 | ); |
491 | - EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
491 | + EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__); |
|
492 | 492 | } |
493 | 493 | } |
494 | 494 | // load core js |
495 | - wp_register_script( 'espresso_core', EE_GLOBAL_ASSETS_URL . 'scripts/espresso_core.js', array('jquery'), EVENT_ESPRESSO_VERSION, TRUE ); |
|
496 | - wp_enqueue_script( 'espresso_core' ); |
|
497 | - wp_localize_script( 'espresso_core', 'eei18n', EE_Registry::$i18n_js_strings ); |
|
495 | + wp_register_script('espresso_core', EE_GLOBAL_ASSETS_URL.'scripts/espresso_core.js', array('jquery'), EVENT_ESPRESSO_VERSION, TRUE); |
|
496 | + wp_enqueue_script('espresso_core'); |
|
497 | + wp_localize_script('espresso_core', 'eei18n', EE_Registry::$i18n_js_strings); |
|
498 | 498 | |
499 | 499 | } |
500 | 500 | |
501 | 501 | //qtip is turned OFF by default, but prior to the wp_enqueue_scripts hook, can be turned back on again via: add_filter('FHEE_load_qtip', '__return_true' ); |
502 | - if ( apply_filters( 'FHEE_load_qtip', FALSE ) ) { |
|
502 | + if (apply_filters('FHEE_load_qtip', FALSE)) { |
|
503 | 503 | EE_Registry::instance()->load_helper('Qtip_Loader'); |
504 | 504 | EEH_Qtip_Loader::instance()->register_and_enqueue(); |
505 | 505 | } |
@@ -507,11 +507,11 @@ discard block |
||
507 | 507 | |
508 | 508 | //accounting.js library |
509 | 509 | // @link http://josscrowcroft.github.io/accounting.js/ |
510 | - if ( apply_filters( 'FHEE_load_accounting_js', FALSE ) ) { |
|
511 | - $acct_js = EE_THIRD_PARTY_URL . 'accounting/accounting.js'; |
|
512 | - wp_register_script( 'ee-accounting', EE_GLOBAL_ASSETS_URL . 'scripts/ee-accounting-config.js', array('ee-accounting-core'), EVENT_ESPRESSO_VERSION, TRUE ); |
|
513 | - wp_register_script( 'ee-accounting-core', $acct_js, array('underscore'), '0.3.2', TRUE ); |
|
514 | - wp_enqueue_script( 'ee-accounting' ); |
|
510 | + if (apply_filters('FHEE_load_accounting_js', FALSE)) { |
|
511 | + $acct_js = EE_THIRD_PARTY_URL.'accounting/accounting.js'; |
|
512 | + wp_register_script('ee-accounting', EE_GLOBAL_ASSETS_URL.'scripts/ee-accounting-config.js', array('ee-accounting-core'), EVENT_ESPRESSO_VERSION, TRUE); |
|
513 | + wp_register_script('ee-accounting-core', $acct_js, array('underscore'), '0.3.2', TRUE); |
|
514 | + wp_enqueue_script('ee-accounting'); |
|
515 | 515 | |
516 | 516 | $currency_config = array( |
517 | 517 | 'currency' => array( |
@@ -534,21 +534,21 @@ discard block |
||
534 | 534 | wp_localize_script('ee-accounting', 'EE_ACCOUNTING_CFG', $currency_config); |
535 | 535 | } |
536 | 536 | |
537 | - if ( ! function_exists( 'wp_head' )) { |
|
537 | + if ( ! function_exists('wp_head')) { |
|
538 | 538 | $msg = sprintf( |
539 | - __( '%sMissing wp_head() function.%sThe WordPress function wp_head() seems to be missing in your theme. Please contact the theme developer to make sure this is fixed before using Event Espresso.', 'event_espresso' ), |
|
539 | + __('%sMissing wp_head() function.%sThe WordPress function wp_head() seems to be missing in your theme. Please contact the theme developer to make sure this is fixed before using Event Espresso.', 'event_espresso'), |
|
540 | 540 | '<em><br />', |
541 | 541 | '</em>' |
542 | 542 | ); |
543 | - EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
543 | + EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__); |
|
544 | 544 | } |
545 | - if ( ! function_exists( 'wp_footer' )) { |
|
545 | + if ( ! function_exists('wp_footer')) { |
|
546 | 546 | $msg = sprintf( |
547 | - __( '%sMissing wp_footer() function.%sThe WordPress function wp_footer() seems to be missing in your theme. Please contact the theme developer to make sure this is fixed before using Event Espresso.', 'event_espresso' ), |
|
547 | + __('%sMissing wp_footer() function.%sThe WordPress function wp_footer() seems to be missing in your theme. Please contact the theme developer to make sure this is fixed before using Event Espresso.', 'event_espresso'), |
|
548 | 548 | '<em><br />', |
549 | 549 | '</em>' |
550 | 550 | ); |
551 | - EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
551 | + EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__); |
|
552 | 552 | } |
553 | 553 | |
554 | 554 | } |
@@ -562,7 +562,7 @@ discard block |
||
562 | 562 | * @return void |
563 | 563 | */ |
564 | 564 | public function header_meta_tag() { |
565 | - print( apply_filters("FHEE__EE_Front_Controller__header_meta_tag","<meta name='generator' content='Event Espresso Version " . EVENT_ESPRESSO_VERSION . "' />")); |
|
565 | + print(apply_filters("FHEE__EE_Front_Controller__header_meta_tag", "<meta name='generator' content='Event Espresso Version ".EVENT_ESPRESSO_VERSION."' />")); |
|
566 | 566 | } |
567 | 567 | |
568 | 568 | |
@@ -576,9 +576,9 @@ discard block |
||
576 | 576 | * @param $the_content |
577 | 577 | * @return string |
578 | 578 | */ |
579 | - public function the_content( $the_content ) { |
|
579 | + public function the_content($the_content) { |
|
580 | 580 | // nothing gets loaded at this point unless other systems turn this hookpoint on by using: add_filter( 'FHEE_run_EE_the_content', '__return_true' ); |
581 | - if ( apply_filters( 'FHEE_run_EE_the_content', FALSE ) ) { |
|
581 | + if (apply_filters('FHEE_run_EE_the_content', FALSE)) { |
|
582 | 582 | } |
583 | 583 | return $the_content; |
584 | 584 | } |
@@ -603,9 +603,9 @@ discard block |
||
603 | 603 | */ |
604 | 604 | public function display_errors() { |
605 | 605 | static $shown_already = FALSE; |
606 | - do_action( 'AHEE__EE_Front_Controller__display_errors__begin' ); |
|
606 | + do_action('AHEE__EE_Front_Controller__display_errors__begin'); |
|
607 | 607 | if ( |
608 | - apply_filters( 'FHEE__EE_Front_Controller__display_errors', TRUE ) |
|
608 | + apply_filters('FHEE__EE_Front_Controller__display_errors', TRUE) |
|
609 | 609 | && ! $shown_already |
610 | 610 | && is_main_query() |
611 | 611 | && ! is_feed() |
@@ -614,10 +614,10 @@ discard block |
||
614 | 614 | ) { |
615 | 615 | echo EE_Error::get_notices(); |
616 | 616 | $shown_already = TRUE; |
617 | - EE_Registry::instance()->load_helper( 'Template' ); |
|
618 | - EEH_Template::display_template( EE_TEMPLATES . 'espresso-ajax-notices.template.php' ); |
|
617 | + EE_Registry::instance()->load_helper('Template'); |
|
618 | + EEH_Template::display_template(EE_TEMPLATES.'espresso-ajax-notices.template.php'); |
|
619 | 619 | } |
620 | - do_action( 'AHEE__EE_Front_Controller__display_errors__end' ); |
|
620 | + do_action('AHEE__EE_Front_Controller__display_errors__end'); |
|
621 | 621 | } |
622 | 622 | |
623 | 623 | |
@@ -632,12 +632,12 @@ discard block |
||
632 | 632 | * @param string $template_include_path |
633 | 633 | * @return string |
634 | 634 | */ |
635 | - public function template_include( $template_include_path = NULL ) { |
|
636 | - if ( EE_Registry::instance()->REQ->is_espresso_page() ) { |
|
637 | - $this->_template_path = ! empty( $this->_template_path ) ? basename( $this->_template_path ) : basename( $template_include_path ); |
|
638 | - $template_path = EEH_Template::locate_template( $this->_template_path, array(), false ); |
|
639 | - $this->_template_path = ! empty( $template_path ) ? $template_path : $template_include_path; |
|
640 | - $this->_template = basename( $this->_template_path ); |
|
635 | + public function template_include($template_include_path = NULL) { |
|
636 | + if (EE_Registry::instance()->REQ->is_espresso_page()) { |
|
637 | + $this->_template_path = ! empty($this->_template_path) ? basename($this->_template_path) : basename($template_include_path); |
|
638 | + $template_path = EEH_Template::locate_template($this->_template_path, array(), false); |
|
639 | + $this->_template_path = ! empty($template_path) ? $template_path : $template_include_path; |
|
640 | + $this->_template = basename($this->_template_path); |
|
641 | 641 | return $this->_template_path; |
642 | 642 | } |
643 | 643 | return $template_include_path; |
@@ -652,7 +652,7 @@ discard block |
||
652 | 652 | * @param bool $with_path |
653 | 653 | * @return string |
654 | 654 | */ |
655 | - public function get_selected_template( $with_path = FALSE ) { |
|
655 | + public function get_selected_template($with_path = FALSE) { |
|
656 | 656 | return $with_path ? $this->_template_path : $this->_template; |
657 | 657 | } |
658 | 658 |
@@ -864,7 +864,7 @@ |
||
864 | 864 | * @param int $ID |
865 | 865 | * @param $shortcode_class |
866 | 866 | * @param $shortcode_posts |
867 | - * @param $page_for_posts |
|
867 | + * @param string $page_for_posts |
|
868 | 868 | * @return bool |
869 | 869 | */ |
870 | 870 | protected static function unset_posts_page_shortcode_for_post( $ID, $shortcode_class, $shortcode_posts, $page_for_posts ) { |
@@ -316,7 +316,7 @@ |
||
316 | 316 | ); |
317 | 317 | // verify that post_shortcodes is set |
318 | 318 | \EE_Config::instance()->core->post_shortcodes = isset( \EE_Config::instance()->core->post_shortcodes ) |
319 | - && is_array( \EE_Config::instance()->core->post_shortcodes ) |
|
319 | + && is_array( \EE_Config::instance()->core->post_shortcodes ) |
|
320 | 320 | ? \EE_Config::instance()->core->post_shortcodes |
321 | 321 | : array(); |
322 | 322 | // cycle thru post_shortcodes |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace EventEspresso\core\admin; |
3 | 3 | |
4 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
5 | - exit( 'No direct script access allowed' ); |
|
4 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
5 | + exit('No direct script access allowed'); |
|
6 | 6 | } |
7 | 7 | |
8 | 8 | |
@@ -28,31 +28,31 @@ discard block |
||
28 | 28 | public static function set_hooks_admin() { |
29 | 29 | add_action( |
30 | 30 | 'save_post', |
31 | - array( 'EventEspresso\core\admin\PostShortcodeTracking', 'parse_post_content_on_save' ), |
|
31 | + array('EventEspresso\core\admin\PostShortcodeTracking', 'parse_post_content_on_save'), |
|
32 | 32 | 100, |
33 | 33 | 2 |
34 | 34 | ); |
35 | 35 | add_action( |
36 | 36 | 'delete_post', |
37 | - array( 'EventEspresso\core\admin\PostShortcodeTracking', 'unset_post_shortcodes_on_delete' ), |
|
37 | + array('EventEspresso\core\admin\PostShortcodeTracking', 'unset_post_shortcodes_on_delete'), |
|
38 | 38 | 100, |
39 | 39 | 1 |
40 | 40 | ); |
41 | 41 | add_action( |
42 | 42 | 'add_option_page_for_posts', |
43 | - array( 'EventEspresso\core\admin\PostShortcodeTracking', 'reset_page_for_posts_on_initial_set' ), |
|
43 | + array('EventEspresso\core\admin\PostShortcodeTracking', 'reset_page_for_posts_on_initial_set'), |
|
44 | 44 | 100, |
45 | 45 | 2 |
46 | 46 | ); |
47 | 47 | add_action( |
48 | 48 | 'update_option', |
49 | - array( 'EventEspresso\core\admin\PostShortcodeTracking', 'reset_page_for_posts_on_change' ), |
|
49 | + array('EventEspresso\core\admin\PostShortcodeTracking', 'reset_page_for_posts_on_change'), |
|
50 | 50 | 100, |
51 | 51 | 3 |
52 | 52 | ); |
53 | 53 | add_action( |
54 | 54 | 'delete_option', |
55 | - array( 'EventEspresso\core\admin\PostShortcodeTracking', 'reset_page_for_posts_on_delete' ), |
|
55 | + array('EventEspresso\core\admin\PostShortcodeTracking', 'reset_page_for_posts_on_delete'), |
|
56 | 56 | 100, |
57 | 57 | 1 |
58 | 58 | ); |
@@ -72,61 +72,61 @@ discard block |
||
72 | 72 | * @param \WP_Post $post |
73 | 73 | * @return void |
74 | 74 | */ |
75 | - public static function parse_post_content_on_save( $post_ID, $post ) { |
|
75 | + public static function parse_post_content_on_save($post_ID, $post) { |
|
76 | 76 | // if the post is trashed, then let's remove our post shortcode tracking |
77 | - if ( $post instanceof \WP_Post && $post->post_status == 'trash' ) { |
|
78 | - PostShortcodeTracking::unset_post_shortcodes_on_delete( $post_ID ); |
|
77 | + if ($post instanceof \WP_Post && $post->post_status == 'trash') { |
|
78 | + PostShortcodeTracking::unset_post_shortcodes_on_delete($post_ID); |
|
79 | 79 | return; |
80 | 80 | } |
81 | 81 | // default post types |
82 | - $post_types = array( 'post' => 0, 'page' => 1 ); |
|
82 | + $post_types = array('post' => 0, 'page' => 1); |
|
83 | 83 | // add CPTs |
84 | 84 | $CPTs = \EE_Register_CPTs::get_CPTs(); |
85 | - $post_types = array_merge( $post_types, $CPTs ); |
|
85 | + $post_types = array_merge($post_types, $CPTs); |
|
86 | 86 | // for default or CPT posts... |
87 | - if ( isset( $post_types[ $post->post_type ] ) ) { |
|
87 | + if (isset($post_types[$post->post_type])) { |
|
88 | 88 | // post on frontpage ? |
89 | 89 | $page_for_posts = \EE_Config::get_page_for_posts(); |
90 | - if ( $post->post_name == $page_for_posts ) { |
|
91 | - PostShortcodeTracking::set_post_shortcodes_for_posts_page( $page_for_posts ); |
|
90 | + if ($post->post_name == $page_for_posts) { |
|
91 | + PostShortcodeTracking::set_post_shortcodes_for_posts_page($page_for_posts); |
|
92 | 92 | return; |
93 | 93 | } |
94 | 94 | // array of shortcodes indexed by post name |
95 | - \EE_Registry::CFG()->core->post_shortcodes = isset( \EE_Registry::CFG()->core->post_shortcodes ) |
|
95 | + \EE_Registry::CFG()->core->post_shortcodes = isset(\EE_Registry::CFG()->core->post_shortcodes) |
|
96 | 96 | ? \EE_Registry::CFG()->core->post_shortcodes |
97 | 97 | : array(); |
98 | 98 | // whether to proceed with update |
99 | 99 | $update_post_shortcodes = false; |
100 | 100 | // empty both arrays |
101 | - \EE_Registry::CFG()->core->post_shortcodes[ $post->post_name ] = array(); |
|
101 | + \EE_Registry::CFG()->core->post_shortcodes[$post->post_name] = array(); |
|
102 | 102 | // check that posts page is already being tracked |
103 | - if ( ! isset( \EE_Registry::CFG()->core->post_shortcodes[ $page_for_posts ] ) ) { |
|
103 | + if ( ! isset(\EE_Registry::CFG()->core->post_shortcodes[$page_for_posts])) { |
|
104 | 104 | // if not, then ensure that it is properly added |
105 | - \EE_Registry::CFG()->core->post_shortcodes[ $page_for_posts ] = array(); |
|
105 | + \EE_Registry::CFG()->core->post_shortcodes[$page_for_posts] = array(); |
|
106 | 106 | } |
107 | 107 | // loop thru shortcodes |
108 | - foreach ( \EE_Registry::instance()->shortcodes as $EES_Shortcode => $shortcode_dir ) { |
|
108 | + foreach (\EE_Registry::instance()->shortcodes as $EES_Shortcode => $shortcode_dir) { |
|
109 | 109 | // convert to UPPERCASE to get actual shortcode |
110 | - $EES_Shortcode = strtoupper( $EES_Shortcode ); |
|
110 | + $EES_Shortcode = strtoupper($EES_Shortcode); |
|
111 | 111 | // is the shortcode in the post_content ? |
112 | - if ( strpos( $post->post_content, $EES_Shortcode ) !== false ) { |
|
112 | + if (strpos($post->post_content, $EES_Shortcode) !== false) { |
|
113 | 113 | // map shortcode to post names and post IDs |
114 | - \EE_Registry::CFG()->core->post_shortcodes[ $post->post_name ][ $EES_Shortcode ] = $post_ID; |
|
114 | + \EE_Registry::CFG()->core->post_shortcodes[$post->post_name][$EES_Shortcode] = $post_ID; |
|
115 | 115 | // and add this shortcode to the tracking for the blog page |
116 | - PostShortcodeTracking::set_post_shortcode_for_posts_page( $page_for_posts, $EES_Shortcode, $post_ID ); |
|
116 | + PostShortcodeTracking::set_post_shortcode_for_posts_page($page_for_posts, $EES_Shortcode, $post_ID); |
|
117 | 117 | $update_post_shortcodes = true; |
118 | 118 | } else { |
119 | 119 | // shortcode is not present in post content, so check if we were tracking it previously |
120 | 120 | // stop tracking if shortcode is not used in this specific post |
121 | - if ( isset( \EE_Registry::CFG()->core->post_shortcodes[ $post->post_name ][ $EES_Shortcode ] ) ) { |
|
122 | - unset( \EE_Registry::CFG()->core->post_shortcodes[ $post->post_name ][ $EES_Shortcode ] ); |
|
121 | + if (isset(\EE_Registry::CFG()->core->post_shortcodes[$post->post_name][$EES_Shortcode])) { |
|
122 | + unset(\EE_Registry::CFG()->core->post_shortcodes[$post->post_name][$EES_Shortcode]); |
|
123 | 123 | $update_post_shortcodes = true; |
124 | 124 | } |
125 | 125 | // make sure that something is set for the shortcode posts (even though we may remove this) |
126 | 126 | $shortcode_posts = isset( |
127 | - \EE_Registry::CFG()->core->post_shortcodes[ $page_for_posts ][ $EES_Shortcode ] |
|
127 | + \EE_Registry::CFG()->core->post_shortcodes[$page_for_posts][$EES_Shortcode] |
|
128 | 128 | ) |
129 | - ? \EE_Registry::CFG()->core->post_shortcodes[ $page_for_posts ][ $EES_Shortcode ] |
|
129 | + ? \EE_Registry::CFG()->core->post_shortcodes[$page_for_posts][$EES_Shortcode] |
|
130 | 130 | : array(); |
131 | 131 | // and stop tracking for this shortcode on the blog page if it is not used |
132 | 132 | $update_post_shortcodes = PostShortcodeTracking::unset_posts_page_shortcode_for_post( |
@@ -140,8 +140,8 @@ discard block |
||
140 | 140 | : $update_post_shortcodes; |
141 | 141 | } |
142 | 142 | } |
143 | - if ( $update_post_shortcodes ) { |
|
144 | - PostShortcodeTracking::update_post_shortcodes( $page_for_posts ); |
|
143 | + if ($update_post_shortcodes) { |
|
144 | + PostShortcodeTracking::update_post_shortcodes($page_for_posts); |
|
145 | 145 | } |
146 | 146 | } |
147 | 147 | } |
@@ -158,15 +158,15 @@ discard block |
||
158 | 158 | * @param string $page_for_posts |
159 | 159 | * @return void |
160 | 160 | */ |
161 | - protected static function set_post_shortcodes_for_posts_page( $page_for_posts ) { |
|
162 | - \EE_Registry::CFG()->core->post_shortcodes[ $page_for_posts ] = array(); |
|
161 | + protected static function set_post_shortcodes_for_posts_page($page_for_posts) { |
|
162 | + \EE_Registry::CFG()->core->post_shortcodes[$page_for_posts] = array(); |
|
163 | 163 | // loop thru shortcodes |
164 | - foreach ( \EE_Registry::CFG()->core->post_shortcodes as $post_name => $post_shortcodes ) { |
|
165 | - foreach ( $post_shortcodes as $EES_Shortcode => $post_ID ) { |
|
166 | - PostShortcodeTracking::set_post_shortcode_for_posts_page( $page_for_posts, $EES_Shortcode, $post_ID ); |
|
164 | + foreach (\EE_Registry::CFG()->core->post_shortcodes as $post_name => $post_shortcodes) { |
|
165 | + foreach ($post_shortcodes as $EES_Shortcode => $post_ID) { |
|
166 | + PostShortcodeTracking::set_post_shortcode_for_posts_page($page_for_posts, $EES_Shortcode, $post_ID); |
|
167 | 167 | } |
168 | 168 | } |
169 | - PostShortcodeTracking::update_post_shortcodes( $page_for_posts ); |
|
169 | + PostShortcodeTracking::update_post_shortcodes($page_for_posts); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | |
@@ -181,25 +181,25 @@ discard block |
||
181 | 181 | * @param $EES_Shortcode |
182 | 182 | * @param $post_ID |
183 | 183 | */ |
184 | - protected static function set_post_shortcode_for_posts_page( $page_for_posts, $EES_Shortcode, $post_ID ) { |
|
184 | + protected static function set_post_shortcode_for_posts_page($page_for_posts, $EES_Shortcode, $post_ID) { |
|
185 | 185 | // critical page shortcodes that we do NOT want added to the Posts page (blog) |
186 | 186 | $critical_shortcodes = \EE_Registry::CFG()->core->get_critical_pages_shortcodes_array(); |
187 | 187 | // if the shortcode is NOT one of the critical page shortcodes like ESPRESSO_TXN_PAGE |
188 | - if ( in_array( $EES_Shortcode, $critical_shortcodes ) ) { |
|
188 | + if (in_array($EES_Shortcode, $critical_shortcodes)) { |
|
189 | 189 | return; |
190 | 190 | } |
191 | 191 | // add shortcode to "Posts page" tracking |
192 | - if ( isset( \EE_Registry::CFG()->core->post_shortcodes[ $page_for_posts ][ $EES_Shortcode ] ) ) { |
|
192 | + if (isset(\EE_Registry::CFG()->core->post_shortcodes[$page_for_posts][$EES_Shortcode])) { |
|
193 | 193 | // make sure tracking is in form of an array |
194 | - if ( ! is_array( \EE_Registry::CFG()->core->post_shortcodes[ $page_for_posts ][ $EES_Shortcode ] ) ) { |
|
195 | - \EE_Registry::CFG()->core->post_shortcodes[ $page_for_posts ][ $EES_Shortcode ] = array( |
|
196 | - \EE_Registry::CFG()->core->post_shortcodes[ $page_for_posts ][ $EES_Shortcode ] => true |
|
194 | + if ( ! is_array(\EE_Registry::CFG()->core->post_shortcodes[$page_for_posts][$EES_Shortcode])) { |
|
195 | + \EE_Registry::CFG()->core->post_shortcodes[$page_for_posts][$EES_Shortcode] = array( |
|
196 | + \EE_Registry::CFG()->core->post_shortcodes[$page_for_posts][$EES_Shortcode] => true |
|
197 | 197 | ); |
198 | 198 | } |
199 | - \EE_Registry::CFG()->core->post_shortcodes[ $page_for_posts ][ $EES_Shortcode ] = |
|
200 | - \EE_Registry::CFG()->core->post_shortcodes[ $page_for_posts ][ $EES_Shortcode ] + array( $post_ID => true ); |
|
199 | + \EE_Registry::CFG()->core->post_shortcodes[$page_for_posts][$EES_Shortcode] = |
|
200 | + \EE_Registry::CFG()->core->post_shortcodes[$page_for_posts][$EES_Shortcode] + array($post_ID => true); |
|
201 | 201 | } else { |
202 | - \EE_Registry::CFG()->core->post_shortcodes[ $page_for_posts ][ $EES_Shortcode ] = array( $post_ID => true ); |
|
202 | + \EE_Registry::CFG()->core->post_shortcodes[$page_for_posts][$EES_Shortcode] = array($post_ID => true); |
|
203 | 203 | } |
204 | 204 | } |
205 | 205 | |
@@ -212,16 +212,16 @@ discard block |
||
212 | 212 | * @param int $ID |
213 | 213 | * @return void |
214 | 214 | */ |
215 | - protected static function unset_post_shortcodes_on_delete( $ID ) { |
|
215 | + protected static function unset_post_shortcodes_on_delete($ID) { |
|
216 | 216 | $update_post_shortcodes = false; |
217 | 217 | // post on frontpage ? |
218 | 218 | $page_for_posts = \EE_Config::get_page_for_posts(); |
219 | 219 | // looking for any references to this post |
220 | - foreach ( \EE_Registry::CFG()->core->post_shortcodes as $post_name => $post_shortcodes ) { |
|
220 | + foreach (\EE_Registry::CFG()->core->post_shortcodes as $post_name => $post_shortcodes) { |
|
221 | 221 | // is this the "Posts Page" (blog) ? |
222 | - if ( $post_name == $page_for_posts ) { |
|
222 | + if ($post_name == $page_for_posts) { |
|
223 | 223 | // loop thru shortcodes registered for the posts page |
224 | - foreach ( $post_shortcodes as $shortcode_class => $shortcode_posts ) { |
|
224 | + foreach ($post_shortcodes as $shortcode_class => $shortcode_posts) { |
|
225 | 225 | $update_post_shortcodes = PostShortcodeTracking::unset_posts_page_shortcode_for_post( |
226 | 226 | $ID, |
227 | 227 | $shortcode_class, |
@@ -234,17 +234,17 @@ discard block |
||
234 | 234 | } |
235 | 235 | } else { |
236 | 236 | // loop thru shortcodes registered for each page |
237 | - foreach ( $post_shortcodes as $shortcode_class => $post_ID ) { |
|
237 | + foreach ($post_shortcodes as $shortcode_class => $post_ID) { |
|
238 | 238 | // if this is page is being deleted, then don't track any post shortcodes for it |
239 | - if ( $post_ID == $ID ) { |
|
240 | - unset( \EE_Registry::CFG()->core->post_shortcodes[ $post_name ] ); |
|
239 | + if ($post_ID == $ID) { |
|
240 | + unset(\EE_Registry::CFG()->core->post_shortcodes[$post_name]); |
|
241 | 241 | $update_post_shortcodes = true; |
242 | 242 | } |
243 | 243 | } |
244 | 244 | } |
245 | 245 | } |
246 | - if ( $update_post_shortcodes ) { |
|
247 | - PostShortcodeTracking::update_post_shortcodes( $page_for_posts ); |
|
246 | + if ($update_post_shortcodes) { |
|
247 | + PostShortcodeTracking::update_post_shortcodes($page_for_posts); |
|
248 | 248 | } |
249 | 249 | } |
250 | 250 | |
@@ -269,20 +269,20 @@ discard block |
||
269 | 269 | $update_post_shortcodes = false |
270 | 270 | ) { |
271 | 271 | // make sure that an array of post IDs is being tracked for each shortcode |
272 | - if ( ! is_array( $shortcode_posts ) ) { |
|
273 | - \EE_Registry::CFG()->core->post_shortcodes[ $page_for_posts ][ $shortcode_class ] = array( |
|
272 | + if ( ! is_array($shortcode_posts)) { |
|
273 | + \EE_Registry::CFG()->core->post_shortcodes[$page_for_posts][$shortcode_class] = array( |
|
274 | 274 | $shortcode_posts => true |
275 | 275 | ); |
276 | 276 | $update_post_shortcodes = true; |
277 | 277 | } |
278 | 278 | // now if the ID of the post being deleted is in the $shortcode_posts array |
279 | - if ( is_array( $shortcode_posts ) && isset( $shortcode_posts[ $ID ] ) ) { |
|
280 | - unset( \EE_Registry::CFG()->core->post_shortcodes[ $page_for_posts ][ $shortcode_class ][ $ID ] ); |
|
279 | + if (is_array($shortcode_posts) && isset($shortcode_posts[$ID])) { |
|
280 | + unset(\EE_Registry::CFG()->core->post_shortcodes[$page_for_posts][$shortcode_class][$ID]); |
|
281 | 281 | $update_post_shortcodes = true; |
282 | 282 | } |
283 | 283 | // if nothing is registered for that shortcode anymore, then delete the shortcode altogether |
284 | - if ( empty( \EE_Registry::CFG()->core->post_shortcodes[ $page_for_posts ][ $shortcode_class ] ) ) { |
|
285 | - unset( \EE_Registry::CFG()->core->post_shortcodes[ $page_for_posts ][ $shortcode_class ] ); |
|
284 | + if (empty(\EE_Registry::CFG()->core->post_shortcodes[$page_for_posts][$shortcode_class])) { |
|
285 | + unset(\EE_Registry::CFG()->core->post_shortcodes[$page_for_posts][$shortcode_class]); |
|
286 | 286 | $update_post_shortcodes = true; |
287 | 287 | } |
288 | 288 | return $update_post_shortcodes; |
@@ -297,9 +297,9 @@ discard block |
||
297 | 297 | * @param $page_for_posts |
298 | 298 | * @return void |
299 | 299 | */ |
300 | - public static function update_post_shortcodes( $page_for_posts = '' ) { |
|
300 | + public static function update_post_shortcodes($page_for_posts = '') { |
|
301 | 301 | // make sure page_for_posts is set |
302 | - $page_for_posts = ! empty( $page_for_posts ) |
|
302 | + $page_for_posts = ! empty($page_for_posts) |
|
303 | 303 | ? $page_for_posts |
304 | 304 | : \EE_Config::get_page_for_posts(); |
305 | 305 | // allow others to mess stuff up :D |
@@ -315,47 +315,47 @@ discard block |
||
315 | 315 | $page_for_posts |
316 | 316 | ); |
317 | 317 | // verify that post_shortcodes is set |
318 | - \EE_Config::instance()->core->post_shortcodes = isset( \EE_Config::instance()->core->post_shortcodes ) |
|
319 | - && is_array( \EE_Config::instance()->core->post_shortcodes ) |
|
318 | + \EE_Config::instance()->core->post_shortcodes = isset(\EE_Config::instance()->core->post_shortcodes) |
|
319 | + && is_array(\EE_Config::instance()->core->post_shortcodes) |
|
320 | 320 | ? \EE_Config::instance()->core->post_shortcodes |
321 | 321 | : array(); |
322 | 322 | // cycle thru post_shortcodes |
323 | - foreach ( \EE_Config::instance()->core->post_shortcodes as $post_name => $shortcodes ) { |
|
323 | + foreach (\EE_Config::instance()->core->post_shortcodes as $post_name => $shortcodes) { |
|
324 | 324 | // are there any shortcodes to track ? |
325 | - if ( ! empty( $shortcodes ) ) { |
|
325 | + if ( ! empty($shortcodes)) { |
|
326 | 326 | // loop thru list of tracked shortcodes |
327 | - foreach ( $shortcodes as $shortcode => $post_id ) { |
|
327 | + foreach ($shortcodes as $shortcode => $post_id) { |
|
328 | 328 | // if shortcode is for a critical page, |
329 | 329 | // BUT this is NOT the corresponding critical page for that shortcode |
330 | - if ( $post_name == $page_for_posts ) { |
|
330 | + if ($post_name == $page_for_posts) { |
|
331 | 331 | continue; |
332 | 332 | } |
333 | 333 | // skip the posts page, because we want all shortcodes registered for it |
334 | - if ( $post_name == $page_for_posts ) { |
|
334 | + if ($post_name == $page_for_posts) { |
|
335 | 335 | continue; |
336 | 336 | } |
337 | 337 | // make sure post still exists |
338 | - $post = get_post( $post_id ); |
|
339 | - if ( $post ) { |
|
338 | + $post = get_post($post_id); |
|
339 | + if ($post) { |
|
340 | 340 | // check that the post name matches what we have saved |
341 | - if ( $post->post_name == $post_name ) { |
|
341 | + if ($post->post_name == $post_name) { |
|
342 | 342 | // if so, then break before hitting the unset below |
343 | 343 | continue; |
344 | 344 | } |
345 | 345 | } |
346 | 346 | // we don't like missing posts around here >:( |
347 | - unset( \EE_Config::instance()->core->post_shortcodes[ $post_name ] ); |
|
347 | + unset(\EE_Config::instance()->core->post_shortcodes[$post_name]); |
|
348 | 348 | } |
349 | 349 | } else { |
350 | 350 | // you got no shortcodes to keep track of ! |
351 | - unset( \EE_Config::instance()->core->post_shortcodes[ $post_name ] ); |
|
351 | + unset(\EE_Config::instance()->core->post_shortcodes[$post_name]); |
|
352 | 352 | } |
353 | 353 | } |
354 | 354 | // critical page shortcodes that we do NOT want added to the Posts page (blog) |
355 | 355 | $critical_shortcodes = \EE_Config::instance()->core->get_critical_pages_shortcodes_array(); |
356 | - $critical_shortcodes = array_flip( $critical_shortcodes ); |
|
357 | - foreach ( $critical_shortcodes as $critical_shortcode ) { |
|
358 | - unset( \EE_Config::instance()->core->post_shortcodes[ $page_for_posts ][ $critical_shortcode ] ); |
|
356 | + $critical_shortcodes = array_flip($critical_shortcodes); |
|
357 | + foreach ($critical_shortcodes as $critical_shortcode) { |
|
358 | + unset(\EE_Config::instance()->core->post_shortcodes[$page_for_posts][$critical_shortcode]); |
|
359 | 359 | } |
360 | 360 | //only show errors |
361 | 361 | \EE_Config::instance()->update_espresso_config(); |
@@ -375,8 +375,8 @@ discard block |
||
375 | 375 | * @param string $value |
376 | 376 | * @return void |
377 | 377 | */ |
378 | - public static function reset_page_for_posts_on_initial_set( $option, $value ) { |
|
379 | - PostShortcodeTracking::reset_page_for_posts_on_change( $option, '', $value ); |
|
378 | + public static function reset_page_for_posts_on_initial_set($option, $value) { |
|
379 | + PostShortcodeTracking::reset_page_for_posts_on_change($option, '', $value); |
|
380 | 380 | } |
381 | 381 | |
382 | 382 | |
@@ -393,13 +393,13 @@ discard block |
||
393 | 393 | * @param string $value |
394 | 394 | * @return void |
395 | 395 | */ |
396 | - public static function reset_page_for_posts_on_change( $option, $old_value = '', $value = '' ) { |
|
397 | - if ( $option == 'page_for_posts' ) { |
|
396 | + public static function reset_page_for_posts_on_change($option, $old_value = '', $value = '') { |
|
397 | + if ($option == 'page_for_posts') { |
|
398 | 398 | global $wpdb; |
399 | 399 | $table = $wpdb->posts; |
400 | 400 | $SQL = "SELECT post_name from $table WHERE post_type='posts' OR post_type='page' AND post_status='publish' AND ID=%d"; |
401 | - $new_page_for_posts = $value ? $wpdb->get_var( $wpdb->prepare( $SQL, $value ) ) : 'posts'; |
|
402 | - PostShortcodeTracking::set_post_shortcodes_for_posts_page( $new_page_for_posts ); |
|
401 | + $new_page_for_posts = $value ? $wpdb->get_var($wpdb->prepare($SQL, $value)) : 'posts'; |
|
402 | + PostShortcodeTracking::set_post_shortcodes_for_posts_page($new_page_for_posts); |
|
403 | 403 | } |
404 | 404 | } |
405 | 405 | |
@@ -415,9 +415,9 @@ discard block |
||
415 | 415 | * @param string $option |
416 | 416 | * @return void |
417 | 417 | */ |
418 | - public static function reset_page_for_posts_on_delete( $option ) { |
|
419 | - if ( $option == 'page_for_posts' ) { |
|
420 | - PostShortcodeTracking::set_post_shortcodes_for_posts_page( 'posts' ); |
|
418 | + public static function reset_page_for_posts_on_delete($option) { |
|
419 | + if ($option == 'page_for_posts') { |
|
420 | + PostShortcodeTracking::set_post_shortcodes_for_posts_page('posts'); |
|
421 | 421 | } |
422 | 422 | } |
423 | 423 |
@@ -24,14 +24,14 @@ discard block |
||
24 | 24 | * But either way, the string or the array's values can ONLY contain simple HTML tags. |
25 | 25 | * If you want to allow Full HTML in the value, use EE_Maybe_Serialized_Text_Field |
26 | 26 | */ |
27 | -class EE_Maybe_Serialized_Simple_HTML_Field extends EE_Maybe_Serialized_Text_Field{ |
|
27 | +class EE_Maybe_Serialized_Simple_HTML_Field extends EE_Maybe_Serialized_Text_Field { |
|
28 | 28 | /** |
29 | 29 | * removes all non-basic tags when setting |
30 | 30 | * @param string $value_inputted_for_field_on_model_object |
31 | 31 | * @return string |
32 | 32 | */ |
33 | 33 | function prepare_for_set($value_inputted_for_field_on_model_object) { |
34 | - return parent::prepare_for_set( $this->_remove_tags( $value_inputted_for_field_on_model_object ) ); |
|
34 | + return parent::prepare_for_set($this->_remove_tags($value_inputted_for_field_on_model_object)); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | /** |
@@ -39,13 +39,13 @@ discard block |
||
39 | 39 | * @param array|string $value |
40 | 40 | * @return array|string |
41 | 41 | */ |
42 | - protected function _remove_tags( $value ) { |
|
43 | - if( is_array( $value ) ) { |
|
44 | - foreach( $value as $key => $v ) { |
|
45 | - $value[ $key ] = $this->_remove_tags( $v ); |
|
42 | + protected function _remove_tags($value) { |
|
43 | + if (is_array($value)) { |
|
44 | + foreach ($value as $key => $v) { |
|
45 | + $value[$key] = $this->_remove_tags($v); |
|
46 | 46 | } |
47 | - }elseif( is_string( $value ) ) { |
|
48 | - $value = wp_kses("$value", $this->_get_allowed_tags() ); |
|
47 | + }elseif (is_string($value)) { |
|
48 | + $value = wp_kses("$value", $this->_get_allowed_tags()); |
|
49 | 49 | } |
50 | 50 | return $value; |
51 | 51 | } |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | * @return array|string |
57 | 57 | */ |
58 | 58 | function prepare_for_set_from_db($value_found_in_db_for_model_object) { |
59 | - return $this->_remove_tags( parent::prepare_for_set_from_db( $value_found_in_db_for_model_object ) ); |
|
59 | + return $this->_remove_tags(parent::prepare_for_set_from_db($value_found_in_db_for_model_object)); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | * @global array $allowedtags |
66 | 66 | * @return array |
67 | 67 | */ |
68 | - function _get_allowed_tags(){ |
|
69 | - return apply_filters( 'FHEE__EE_Maybe_Serialized_Simple_HTML_Field___get_allowed_tags', EEH_HTML::get_simple_tags(), $this ); |
|
68 | + function _get_allowed_tags() { |
|
69 | + return apply_filters('FHEE__EE_Maybe_Serialized_Simple_HTML_Field___get_allowed_tags', EEH_HTML::get_simple_tags(), $this); |
|
70 | 70 | } |
71 | 71 | } |
@@ -1,18 +1,18 @@ |
||
1 | 1 | <?php |
2 | -require_once( EE_MODELS . 'fields/EE_Text_Field_Base.php' ); |
|
2 | +require_once(EE_MODELS.'fields/EE_Text_Field_Base.php'); |
|
3 | 3 | /** |
4 | 4 | * Only allows a select, small number of html tags: a,abbr,acronym,b,blockquote,cite,code,del,em,i,q,strike,strong,ol,ul,li |
5 | 5 | * If you want more use EE_Post_Content_Field, or if you want to allow ALL, use EE_Full_HTML_Field. |
6 | 6 | * If you want NONE, use EE_Plain_Text_Field. |
7 | 7 | */ |
8 | -class EE_Simple_HTML_Field extends EE_Text_Field_Base{ |
|
8 | +class EE_Simple_HTML_Field extends EE_Text_Field_Base { |
|
9 | 9 | /** |
10 | 10 | * removes all tags when setting |
11 | 11 | * @param string $value_inputted_for_field_on_model_object |
12 | 12 | * @return string |
13 | 13 | */ |
14 | 14 | function prepare_for_set($value_inputted_for_field_on_model_object) { |
15 | - $value_with_select_tags = wp_kses("$value_inputted_for_field_on_model_object", EEH_HTML::get_simple_tags() ); |
|
15 | + $value_with_select_tags = wp_kses("$value_inputted_for_field_on_model_object", EEH_HTML::get_simple_tags()); |
|
16 | 16 | return parent::prepare_for_set($value_with_select_tags); |
17 | 17 | } |
18 | 18 |
@@ -10,17 +10,17 @@ discard block |
||
10 | 10 | * @since 4.6 |
11 | 11 | * |
12 | 12 | */ |
13 | -class EE_Simple_HTML_Validation_Strategy extends EE_Validation_Strategy_Base{ |
|
13 | +class EE_Simple_HTML_Validation_Strategy extends EE_Validation_Strategy_Base { |
|
14 | 14 | |
15 | 15 | /** |
16 | 16 | * @param null $validation_error_message |
17 | 17 | */ |
18 | - public function __construct( $validation_error_message = NULL ) { |
|
19 | - if( ! $validation_error_message ){ |
|
18 | + public function __construct($validation_error_message = NULL) { |
|
19 | + if ( ! $validation_error_message) { |
|
20 | 20 | $allowedtags = $this->_get_allowed_tags(); |
21 | - $validation_error_message = sprintf( __( "Only simple HTML tags are allowed. Eg, %s", "event_espresso" ), implode( ",", array_keys( $allowedtags ) ) ); |
|
21 | + $validation_error_message = sprintf(__("Only simple HTML tags are allowed. Eg, %s", "event_espresso"), implode(",", array_keys($allowedtags))); |
|
22 | 22 | } |
23 | - parent::__construct( $validation_error_message ); |
|
23 | + parent::__construct($validation_error_message); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | |
@@ -40,10 +40,10 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public function validate($normalized_value) { |
42 | 42 | $allowedtags = $this->_get_allowed_tags(); |
43 | - parent::validate( $normalized_value ); |
|
44 | - $normalized_value_sans_tags = wp_kses( "$normalized_value",$allowedtags ); |
|
45 | - if ( strlen( $normalized_value ) > strlen( $normalized_value_sans_tags ) ) { |
|
46 | - throw new EE_Validation_Error( $this->get_validation_error_message(), 'complex_html_tags' ); |
|
43 | + parent::validate($normalized_value); |
|
44 | + $normalized_value_sans_tags = wp_kses("$normalized_value", $allowedtags); |
|
45 | + if (strlen($normalized_value) > strlen($normalized_value_sans_tags)) { |
|
46 | + throw new EE_Validation_Error($this->get_validation_error_message(), 'complex_html_tags'); |
|
47 | 47 | } |
48 | 48 | } |
49 | 49 | } |
50 | 50 | \ No newline at end of file |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | */ |
42 | 42 | public static function instance() { |
43 | 43 | // check if class object is instantiated, and instantiated properly |
44 | - if ( ! self::$_instance instanceof EEH_HTML ) { |
|
44 | + if ( ! self::$_instance instanceof EEH_HTML) { |
|
45 | 45 | self::$_instance = new EEH_HTML(); |
46 | 46 | } |
47 | 47 | return self::$_instance; |
@@ -102,14 +102,14 @@ discard block |
||
102 | 102 | $other_attributes = '', |
103 | 103 | $force_close = false |
104 | 104 | ) { |
105 | - $attributes = ! empty( $id ) ? ' id="' . EEH_HTML::sanitize_id( $id ) . '"' : ''; |
|
106 | - $attributes .= ! empty( $class ) ? ' class="' . $class . '"' : ''; |
|
107 | - $attributes .= ! empty( $style ) ? ' style="' . $style . '"' : ''; |
|
108 | - $attributes .= ! empty( $other_attributes ) ? ' ' . $other_attributes : ''; |
|
109 | - $html = EEH_HTML::nl( 0, $tag ) . '<' . $tag . $attributes . '>'; |
|
110 | - $html .= ! empty( $content ) ? EEH_HTML::nl( 1, $tag ) . $content : ''; |
|
111 | - $indent = ! empty( $content ) || $force_close ? TRUE : FALSE; |
|
112 | - $html .= ! empty( $content ) || $force_close ? EEH_HTML::_close_tag( $tag, $id, $class, $indent ) : ''; |
|
105 | + $attributes = ! empty($id) ? ' id="'.EEH_HTML::sanitize_id($id).'"' : ''; |
|
106 | + $attributes .= ! empty($class) ? ' class="'.$class.'"' : ''; |
|
107 | + $attributes .= ! empty($style) ? ' style="'.$style.'"' : ''; |
|
108 | + $attributes .= ! empty($other_attributes) ? ' '.$other_attributes : ''; |
|
109 | + $html = EEH_HTML::nl(0, $tag).'<'.$tag.$attributes.'>'; |
|
110 | + $html .= ! empty($content) ? EEH_HTML::nl(1, $tag).$content : ''; |
|
111 | + $indent = ! empty($content) || $force_close ? TRUE : FALSE; |
|
112 | + $html .= ! empty($content) || $force_close ? EEH_HTML::_close_tag($tag, $id, $class, $indent) : ''; |
|
113 | 113 | return $html; |
114 | 114 | } |
115 | 115 | |
@@ -126,15 +126,15 @@ discard block |
||
126 | 126 | * @param bool $indent |
127 | 127 | * @return string |
128 | 128 | */ |
129 | - protected static function _close_tag( $tag = 'div', $id = '', $class = '', $indent = TRUE ) { |
|
129 | + protected static function _close_tag($tag = 'div', $id = '', $class = '', $indent = TRUE) { |
|
130 | 130 | $comment = ''; |
131 | - if ( $id ) { |
|
132 | - $comment = EEH_HTML::comment( 'close ' . $id ) . EEH_HTML::nl( 0, $tag ); |
|
133 | - } else if ( $class ) { |
|
134 | - $comment = EEH_HTML::comment( 'close ' . $class ) . EEH_HTML::nl( 0, $tag ); |
|
131 | + if ($id) { |
|
132 | + $comment = EEH_HTML::comment('close '.$id).EEH_HTML::nl(0, $tag); |
|
133 | + } else if ($class) { |
|
134 | + $comment = EEH_HTML::comment('close '.$class).EEH_HTML::nl(0, $tag); |
|
135 | 135 | } |
136 | 136 | $html = $indent ? EEH_HTML::nl( -1, $tag ) : ''; |
137 | - $html .= '</' . $tag . '>' . $comment; |
|
137 | + $html .= '</'.$tag.'>'.$comment; |
|
138 | 138 | return $html; |
139 | 139 | } |
140 | 140 | |
@@ -153,8 +153,8 @@ discard block |
||
153 | 153 | * @param string $other_attributes - additional attributes like "colspan", inline JS, "rel" tags, etc |
154 | 154 | * @return string |
155 | 155 | */ |
156 | - public static function div( $content = '', $id = '', $class = '', $style = '', $other_attributes = '' ) { |
|
157 | - return EEH_HTML::_open_tag( 'div', $content, $id, $class, $style, $other_attributes ); |
|
156 | + public static function div($content = '', $id = '', $class = '', $style = '', $other_attributes = '') { |
|
157 | + return EEH_HTML::_open_tag('div', $content, $id, $class, $style, $other_attributes); |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | |
@@ -167,8 +167,8 @@ discard block |
||
167 | 167 | * @param string $class - html class attribute |
168 | 168 | * @return string |
169 | 169 | */ |
170 | - public static function divx( $id = '', $class = '' ) { |
|
171 | - return EEH_HTML::_close_tag( 'div', $id, $class ); |
|
170 | + public static function divx($id = '', $class = '') { |
|
171 | + return EEH_HTML::_close_tag('div', $id, $class); |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | |
@@ -184,8 +184,8 @@ discard block |
||
184 | 184 | * @param string $other_attributes - additional attributes like "colspan", inline JS, "rel" tags, etc |
185 | 185 | * @return string |
186 | 186 | */ |
187 | - public static function h1( $content = '', $id = '', $class = '', $style = '', $other_attributes = '' ) { |
|
188 | - return EEH_HTML::_open_tag( 'h1', $content, $id, $class, $style, $other_attributes, TRUE ); |
|
187 | + public static function h1($content = '', $id = '', $class = '', $style = '', $other_attributes = '') { |
|
188 | + return EEH_HTML::_open_tag('h1', $content, $id, $class, $style, $other_attributes, TRUE); |
|
189 | 189 | } |
190 | 190 | |
191 | 191 | |
@@ -201,8 +201,8 @@ discard block |
||
201 | 201 | * @param string $other_attributes - additional attributes like "colspan", inline JS, "rel" tags, etc |
202 | 202 | * @return string |
203 | 203 | */ |
204 | - public static function h2( $content = '', $id = '', $class = '', $style = '', $other_attributes = '' ) { |
|
205 | - return EEH_HTML::_open_tag( 'h2', $content, $id, $class, $style, $other_attributes, TRUE ); |
|
204 | + public static function h2($content = '', $id = '', $class = '', $style = '', $other_attributes = '') { |
|
205 | + return EEH_HTML::_open_tag('h2', $content, $id, $class, $style, $other_attributes, TRUE); |
|
206 | 206 | } |
207 | 207 | |
208 | 208 | |
@@ -218,8 +218,8 @@ discard block |
||
218 | 218 | * @param string $other_attributes - additional attributes like "colspan", inline JS, "rel" tags, etc |
219 | 219 | * @return string |
220 | 220 | */ |
221 | - public static function h3( $content = '', $id = '', $class = '', $style = '', $other_attributes = '' ) { |
|
222 | - return EEH_HTML::_open_tag( 'h3', $content, $id, $class, $style, $other_attributes, TRUE ); |
|
221 | + public static function h3($content = '', $id = '', $class = '', $style = '', $other_attributes = '') { |
|
222 | + return EEH_HTML::_open_tag('h3', $content, $id, $class, $style, $other_attributes, TRUE); |
|
223 | 223 | } |
224 | 224 | |
225 | 225 | |
@@ -235,8 +235,8 @@ discard block |
||
235 | 235 | * @param string $other_attributes - additional attributes like "colspan", inline JS, "rel" tags, etc |
236 | 236 | * @return string |
237 | 237 | */ |
238 | - public static function h4( $content = '', $id = '', $class = '', $style = '', $other_attributes = '' ) { |
|
239 | - return EEH_HTML::_open_tag( 'h4', $content, $id, $class, $style, $other_attributes, TRUE ); |
|
238 | + public static function h4($content = '', $id = '', $class = '', $style = '', $other_attributes = '') { |
|
239 | + return EEH_HTML::_open_tag('h4', $content, $id, $class, $style, $other_attributes, TRUE); |
|
240 | 240 | } |
241 | 241 | |
242 | 242 | |
@@ -252,8 +252,8 @@ discard block |
||
252 | 252 | * @param string $other_attributes - additional attributes like "colspan", inline JS, "rel" tags, etc |
253 | 253 | * @return string |
254 | 254 | */ |
255 | - public static function h5( $content = '', $id = '', $class = '', $style = '', $other_attributes = '' ) { |
|
256 | - return EEH_HTML::_open_tag( 'h5', $content, $id, $class, $style, $other_attributes, TRUE ); |
|
255 | + public static function h5($content = '', $id = '', $class = '', $style = '', $other_attributes = '') { |
|
256 | + return EEH_HTML::_open_tag('h5', $content, $id, $class, $style, $other_attributes, TRUE); |
|
257 | 257 | } |
258 | 258 | |
259 | 259 | |
@@ -269,8 +269,8 @@ discard block |
||
269 | 269 | * @param string $other_attributes - additional attributes like "colspan", inline JS, "rel" tags, etc |
270 | 270 | * @return string |
271 | 271 | */ |
272 | - public static function h6( $content = '', $id = '', $class = '', $style = '', $other_attributes = '' ) { |
|
273 | - return EEH_HTML::_open_tag( 'h6', $content, $id, $class, $style, $other_attributes, TRUE ); |
|
272 | + public static function h6($content = '', $id = '', $class = '', $style = '', $other_attributes = '') { |
|
273 | + return EEH_HTML::_open_tag('h6', $content, $id, $class, $style, $other_attributes, TRUE); |
|
274 | 274 | } |
275 | 275 | |
276 | 276 | |
@@ -286,8 +286,8 @@ discard block |
||
286 | 286 | * @param string $other_attributes - additional attributes like "colspan", inline JS, "rel" tags, etc |
287 | 287 | * @return string |
288 | 288 | */ |
289 | - public static function p( $content = '', $id = '', $class = '', $style = '', $other_attributes = '' ) { |
|
290 | - return EEH_HTML::_open_tag( 'p', $content, $id, $class, $style, $other_attributes, TRUE ); |
|
289 | + public static function p($content = '', $id = '', $class = '', $style = '', $other_attributes = '') { |
|
290 | + return EEH_HTML::_open_tag('p', $content, $id, $class, $style, $other_attributes, TRUE); |
|
291 | 291 | } |
292 | 292 | |
293 | 293 | |
@@ -302,8 +302,8 @@ discard block |
||
302 | 302 | * @param string $other_attributes - additional attributes like "colspan", inline JS, "rel" tags, etc |
303 | 303 | * @return string |
304 | 304 | */ |
305 | - public static function ul( $id = '', $class = '', $style = '', $other_attributes = '' ) { |
|
306 | - return EEH_HTML::_open_tag( 'ul', '', $id, $class, $style, $other_attributes ); |
|
305 | + public static function ul($id = '', $class = '', $style = '', $other_attributes = '') { |
|
306 | + return EEH_HTML::_open_tag('ul', '', $id, $class, $style, $other_attributes); |
|
307 | 307 | } |
308 | 308 | |
309 | 309 | |
@@ -316,8 +316,8 @@ discard block |
||
316 | 316 | * @param string $class - html class attribute |
317 | 317 | * @return string |
318 | 318 | */ |
319 | - public static function ulx( $id = '', $class = '' ) { |
|
320 | - return EEH_HTML::_close_tag( 'ul', $id, $class ); |
|
319 | + public static function ulx($id = '', $class = '') { |
|
320 | + return EEH_HTML::_close_tag('ul', $id, $class); |
|
321 | 321 | } |
322 | 322 | |
323 | 323 | |
@@ -334,8 +334,8 @@ discard block |
||
334 | 334 | * @param string $other_attributes - additional attributes like "colspan", inline JS, "rel" tags, etc |
335 | 335 | * @return string |
336 | 336 | */ |
337 | - public static function li( $content = '', $id = '', $class = '', $style = '', $other_attributes = '' ) { |
|
338 | - return EEH_HTML::_open_tag( 'li', $content, $id, $class, $style, $other_attributes ); |
|
337 | + public static function li($content = '', $id = '', $class = '', $style = '', $other_attributes = '') { |
|
338 | + return EEH_HTML::_open_tag('li', $content, $id, $class, $style, $other_attributes); |
|
339 | 339 | } |
340 | 340 | |
341 | 341 | |
@@ -348,8 +348,8 @@ discard block |
||
348 | 348 | * @param string $class - html class attribute |
349 | 349 | * @return string |
350 | 350 | */ |
351 | - public static function lix( $id = '', $class = '' ) { |
|
352 | - return EEH_HTML::_close_tag( 'li', $id, $class ); |
|
351 | + public static function lix($id = '', $class = '') { |
|
352 | + return EEH_HTML::_close_tag('li', $id, $class); |
|
353 | 353 | } |
354 | 354 | |
355 | 355 | |
@@ -365,8 +365,8 @@ discard block |
||
365 | 365 | * @param string $other_attributes - additional attributes like "colspan", inline JS, "rel" tags, etc |
366 | 366 | * @return string |
367 | 367 | */ |
368 | - public static function table( $content = '', $id = '', $class = '', $style = '', $other_attributes = '' ) { |
|
369 | - return EEH_HTML::_open_tag( 'table', $content, $id, $class, $style, $other_attributes ); |
|
368 | + public static function table($content = '', $id = '', $class = '', $style = '', $other_attributes = '') { |
|
369 | + return EEH_HTML::_open_tag('table', $content, $id, $class, $style, $other_attributes); |
|
370 | 370 | } |
371 | 371 | |
372 | 372 | |
@@ -378,8 +378,8 @@ discard block |
||
378 | 378 | * @param string $class - html class attribute |
379 | 379 | * @return string |
380 | 380 | */ |
381 | - public static function tablex( $id = '', $class = '' ) { |
|
382 | - return EEH_HTML::_close_tag( 'table', $id, $class ); |
|
381 | + public static function tablex($id = '', $class = '') { |
|
382 | + return EEH_HTML::_close_tag('table', $id, $class); |
|
383 | 383 | } |
384 | 384 | |
385 | 385 | |
@@ -395,8 +395,8 @@ discard block |
||
395 | 395 | * @param string $other_attributes - additional attributes like "colspan", inline JS, "rel" tags, etc |
396 | 396 | * @return string |
397 | 397 | */ |
398 | - public static function thead( $content = '', $id = '', $class = '', $style = '', $other_attributes = '' ) { |
|
399 | - return EEH_HTML::_open_tag( 'thead', $content, $id, $class, $style, $other_attributes ); |
|
398 | + public static function thead($content = '', $id = '', $class = '', $style = '', $other_attributes = '') { |
|
399 | + return EEH_HTML::_open_tag('thead', $content, $id, $class, $style, $other_attributes); |
|
400 | 400 | } |
401 | 401 | |
402 | 402 | |
@@ -408,8 +408,8 @@ discard block |
||
408 | 408 | * @param string $class - html class attribute |
409 | 409 | * @return string |
410 | 410 | */ |
411 | - public static function theadx( $id = '', $class = '' ) { |
|
412 | - return EEH_HTML::_close_tag( 'thead', $id, $class ); |
|
411 | + public static function theadx($id = '', $class = '') { |
|
412 | + return EEH_HTML::_close_tag('thead', $id, $class); |
|
413 | 413 | } |
414 | 414 | |
415 | 415 | |
@@ -425,8 +425,8 @@ discard block |
||
425 | 425 | * @param string $other_attributes - additional attributes like "colspan", inline JS, "rel" tags, etc |
426 | 426 | * @return string |
427 | 427 | */ |
428 | - public static function tbody( $content = '', $id = '', $class = '', $style = '', $other_attributes = '' ) { |
|
429 | - return EEH_HTML::_open_tag( 'tbody', $content, $id, $class, $style, $other_attributes ); |
|
428 | + public static function tbody($content = '', $id = '', $class = '', $style = '', $other_attributes = '') { |
|
429 | + return EEH_HTML::_open_tag('tbody', $content, $id, $class, $style, $other_attributes); |
|
430 | 430 | } |
431 | 431 | |
432 | 432 | |
@@ -438,8 +438,8 @@ discard block |
||
438 | 438 | * @param string $class - html class attribute |
439 | 439 | * @return string |
440 | 440 | */ |
441 | - public static function tbodyx( $id = '', $class = '' ) { |
|
442 | - return EEH_HTML::_close_tag( 'tbody', $id, $class ); |
|
441 | + public static function tbodyx($id = '', $class = '') { |
|
442 | + return EEH_HTML::_close_tag('tbody', $id, $class); |
|
443 | 443 | } |
444 | 444 | |
445 | 445 | |
@@ -455,8 +455,8 @@ discard block |
||
455 | 455 | * @param string $other_attributes - additional attributes like "colspan", inline JS, "rel" tags, etc |
456 | 456 | * @return string |
457 | 457 | */ |
458 | - public static function tr( $content = '', $id = '', $class = '', $style = '', $other_attributes = '' ) { |
|
459 | - return EEH_HTML::_open_tag( 'tr', $content, $id, $class, $style, $other_attributes ); |
|
458 | + public static function tr($content = '', $id = '', $class = '', $style = '', $other_attributes = '') { |
|
459 | + return EEH_HTML::_open_tag('tr', $content, $id, $class, $style, $other_attributes); |
|
460 | 460 | } |
461 | 461 | |
462 | 462 | |
@@ -468,8 +468,8 @@ discard block |
||
468 | 468 | * @param string $class - html class attribute |
469 | 469 | * @return string |
470 | 470 | */ |
471 | - public static function trx( $id = '', $class = '' ) { |
|
472 | - return EEH_HTML::_close_tag( 'tr', $id, $class ); |
|
471 | + public static function trx($id = '', $class = '') { |
|
472 | + return EEH_HTML::_close_tag('tr', $id, $class); |
|
473 | 473 | } |
474 | 474 | |
475 | 475 | |
@@ -485,8 +485,8 @@ discard block |
||
485 | 485 | * @param string $other_attributes - additional attributes like "colspan", inline JS, "rel" tags, etc |
486 | 486 | * @return string |
487 | 487 | */ |
488 | - public static function th( $content = '', $id = '', $class = '', $style = '', $other_attributes = '' ) { |
|
489 | - return EEH_HTML::_open_tag( 'th', $content, $id, $class, $style, $other_attributes ); |
|
488 | + public static function th($content = '', $id = '', $class = '', $style = '', $other_attributes = '') { |
|
489 | + return EEH_HTML::_open_tag('th', $content, $id, $class, $style, $other_attributes); |
|
490 | 490 | } |
491 | 491 | |
492 | 492 | |
@@ -498,8 +498,8 @@ discard block |
||
498 | 498 | * @param string $class - html class attribute |
499 | 499 | * @return string |
500 | 500 | */ |
501 | - public static function thx( $id = '', $class = '' ) { |
|
502 | - return EEH_HTML::_close_tag( 'th', $id, $class ); |
|
501 | + public static function thx($id = '', $class = '') { |
|
502 | + return EEH_HTML::_close_tag('th', $id, $class); |
|
503 | 503 | } |
504 | 504 | |
505 | 505 | |
@@ -515,8 +515,8 @@ discard block |
||
515 | 515 | * @param string $other_attributes - additional attributes like "colspan", inline JS, "rel" tags, etc |
516 | 516 | * @return string |
517 | 517 | */ |
518 | - public static function td( $content = '', $id = '', $class = '', $style = '', $other_attributes = '' ) { |
|
519 | - return EEH_HTML::_open_tag( 'td', $content, $id, $class, $style, $other_attributes ); |
|
518 | + public static function td($content = '', $id = '', $class = '', $style = '', $other_attributes = '') { |
|
519 | + return EEH_HTML::_open_tag('td', $content, $id, $class, $style, $other_attributes); |
|
520 | 520 | } |
521 | 521 | |
522 | 522 | |
@@ -528,8 +528,8 @@ discard block |
||
528 | 528 | * @param string $class - html class attribute |
529 | 529 | * @return string |
530 | 530 | */ |
531 | - public static function tdx( $id = '', $class = '' ) { |
|
532 | - return EEH_HTML::_close_tag( 'td', $id, $class ); |
|
531 | + public static function tdx($id = '', $class = '') { |
|
532 | + return EEH_HTML::_close_tag('td', $id, $class); |
|
533 | 533 | } |
534 | 534 | |
535 | 535 | |
@@ -543,10 +543,10 @@ discard block |
||
543 | 543 | * @param int $colspan |
544 | 544 | * @return string |
545 | 545 | */ |
546 | - public static function no_row( $content = '', $colspan = 2 ) { |
|
546 | + public static function no_row($content = '', $colspan = 2) { |
|
547 | 547 | return EEH_HTML::tr( |
548 | - EEH_HTML::td( $content, '', '', 'padding:0; border:none;', 'colspan="' . $colspan . '"' ), |
|
549 | - '', '', 'padding:0; border:none;' |
|
548 | + EEH_HTML::td($content, '', '', 'padding:0; border:none;', 'colspan="'.$colspan.'"'), |
|
549 | + '', '', 'padding:0; border:none;' |
|
550 | 550 | ); |
551 | 551 | } |
552 | 552 | |
@@ -566,14 +566,14 @@ discard block |
||
566 | 566 | * @param string $other_attributes - additional attributes like "colspan", inline JS, "rel" tags, etc |
567 | 567 | * @return string |
568 | 568 | */ |
569 | - public static function link( $href = '', $link_text = '', $title = '', $id = '', $class = '', $style = '', $other_attributes = '' ) { |
|
570 | - $link_text = ! empty( $link_text ) ? $link_text : $href; |
|
571 | - $attributes = ! empty( $id ) ? ' id="' . EEH_HTML::sanitize_id( $id ) . '"' : ''; |
|
572 | - $attributes .= ! empty( $class ) ? ' class="' . $class . '"' : ''; |
|
573 | - $attributes .= ! empty( $style ) ? ' style="' . $style . '"' : ''; |
|
574 | - $attributes .= ! empty( $title ) ? ' title="' . esc_attr( $title ) . '"' : ''; |
|
575 | - $attributes .= ! empty( $other_attributes ) ? ' ' . $other_attributes : ''; |
|
576 | - return '<a href="' . $href . '" ' . $attributes . '>' . $link_text . '</a>'; |
|
569 | + public static function link($href = '', $link_text = '', $title = '', $id = '', $class = '', $style = '', $other_attributes = '') { |
|
570 | + $link_text = ! empty($link_text) ? $link_text : $href; |
|
571 | + $attributes = ! empty($id) ? ' id="'.EEH_HTML::sanitize_id($id).'"' : ''; |
|
572 | + $attributes .= ! empty($class) ? ' class="'.$class.'"' : ''; |
|
573 | + $attributes .= ! empty($style) ? ' style="'.$style.'"' : ''; |
|
574 | + $attributes .= ! empty($title) ? ' title="'.esc_attr($title).'"' : ''; |
|
575 | + $attributes .= ! empty($other_attributes) ? ' '.$other_attributes : ''; |
|
576 | + return '<a href="'.$href.'" '.$attributes.'>'.$link_text.'</a>'; |
|
577 | 577 | } |
578 | 578 | |
579 | 579 | |
@@ -590,14 +590,14 @@ discard block |
||
590 | 590 | * @param string $other_attributes - additional attributes like "colspan", inline JS, "rel" tags, etc |
591 | 591 | * @return string |
592 | 592 | */ |
593 | - public static function img( $src = '', $alt = '', $id = '', $class = '', $style = '', $other_attributes = '' ) { |
|
594 | - $attributes = ! empty( $src ) ? ' src="' . esc_url_raw( $src ) . '"' : ''; |
|
595 | - $attributes .= ! empty( $alt ) ? ' alt="' . esc_attr( $alt ) . '"' : ''; |
|
596 | - $attributes .= ! empty( $id ) ? ' id="' . EEH_HTML::sanitize_id( $id ) . '"' : ''; |
|
597 | - $attributes .= ! empty( $class ) ? ' class="' . $class . '"' : ''; |
|
598 | - $attributes .= ! empty( $style ) ? ' style="' . $style . '"' : ''; |
|
599 | - $attributes .= ! empty( $other_attributes ) ? ' ' . $other_attributes : ''; |
|
600 | - return '<img' . $attributes . '/>'; |
|
593 | + public static function img($src = '', $alt = '', $id = '', $class = '', $style = '', $other_attributes = '') { |
|
594 | + $attributes = ! empty($src) ? ' src="'.esc_url_raw($src).'"' : ''; |
|
595 | + $attributes .= ! empty($alt) ? ' alt="'.esc_attr($alt).'"' : ''; |
|
596 | + $attributes .= ! empty($id) ? ' id="'.EEH_HTML::sanitize_id($id).'"' : ''; |
|
597 | + $attributes .= ! empty($class) ? ' class="'.$class.'"' : ''; |
|
598 | + $attributes .= ! empty($style) ? ' style="'.$style.'"' : ''; |
|
599 | + $attributes .= ! empty($other_attributes) ? ' '.$other_attributes : ''; |
|
600 | + return '<img'.$attributes.'/>'; |
|
601 | 601 | } |
602 | 602 | |
603 | 603 | |
@@ -615,12 +615,12 @@ discard block |
||
615 | 615 | * @param string $other_attributes - additional attributes like "colspan", inline JS, "rel" tags, etc |
616 | 616 | * @return string |
617 | 617 | */ |
618 | - protected static function _inline_tag( $tag = 'span', $content = '', $id = '', $class = '', $style = '', $other_attributes = '' ) { |
|
619 | - $attributes = ! empty( $id ) ? ' id="' . EEH_HTML::sanitize_id( $id ) . '"' : ''; |
|
620 | - $attributes .= ! empty( $class ) ? ' class="' . $class . '"' : ''; |
|
621 | - $attributes .= ! empty( $style ) ? ' style="' . $style . '"' : ''; |
|
622 | - $attributes .= ! empty( $other_attributes ) ? ' ' . $other_attributes : ''; |
|
623 | - return '<' . $tag . ' ' . $attributes . '>' . $content . '</' . $tag . '>'; |
|
618 | + protected static function _inline_tag($tag = 'span', $content = '', $id = '', $class = '', $style = '', $other_attributes = '') { |
|
619 | + $attributes = ! empty($id) ? ' id="'.EEH_HTML::sanitize_id($id).'"' : ''; |
|
620 | + $attributes .= ! empty($class) ? ' class="'.$class.'"' : ''; |
|
621 | + $attributes .= ! empty($style) ? ' style="'.$style.'"' : ''; |
|
622 | + $attributes .= ! empty($other_attributes) ? ' '.$other_attributes : ''; |
|
623 | + return '<'.$tag.' '.$attributes.'>'.$content.'</'.$tag.'>'; |
|
624 | 624 | } |
625 | 625 | |
626 | 626 | |
@@ -636,8 +636,8 @@ discard block |
||
636 | 636 | * @param string $other_attributes - additional attributes like "colspan", inline JS, "rel" tags, etc |
637 | 637 | * @return string |
638 | 638 | */ |
639 | - public static function label( $content = '', $id = '', $class = '', $style = '', $other_attributes = '' ) { |
|
640 | - return EEH_HTML::_inline_tag( 'label', $content, $id, $class, $style, $other_attributes ); |
|
639 | + public static function label($content = '', $id = '', $class = '', $style = '', $other_attributes = '') { |
|
640 | + return EEH_HTML::_inline_tag('label', $content, $id, $class, $style, $other_attributes); |
|
641 | 641 | } |
642 | 642 | |
643 | 643 | |
@@ -653,8 +653,8 @@ discard block |
||
653 | 653 | * @param string $other_attributes - additional attributes like "colspan", inline JS, "rel" tags, etc |
654 | 654 | * @return string |
655 | 655 | */ |
656 | - public static function span( $content = '', $id = '', $class = '', $style = '', $other_attributes = '' ) { |
|
657 | - return EEH_HTML::_inline_tag( 'span', $content, $id, $class, $style, $other_attributes ); |
|
656 | + public static function span($content = '', $id = '', $class = '', $style = '', $other_attributes = '') { |
|
657 | + return EEH_HTML::_inline_tag('span', $content, $id, $class, $style, $other_attributes); |
|
658 | 658 | } |
659 | 659 | |
660 | 660 | |
@@ -670,8 +670,8 @@ discard block |
||
670 | 670 | * @param string $other_attributes - additional attributes like "colspan", inline JS, "rel" tags, etc |
671 | 671 | * @return string |
672 | 672 | */ |
673 | - public static function strong( $content = '', $id = '', $class = '', $style = '', $other_attributes = '' ) { |
|
674 | - return EEH_HTML::_inline_tag( 'strong', $content, $id, $class, $style, $other_attributes ); |
|
673 | + public static function strong($content = '', $id = '', $class = '', $style = '', $other_attributes = '') { |
|
674 | + return EEH_HTML::_inline_tag('strong', $content, $id, $class, $style, $other_attributes); |
|
675 | 675 | } |
676 | 676 | |
677 | 677 | |
@@ -683,8 +683,8 @@ discard block |
||
683 | 683 | * @param string $comment |
684 | 684 | * @return string |
685 | 685 | */ |
686 | - public static function comment( $comment = '' ) { |
|
687 | - return ! empty( $comment ) ? EEH_HTML::nl() . '<!-- ' . $comment . ' -->' : ''; |
|
686 | + public static function comment($comment = '') { |
|
687 | + return ! empty($comment) ? EEH_HTML::nl().'<!-- '.$comment.' -->' : ''; |
|
688 | 688 | } |
689 | 689 | |
690 | 690 | |
@@ -695,8 +695,8 @@ discard block |
||
695 | 695 | * @param int $nmbr - the number of line breaks to return |
696 | 696 | * @return string |
697 | 697 | */ |
698 | - public static function br( $nmbr = 1 ) { |
|
699 | - return str_repeat( '<br />', $nmbr ); |
|
698 | + public static function br($nmbr = 1) { |
|
699 | + return str_repeat('<br />', $nmbr); |
|
700 | 700 | } |
701 | 701 | |
702 | 702 | |
@@ -707,8 +707,8 @@ discard block |
||
707 | 707 | * @param int $nmbr - the number of non-breaking spaces to return |
708 | 708 | * @return string |
709 | 709 | */ |
710 | - public static function nbsp( $nmbr = 1 ) { |
|
711 | - return str_repeat( ' ', $nmbr ); |
|
710 | + public static function nbsp($nmbr = 1) { |
|
711 | + return str_repeat(' ', $nmbr); |
|
712 | 712 | } |
713 | 713 | |
714 | 714 | |
@@ -722,9 +722,9 @@ discard block |
||
722 | 722 | * @param string $id |
723 | 723 | * @return string |
724 | 724 | */ |
725 | - public static function sanitize_id( $id = '' ) { |
|
726 | - $key = str_replace( ' ', '-', trim( $id ) ); |
|
727 | - return preg_replace( '/[^a-zA-Z0-9_\-]/', '', $key ); |
|
725 | + public static function sanitize_id($id = '') { |
|
726 | + $key = str_replace(' ', '-', trim($id)); |
|
727 | + return preg_replace('/[^a-zA-Z0-9_\-]/', '', $key); |
|
728 | 728 | } |
729 | 729 | |
730 | 730 | |
@@ -736,10 +736,10 @@ discard block |
||
736 | 736 | * @param string $tag |
737 | 737 | * @return string - newline character plus # of indents passed (can be + or -) |
738 | 738 | */ |
739 | - public static function nl( $indent = 0, $tag = 'none' ) { |
|
739 | + public static function nl($indent = 0, $tag = 'none') { |
|
740 | 740 | $html = "\n"; |
741 | - EEH_HTML::indent( $indent, $tag ); |
|
742 | - for ( $x = 0; $x < EEH_HTML::$_indent[ $tag ]; $x++ ) { |
|
741 | + EEH_HTML::indent($indent, $tag); |
|
742 | + for ($x = 0; $x < EEH_HTML::$_indent[$tag]; $x++) { |
|
743 | 743 | $html .= "\t"; |
744 | 744 | } |
745 | 745 | return $html; |
@@ -754,17 +754,17 @@ discard block |
||
754 | 754 | * @param int $indent can be negative to decrease the indentation level |
755 | 755 | * @param string $tag |
756 | 756 | */ |
757 | - public static function indent( $indent, $tag = 'none' ){ |
|
757 | + public static function indent($indent, $tag = 'none') { |
|
758 | 758 | static $default_indentation = FALSE; |
759 | - if ( ! $default_indentation ) { |
|
759 | + if ( ! $default_indentation) { |
|
760 | 760 | EEH_HTML::_set_default_indentation(); |
761 | 761 | $default_indentation = TRUE; |
762 | 762 | } |
763 | - if ( ! isset( EEH_HTML::$_indent[ $tag ] )) { |
|
764 | - EEH_HTML::$_indent[ $tag ] = 0; |
|
763 | + if ( ! isset(EEH_HTML::$_indent[$tag])) { |
|
764 | + EEH_HTML::$_indent[$tag] = 0; |
|
765 | 765 | } |
766 | - EEH_HTML::$_indent[ $tag ] += (int)$indent; |
|
767 | - EEH_HTML::$_indent[ $tag ] = EEH_HTML::$_indent[ $tag ] >= 0 ? EEH_HTML::$_indent[ $tag ] : 0; |
|
766 | + EEH_HTML::$_indent[$tag] += (int) $indent; |
|
767 | + EEH_HTML::$_indent[$tag] = EEH_HTML::$_indent[$tag] >= 0 ? EEH_HTML::$_indent[$tag] : 0; |
|
768 | 768 | } |
769 | 769 | |
770 | 770 | |
@@ -810,15 +810,15 @@ discard block |
||
810 | 810 | * @global array $allowedtags |
811 | 811 | * @return array |
812 | 812 | */ |
813 | - public static function get_simple_tags(){ |
|
813 | + public static function get_simple_tags() { |
|
814 | 814 | global $allowedtags; |
815 | 815 | $tags_we_allow = $allowedtags; |
816 | - $tags_we_allow['ol']=array(); |
|
817 | - $tags_we_allow['ul']=array(); |
|
818 | - $tags_we_allow['li']=array(); |
|
819 | - $tags_we_allow['br']=array(); |
|
820 | - $tags_we_allow['p']=array(); |
|
821 | - return apply_filters( 'FHEE__EEH_HTML__get_simple_tags', $tags_we_allow ); |
|
816 | + $tags_we_allow['ol'] = array(); |
|
817 | + $tags_we_allow['ul'] = array(); |
|
818 | + $tags_we_allow['li'] = array(); |
|
819 | + $tags_we_allow['br'] = array(); |
|
820 | + $tags_we_allow['p'] = array(); |
|
821 | + return apply_filters('FHEE__EEH_HTML__get_simple_tags', $tags_we_allow); |
|
822 | 822 | } |
823 | 823 | |
824 | 824 |
@@ -27,14 +27,14 @@ discard block |
||
27 | 27 | * @param int | \EE_Event $event |
28 | 28 | * @return bool |
29 | 29 | */ |
30 | -function is_espresso_event( $event = NULL ) { |
|
31 | - if ( can_use_espresso_conditionals( __FUNCTION__ )) { |
|
30 | +function is_espresso_event($event = NULL) { |
|
31 | + if (can_use_espresso_conditionals(__FUNCTION__)) { |
|
32 | 32 | // load event view helper |
33 | - EE_Registry::instance()->load_helper( 'Event_View' ); |
|
33 | + EE_Registry::instance()->load_helper('Event_View'); |
|
34 | 34 | // extract EE_Event object from passed param regardless of what it is (within reason of course) |
35 | - $event = EEH_Event_View::get_event( $event ); |
|
35 | + $event = EEH_Event_View::get_event($event); |
|
36 | 36 | // do we have a valid event ? |
37 | - return $event instanceof EE_Event ? TRUE : FALSE; |
|
37 | + return $event instanceof EE_Event ? TRUE : FALSE; |
|
38 | 38 | } |
39 | 39 | return FALSE; |
40 | 40 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | * @return bool |
47 | 47 | */ |
48 | 48 | function is_espresso_event_single() { |
49 | - if ( can_use_espresso_conditionals( __FUNCTION__ )) { |
|
49 | + if (can_use_espresso_conditionals(__FUNCTION__)) { |
|
50 | 50 | global $wp_query; |
51 | 51 | // return conditionals set by CPTs |
52 | 52 | return $wp_query instanceof WP_Query ? $wp_query->is_espresso_event_single : FALSE; |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | * @return bool |
62 | 62 | */ |
63 | 63 | function is_espresso_event_archive() { |
64 | - if ( can_use_espresso_conditionals( __FUNCTION__ )) { |
|
64 | + if (can_use_espresso_conditionals(__FUNCTION__)) { |
|
65 | 65 | global $wp_query; |
66 | 66 | return $wp_query instanceof WP_Query ? $wp_query->is_espresso_event_archive : FALSE; |
67 | 67 | } |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | * @return bool |
76 | 76 | */ |
77 | 77 | function is_espresso_event_taxonomy() { |
78 | - if ( can_use_espresso_conditionals( __FUNCTION__ )) { |
|
78 | + if (can_use_espresso_conditionals(__FUNCTION__)) { |
|
79 | 79 | global $wp_query; |
80 | 80 | return $wp_query instanceof WP_Query ? $wp_query->is_espresso_event_taxonomy : FALSE; |
81 | 81 | } |
@@ -89,12 +89,12 @@ discard block |
||
89 | 89 | * @param int | \EE_Venue $venue |
90 | 90 | * @return bool |
91 | 91 | */ |
92 | -function is_espresso_venue( $venue = NULL ) { |
|
93 | - if ( can_use_espresso_conditionals( __FUNCTION__ )) { |
|
92 | +function is_espresso_venue($venue = NULL) { |
|
93 | + if (can_use_espresso_conditionals(__FUNCTION__)) { |
|
94 | 94 | // load event view helper |
95 | - EE_Registry::instance()->load_helper( 'Venue_View' ); |
|
95 | + EE_Registry::instance()->load_helper('Venue_View'); |
|
96 | 96 | // extract EE_Venue object from passed param regardless of what it is (within reason of course) |
97 | - $venue = EEH_Venue_View::get_venue( $venue, FALSE ); |
|
97 | + $venue = EEH_Venue_View::get_venue($venue, FALSE); |
|
98 | 98 | // do we have a valid event ? |
99 | 99 | return $venue instanceof EE_Venue ? TRUE : FALSE; |
100 | 100 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | * @return bool |
109 | 109 | */ |
110 | 110 | function is_espresso_venue_single() { |
111 | - if ( can_use_espresso_conditionals( __FUNCTION__ )) { |
|
111 | + if (can_use_espresso_conditionals(__FUNCTION__)) { |
|
112 | 112 | global $wp_query; |
113 | 113 | return $wp_query instanceof WP_Query ? $wp_query->is_espresso_venue_single : FALSE; |
114 | 114 | } |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | * @return bool |
123 | 123 | */ |
124 | 124 | function is_espresso_venue_archive() { |
125 | - if ( can_use_espresso_conditionals( __FUNCTION__ )) { |
|
125 | + if (can_use_espresso_conditionals(__FUNCTION__)) { |
|
126 | 126 | global $wp_query; |
127 | 127 | return $wp_query instanceof WP_Query ? $wp_query->is_espresso_venue_archive : FALSE; |
128 | 128 | } |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | * @return bool |
137 | 137 | */ |
138 | 138 | function is_espresso_venue_taxonomy() { |
139 | - if ( can_use_espresso_conditionals( __FUNCTION__ )) { |
|
139 | + if (can_use_espresso_conditionals(__FUNCTION__)) { |
|
140 | 140 | global $wp_query; |
141 | 141 | return $wp_query instanceof WP_Query ? $wp_query->is_espresso_venue_taxonomy : FALSE; |
142 | 142 | } |
@@ -150,12 +150,12 @@ discard block |
||
150 | 150 | * @param $conditional_tag |
151 | 151 | * @return bool |
152 | 152 | */ |
153 | -function can_use_espresso_conditionals( $conditional_tag ) { |
|
154 | - if ( ! did_action( 'AHEE__EE_System__initialize' )) { |
|
153 | +function can_use_espresso_conditionals($conditional_tag) { |
|
154 | + if ( ! did_action('AHEE__EE_System__initialize')) { |
|
155 | 155 | EE_Error::doing_it_wrong( |
156 | 156 | __FUNCTION__, |
157 | 157 | sprintf( |
158 | - __( 'The "%s" conditional tag can not be used until after the "init" hook has run, but works best when used within a theme\'s template files.','event_espresso'), |
|
158 | + __('The "%s" conditional tag can not be used until after the "init" hook has run, but works best when used within a theme\'s template files.', 'event_espresso'), |
|
159 | 159 | $conditional_tag |
160 | 160 | ), |
161 | 161 | '4.4.0' |
@@ -170,13 +170,13 @@ discard block |
||
170 | 170 | |
171 | 171 | /*************************** Event Queries ***************************/ |
172 | 172 | |
173 | -if ( ! function_exists( 'espresso_get_events' )) { |
|
173 | +if ( ! function_exists('espresso_get_events')) { |
|
174 | 174 | /** |
175 | 175 | * espresso_get_events |
176 | 176 | * @param array $params |
177 | 177 | * @return array |
178 | 178 | */ |
179 | - function espresso_get_events( $params = array() ) { |
|
179 | + function espresso_get_events($params = array()) { |
|
180 | 180 | //set default params |
181 | 181 | $default_espresso_events_params = array( |
182 | 182 | 'limit' => 10, |
@@ -187,18 +187,18 @@ discard block |
||
187 | 187 | 'sort' => 'ASC' |
188 | 188 | ); |
189 | 189 | // allow the defaults to be filtered |
190 | - $default_espresso_events_params = apply_filters( 'espresso_get_events__default_espresso_events_params', $default_espresso_events_params ); |
|
190 | + $default_espresso_events_params = apply_filters('espresso_get_events__default_espresso_events_params', $default_espresso_events_params); |
|
191 | 191 | // grab params and merge with defaults, then extract |
192 | - $params = array_merge( $default_espresso_events_params, $params ); |
|
192 | + $params = array_merge($default_espresso_events_params, $params); |
|
193 | 193 | // run the query |
194 | - $events_query = new EE_Event_List_Query( $params ); |
|
194 | + $events_query = new EE_Event_List_Query($params); |
|
195 | 195 | // assign results to a variable so we can return it |
196 | 196 | $events = $events_query->have_posts() ? $events_query->posts : array(); |
197 | 197 | // but first reset the query and postdata |
198 | 198 | wp_reset_query(); |
199 | 199 | wp_reset_postdata(); |
200 | 200 | EED_Events_Archive::remove_all_events_archive_filters(); |
201 | - unset( $events_query ); |
|
201 | + unset($events_query); |
|
202 | 202 | return $events; |
203 | 203 | } |
204 | 204 | } |
@@ -212,32 +212,32 @@ discard block |
||
212 | 212 | * espresso_load_ticket_selector |
213 | 213 | */ |
214 | 214 | function espresso_load_ticket_selector() { |
215 | - EE_Registry::instance()->load_file( EE_MODULES . 'ticket_selector', 'EED_Ticket_Selector', 'module' ); |
|
215 | + EE_Registry::instance()->load_file(EE_MODULES.'ticket_selector', 'EED_Ticket_Selector', 'module'); |
|
216 | 216 | } |
217 | 217 | |
218 | -if ( ! function_exists( 'espresso_ticket_selector' )) { |
|
218 | +if ( ! function_exists('espresso_ticket_selector')) { |
|
219 | 219 | /** |
220 | 220 | * espresso_ticket_selector |
221 | 221 | * @param null $event |
222 | 222 | */ |
223 | - function espresso_ticket_selector( $event = NULL ) { |
|
224 | - if ( ! apply_filters( 'FHEE_disable_espresso_ticket_selector', FALSE ) ) { |
|
223 | + function espresso_ticket_selector($event = NULL) { |
|
224 | + if ( ! apply_filters('FHEE_disable_espresso_ticket_selector', FALSE)) { |
|
225 | 225 | espresso_load_ticket_selector(); |
226 | - echo EED_Ticket_Selector::display_ticket_selector( $event ); |
|
226 | + echo EED_Ticket_Selector::display_ticket_selector($event); |
|
227 | 227 | } |
228 | 228 | } |
229 | 229 | } |
230 | 230 | |
231 | 231 | |
232 | - if ( ! function_exists( 'espresso_view_details_btn' )) { |
|
232 | + if ( ! function_exists('espresso_view_details_btn')) { |
|
233 | 233 | /** |
234 | 234 | * espresso_view_details_btn |
235 | 235 | * @param null $event |
236 | 236 | */ |
237 | - function espresso_view_details_btn( $event = NULL ) { |
|
238 | - if ( ! apply_filters( 'FHEE_disable_espresso_view_details_btn', FALSE ) ) { |
|
237 | + function espresso_view_details_btn($event = NULL) { |
|
238 | + if ( ! apply_filters('FHEE_disable_espresso_view_details_btn', FALSE)) { |
|
239 | 239 | espresso_load_ticket_selector(); |
240 | - echo EED_Ticket_Selector::display_ticket_selector( $event, TRUE ); |
|
240 | + echo EED_Ticket_Selector::display_ticket_selector($event, TRUE); |
|
241 | 241 | } |
242 | 242 | } |
243 | 243 | } |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | |
248 | 248 | /*************************** EEH_Event_View ***************************/ |
249 | 249 | |
250 | -if ( ! function_exists( 'espresso_load_event_list_assets' )) { |
|
250 | +if ( ! function_exists('espresso_load_event_list_assets')) { |
|
251 | 251 | /** |
252 | 252 | * espresso_load_event_list_assets |
253 | 253 | * ensures that event list styles and scripts are loaded |
@@ -256,13 +256,13 @@ discard block |
||
256 | 256 | */ |
257 | 257 | function espresso_load_event_list_assets() { |
258 | 258 | $event_list = EED_Events_Archive::instance(); |
259 | - add_action( 'AHEE__EE_System__initialize_last', array( $event_list, 'load_event_list_assets' ), 10 ); |
|
260 | - add_filter( 'FHEE_enable_default_espresso_css', '__return_true' ); |
|
259 | + add_action('AHEE__EE_System__initialize_last', array($event_list, 'load_event_list_assets'), 10); |
|
260 | + add_filter('FHEE_enable_default_espresso_css', '__return_true'); |
|
261 | 261 | } |
262 | 262 | } |
263 | 263 | |
264 | 264 | |
265 | -if ( ! function_exists( 'espresso_event_reg_button' )) { |
|
265 | +if ( ! function_exists('espresso_event_reg_button')) { |
|
266 | 266 | /** |
267 | 267 | * espresso_event_reg_button |
268 | 268 | * returns the "Register Now" button if event is active, |
@@ -274,10 +274,10 @@ discard block |
||
274 | 274 | * @param bool $EVT_ID |
275 | 275 | * @return string |
276 | 276 | */ |
277 | - function espresso_event_reg_button( $btn_text_if_active = NULL, $btn_text_if_inactive = FALSE, $EVT_ID = FALSE ) { |
|
278 | - EE_Registry::instance()->load_helper( 'Event_View' ); |
|
279 | - $event_status = EEH_Event_View::event_active_status( $EVT_ID ); |
|
280 | - switch ( $event_status ) { |
|
277 | + function espresso_event_reg_button($btn_text_if_active = NULL, $btn_text_if_inactive = FALSE, $EVT_ID = FALSE) { |
|
278 | + EE_Registry::instance()->load_helper('Event_View'); |
|
279 | + $event_status = EEH_Event_View::event_active_status($EVT_ID); |
|
280 | + switch ($event_status) { |
|
281 | 281 | case EE_Datetime::sold_out : |
282 | 282 | $btn_text = __('Sold Out', 'event_espresso'); |
283 | 283 | $class = 'ee-pink'; |
@@ -293,10 +293,10 @@ discard block |
||
293 | 293 | case EE_Datetime::upcoming : |
294 | 294 | case EE_Datetime::active : |
295 | 295 | default : |
296 | - $btn_text =! empty( $btn_text_if_active ) ? $btn_text_if_active : __( 'Register Now', 'event_espresso' ); |
|
296 | + $btn_text = ! empty($btn_text_if_active) ? $btn_text_if_active : __('Register Now', 'event_espresso'); |
|
297 | 297 | $class = 'ee-green'; |
298 | 298 | } |
299 | - if ( $event_status < 1 && ! empty( $btn_text_if_inactive )) { |
|
299 | + if ($event_status < 1 && ! empty($btn_text_if_inactive)) { |
|
300 | 300 | $btn_text = $btn_text_if_inactive; |
301 | 301 | $class = 'ee-grey'; |
302 | 302 | } |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | |
311 | 311 | |
312 | 312 | |
313 | -if ( ! function_exists( 'espresso_display_ticket_selector' )) { |
|
313 | +if ( ! function_exists('espresso_display_ticket_selector')) { |
|
314 | 314 | /** |
315 | 315 | * espresso_display_ticket_selector |
316 | 316 | * whether or not to display the Ticket Selector for an event |
@@ -318,15 +318,15 @@ discard block |
||
318 | 318 | * @param bool $EVT_ID |
319 | 319 | * @return boolean |
320 | 320 | */ |
321 | - function espresso_display_ticket_selector( $EVT_ID = FALSE ) { |
|
322 | - EE_Registry::instance()->load_helper( 'Event_View' ); |
|
323 | - return EEH_Event_View::display_ticket_selector( $EVT_ID ); |
|
321 | + function espresso_display_ticket_selector($EVT_ID = FALSE) { |
|
322 | + EE_Registry::instance()->load_helper('Event_View'); |
|
323 | + return EEH_Event_View::display_ticket_selector($EVT_ID); |
|
324 | 324 | } |
325 | 325 | } |
326 | 326 | |
327 | 327 | |
328 | 328 | |
329 | -if ( ! function_exists( 'espresso_event_status_banner' )) { |
|
329 | +if ( ! function_exists('espresso_event_status_banner')) { |
|
330 | 330 | /** |
331 | 331 | * espresso_event_status |
332 | 332 | * returns a banner showing the event status if it is sold out, expired, or inactive |
@@ -334,14 +334,14 @@ discard block |
||
334 | 334 | * @param bool $EVT_ID |
335 | 335 | * @return string |
336 | 336 | */ |
337 | - function espresso_event_status_banner( $EVT_ID = FALSE ) { |
|
338 | - EE_Registry::instance()->load_helper( 'Event_View' ); |
|
339 | - return EEH_Event_View::event_status( $EVT_ID ); |
|
337 | + function espresso_event_status_banner($EVT_ID = FALSE) { |
|
338 | + EE_Registry::instance()->load_helper('Event_View'); |
|
339 | + return EEH_Event_View::event_status($EVT_ID); |
|
340 | 340 | } |
341 | 341 | } |
342 | 342 | |
343 | 343 | |
344 | -if ( ! function_exists( 'espresso_event_status' )) { |
|
344 | +if ( ! function_exists('espresso_event_status')) { |
|
345 | 345 | /** |
346 | 346 | * espresso_event_status |
347 | 347 | * returns the event status if it is sold out, expired, or inactive |
@@ -350,18 +350,18 @@ discard block |
||
350 | 350 | * @param bool $echo |
351 | 351 | * @return string |
352 | 352 | */ |
353 | - function espresso_event_status( $EVT_ID = 0, $echo = TRUE ) { |
|
354 | - EE_Registry::instance()->load_helper( 'Event_View' ); |
|
355 | - if ( $echo ) { |
|
356 | - echo EEH_Event_View::event_active_status( $EVT_ID ); |
|
353 | + function espresso_event_status($EVT_ID = 0, $echo = TRUE) { |
|
354 | + EE_Registry::instance()->load_helper('Event_View'); |
|
355 | + if ($echo) { |
|
356 | + echo EEH_Event_View::event_active_status($EVT_ID); |
|
357 | 357 | return ''; |
358 | 358 | } |
359 | - return EEH_Event_View::event_active_status( $EVT_ID ); |
|
359 | + return EEH_Event_View::event_active_status($EVT_ID); |
|
360 | 360 | } |
361 | 361 | } |
362 | 362 | |
363 | 363 | |
364 | -if ( ! function_exists( 'espresso_event_categories' )) { |
|
364 | +if ( ! function_exists('espresso_event_categories')) { |
|
365 | 365 | /** |
366 | 366 | * espresso_event_categories |
367 | 367 | * returns the terms associated with an event |
@@ -371,18 +371,18 @@ discard block |
||
371 | 371 | * @param bool $echo |
372 | 372 | * @return string |
373 | 373 | */ |
374 | - function espresso_event_categories( $EVT_ID = 0, $hide_uncategorized = TRUE, $echo = TRUE ) { |
|
375 | - EE_Registry::instance()->load_helper( 'Event_View' ); |
|
376 | - if ( $echo ) { |
|
377 | - echo EEH_Event_View::event_categories( $EVT_ID, $hide_uncategorized ); |
|
374 | + function espresso_event_categories($EVT_ID = 0, $hide_uncategorized = TRUE, $echo = TRUE) { |
|
375 | + EE_Registry::instance()->load_helper('Event_View'); |
|
376 | + if ($echo) { |
|
377 | + echo EEH_Event_View::event_categories($EVT_ID, $hide_uncategorized); |
|
378 | 378 | return ''; |
379 | 379 | } |
380 | - return EEH_Event_View::event_categories( $EVT_ID, $hide_uncategorized ); |
|
380 | + return EEH_Event_View::event_categories($EVT_ID, $hide_uncategorized); |
|
381 | 381 | } |
382 | 382 | } |
383 | 383 | |
384 | 384 | |
385 | -if ( ! function_exists( 'espresso_event_tickets_available' )) { |
|
385 | +if ( ! function_exists('espresso_event_tickets_available')) { |
|
386 | 386 | /** |
387 | 387 | * espresso_event_tickets_available |
388 | 388 | * returns the ticket types available for purchase for an event |
@@ -392,27 +392,27 @@ discard block |
||
392 | 392 | * @param bool $format |
393 | 393 | * @return string |
394 | 394 | */ |
395 | - function espresso_event_tickets_available( $EVT_ID = 0, $echo = TRUE, $format = TRUE ) { |
|
396 | - EE_Registry::instance()->load_helper( 'Event_View' ); |
|
397 | - $tickets = EEH_Event_View::event_tickets_available( $EVT_ID ); |
|
398 | - if ( is_array( $tickets ) && ! empty( $tickets )) { |
|
395 | + function espresso_event_tickets_available($EVT_ID = 0, $echo = TRUE, $format = TRUE) { |
|
396 | + EE_Registry::instance()->load_helper('Event_View'); |
|
397 | + $tickets = EEH_Event_View::event_tickets_available($EVT_ID); |
|
398 | + if (is_array($tickets) && ! empty($tickets)) { |
|
399 | 399 | // if formatting then $html will be a string, else it will be an array of ticket objects |
400 | - $html = $format ? '<ul id="ee-event-tickets-ul-' . $EVT_ID . '" class="ee-event-tickets-ul">' : array(); |
|
401 | - foreach ( $tickets as $ticket ) { |
|
402 | - if ( $ticket instanceof EE_Ticket ) { |
|
403 | - if ( $format ) { |
|
404 | - $html .= '<li id="ee-event-tickets-li-' . $ticket->ID() . '" class="ee-event-tickets-li">'; |
|
405 | - $html .= $ticket->name() . ' ' . EEH_Template::format_currency( $ticket->get_ticket_total_with_taxes() ); |
|
400 | + $html = $format ? '<ul id="ee-event-tickets-ul-'.$EVT_ID.'" class="ee-event-tickets-ul">' : array(); |
|
401 | + foreach ($tickets as $ticket) { |
|
402 | + if ($ticket instanceof EE_Ticket) { |
|
403 | + if ($format) { |
|
404 | + $html .= '<li id="ee-event-tickets-li-'.$ticket->ID().'" class="ee-event-tickets-li">'; |
|
405 | + $html .= $ticket->name().' '.EEH_Template::format_currency($ticket->get_ticket_total_with_taxes()); |
|
406 | 406 | $html .= '</li>'; |
407 | 407 | } else { |
408 | 408 | $html[] = $ticket; |
409 | 409 | } |
410 | 410 | } |
411 | 411 | } |
412 | - if ( $format ) { |
|
412 | + if ($format) { |
|
413 | 413 | $html .= '</ul>'; |
414 | 414 | } |
415 | - if ( $echo && ! $format ) { |
|
415 | + if ($echo && ! $format) { |
|
416 | 416 | echo $html; |
417 | 417 | return ''; |
418 | 418 | } |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | } |
423 | 423 | } |
424 | 424 | |
425 | -if ( ! function_exists( 'espresso_event_date_obj' )) { |
|
425 | +if ( ! function_exists('espresso_event_date_obj')) { |
|
426 | 426 | /** |
427 | 427 | * espresso_event_date_obj |
428 | 428 | * returns the primary date object for an event |
@@ -430,14 +430,14 @@ discard block |
||
430 | 430 | * @param bool $EVT_ID |
431 | 431 | * @return object |
432 | 432 | */ |
433 | - function espresso_event_date_obj( $EVT_ID = FALSE ) { |
|
434 | - EE_Registry::instance()->load_helper( 'Event_View' ); |
|
435 | - return EEH_Event_View::get_primary_date_obj( $EVT_ID ); |
|
433 | + function espresso_event_date_obj($EVT_ID = FALSE) { |
|
434 | + EE_Registry::instance()->load_helper('Event_View'); |
|
435 | + return EEH_Event_View::get_primary_date_obj($EVT_ID); |
|
436 | 436 | } |
437 | 437 | } |
438 | 438 | |
439 | 439 | |
440 | -if ( ! function_exists( 'espresso_event_date' )) { |
|
440 | +if ( ! function_exists('espresso_event_date')) { |
|
441 | 441 | /** |
442 | 442 | * espresso_event_date |
443 | 443 | * returns the primary date for an event |
@@ -448,23 +448,23 @@ discard block |
||
448 | 448 | * @param bool $echo |
449 | 449 | * @return string |
450 | 450 | */ |
451 | - function espresso_event_date( $date_format = '', $time_format = '', $EVT_ID = FALSE, $echo = TRUE ) { |
|
452 | - $date_format = ! empty( $date_format ) ? $date_format : get_option( 'date_format' ); |
|
453 | - $time_format = ! empty( $time_format ) ? $time_format : get_option( 'time_format' ); |
|
454 | - $date_format = apply_filters( 'FHEE__espresso_event_date__date_format', $date_format ); |
|
455 | - $time_format = apply_filters( 'FHEE__espresso_event_date__time_format', $time_format ); |
|
456 | - EE_Registry::instance()->load_helper( 'Event_View' ); |
|
457 | - if($echo){ |
|
458 | - echo EEH_Event_View::the_event_date( $date_format, $time_format, $EVT_ID ); |
|
451 | + function espresso_event_date($date_format = '', $time_format = '', $EVT_ID = FALSE, $echo = TRUE) { |
|
452 | + $date_format = ! empty($date_format) ? $date_format : get_option('date_format'); |
|
453 | + $time_format = ! empty($time_format) ? $time_format : get_option('time_format'); |
|
454 | + $date_format = apply_filters('FHEE__espresso_event_date__date_format', $date_format); |
|
455 | + $time_format = apply_filters('FHEE__espresso_event_date__time_format', $time_format); |
|
456 | + EE_Registry::instance()->load_helper('Event_View'); |
|
457 | + if ($echo) { |
|
458 | + echo EEH_Event_View::the_event_date($date_format, $time_format, $EVT_ID); |
|
459 | 459 | return ''; |
460 | 460 | } |
461 | - return EEH_Event_View::the_event_date( $date_format, $time_format, $EVT_ID ); |
|
461 | + return EEH_Event_View::the_event_date($date_format, $time_format, $EVT_ID); |
|
462 | 462 | |
463 | 463 | } |
464 | 464 | } |
465 | 465 | |
466 | 466 | |
467 | -if ( ! function_exists( 'espresso_list_of_event_dates' )) { |
|
467 | +if ( ! function_exists('espresso_list_of_event_dates')) { |
|
468 | 468 | /** |
469 | 469 | * espresso_list_of_event_dates |
470 | 470 | * returns a unordered list of dates for an event |
@@ -479,41 +479,41 @@ discard block |
||
479 | 479 | * @param null $limit |
480 | 480 | * @return string |
481 | 481 | */ |
482 | - function espresso_list_of_event_dates( $EVT_ID = 0, $date_format = '', $time_format = '', $echo = TRUE, $show_expired = NULL, $format = TRUE, $add_breaks = TRUE, $limit = NULL ) { |
|
483 | - $date_format = ! empty( $date_format ) ? $date_format : get_option( 'date_format' ); |
|
484 | - $time_format = ! empty( $time_format ) ? $time_format : get_option( 'time_format' ); |
|
485 | - $date_format = apply_filters( 'FHEE__espresso_list_of_event_dates__date_format', $date_format ); |
|
486 | - $time_format = apply_filters( 'FHEE__espresso_list_of_event_dates__time_format', $time_format ); |
|
487 | - EE_Registry::instance()->load_helper( 'Event_View' ); |
|
488 | - $datetimes = EEH_Event_View::get_all_date_obj( $EVT_ID, $show_expired, FALSE, $limit ); |
|
489 | - if ( ! $format ) { |
|
490 | - return apply_filters( 'FHEE__espresso_list_of_event_dates__datetimes', $datetimes ); |
|
482 | + function espresso_list_of_event_dates($EVT_ID = 0, $date_format = '', $time_format = '', $echo = TRUE, $show_expired = NULL, $format = TRUE, $add_breaks = TRUE, $limit = NULL) { |
|
483 | + $date_format = ! empty($date_format) ? $date_format : get_option('date_format'); |
|
484 | + $time_format = ! empty($time_format) ? $time_format : get_option('time_format'); |
|
485 | + $date_format = apply_filters('FHEE__espresso_list_of_event_dates__date_format', $date_format); |
|
486 | + $time_format = apply_filters('FHEE__espresso_list_of_event_dates__time_format', $time_format); |
|
487 | + EE_Registry::instance()->load_helper('Event_View'); |
|
488 | + $datetimes = EEH_Event_View::get_all_date_obj($EVT_ID, $show_expired, FALSE, $limit); |
|
489 | + if ( ! $format) { |
|
490 | + return apply_filters('FHEE__espresso_list_of_event_dates__datetimes', $datetimes); |
|
491 | 491 | } |
492 | 492 | //d( $datetimes ); |
493 | - if ( is_array( $datetimes ) && ! empty( $datetimes )) { |
|
493 | + if (is_array($datetimes) && ! empty($datetimes)) { |
|
494 | 494 | global $post; |
495 | - $html = $format ? '<ul id="ee-event-datetimes-ul-' . $post->ID . '" class="ee-event-datetimes-ul ee-clearfix">' : ''; |
|
496 | - foreach ( $datetimes as $datetime ) { |
|
497 | - if ( $datetime instanceof EE_Datetime ) { |
|
498 | - $html .= '<li id="ee-event-datetimes-li-' . $datetime->ID(); |
|
499 | - $html .= '" class="ee-event-datetimes-li ee-event-datetimes-li-' . $datetime->get_active_status() . '">'; |
|
495 | + $html = $format ? '<ul id="ee-event-datetimes-ul-'.$post->ID.'" class="ee-event-datetimes-ul ee-clearfix">' : ''; |
|
496 | + foreach ($datetimes as $datetime) { |
|
497 | + if ($datetime instanceof EE_Datetime) { |
|
498 | + $html .= '<li id="ee-event-datetimes-li-'.$datetime->ID(); |
|
499 | + $html .= '" class="ee-event-datetimes-li ee-event-datetimes-li-'.$datetime->get_active_status().'">'; |
|
500 | 500 | $datetime_name = $datetime->name(); |
501 | - $html .= ! empty( $datetime_name ) ? '<strong>' . $datetime_name . '</strong>' : ''; |
|
502 | - $html .= ! empty( $datetime_name ) && $add_breaks ? '<br />' : ''; |
|
503 | - $html .= '<span class="dashicons dashicons-calendar"></span>' . $datetime->date_range( $date_format ) . '<br/>'; |
|
504 | - $html .= '<span class="dashicons dashicons-clock"></span>' . $datetime->time_range( $time_format ); |
|
501 | + $html .= ! empty($datetime_name) ? '<strong>'.$datetime_name.'</strong>' : ''; |
|
502 | + $html .= ! empty($datetime_name) && $add_breaks ? '<br />' : ''; |
|
503 | + $html .= '<span class="dashicons dashicons-calendar"></span>'.$datetime->date_range($date_format).'<br/>'; |
|
504 | + $html .= '<span class="dashicons dashicons-clock"></span>'.$datetime->time_range($time_format); |
|
505 | 505 | $datetime_description = $datetime->description(); |
506 | - $html .= ! empty( $datetime_description ) && $add_breaks ? '<br />' : ''; |
|
507 | - $html .= ! empty( $datetime_description ) ? ' - ' . $datetime_description : ''; |
|
508 | - $html = apply_filters( 'FHEE__espresso_list_of_event_dates__datetime_html', $html, $datetime ); |
|
506 | + $html .= ! empty($datetime_description) && $add_breaks ? '<br />' : ''; |
|
507 | + $html .= ! empty($datetime_description) ? ' - '.$datetime_description : ''; |
|
508 | + $html = apply_filters('FHEE__espresso_list_of_event_dates__datetime_html', $html, $datetime); |
|
509 | 509 | $html .= '</li>'; |
510 | 510 | } |
511 | 511 | } |
512 | 512 | $html .= $format ? '</ul>' : ''; |
513 | 513 | } else { |
514 | - $html = $format ? '<p><span class="dashicons dashicons-marker pink-text"></span>' . __( 'There are no upcoming dates for this event.', 'event_espresso' ) . '</p><br/>' : ''; |
|
514 | + $html = $format ? '<p><span class="dashicons dashicons-marker pink-text"></span>'.__('There are no upcoming dates for this event.', 'event_espresso').'</p><br/>' : ''; |
|
515 | 515 | } |
516 | - if ( $echo ) { |
|
516 | + if ($echo) { |
|
517 | 517 | echo $html; |
518 | 518 | return ''; |
519 | 519 | } |
@@ -522,7 +522,7 @@ discard block |
||
522 | 522 | } |
523 | 523 | |
524 | 524 | |
525 | -if ( ! function_exists( 'espresso_event_end_date' )) { |
|
525 | +if ( ! function_exists('espresso_event_end_date')) { |
|
526 | 526 | /** |
527 | 527 | * espresso_event_end_date |
528 | 528 | * returns the last date for an event |
@@ -533,21 +533,21 @@ discard block |
||
533 | 533 | * @param bool $echo |
534 | 534 | * @return string |
535 | 535 | */ |
536 | - function espresso_event_end_date( $date_format = '', $time_format = '', $EVT_ID = FALSE, $echo = TRUE ) { |
|
537 | - $date_format = ! empty( $date_format ) ? $date_format : get_option( 'date_format' ); |
|
538 | - $time_format = ! empty( $time_format ) ? $time_format : get_option( 'time_format' ); |
|
539 | - $date_format = apply_filters( 'FHEE__espresso_event_end_date__date_format', $date_format ); |
|
540 | - $time_format = apply_filters( 'FHEE__espresso_event_end_date__time_format', $time_format ); |
|
541 | - EE_Registry::instance()->load_helper( 'Event_View' ); |
|
542 | - if($echo){ |
|
543 | - echo EEH_Event_View::the_event_end_date( $date_format, $time_format, $EVT_ID ); |
|
536 | + function espresso_event_end_date($date_format = '', $time_format = '', $EVT_ID = FALSE, $echo = TRUE) { |
|
537 | + $date_format = ! empty($date_format) ? $date_format : get_option('date_format'); |
|
538 | + $time_format = ! empty($time_format) ? $time_format : get_option('time_format'); |
|
539 | + $date_format = apply_filters('FHEE__espresso_event_end_date__date_format', $date_format); |
|
540 | + $time_format = apply_filters('FHEE__espresso_event_end_date__time_format', $time_format); |
|
541 | + EE_Registry::instance()->load_helper('Event_View'); |
|
542 | + if ($echo) { |
|
543 | + echo EEH_Event_View::the_event_end_date($date_format, $time_format, $EVT_ID); |
|
544 | 544 | return ''; |
545 | 545 | } |
546 | - return EEH_Event_View::the_event_end_date( $date_format, $time_format, $EVT_ID ); |
|
546 | + return EEH_Event_View::the_event_end_date($date_format, $time_format, $EVT_ID); |
|
547 | 547 | } |
548 | 548 | } |
549 | 549 | |
550 | -if ( ! function_exists( 'espresso_event_date_range' )) { |
|
550 | +if ( ! function_exists('espresso_event_date_range')) { |
|
551 | 551 | /** |
552 | 552 | * espresso_event_date_range |
553 | 553 | * returns the first and last chronologically ordered dates for an event (if different) |
@@ -559,32 +559,32 @@ discard block |
||
559 | 559 | * @param bool $EVT_ID |
560 | 560 | * @return string |
561 | 561 | */ |
562 | - function espresso_event_date_range( $date_format = '', $time_format = '', $single_date_format = '', $single_time_format = '', $EVT_ID = FALSE, $echo = TRUE ) { |
|
563 | - EE_Registry::instance()->load_helper( 'Event_View' ); |
|
562 | + function espresso_event_date_range($date_format = '', $time_format = '', $single_date_format = '', $single_time_format = '', $EVT_ID = FALSE, $echo = TRUE) { |
|
563 | + EE_Registry::instance()->load_helper('Event_View'); |
|
564 | 564 | // set and filter date and time formats when a range is returned |
565 | - $date_format = ! empty( $date_format ) ? $date_format : get_option( 'date_format' ); |
|
566 | - $date_format = apply_filters( 'FHEE__espresso_event_date_range__date_format', $date_format ); |
|
565 | + $date_format = ! empty($date_format) ? $date_format : get_option('date_format'); |
|
566 | + $date_format = apply_filters('FHEE__espresso_event_date_range__date_format', $date_format); |
|
567 | 567 | // get the start and end date with NO time portion |
568 | - $the_event_date = EEH_Event_View::the_earliest_event_date( $date_format, '', $EVT_ID ); |
|
569 | - $the_event_end_date = EEH_Event_View::the_latest_event_date( $date_format, '', $EVT_ID ); |
|
568 | + $the_event_date = EEH_Event_View::the_earliest_event_date($date_format, '', $EVT_ID); |
|
569 | + $the_event_end_date = EEH_Event_View::the_latest_event_date($date_format, '', $EVT_ID); |
|
570 | 570 | // now we can determine if date range spans more than one day |
571 | - if ( $the_event_date != $the_event_end_date ) { |
|
572 | - $time_format = ! empty( $time_format ) ? $time_format : get_option( 'time_format' ); |
|
573 | - $time_format = apply_filters( 'FHEE__espresso_event_date_range__time_format', $time_format ); |
|
571 | + if ($the_event_date != $the_event_end_date) { |
|
572 | + $time_format = ! empty($time_format) ? $time_format : get_option('time_format'); |
|
573 | + $time_format = apply_filters('FHEE__espresso_event_date_range__time_format', $time_format); |
|
574 | 574 | $html = sprintf( |
575 | - __( '%1$s - %2$s', 'event_espresso' ), |
|
576 | - EEH_Event_View::the_earliest_event_date( $date_format, $time_format, $EVT_ID ), |
|
577 | - EEH_Event_View::the_latest_event_date( $date_format, $time_format, $EVT_ID ) |
|
575 | + __('%1$s - %2$s', 'event_espresso'), |
|
576 | + EEH_Event_View::the_earliest_event_date($date_format, $time_format, $EVT_ID), |
|
577 | + EEH_Event_View::the_latest_event_date($date_format, $time_format, $EVT_ID) |
|
578 | 578 | ); |
579 | 579 | } else { |
580 | 580 | // set and filter date and time formats when only a single datetime is returned |
581 | - $single_date_format = ! empty( $single_date_format ) ? $single_date_format : get_option( 'date_format' ); |
|
582 | - $single_time_format = ! empty( $single_time_format ) ? $single_time_format : get_option( 'time_format' ); |
|
583 | - $single_date_format = apply_filters( 'FHEE__espresso_event_date_range__single_date_format', $single_date_format ); |
|
584 | - $single_time_format = apply_filters( 'FHEE__espresso_event_date_range__single_time_format', $single_time_format ); |
|
585 | - $html = EEH_Event_View::the_earliest_event_date( $single_date_format, $single_time_format, $EVT_ID ); |
|
581 | + $single_date_format = ! empty($single_date_format) ? $single_date_format : get_option('date_format'); |
|
582 | + $single_time_format = ! empty($single_time_format) ? $single_time_format : get_option('time_format'); |
|
583 | + $single_date_format = apply_filters('FHEE__espresso_event_date_range__single_date_format', $single_date_format); |
|
584 | + $single_time_format = apply_filters('FHEE__espresso_event_date_range__single_time_format', $single_time_format); |
|
585 | + $html = EEH_Event_View::the_earliest_event_date($single_date_format, $single_time_format, $EVT_ID); |
|
586 | 586 | } |
587 | - if ( $echo ) { |
|
587 | + if ($echo) { |
|
588 | 588 | echo $html; |
589 | 589 | return ''; |
590 | 590 | } |
@@ -593,7 +593,7 @@ discard block |
||
593 | 593 | } |
594 | 594 | |
595 | 595 | |
596 | -if ( ! function_exists( 'espresso_event_date_as_calendar_page' )) { |
|
596 | +if ( ! function_exists('espresso_event_date_as_calendar_page')) { |
|
597 | 597 | /** |
598 | 598 | * espresso_event_date_as_calendar_page |
599 | 599 | * returns the primary date for an event, stylized to appear as the page of a calendar |
@@ -601,16 +601,16 @@ discard block |
||
601 | 601 | * @param bool $EVT_ID |
602 | 602 | * @return string |
603 | 603 | */ |
604 | - function espresso_event_date_as_calendar_page( $EVT_ID = FALSE ) { |
|
605 | - EE_Registry::instance()->load_helper( 'Event_View' ); |
|
606 | - EEH_Event_View::event_date_as_calendar_page( $EVT_ID ); |
|
604 | + function espresso_event_date_as_calendar_page($EVT_ID = FALSE) { |
|
605 | + EE_Registry::instance()->load_helper('Event_View'); |
|
606 | + EEH_Event_View::event_date_as_calendar_page($EVT_ID); |
|
607 | 607 | } |
608 | 608 | } |
609 | 609 | |
610 | 610 | |
611 | 611 | |
612 | 612 | |
613 | -if ( ! function_exists( 'espresso_event_link_url' )) { |
|
613 | +if ( ! function_exists('espresso_event_link_url')) { |
|
614 | 614 | /** |
615 | 615 | * espresso_event_link_url |
616 | 616 | * |
@@ -618,19 +618,19 @@ discard block |
||
618 | 618 | * @param bool $echo |
619 | 619 | * @return string |
620 | 620 | */ |
621 | - function espresso_event_link_url( $EVT_ID = 0, $echo = TRUE ) { |
|
622 | - EE_Registry::instance()->load_helper( 'Event_View' ); |
|
623 | - if ( $echo ) { |
|
624 | - echo EEH_Event_View::event_link_url( $EVT_ID ); |
|
621 | + function espresso_event_link_url($EVT_ID = 0, $echo = TRUE) { |
|
622 | + EE_Registry::instance()->load_helper('Event_View'); |
|
623 | + if ($echo) { |
|
624 | + echo EEH_Event_View::event_link_url($EVT_ID); |
|
625 | 625 | return ''; |
626 | 626 | } |
627 | - return EEH_Event_View::event_link_url( $EVT_ID ); |
|
627 | + return EEH_Event_View::event_link_url($EVT_ID); |
|
628 | 628 | } |
629 | 629 | } |
630 | 630 | |
631 | 631 | |
632 | 632 | |
633 | -if ( ! function_exists( 'espresso_event_has_content_or_excerpt' )) { |
|
633 | +if ( ! function_exists('espresso_event_has_content_or_excerpt')) { |
|
634 | 634 | /** |
635 | 635 | * espresso_event_has_content_or_excerpt |
636 | 636 | * |
@@ -638,16 +638,16 @@ discard block |
||
638 | 638 | * @param bool $EVT_ID |
639 | 639 | * @return boolean |
640 | 640 | */ |
641 | - function espresso_event_has_content_or_excerpt( $EVT_ID = FALSE ) { |
|
642 | - EE_Registry::instance()->load_helper( 'Event_View' ); |
|
643 | - return EEH_Event_View::event_has_content_or_excerpt( $EVT_ID ); |
|
641 | + function espresso_event_has_content_or_excerpt($EVT_ID = FALSE) { |
|
642 | + EE_Registry::instance()->load_helper('Event_View'); |
|
643 | + return EEH_Event_View::event_has_content_or_excerpt($EVT_ID); |
|
644 | 644 | } |
645 | 645 | } |
646 | 646 | |
647 | 647 | |
648 | 648 | |
649 | 649 | |
650 | -if ( ! function_exists( 'espresso_event_content_or_excerpt' )) { |
|
650 | +if ( ! function_exists('espresso_event_content_or_excerpt')) { |
|
651 | 651 | /** |
652 | 652 | * espresso_event_content_or_excerpt |
653 | 653 | * |
@@ -656,19 +656,19 @@ discard block |
||
656 | 656 | * @param bool $echo |
657 | 657 | * @return string |
658 | 658 | */ |
659 | - function espresso_event_content_or_excerpt( $num_words = 55, $more = NULL, $echo = TRUE ) { |
|
660 | - EE_Registry::instance()->load_helper( 'Event_View' ); |
|
661 | - if ( $echo ) { |
|
662 | - echo EEH_Event_View::event_content_or_excerpt( $num_words, $more ); |
|
659 | + function espresso_event_content_or_excerpt($num_words = 55, $more = NULL, $echo = TRUE) { |
|
660 | + EE_Registry::instance()->load_helper('Event_View'); |
|
661 | + if ($echo) { |
|
662 | + echo EEH_Event_View::event_content_or_excerpt($num_words, $more); |
|
663 | 663 | return ''; |
664 | 664 | } |
665 | - return EEH_Event_View::event_content_or_excerpt( $num_words, $more ); |
|
665 | + return EEH_Event_View::event_content_or_excerpt($num_words, $more); |
|
666 | 666 | } |
667 | 667 | } |
668 | 668 | |
669 | 669 | |
670 | 670 | |
671 | -if ( ! function_exists( 'espresso_event_phone' )) { |
|
671 | +if ( ! function_exists('espresso_event_phone')) { |
|
672 | 672 | /** |
673 | 673 | * espresso_event_phone |
674 | 674 | * |
@@ -676,19 +676,19 @@ discard block |
||
676 | 676 | * @param bool $echo |
677 | 677 | * @return string |
678 | 678 | */ |
679 | - function espresso_event_phone( $EVT_ID = 0, $echo = TRUE ) { |
|
680 | - EE_Registry::instance()->load_helper( 'Event_View' ); |
|
681 | - if ( $echo ) { |
|
682 | - echo EEH_Event_View::event_phone( $EVT_ID ); |
|
679 | + function espresso_event_phone($EVT_ID = 0, $echo = TRUE) { |
|
680 | + EE_Registry::instance()->load_helper('Event_View'); |
|
681 | + if ($echo) { |
|
682 | + echo EEH_Event_View::event_phone($EVT_ID); |
|
683 | 683 | return ''; |
684 | 684 | } |
685 | - return EEH_Event_View::event_phone( $EVT_ID ); |
|
685 | + return EEH_Event_View::event_phone($EVT_ID); |
|
686 | 686 | } |
687 | 687 | } |
688 | 688 | |
689 | 689 | |
690 | 690 | |
691 | -if ( ! function_exists( 'espresso_edit_event_link' )) { |
|
691 | +if ( ! function_exists('espresso_edit_event_link')) { |
|
692 | 692 | /** |
693 | 693 | * espresso_edit_event_link |
694 | 694 | * returns a link to edit an event |
@@ -697,41 +697,41 @@ discard block |
||
697 | 697 | * @param bool $echo |
698 | 698 | * @return string |
699 | 699 | */ |
700 | - function espresso_edit_event_link( $EVT_ID = 0, $echo = TRUE ) { |
|
701 | - EE_Registry::instance()->load_helper( 'Event_View' ); |
|
702 | - if ( $echo ) { |
|
703 | - echo EEH_Event_View::edit_event_link( $EVT_ID ); |
|
700 | + function espresso_edit_event_link($EVT_ID = 0, $echo = TRUE) { |
|
701 | + EE_Registry::instance()->load_helper('Event_View'); |
|
702 | + if ($echo) { |
|
703 | + echo EEH_Event_View::edit_event_link($EVT_ID); |
|
704 | 704 | return ''; |
705 | 705 | } |
706 | - return EEH_Event_View::edit_event_link( $EVT_ID ); |
|
706 | + return EEH_Event_View::edit_event_link($EVT_ID); |
|
707 | 707 | } |
708 | 708 | } |
709 | 709 | |
710 | 710 | |
711 | -if ( ! function_exists( 'espresso_organization_name' )) { |
|
711 | +if ( ! function_exists('espresso_organization_name')) { |
|
712 | 712 | /** |
713 | 713 | * espresso_organization_name |
714 | 714 | * @param bool $echo |
715 | 715 | * @return string |
716 | 716 | */ |
717 | 717 | function espresso_organization_name($echo = TRUE) { |
718 | - if($echo){ |
|
719 | - echo EE_Registry::instance()->CFG->organization->get_pretty( 'name' ); |
|
718 | + if ($echo) { |
|
719 | + echo EE_Registry::instance()->CFG->organization->get_pretty('name'); |
|
720 | 720 | return ''; |
721 | 721 | } |
722 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'name' ); |
|
722 | + return EE_Registry::instance()->CFG->organization->get_pretty('name'); |
|
723 | 723 | } |
724 | 724 | } |
725 | 725 | |
726 | -if ( ! function_exists( 'espresso_organization_address' )) { |
|
726 | +if ( ! function_exists('espresso_organization_address')) { |
|
727 | 727 | /** |
728 | 728 | * espresso_organization_address |
729 | 729 | * @param string $type |
730 | 730 | * @return string |
731 | 731 | */ |
732 | - function espresso_organization_address( $type = 'inline' ) { |
|
733 | - if ( EE_Registry::instance()->CFG->organization instanceof EE_Organization_Config ) { |
|
734 | - EE_Registry::instance()->load_helper( 'Formatter' ); |
|
732 | + function espresso_organization_address($type = 'inline') { |
|
733 | + if (EE_Registry::instance()->CFG->organization instanceof EE_Organization_Config) { |
|
734 | + EE_Registry::instance()->load_helper('Formatter'); |
|
735 | 735 | $address = new EE_Generic_Address( |
736 | 736 | EE_Registry::instance()->CFG->organization->address_1, |
737 | 737 | EE_Registry::instance()->CFG->organization->address_2, |
@@ -740,129 +740,129 @@ discard block |
||
740 | 740 | EE_Registry::instance()->CFG->organization->zip, |
741 | 741 | EE_Registry::instance()->CFG->organization->CNT_ISO |
742 | 742 | ); |
743 | - return EEH_Address::format( $address, $type ); |
|
743 | + return EEH_Address::format($address, $type); |
|
744 | 744 | } |
745 | 745 | return ''; |
746 | 746 | } |
747 | 747 | } |
748 | 748 | |
749 | -if ( ! function_exists( 'espresso_organization_email' )) { |
|
749 | +if ( ! function_exists('espresso_organization_email')) { |
|
750 | 750 | /** |
751 | 751 | * espresso_organization_email |
752 | 752 | * @param bool $echo |
753 | 753 | * @return string |
754 | 754 | */ |
755 | - function espresso_organization_email( $echo = TRUE ) { |
|
756 | - if($echo){ |
|
757 | - echo EE_Registry::instance()->CFG->organization->get_pretty( 'email' ); |
|
755 | + function espresso_organization_email($echo = TRUE) { |
|
756 | + if ($echo) { |
|
757 | + echo EE_Registry::instance()->CFG->organization->get_pretty('email'); |
|
758 | 758 | return ''; |
759 | 759 | } |
760 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'email' ); |
|
760 | + return EE_Registry::instance()->CFG->organization->get_pretty('email'); |
|
761 | 761 | } |
762 | 762 | } |
763 | 763 | |
764 | -if ( ! function_exists( 'espresso_organization_logo_url' )) { |
|
764 | +if ( ! function_exists('espresso_organization_logo_url')) { |
|
765 | 765 | /** |
766 | 766 | * espresso_organization_logo_url |
767 | 767 | * @param bool $echo |
768 | 768 | * @return string |
769 | 769 | */ |
770 | - function espresso_organization_logo_url( $echo = TRUE ) { |
|
771 | - if($echo){ |
|
772 | - echo EE_Registry::instance()->CFG->organization->get_pretty( 'logo_url' ); |
|
770 | + function espresso_organization_logo_url($echo = TRUE) { |
|
771 | + if ($echo) { |
|
772 | + echo EE_Registry::instance()->CFG->organization->get_pretty('logo_url'); |
|
773 | 773 | return ''; |
774 | 774 | } |
775 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'logo_url' ); |
|
775 | + return EE_Registry::instance()->CFG->organization->get_pretty('logo_url'); |
|
776 | 776 | } |
777 | 777 | } |
778 | 778 | |
779 | -if ( ! function_exists( 'espresso_organization_facebook' )) { |
|
779 | +if ( ! function_exists('espresso_organization_facebook')) { |
|
780 | 780 | /** |
781 | 781 | * espresso_organization_facebook |
782 | 782 | * @param bool $echo |
783 | 783 | * @return string |
784 | 784 | */ |
785 | - function espresso_organization_facebook( $echo = TRUE ) { |
|
786 | - if($echo){ |
|
787 | - echo EE_Registry::instance()->CFG->organization->get_pretty( 'facebook' ); |
|
785 | + function espresso_organization_facebook($echo = TRUE) { |
|
786 | + if ($echo) { |
|
787 | + echo EE_Registry::instance()->CFG->organization->get_pretty('facebook'); |
|
788 | 788 | return ''; |
789 | 789 | } |
790 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'facebook' ); |
|
790 | + return EE_Registry::instance()->CFG->organization->get_pretty('facebook'); |
|
791 | 791 | } |
792 | 792 | } |
793 | 793 | |
794 | -if ( ! function_exists( 'espresso_organization_twitter' )) { |
|
794 | +if ( ! function_exists('espresso_organization_twitter')) { |
|
795 | 795 | /** |
796 | 796 | * espresso_organization_twitter |
797 | 797 | * @param bool $echo |
798 | 798 | * @return string |
799 | 799 | */ |
800 | - function espresso_organization_twitter( $echo = TRUE ) { |
|
801 | - if($echo){ |
|
802 | - echo EE_Registry::instance()->CFG->organization->get_pretty( 'twitter' ); |
|
800 | + function espresso_organization_twitter($echo = TRUE) { |
|
801 | + if ($echo) { |
|
802 | + echo EE_Registry::instance()->CFG->organization->get_pretty('twitter'); |
|
803 | 803 | return ''; |
804 | 804 | } |
805 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'twitter' ); |
|
805 | + return EE_Registry::instance()->CFG->organization->get_pretty('twitter'); |
|
806 | 806 | } |
807 | 807 | } |
808 | 808 | |
809 | -if ( ! function_exists( 'espresso_organization_linkedin' )) { |
|
809 | +if ( ! function_exists('espresso_organization_linkedin')) { |
|
810 | 810 | /** |
811 | 811 | * espresso_organization_linkedin |
812 | 812 | * @param bool $echo |
813 | 813 | * @return string |
814 | 814 | */ |
815 | - function espresso_organization_linkedin( $echo = TRUE ) { |
|
816 | - if($echo){ |
|
817 | - echo EE_Registry::instance()->CFG->organization->get_pretty( 'linkedin' ); |
|
815 | + function espresso_organization_linkedin($echo = TRUE) { |
|
816 | + if ($echo) { |
|
817 | + echo EE_Registry::instance()->CFG->organization->get_pretty('linkedin'); |
|
818 | 818 | return ''; |
819 | 819 | } |
820 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'linkedin' ); |
|
820 | + return EE_Registry::instance()->CFG->organization->get_pretty('linkedin'); |
|
821 | 821 | } |
822 | 822 | } |
823 | 823 | |
824 | -if ( ! function_exists( 'espresso_organization_pinterest' )) { |
|
824 | +if ( ! function_exists('espresso_organization_pinterest')) { |
|
825 | 825 | /** |
826 | 826 | * espresso_organization_pinterest |
827 | 827 | * @param bool $echo |
828 | 828 | * @return string |
829 | 829 | */ |
830 | - function espresso_organization_pinterest( $echo = TRUE ) { |
|
831 | - if($echo){ |
|
832 | - echo EE_Registry::instance()->CFG->organization->get_pretty( 'pinterest' ); |
|
830 | + function espresso_organization_pinterest($echo = TRUE) { |
|
831 | + if ($echo) { |
|
832 | + echo EE_Registry::instance()->CFG->organization->get_pretty('pinterest'); |
|
833 | 833 | return ''; |
834 | 834 | } |
835 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'pinterest' ); |
|
835 | + return EE_Registry::instance()->CFG->organization->get_pretty('pinterest'); |
|
836 | 836 | } |
837 | 837 | } |
838 | 838 | |
839 | -if ( ! function_exists( 'espresso_organization_google' )) { |
|
839 | +if ( ! function_exists('espresso_organization_google')) { |
|
840 | 840 | /** |
841 | 841 | * espresso_organization_google |
842 | 842 | * @param bool $echo |
843 | 843 | * @return string |
844 | 844 | */ |
845 | - function espresso_organization_google( $echo = TRUE ) { |
|
846 | - if($echo){ |
|
847 | - echo EE_Registry::instance()->CFG->organization->get_pretty( 'google' ); |
|
845 | + function espresso_organization_google($echo = TRUE) { |
|
846 | + if ($echo) { |
|
847 | + echo EE_Registry::instance()->CFG->organization->get_pretty('google'); |
|
848 | 848 | return ''; |
849 | 849 | } |
850 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'google' ); |
|
850 | + return EE_Registry::instance()->CFG->organization->get_pretty('google'); |
|
851 | 851 | } |
852 | 852 | } |
853 | 853 | |
854 | -if ( ! function_exists( 'espresso_organization_instagram' )) { |
|
854 | +if ( ! function_exists('espresso_organization_instagram')) { |
|
855 | 855 | /** |
856 | 856 | * espresso_organization_instagram |
857 | 857 | * @param bool $echo |
858 | 858 | * @return string |
859 | 859 | */ |
860 | - function espresso_organization_instagram( $echo = TRUE ) { |
|
861 | - if($echo){ |
|
862 | - echo EE_Registry::instance()->CFG->organization->get_pretty( 'instagram' ); |
|
860 | + function espresso_organization_instagram($echo = TRUE) { |
|
861 | + if ($echo) { |
|
862 | + echo EE_Registry::instance()->CFG->organization->get_pretty('instagram'); |
|
863 | 863 | return ''; |
864 | 864 | } |
865 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'instagram' ); |
|
865 | + return EE_Registry::instance()->CFG->organization->get_pretty('instagram'); |
|
866 | 866 | } |
867 | 867 | } |
868 | 868 | |
@@ -872,14 +872,14 @@ discard block |
||
872 | 872 | |
873 | 873 | |
874 | 874 | |
875 | -if ( ! function_exists( 'espresso_event_venues' )) { |
|
875 | +if ( ! function_exists('espresso_event_venues')) { |
|
876 | 876 | /** |
877 | 877 | * espresso_event_venues |
878 | 878 | * |
879 | 879 | * @return array all venues related to an event |
880 | 880 | */ |
881 | 881 | function espresso_event_venues() { |
882 | - EE_Registry::instance()->load_helper( 'Venue_View' ); |
|
882 | + EE_Registry::instance()->load_helper('Venue_View'); |
|
883 | 883 | return EEH_Venue_View::get_event_venues(); |
884 | 884 | } |
885 | 885 | } |
@@ -887,7 +887,7 @@ discard block |
||
887 | 887 | |
888 | 888 | |
889 | 889 | |
890 | -if ( ! function_exists( 'espresso_venue_id' )) { |
|
890 | +if ( ! function_exists('espresso_venue_id')) { |
|
891 | 891 | /** |
892 | 892 | * espresso_venue_name |
893 | 893 | * |
@@ -895,16 +895,16 @@ discard block |
||
895 | 895 | * @param int $EVT_ID |
896 | 896 | * @return string |
897 | 897 | */ |
898 | - function espresso_venue_id( $EVT_ID = 0 ) { |
|
899 | - EE_Registry::instance()->load_helper( 'Venue_View' ); |
|
900 | - $venue = EEH_Venue_View::get_venue( $EVT_ID ); |
|
898 | + function espresso_venue_id($EVT_ID = 0) { |
|
899 | + EE_Registry::instance()->load_helper('Venue_View'); |
|
900 | + $venue = EEH_Venue_View::get_venue($EVT_ID); |
|
901 | 901 | return $venue instanceof EE_Venue ? $venue->ID() : 0; |
902 | 902 | } |
903 | 903 | } |
904 | 904 | |
905 | 905 | |
906 | 906 | |
907 | -if ( ! function_exists( 'espresso_is_venue_private' ) ) { |
|
907 | +if ( ! function_exists('espresso_is_venue_private')) { |
|
908 | 908 | /** |
909 | 909 | * Return whether a venue is private or not. |
910 | 910 | * @see EEH_Venue_View::get_venue() for more info on expected return results. |
@@ -913,16 +913,16 @@ discard block |
||
913 | 913 | * |
914 | 914 | * @return bool | null |
915 | 915 | */ |
916 | - function espresso_is_venue_private( $VNU_ID = 0 ) { |
|
917 | - EE_Registry::instance()->load_helper( 'Venue_View' ); |
|
918 | - return EEH_Venue_View::is_venue_private( $VNU_ID ); |
|
916 | + function espresso_is_venue_private($VNU_ID = 0) { |
|
917 | + EE_Registry::instance()->load_helper('Venue_View'); |
|
918 | + return EEH_Venue_View::is_venue_private($VNU_ID); |
|
919 | 919 | } |
920 | 920 | } |
921 | 921 | |
922 | 922 | |
923 | 923 | |
924 | 924 | |
925 | -if ( ! function_exists( 'espresso_venue_name' )) { |
|
925 | +if ( ! function_exists('espresso_venue_name')) { |
|
926 | 926 | /** |
927 | 927 | * espresso_venue_name |
928 | 928 | * |
@@ -932,20 +932,20 @@ discard block |
||
932 | 932 | * @param bool $echo |
933 | 933 | * @return string |
934 | 934 | */ |
935 | - function espresso_venue_name( $VNU_ID = 0, $link_to = 'details', $echo = TRUE ) { |
|
936 | - EE_Registry::instance()->load_helper( 'Venue_View' ); |
|
937 | - if($echo){ |
|
938 | - echo EEH_Venue_View::venue_name( $link_to, $VNU_ID ); |
|
935 | + function espresso_venue_name($VNU_ID = 0, $link_to = 'details', $echo = TRUE) { |
|
936 | + EE_Registry::instance()->load_helper('Venue_View'); |
|
937 | + if ($echo) { |
|
938 | + echo EEH_Venue_View::venue_name($link_to, $VNU_ID); |
|
939 | 939 | return ''; |
940 | 940 | } |
941 | - return EEH_Venue_View::venue_name( $link_to, $VNU_ID ); |
|
941 | + return EEH_Venue_View::venue_name($link_to, $VNU_ID); |
|
942 | 942 | } |
943 | 943 | } |
944 | 944 | |
945 | 945 | |
946 | 946 | |
947 | 947 | |
948 | -if ( ! function_exists( 'espresso_venue_link' )) { |
|
948 | +if ( ! function_exists('espresso_venue_link')) { |
|
949 | 949 | /** |
950 | 950 | * espresso_venue_link |
951 | 951 | * |
@@ -954,15 +954,15 @@ discard block |
||
954 | 954 | * @param string $text |
955 | 955 | * @return string |
956 | 956 | */ |
957 | - function espresso_venue_link( $VNU_ID = 0, $text = '' ) { |
|
958 | - EE_Registry::instance()->load_helper( 'Venue_View' ); |
|
959 | - return EEH_Venue_View::venue_details_link( $VNU_ID, $text ); |
|
957 | + function espresso_venue_link($VNU_ID = 0, $text = '') { |
|
958 | + EE_Registry::instance()->load_helper('Venue_View'); |
|
959 | + return EEH_Venue_View::venue_details_link($VNU_ID, $text); |
|
960 | 960 | } |
961 | 961 | } |
962 | 962 | |
963 | 963 | |
964 | 964 | |
965 | -if ( ! function_exists( 'espresso_venue_description' )) { |
|
965 | +if ( ! function_exists('espresso_venue_description')) { |
|
966 | 966 | /** |
967 | 967 | * espresso_venue_description |
968 | 968 | * |
@@ -971,18 +971,18 @@ discard block |
||
971 | 971 | * @param bool $echo |
972 | 972 | * @return string |
973 | 973 | */ |
974 | - function espresso_venue_description( $VNU_ID = FALSE, $echo = TRUE ) { |
|
975 | - EE_Registry::instance()->load_helper( 'Venue_View' ); |
|
976 | - if($echo){ |
|
977 | - echo EEH_Venue_View::venue_description( $VNU_ID ); |
|
974 | + function espresso_venue_description($VNU_ID = FALSE, $echo = TRUE) { |
|
975 | + EE_Registry::instance()->load_helper('Venue_View'); |
|
976 | + if ($echo) { |
|
977 | + echo EEH_Venue_View::venue_description($VNU_ID); |
|
978 | 978 | return ''; |
979 | 979 | } |
980 | - return EEH_Venue_View::venue_description( $VNU_ID ); |
|
980 | + return EEH_Venue_View::venue_description($VNU_ID); |
|
981 | 981 | } |
982 | 982 | } |
983 | 983 | |
984 | 984 | |
985 | -if ( ! function_exists( 'espresso_venue_excerpt' )) { |
|
985 | +if ( ! function_exists('espresso_venue_excerpt')) { |
|
986 | 986 | /** |
987 | 987 | * espresso_venue_excerpt |
988 | 988 | * |
@@ -991,19 +991,19 @@ discard block |
||
991 | 991 | * @param bool $echo |
992 | 992 | * @return string |
993 | 993 | */ |
994 | - function espresso_venue_excerpt( $VNU_ID = 0, $echo = TRUE ) { |
|
995 | - EE_Registry::instance()->load_helper( 'Venue_View' ); |
|
996 | - if ( $echo ) { |
|
997 | - echo EEH_Venue_View::venue_excerpt( $VNU_ID, $echo ); |
|
994 | + function espresso_venue_excerpt($VNU_ID = 0, $echo = TRUE) { |
|
995 | + EE_Registry::instance()->load_helper('Venue_View'); |
|
996 | + if ($echo) { |
|
997 | + echo EEH_Venue_View::venue_excerpt($VNU_ID, $echo); |
|
998 | 998 | return ''; |
999 | 999 | } |
1000 | - return EEH_Venue_View::venue_excerpt( $VNU_ID, $echo ); |
|
1000 | + return EEH_Venue_View::venue_excerpt($VNU_ID, $echo); |
|
1001 | 1001 | } |
1002 | 1002 | } |
1003 | 1003 | |
1004 | 1004 | |
1005 | 1005 | |
1006 | -if ( ! function_exists( 'espresso_venue_categories' )) { |
|
1006 | +if ( ! function_exists('espresso_venue_categories')) { |
|
1007 | 1007 | /** |
1008 | 1008 | * espresso_venue_categories |
1009 | 1009 | * returns the terms associated with a venue |
@@ -1013,18 +1013,18 @@ discard block |
||
1013 | 1013 | * @param bool $echo |
1014 | 1014 | * @return string |
1015 | 1015 | */ |
1016 | - function espresso_venue_categories( $VNU_ID = 0, $hide_uncategorized = TRUE, $echo = TRUE ) { |
|
1017 | - EE_Registry::instance()->load_helper( 'Venue_View' ); |
|
1018 | - if ( $echo ) { |
|
1019 | - echo EEH_Venue_View::venue_categories( $VNU_ID, $hide_uncategorized ); |
|
1016 | + function espresso_venue_categories($VNU_ID = 0, $hide_uncategorized = TRUE, $echo = TRUE) { |
|
1017 | + EE_Registry::instance()->load_helper('Venue_View'); |
|
1018 | + if ($echo) { |
|
1019 | + echo EEH_Venue_View::venue_categories($VNU_ID, $hide_uncategorized); |
|
1020 | 1020 | return ''; |
1021 | 1021 | } |
1022 | - return EEH_Venue_View::venue_categories( $VNU_ID, $hide_uncategorized ); |
|
1022 | + return EEH_Venue_View::venue_categories($VNU_ID, $hide_uncategorized); |
|
1023 | 1023 | } |
1024 | 1024 | } |
1025 | 1025 | |
1026 | 1026 | |
1027 | -if ( ! function_exists( 'espresso_venue_address' )) { |
|
1027 | +if ( ! function_exists('espresso_venue_address')) { |
|
1028 | 1028 | /** |
1029 | 1029 | * espresso_venue_address |
1030 | 1030 | * returns a formatted block of html for displaying a venue's address |
@@ -1034,18 +1034,18 @@ discard block |
||
1034 | 1034 | * @param bool $echo |
1035 | 1035 | * @return string |
1036 | 1036 | */ |
1037 | - function espresso_venue_address( $type = 'multiline', $VNU_ID = 0, $echo = TRUE ) { |
|
1038 | - EE_Registry::instance()->load_helper( 'Venue_View' ); |
|
1039 | - if ( $echo ) { |
|
1040 | - echo EEH_Venue_View::venue_address( $type, $VNU_ID ); |
|
1037 | + function espresso_venue_address($type = 'multiline', $VNU_ID = 0, $echo = TRUE) { |
|
1038 | + EE_Registry::instance()->load_helper('Venue_View'); |
|
1039 | + if ($echo) { |
|
1040 | + echo EEH_Venue_View::venue_address($type, $VNU_ID); |
|
1041 | 1041 | return ''; |
1042 | 1042 | } |
1043 | - return EEH_Venue_View::venue_address( $type, $VNU_ID ); |
|
1043 | + return EEH_Venue_View::venue_address($type, $VNU_ID); |
|
1044 | 1044 | } |
1045 | 1045 | } |
1046 | 1046 | |
1047 | 1047 | |
1048 | -if ( ! function_exists( 'espresso_venue_raw_address' )) { |
|
1048 | +if ( ! function_exists('espresso_venue_raw_address')) { |
|
1049 | 1049 | /** |
1050 | 1050 | * espresso_venue_address |
1051 | 1051 | * returns an UN-formatted string containing a venue's address |
@@ -1055,18 +1055,18 @@ discard block |
||
1055 | 1055 | * @param bool $echo |
1056 | 1056 | * @return string |
1057 | 1057 | */ |
1058 | - function espresso_venue_raw_address( $type = 'multiline', $VNU_ID = 0, $echo = TRUE ) { |
|
1059 | - EE_Registry::instance()->load_helper( 'Venue_View' ); |
|
1060 | - if ( $echo ) { |
|
1061 | - echo EEH_Venue_View::venue_address( $type, $VNU_ID, FALSE, FALSE ); |
|
1058 | + function espresso_venue_raw_address($type = 'multiline', $VNU_ID = 0, $echo = TRUE) { |
|
1059 | + EE_Registry::instance()->load_helper('Venue_View'); |
|
1060 | + if ($echo) { |
|
1061 | + echo EEH_Venue_View::venue_address($type, $VNU_ID, FALSE, FALSE); |
|
1062 | 1062 | return ''; |
1063 | 1063 | } |
1064 | - return EEH_Venue_View::venue_address( $type, $VNU_ID, FALSE, FALSE ); |
|
1064 | + return EEH_Venue_View::venue_address($type, $VNU_ID, FALSE, FALSE); |
|
1065 | 1065 | } |
1066 | 1066 | } |
1067 | 1067 | |
1068 | 1068 | |
1069 | -if ( ! function_exists( 'espresso_venue_has_address' )) { |
|
1069 | +if ( ! function_exists('espresso_venue_has_address')) { |
|
1070 | 1070 | /** |
1071 | 1071 | * espresso_venue_has_address |
1072 | 1072 | * returns TRUE or FALSE if a Venue has address information |
@@ -1074,14 +1074,14 @@ discard block |
||
1074 | 1074 | * @param int $VNU_ID |
1075 | 1075 | * @return bool |
1076 | 1076 | */ |
1077 | - function espresso_venue_has_address( $VNU_ID = 0 ) { |
|
1078 | - EE_Registry::instance()->load_helper( 'Venue_View' ); |
|
1079 | - return EEH_Venue_View::venue_has_address( $VNU_ID ); |
|
1077 | + function espresso_venue_has_address($VNU_ID = 0) { |
|
1078 | + EE_Registry::instance()->load_helper('Venue_View'); |
|
1079 | + return EEH_Venue_View::venue_has_address($VNU_ID); |
|
1080 | 1080 | } |
1081 | 1081 | } |
1082 | 1082 | |
1083 | 1083 | |
1084 | -if ( ! function_exists( 'espresso_venue_gmap' )) { |
|
1084 | +if ( ! function_exists('espresso_venue_gmap')) { |
|
1085 | 1085 | /** |
1086 | 1086 | * espresso_venue_gmap |
1087 | 1087 | * returns a google map for the venue address |
@@ -1092,18 +1092,18 @@ discard block |
||
1092 | 1092 | * @param bool $echo |
1093 | 1093 | * @return string |
1094 | 1094 | */ |
1095 | - function espresso_venue_gmap( $VNU_ID = 0, $map_ID = FALSE, $gmap = array(), $echo = TRUE ) { |
|
1096 | - EE_Registry::instance()->load_helper( 'Venue_View' ); |
|
1097 | - if ( $echo ) { |
|
1098 | - echo EEH_Venue_View::venue_gmap( $VNU_ID, $map_ID, $gmap ); |
|
1095 | + function espresso_venue_gmap($VNU_ID = 0, $map_ID = FALSE, $gmap = array(), $echo = TRUE) { |
|
1096 | + EE_Registry::instance()->load_helper('Venue_View'); |
|
1097 | + if ($echo) { |
|
1098 | + echo EEH_Venue_View::venue_gmap($VNU_ID, $map_ID, $gmap); |
|
1099 | 1099 | return ''; |
1100 | 1100 | } |
1101 | - return EEH_Venue_View::venue_gmap( $VNU_ID, $map_ID, $gmap ); |
|
1101 | + return EEH_Venue_View::venue_gmap($VNU_ID, $map_ID, $gmap); |
|
1102 | 1102 | } |
1103 | 1103 | } |
1104 | 1104 | |
1105 | 1105 | |
1106 | -if ( ! function_exists( 'espresso_venue_phone' )) { |
|
1106 | +if ( ! function_exists('espresso_venue_phone')) { |
|
1107 | 1107 | /** |
1108 | 1108 | * espresso_venue_phone |
1109 | 1109 | * |
@@ -1111,19 +1111,19 @@ discard block |
||
1111 | 1111 | * @param bool $echo |
1112 | 1112 | * @return string |
1113 | 1113 | */ |
1114 | - function espresso_venue_phone( $VNU_ID = 0, $echo = TRUE ) { |
|
1115 | - EE_Registry::instance()->load_helper( 'Venue_View' ); |
|
1116 | - if ( $echo ) { |
|
1117 | - echo EEH_Venue_View::venue_phone( $VNU_ID ); |
|
1114 | + function espresso_venue_phone($VNU_ID = 0, $echo = TRUE) { |
|
1115 | + EE_Registry::instance()->load_helper('Venue_View'); |
|
1116 | + if ($echo) { |
|
1117 | + echo EEH_Venue_View::venue_phone($VNU_ID); |
|
1118 | 1118 | return ''; |
1119 | 1119 | } |
1120 | - return EEH_Venue_View::venue_phone( $VNU_ID ); |
|
1120 | + return EEH_Venue_View::venue_phone($VNU_ID); |
|
1121 | 1121 | } |
1122 | 1122 | } |
1123 | 1123 | |
1124 | 1124 | |
1125 | 1125 | |
1126 | -if ( ! function_exists( 'espresso_venue_website' )) { |
|
1126 | +if ( ! function_exists('espresso_venue_website')) { |
|
1127 | 1127 | /** |
1128 | 1128 | * espresso_venue_website |
1129 | 1129 | * |
@@ -1131,19 +1131,19 @@ discard block |
||
1131 | 1131 | * @param bool $echo |
1132 | 1132 | * @return string |
1133 | 1133 | */ |
1134 | - function espresso_venue_website( $VNU_ID = 0, $echo = TRUE ) { |
|
1135 | - EE_Registry::instance()->load_helper( 'Venue_View' ); |
|
1136 | - if ( $echo ) { |
|
1137 | - echo EEH_Venue_View::venue_website_link( $VNU_ID ); |
|
1134 | + function espresso_venue_website($VNU_ID = 0, $echo = TRUE) { |
|
1135 | + EE_Registry::instance()->load_helper('Venue_View'); |
|
1136 | + if ($echo) { |
|
1137 | + echo EEH_Venue_View::venue_website_link($VNU_ID); |
|
1138 | 1138 | return ''; |
1139 | 1139 | } |
1140 | - return EEH_Venue_View::venue_website_link( $VNU_ID ); |
|
1140 | + return EEH_Venue_View::venue_website_link($VNU_ID); |
|
1141 | 1141 | } |
1142 | 1142 | } |
1143 | 1143 | |
1144 | 1144 | |
1145 | 1145 | |
1146 | -if ( ! function_exists( 'espresso_edit_venue_link' )) { |
|
1146 | +if ( ! function_exists('espresso_edit_venue_link')) { |
|
1147 | 1147 | /** |
1148 | 1148 | * espresso_edit_venue_link |
1149 | 1149 | * |
@@ -1151,13 +1151,13 @@ discard block |
||
1151 | 1151 | * @param bool $echo |
1152 | 1152 | * @return string |
1153 | 1153 | */ |
1154 | - function espresso_edit_venue_link( $VNU_ID = 0, $echo = TRUE ) { |
|
1155 | - EE_Registry::instance()->load_helper( 'Venue_View' ); |
|
1156 | - if($echo){ |
|
1157 | - echo EEH_Venue_View::edit_venue_link( $VNU_ID ); |
|
1154 | + function espresso_edit_venue_link($VNU_ID = 0, $echo = TRUE) { |
|
1155 | + EE_Registry::instance()->load_helper('Venue_View'); |
|
1156 | + if ($echo) { |
|
1157 | + echo EEH_Venue_View::edit_venue_link($VNU_ID); |
|
1158 | 1158 | return ''; |
1159 | 1159 | } |
1160 | - return EEH_Venue_View::edit_venue_link( $VNU_ID ); |
|
1160 | + return EEH_Venue_View::edit_venue_link($VNU_ID); |
|
1161 | 1161 | } |
1162 | 1162 | } |
1163 | 1163 |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if (!defined('EVENT_ESPRESSO_VERSION')) |
|
2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
3 | 3 | exit('No direct script access allowed'); |
4 | 4 | |
5 | 5 | /** |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | * |
25 | 25 | * ------------------------------------------------------------------------ |
26 | 26 | */ |
27 | -class EE_Credit_Card_Month_Input extends EE_Month_Input{ |
|
27 | +class EE_Credit_Card_Month_Input extends EE_Month_Input { |
|
28 | 28 | |
29 | 29 | /** |
30 | 30 | * @param bool $leading_zero |
@@ -35,8 +35,8 @@ discard block |
||
35 | 35 | $leading_zero = false, |
36 | 36 | $input_settings = array(), |
37 | 37 | $january_is_month_1 = true |
38 | - ){ |
|
39 | - $this->set_sensitive_data_removal_strategy( new EE_All_Sensitive_Data_Removal() ); |
|
38 | + ) { |
|
39 | + $this->set_sensitive_data_removal_strategy(new EE_All_Sensitive_Data_Removal()); |
|
40 | 40 | parent::__construct( |
41 | 41 | $leading_zero, |
42 | 42 | $input_settings, |
@@ -6,21 +6,21 @@ discard block |
||
6 | 6 | * @subpackage |
7 | 7 | * @author Mike Nelson |
8 | 8 | */ |
9 | -class EE_Month_Input extends EE_Select_Input{ |
|
9 | +class EE_Month_Input extends EE_Select_Input { |
|
10 | 10 | |
11 | 11 | /** |
12 | 12 | * @param bool $leading_zero |
13 | 13 | * @param array $input_settings |
14 | 14 | * @param bool $january_is_month_1 whether january should have value of 1; or it should be month 0 |
15 | 15 | */ |
16 | - function __construct( $leading_zero = false, $input_settings = array(), $january_is_month_1 = true){ |
|
16 | + function __construct($leading_zero = false, $input_settings = array(), $january_is_month_1 = true) { |
|
17 | 17 | $key_begin_range = $january_is_month_1 ? 1 : 0; |
18 | - $key_range = range($key_begin_range, $key_begin_range + 11 ); |
|
19 | - if($leading_zero){ |
|
20 | - array_walk( $key_range, array( $this, '_zero_pad' ) ); |
|
18 | + $key_range = range($key_begin_range, $key_begin_range + 11); |
|
19 | + if ($leading_zero) { |
|
20 | + array_walk($key_range, array($this, '_zero_pad')); |
|
21 | 21 | } |
22 | - $value_range = range( 1, 12 ); |
|
23 | - array_walk( $value_range, array( $this, '_zero_pad' ) ); |
|
22 | + $value_range = range(1, 12); |
|
23 | + array_walk($value_range, array($this, '_zero_pad')); |
|
24 | 24 | parent::__construct( |
25 | 25 | array_combine( |
26 | 26 | $key_range, |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | * @param int $input |
36 | 36 | * @param mixed $key |
37 | 37 | */ |
38 | - protected function _zero_pad( &$input, $key ) { |
|
39 | - $input = str_pad( $input, 2, '0', STR_PAD_LEFT ); |
|
38 | + protected function _zero_pad(&$input, $key) { |
|
39 | + $input = str_pad($input, 2, '0', STR_PAD_LEFT); |
|
40 | 40 | } |
41 | 41 | } |
42 | 42 | \ No newline at end of file |