@@ -7,32 +7,32 @@ discard block |
||
| 7 | 7 | * other than explicitly setting it to EE_INF. |
| 8 | 8 | * Makes use of constant EE_INF_IN_DB set in espresso.php, and EE_INF, which is a PHP constant definedin the ether |
| 9 | 9 | */ |
| 10 | -class EE_Infinite_Integer_Field extends EE_Model_Field_Base{ |
|
| 11 | - function get_wpdb_data_type(){ |
|
| 10 | +class EE_Infinite_Integer_Field extends EE_Model_Field_Base { |
|
| 11 | + function get_wpdb_data_type() { |
|
| 12 | 12 | return '%d'; |
| 13 | 13 | } |
| 14 | 14 | function prepare_for_use_in_db($value_of_field_on_model_object) { |
| 15 | - if($value_of_field_on_model_object === EE_INF){ |
|
| 15 | + if ($value_of_field_on_model_object === EE_INF) { |
|
| 16 | 16 | return EE_INF_IN_DB; |
| 17 | - }else{ |
|
| 17 | + } else { |
|
| 18 | 18 | return intval($value_of_field_on_model_object); |
| 19 | 19 | } |
| 20 | 20 | } |
| 21 | 21 | function prepare_for_set($value_inputted_for_field_on_model_object) { |
| 22 | - if($value_inputted_for_field_on_model_object === EE_INF_IN_DB || |
|
| 22 | + if ($value_inputted_for_field_on_model_object === EE_INF_IN_DB || |
|
| 23 | 23 | $value_inputted_for_field_on_model_object === EE_INF || |
| 24 | 24 | $value_inputted_for_field_on_model_object === "EE_INF" |
| 25 | - ){ |
|
| 25 | + ) { |
|
| 26 | 26 | return EE_INF; |
| 27 | - }else{ |
|
| 27 | + } else { |
|
| 28 | 28 | return intval($value_inputted_for_field_on_model_object); |
| 29 | 29 | } |
| 30 | 30 | } |
| 31 | 31 | function prepare_for_set_from_db($value_inputted_for_field_on_model_object) { |
| 32 | 32 | $intval = intval($value_inputted_for_field_on_model_object); |
| 33 | - if($intval == EE_INF_IN_DB){ |
|
| 33 | + if ($intval == EE_INF_IN_DB) { |
|
| 34 | 34 | return EE_INF; |
| 35 | - }else{ |
|
| 35 | + } else { |
|
| 36 | 36 | return $intval; |
| 37 | 37 | } |
| 38 | 38 | } |
@@ -45,9 +45,9 @@ discard block |
||
| 45 | 45 | * @param string $schema input, symbol, text; or any string you want to show if the value equals EE_INF |
| 46 | 46 | * @return string |
| 47 | 47 | */ |
| 48 | - function prepare_for_pretty_echoing( $value_on_field_to_be_outputted, $schema = null ) { |
|
| 49 | - if( $value_on_field_to_be_outputted === EE_INF ){ |
|
| 50 | - switch($schema){ |
|
| 48 | + function prepare_for_pretty_echoing($value_on_field_to_be_outputted, $schema = null) { |
|
| 49 | + if ($value_on_field_to_be_outputted === EE_INF) { |
|
| 50 | + switch ($schema) { |
|
| 51 | 51 | case 'input': |
| 52 | 52 | return ''; |
| 53 | 53 | case 'symbol': |
@@ -40,27 +40,27 @@ discard block |
||
| 40 | 40 | * @param int $EVT_ID |
| 41 | 41 | * @return object |
| 42 | 42 | */ |
| 43 | - public static function get_event( $EVT_ID = 0 ) { |
|
| 44 | - $EVT_ID = $EVT_ID instanceof WP_Post ? $EVT_ID->ID : absint( $EVT_ID ); |
|
| 43 | + public static function get_event($EVT_ID = 0) { |
|
| 44 | + $EVT_ID = $EVT_ID instanceof WP_Post ? $EVT_ID->ID : absint($EVT_ID); |
|
| 45 | 45 | // do we already have the Event you are looking for? |
| 46 | - if ( EEH_Event_View::$_event instanceof EE_Event && $EVT_ID && EEH_Event_View::$_event->ID() === $EVT_ID ) { |
|
| 46 | + if (EEH_Event_View::$_event instanceof EE_Event && $EVT_ID && EEH_Event_View::$_event->ID() === $EVT_ID) { |
|
| 47 | 47 | return EEH_Event_View::$_event; |
| 48 | 48 | } |
| 49 | 49 | EEH_Event_View::$_event = NULL; |
| 50 | 50 | // international newspaper? |
| 51 | 51 | global $post; |
| 52 | 52 | // if this is being called from an EE_Event post, then we can just grab the attached EE_Event object |
| 53 | - if ( isset( $post->post_type ) && $post->post_type == 'espresso_events' || $EVT_ID ) { |
|
| 53 | + if (isset($post->post_type) && $post->post_type == 'espresso_events' || $EVT_ID) { |
|
| 54 | 54 | // d( $post ); |
| 55 | 55 | // grab the event we're looking for |
| 56 | - if ( isset( $post->EE_Event ) && ( $EVT_ID == 0 || ( $EVT_ID == $post->ID ))) { |
|
| 56 | + if (isset($post->EE_Event) && ($EVT_ID == 0 || ($EVT_ID == $post->ID))) { |
|
| 57 | 57 | EEH_Event_View::$_event = $post->EE_Event; |
| 58 | 58 | // d( EEH_Event_View::$_event ); |
| 59 | 59 | } |
| 60 | 60 | // now if we STILL do NOT have an EE_Event model object, BUT we have an Event ID... |
| 61 | - if ( ! EEH_Event_View::$_event instanceof EE_Event && $EVT_ID ) { |
|
| 61 | + if ( ! EEH_Event_View::$_event instanceof EE_Event && $EVT_ID) { |
|
| 62 | 62 | // sigh... pull it from the db |
| 63 | - EEH_Event_View::$_event = EEM_Event::instance()->get_one_by_ID( $EVT_ID ); |
|
| 63 | + EEH_Event_View::$_event = EEM_Event::instance()->get_one_by_ID($EVT_ID); |
|
| 64 | 64 | // d( EEH_Event_View::$_event ); |
| 65 | 65 | } |
| 66 | 66 | } |
@@ -76,8 +76,8 @@ discard block |
||
| 76 | 76 | * @param int $EVT_ID |
| 77 | 77 | * @return boolean |
| 78 | 78 | */ |
| 79 | - public static function display_ticket_selector( $EVT_ID = 0 ) { |
|
| 80 | - $event = EEH_Event_View::get_event( $EVT_ID ); |
|
| 79 | + public static function display_ticket_selector($EVT_ID = 0) { |
|
| 80 | + $event = EEH_Event_View::get_event($EVT_ID); |
|
| 81 | 81 | return $event instanceof EE_Event ? $event->display_ticket_selector() : FALSE; |
| 82 | 82 | } |
| 83 | 83 | |
@@ -90,9 +90,9 @@ discard block |
||
| 90 | 90 | * @param int $EVT_ID |
| 91 | 91 | * @return string |
| 92 | 92 | */ |
| 93 | - public static function event_status( $EVT_ID = 0 ) { |
|
| 94 | - $event = EEH_Event_View::get_event( $EVT_ID ); |
|
| 95 | - return $event instanceof EE_Event ? $event->pretty_active_status( FALSE ) : ''; |
|
| 93 | + public static function event_status($EVT_ID = 0) { |
|
| 94 | + $event = EEH_Event_View::get_event($EVT_ID); |
|
| 95 | + return $event instanceof EE_Event ? $event->pretty_active_status(FALSE) : ''; |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | |
@@ -104,8 +104,8 @@ discard block |
||
| 104 | 104 | * @param int $EVT_ID |
| 105 | 105 | * @return string |
| 106 | 106 | */ |
| 107 | - public static function event_active_status( $EVT_ID = 0 ) { |
|
| 108 | - $event = EEH_Event_View::get_event( $EVT_ID ); |
|
| 107 | + public static function event_active_status($EVT_ID = 0) { |
|
| 108 | + $event = EEH_Event_View::get_event($EVT_ID); |
|
| 109 | 109 | return $event instanceof EE_Event ? $event->pretty_active_status() : 'inactive'; |
| 110 | 110 | } |
| 111 | 111 | |
@@ -118,13 +118,13 @@ discard block |
||
| 118 | 118 | * @param int $EVT_ID |
| 119 | 119 | * @return string |
| 120 | 120 | */ |
| 121 | - public static function event_has_content_or_excerpt( $EVT_ID = 0 ) { |
|
| 122 | - $event = EEH_Event_View::get_event( $EVT_ID ); |
|
| 121 | + public static function event_has_content_or_excerpt($EVT_ID = 0) { |
|
| 122 | + $event = EEH_Event_View::get_event($EVT_ID); |
|
| 123 | 123 | $has_content_or_excerpt = FALSE; |
| 124 | - if ( $event instanceof EE_Event ) { |
|
| 125 | - $has_content_or_excerpt = $event->description() != '' || $event->short_description( NULL, NULL, TRUE ) != '' ? TRUE : FALSE; |
|
| 124 | + if ($event instanceof EE_Event) { |
|
| 125 | + $has_content_or_excerpt = $event->description() != '' || $event->short_description(NULL, NULL, TRUE) != '' ? TRUE : FALSE; |
|
| 126 | 126 | } |
| 127 | - if ( is_archive() && ! ( espresso_display_full_description_in_event_list() || espresso_display_excerpt_in_event_list() )) { |
|
| 127 | + if (is_archive() && ! (espresso_display_full_description_in_event_list() || espresso_display_excerpt_in_event_list())) { |
|
| 128 | 128 | $has_content_or_excerpt = FALSE; |
| 129 | 129 | } |
| 130 | 130 | return $has_content_or_excerpt; |
@@ -140,45 +140,45 @@ discard block |
||
| 140 | 140 | * @param null $more |
| 141 | 141 | * @return string |
| 142 | 142 | */ |
| 143 | - public static function event_content_or_excerpt( $num_words = NULL, $more = NULL ) { |
|
| 143 | + public static function event_content_or_excerpt($num_words = NULL, $more = NULL) { |
|
| 144 | 144 | global $post; |
| 145 | 145 | |
| 146 | 146 | ob_start(); |
| 147 | - if (( is_single() ) || ( is_archive() && espresso_display_full_description_in_event_list() )) { |
|
| 147 | + if ((is_single()) || (is_archive() && espresso_display_full_description_in_event_list())) { |
|
| 148 | 148 | |
| 149 | 149 | // admin has chosen "full description" for the "Event Espresso - Events > Templates > Display Description" option |
| 150 | 150 | the_content(); |
| 151 | 151 | |
| 152 | - } else if (( is_archive() && has_excerpt( $post->ID ) && espresso_display_excerpt_in_event_list() ) ) { |
|
| 152 | + } else if ((is_archive() && has_excerpt($post->ID) && espresso_display_excerpt_in_event_list())) { |
|
| 153 | 153 | |
| 154 | 154 | // admin has chosen "excerpt (short desc)" for the "Event Espresso - Events > Templates > Display Description" option |
| 155 | 155 | // AND an excerpt actually exists |
| 156 | 156 | the_excerpt(); |
| 157 | 157 | |
| 158 | - } else if (( is_archive() && ! has_excerpt( $post->ID ) && espresso_display_excerpt_in_event_list() )) { |
|
| 158 | + } else if ((is_archive() && ! has_excerpt($post->ID) && espresso_display_excerpt_in_event_list())) { |
|
| 159 | 159 | |
| 160 | 160 | // admin has chosen "excerpt (short desc)" for the "Event Espresso - Events > Templates > Display Description" option |
| 161 | 161 | // but NO excerpt actually exists, so we need to create one |
| 162 | - if ( ! empty( $num_words )) { |
|
| 163 | - if ( empty( $more )) { |
|
| 164 | - $more_link_text = __( '(more…)' ); |
|
| 165 | - $more = ' <a href="' . get_permalink() . '" class="more-link">' . $more_link_text . '</a>'; |
|
| 166 | - $more = apply_filters( 'the_content_more_link', $more, $more_link_text ); |
|
| 162 | + if ( ! empty($num_words)) { |
|
| 163 | + if (empty($more)) { |
|
| 164 | + $more_link_text = __('(more…)'); |
|
| 165 | + $more = ' <a href="'.get_permalink().'" class="more-link">'.$more_link_text.'</a>'; |
|
| 166 | + $more = apply_filters('the_content_more_link', $more, $more_link_text); |
|
| 167 | 167 | } |
| 168 | - $content = str_replace( 'NOMORELINK', '', get_the_content( 'NOMORELINK' )); |
|
| 168 | + $content = str_replace('NOMORELINK', '', get_the_content('NOMORELINK')); |
|
| 169 | 169 | |
| 170 | - $content = wp_trim_words( $content, $num_words, ' ' ) . $more; |
|
| 170 | + $content = wp_trim_words($content, $num_words, ' ').$more; |
|
| 171 | 171 | } else { |
| 172 | - $content = get_the_content(); |
|
| 172 | + $content = get_the_content(); |
|
| 173 | 173 | } |
| 174 | 174 | global $allowedtags; |
| 175 | - $content = wp_kses( $content, $allowedtags ); |
|
| 176 | - $content = strip_shortcodes( $content ); |
|
| 177 | - echo apply_filters( 'the_content', $content ); |
|
| 175 | + $content = wp_kses($content, $allowedtags); |
|
| 176 | + $content = strip_shortcodes($content); |
|
| 177 | + echo apply_filters('the_content', $content); |
|
| 178 | 178 | |
| 179 | 179 | } else { |
| 180 | 180 | // admin has chosen "none" for the "Event Espresso - Events > Templates > Display Description" option |
| 181 | - echo apply_filters( 'the_content', '' ); |
|
| 181 | + echo apply_filters('the_content', ''); |
|
| 182 | 182 | } |
| 183 | 183 | return ob_get_clean(); |
| 184 | 184 | } |
@@ -192,13 +192,13 @@ discard block |
||
| 192 | 192 | * @param int $EVT_ID |
| 193 | 193 | * @return EE_Ticket[] |
| 194 | 194 | */ |
| 195 | - public static function event_tickets_available( $EVT_ID = 0 ) { |
|
| 196 | - $event = EEH_Event_View::get_event( $EVT_ID ); |
|
| 195 | + public static function event_tickets_available($EVT_ID = 0) { |
|
| 196 | + $event = EEH_Event_View::get_event($EVT_ID); |
|
| 197 | 197 | $tickets_available_for_purchase = array(); |
| 198 | - if( $event instanceof EE_Event ) { |
|
| 199 | - $datetimes = EEH_Event_View::get_all_date_obj( $EVT_ID, FALSE ); |
|
| 200 | - foreach( $datetimes as $datetime ) { |
|
| 201 | - $tickets_available_for_purchase = array_merge( $tickets_available_for_purchase, $datetime->ticket_types_available_for_purchase() ); |
|
| 198 | + if ($event instanceof EE_Event) { |
|
| 199 | + $datetimes = EEH_Event_View::get_all_date_obj($EVT_ID, FALSE); |
|
| 200 | + foreach ($datetimes as $datetime) { |
|
| 201 | + $tickets_available_for_purchase = array_merge($tickets_available_for_purchase, $datetime->ticket_types_available_for_purchase()); |
|
| 202 | 202 | } |
| 203 | 203 | } |
| 204 | 204 | return $tickets_available_for_purchase; |
@@ -214,22 +214,22 @@ discard block |
||
| 214 | 214 | * @param bool $hide_uncategorized |
| 215 | 215 | * @return string |
| 216 | 216 | */ |
| 217 | - public static function event_categories( $EVT_ID = 0, $hide_uncategorized = TRUE ) { |
|
| 217 | + public static function event_categories($EVT_ID = 0, $hide_uncategorized = TRUE) { |
|
| 218 | 218 | $category_links = array(); |
| 219 | - $event = EEH_Event_View::get_event( $EVT_ID ); |
|
| 220 | - if ( $event instanceof EE_Event ) { |
|
| 221 | - $event_categories = get_the_terms( $event->ID(), 'espresso_event_categories' ); |
|
| 222 | - if ( $event_categories ) { |
|
| 219 | + $event = EEH_Event_View::get_event($EVT_ID); |
|
| 220 | + if ($event instanceof EE_Event) { |
|
| 221 | + $event_categories = get_the_terms($event->ID(), 'espresso_event_categories'); |
|
| 222 | + if ($event_categories) { |
|
| 223 | 223 | // loop thru terms and create links |
| 224 | - foreach ( $event_categories as $term ) { |
|
| 225 | - $url = get_term_link( $term, 'espresso_venue_categories' ); |
|
| 226 | - if ( ! is_wp_error( $url ) && (( $hide_uncategorized && strtolower( $term->name ) != __( 'uncategorized', 'event_espresso' )) || ! $hide_uncategorized )) { |
|
| 227 | - $category_links[] = '<a href="' . esc_url( $url ) . '" rel="tag">' . $term->name . '</a>'; |
|
| 224 | + foreach ($event_categories as $term) { |
|
| 225 | + $url = get_term_link($term, 'espresso_venue_categories'); |
|
| 226 | + if ( ! is_wp_error($url) && (($hide_uncategorized && strtolower($term->name) != __('uncategorized', 'event_espresso')) || ! $hide_uncategorized)) { |
|
| 227 | + $category_links[] = '<a href="'.esc_url($url).'" rel="tag">'.$term->name.'</a>'; |
|
| 228 | 228 | } |
| 229 | 229 | } |
| 230 | 230 | } |
| 231 | 231 | } |
| 232 | - return implode( ', ', $category_links ); |
|
| 232 | + return implode(', ', $category_links); |
|
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | |
@@ -243,10 +243,10 @@ discard block |
||
| 243 | 243 | * @param int $EVT_ID |
| 244 | 244 | * @return string |
| 245 | 245 | */ |
| 246 | - public static function the_event_date( $dt_frmt = 'D M jS', $tm_frmt = 'g:i a', $EVT_ID = 0 ) { |
|
| 247 | - $datetime = EEH_Event_View::get_primary_date_obj( $EVT_ID ); |
|
| 248 | - $format = ! empty( $dt_frmt ) && ! empty( $tm_frmt ) ? $dt_frmt . ' ' . $tm_frmt : $dt_frmt . $tm_frmt; |
|
| 249 | - return $datetime instanceof EE_Datetime ? $datetime->get_i18n_datetime( 'DTT_EVT_start', $format ) : ''; |
|
| 246 | + public static function the_event_date($dt_frmt = 'D M jS', $tm_frmt = 'g:i a', $EVT_ID = 0) { |
|
| 247 | + $datetime = EEH_Event_View::get_primary_date_obj($EVT_ID); |
|
| 248 | + $format = ! empty($dt_frmt) && ! empty($tm_frmt) ? $dt_frmt.' '.$tm_frmt : $dt_frmt.$tm_frmt; |
|
| 249 | + return $datetime instanceof EE_Datetime ? $datetime->get_i18n_datetime('DTT_EVT_start', $format) : ''; |
|
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 | |
@@ -260,10 +260,10 @@ discard block |
||
| 260 | 260 | * @param int $EVT_ID |
| 261 | 261 | * @return string |
| 262 | 262 | */ |
| 263 | - public static function the_event_end_date( $dt_frmt = 'D M jS', $tm_frmt = 'g:i a', $EVT_ID = 0 ) { |
|
| 264 | - $datetime = EEH_Event_View::get_last_date_obj( $EVT_ID ); |
|
| 265 | - $format = ! empty( $dt_frmt ) && ! empty( $tm_frmt ) ? $dt_frmt . ' ' . $tm_frmt : $dt_frmt . $tm_frmt; |
|
| 266 | - return $datetime instanceof EE_Datetime ? $datetime->get_i18n_datetime( 'DTT_EVT_end', $format ) : ''; |
|
| 263 | + public static function the_event_end_date($dt_frmt = 'D M jS', $tm_frmt = 'g:i a', $EVT_ID = 0) { |
|
| 264 | + $datetime = EEH_Event_View::get_last_date_obj($EVT_ID); |
|
| 265 | + $format = ! empty($dt_frmt) && ! empty($tm_frmt) ? $dt_frmt.' '.$tm_frmt : $dt_frmt.$tm_frmt; |
|
| 266 | + return $datetime instanceof EE_Datetime ? $datetime->get_i18n_datetime('DTT_EVT_end', $format) : ''; |
|
| 267 | 267 | } |
| 268 | 268 | |
| 269 | 269 | |
@@ -277,10 +277,10 @@ discard block |
||
| 277 | 277 | * @param int $EVT_ID |
| 278 | 278 | * @return string |
| 279 | 279 | */ |
| 280 | - public static function the_earliest_event_date( $dt_frmt = 'D M jS', $tm_frmt = 'g:i a', $EVT_ID = 0 ) { |
|
| 281 | - $datetime = EEH_Event_View::get_earliest_date_obj( $EVT_ID ); |
|
| 282 | - $format = ! empty( $dt_frmt ) && ! empty( $tm_frmt ) ? $dt_frmt . ' ' . $tm_frmt : $dt_frmt . $tm_frmt; |
|
| 283 | - return $datetime instanceof EE_Datetime ? $datetime->get_i18n_datetime( 'DTT_EVT_start', $format ) : ''; |
|
| 280 | + public static function the_earliest_event_date($dt_frmt = 'D M jS', $tm_frmt = 'g:i a', $EVT_ID = 0) { |
|
| 281 | + $datetime = EEH_Event_View::get_earliest_date_obj($EVT_ID); |
|
| 282 | + $format = ! empty($dt_frmt) && ! empty($tm_frmt) ? $dt_frmt.' '.$tm_frmt : $dt_frmt.$tm_frmt; |
|
| 283 | + return $datetime instanceof EE_Datetime ? $datetime->get_i18n_datetime('DTT_EVT_start', $format) : ''; |
|
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 | |
@@ -294,10 +294,10 @@ discard block |
||
| 294 | 294 | * @param int $EVT_ID |
| 295 | 295 | * @return string |
| 296 | 296 | */ |
| 297 | - public static function the_latest_event_date( $dt_frmt = 'D M jS', $tm_frmt = 'g:i a', $EVT_ID = 0 ) { |
|
| 298 | - $datetime = EEH_Event_View::get_last_date_obj( $EVT_ID ); |
|
| 299 | - $format = ! empty( $dt_frmt ) && ! empty( $tm_frmt ) ? $dt_frmt . ' ' . $tm_frmt : $dt_frmt . $tm_frmt; |
|
| 300 | - return $datetime instanceof EE_Datetime ? $datetime->get_i18n_datetime( 'DTT_EVT_end', $format ) : ''; |
|
| 297 | + public static function the_latest_event_date($dt_frmt = 'D M jS', $tm_frmt = 'g:i a', $EVT_ID = 0) { |
|
| 298 | + $datetime = EEH_Event_View::get_last_date_obj($EVT_ID); |
|
| 299 | + $format = ! empty($dt_frmt) && ! empty($tm_frmt) ? $dt_frmt.' '.$tm_frmt : $dt_frmt.$tm_frmt; |
|
| 300 | + return $datetime instanceof EE_Datetime ? $datetime->get_i18n_datetime('DTT_EVT_end', $format) : ''; |
|
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | |
@@ -309,13 +309,13 @@ discard block |
||
| 309 | 309 | * @param int $EVT_ID |
| 310 | 310 | * @return string |
| 311 | 311 | */ |
| 312 | - public static function event_date_as_calendar_page( $EVT_ID = 0 ) { |
|
| 313 | - $datetime = EEH_Event_View::get_primary_date_obj( $EVT_ID ); |
|
| 314 | - if ( $datetime instanceof EE_Datetime ) { |
|
| 312 | + public static function event_date_as_calendar_page($EVT_ID = 0) { |
|
| 313 | + $datetime = EEH_Event_View::get_primary_date_obj($EVT_ID); |
|
| 314 | + if ($datetime instanceof EE_Datetime) { |
|
| 315 | 315 | ?> |
| 316 | 316 | <div class="event-date-calendar-page-dv"> |
| 317 | - <div class="event-date-calendar-page-month-dv"><?php echo $datetime->get_i18n_datetime( 'DTT_EVT_start', 'M' );?></div> |
|
| 318 | - <div class="event-date-calendar-page-day-dv"><?php echo $datetime->start_date( 'd' );?></div> |
|
| 317 | + <div class="event-date-calendar-page-month-dv"><?php echo $datetime->get_i18n_datetime('DTT_EVT_start', 'M'); ?></div> |
|
| 318 | + <div class="event-date-calendar-page-day-dv"><?php echo $datetime->start_date('d'); ?></div> |
|
| 319 | 319 | </div> |
| 320 | 320 | <?php |
| 321 | 321 | } |
@@ -330,17 +330,17 @@ discard block |
||
| 330 | 330 | * @param int $EVT_ID |
| 331 | 331 | * @return string |
| 332 | 332 | */ |
| 333 | - public static function get_primary_date_obj( $EVT_ID = 0 ) { |
|
| 334 | - $event = EEH_Event_View::get_event( $EVT_ID ); |
|
| 335 | - if ( $event instanceof EE_Event ) { |
|
| 333 | + public static function get_primary_date_obj($EVT_ID = 0) { |
|
| 334 | + $event = EEH_Event_View::get_event($EVT_ID); |
|
| 335 | + if ($event instanceof EE_Event) { |
|
| 336 | 336 | $datetimes = $event->get_many_related( |
| 337 | 337 | 'Datetime', |
| 338 | 338 | array( |
| 339 | 339 | 'limit' => 1, |
| 340 | - 'order_by' => array( 'DTT_order' => 'ASC' ) |
|
| 340 | + 'order_by' => array('DTT_order' => 'ASC') |
|
| 341 | 341 | ) |
| 342 | 342 | ); |
| 343 | - return reset( $datetimes ); |
|
| 343 | + return reset($datetimes); |
|
| 344 | 344 | } else { |
| 345 | 345 | return FALSE; |
| 346 | 346 | } |
@@ -355,17 +355,17 @@ discard block |
||
| 355 | 355 | * @param int $EVT_ID |
| 356 | 356 | * @return string |
| 357 | 357 | */ |
| 358 | - public static function get_last_date_obj( $EVT_ID = 0 ) { |
|
| 359 | - $event = EEH_Event_View::get_event( $EVT_ID ); |
|
| 360 | - if ( $event instanceof EE_Event ) { |
|
| 358 | + public static function get_last_date_obj($EVT_ID = 0) { |
|
| 359 | + $event = EEH_Event_View::get_event($EVT_ID); |
|
| 360 | + if ($event instanceof EE_Event) { |
|
| 361 | 361 | $datetimes = $event->get_many_related( |
| 362 | 362 | 'Datetime', |
| 363 | 363 | array( |
| 364 | 364 | 'limit' => 1, |
| 365 | - 'order_by' => array( 'DTT_order' => 'DESC' ) |
|
| 365 | + 'order_by' => array('DTT_order' => 'DESC') |
|
| 366 | 366 | ) |
| 367 | 367 | ); |
| 368 | - return end( $datetimes ); |
|
| 368 | + return end($datetimes); |
|
| 369 | 369 | } else { |
| 370 | 370 | return FALSE; |
| 371 | 371 | } |
@@ -380,17 +380,17 @@ discard block |
||
| 380 | 380 | * @param int $EVT_ID |
| 381 | 381 | * @return string |
| 382 | 382 | */ |
| 383 | - public static function get_earliest_date_obj( $EVT_ID = 0 ) { |
|
| 384 | - $event = EEH_Event_View::get_event( $EVT_ID ); |
|
| 385 | - if ( $event instanceof EE_Event ) { |
|
| 383 | + public static function get_earliest_date_obj($EVT_ID = 0) { |
|
| 384 | + $event = EEH_Event_View::get_event($EVT_ID); |
|
| 385 | + if ($event instanceof EE_Event) { |
|
| 386 | 386 | $datetimes = $event->get_many_related( |
| 387 | 387 | 'Datetime', |
| 388 | 388 | array( |
| 389 | 389 | 'limit' => 1, |
| 390 | - 'order_by' => array( 'DTT_EVT_start' => 'ASC' ) |
|
| 390 | + 'order_by' => array('DTT_EVT_start' => 'ASC') |
|
| 391 | 391 | ) |
| 392 | 392 | ); |
| 393 | - return reset( $datetimes ); |
|
| 393 | + return reset($datetimes); |
|
| 394 | 394 | } else { |
| 395 | 395 | return FALSE; |
| 396 | 396 | } |
@@ -405,17 +405,17 @@ discard block |
||
| 405 | 405 | * @param int $EVT_ID |
| 406 | 406 | * @return string |
| 407 | 407 | */ |
| 408 | - public static function get_latest_date_obj( $EVT_ID = 0 ) { |
|
| 409 | - $event = EEH_Event_View::get_event( $EVT_ID ); |
|
| 410 | - if ( $event instanceof EE_Event ) { |
|
| 408 | + public static function get_latest_date_obj($EVT_ID = 0) { |
|
| 409 | + $event = EEH_Event_View::get_event($EVT_ID); |
|
| 410 | + if ($event instanceof EE_Event) { |
|
| 411 | 411 | $datetimes = $event->get_many_related( |
| 412 | 412 | 'Datetime', |
| 413 | 413 | array( |
| 414 | 414 | 'limit' => 1, |
| 415 | - 'order_by' => array( 'DTT_EVT_start' => 'DESC' ) |
|
| 415 | + 'order_by' => array('DTT_EVT_start' => 'DESC') |
|
| 416 | 416 | ) |
| 417 | 417 | ); |
| 418 | - return end( $datetimes ); |
|
| 418 | + return end($datetimes); |
|
| 419 | 419 | } else { |
| 420 | 420 | return FALSE; |
| 421 | 421 | } |
@@ -433,17 +433,17 @@ discard block |
||
| 433 | 433 | * @param null $limit |
| 434 | 434 | * @return EE_Datetime[] |
| 435 | 435 | */ |
| 436 | - public static function get_all_date_obj( $EVT_ID = 0, $include_expired = null, $include_deleted = false, $limit = NULL ) { |
|
| 437 | - $event = EEH_Event_View::get_event( $EVT_ID ); |
|
| 438 | - if($include_expired === null){ |
|
| 439 | - if($event instanceof EE_Event && $event->is_expired()){ |
|
| 436 | + public static function get_all_date_obj($EVT_ID = 0, $include_expired = null, $include_deleted = false, $limit = NULL) { |
|
| 437 | + $event = EEH_Event_View::get_event($EVT_ID); |
|
| 438 | + if ($include_expired === null) { |
|
| 439 | + if ($event instanceof EE_Event && $event->is_expired()) { |
|
| 440 | 440 | $include_expired = true; |
| 441 | - }else{ |
|
| 441 | + } else { |
|
| 442 | 442 | $include_expired = false; |
| 443 | 443 | } |
| 444 | 444 | } |
| 445 | 445 | |
| 446 | - if ( $event instanceof EE_Event ) { |
|
| 446 | + if ($event instanceof EE_Event) { |
|
| 447 | 447 | return $event->datetimes_ordered($include_expired, $include_deleted, $limit); |
| 448 | 448 | } else { |
| 449 | 449 | return array(); |
@@ -459,11 +459,11 @@ discard block |
||
| 459 | 459 | * @param int $EVT_ID |
| 460 | 460 | * @return string |
| 461 | 461 | */ |
| 462 | - public static function event_link_url( $EVT_ID = 0 ) { |
|
| 463 | - $event = EEH_Event_View::get_event( $EVT_ID ); |
|
| 464 | - if ( $event instanceof EE_Event ) { |
|
| 465 | - $url = $event->external_url() !== NULL && $event->external_url() !== '' ? $event->external_url() : get_permalink( $event->ID() ); |
|
| 466 | - return preg_match( "~^(?:f|ht)tps?://~i", $url ) ? $url : 'http://' . $url; |
|
| 462 | + public static function event_link_url($EVT_ID = 0) { |
|
| 463 | + $event = EEH_Event_View::get_event($EVT_ID); |
|
| 464 | + if ($event instanceof EE_Event) { |
|
| 465 | + $url = $event->external_url() !== NULL && $event->external_url() !== '' ? $event->external_url() : get_permalink($event->ID()); |
|
| 466 | + return preg_match("~^(?:f|ht)tps?://~i", $url) ? $url : 'http://'.$url; |
|
| 467 | 467 | } |
| 468 | 468 | return NULL; |
| 469 | 469 | } |
@@ -477,11 +477,11 @@ discard block |
||
| 477 | 477 | * @param int $EVT_ID |
| 478 | 478 | * @return string |
| 479 | 479 | */ |
| 480 | - public static function event_phone( $EVT_ID = 0 ) { |
|
| 481 | - $event = EEH_Event_View::get_event( $EVT_ID ); |
|
| 482 | - if ( $event instanceof EE_Event ) { |
|
| 483 | - EE_Registry::instance()->load_helper( 'Formatter' ); |
|
| 484 | - return EEH_Schema::telephone( $event->phone() ); |
|
| 480 | + public static function event_phone($EVT_ID = 0) { |
|
| 481 | + $event = EEH_Event_View::get_event($EVT_ID); |
|
| 482 | + if ($event instanceof EE_Event) { |
|
| 483 | + EE_Registry::instance()->load_helper('Formatter'); |
|
| 484 | + return EEH_Schema::telephone($event->phone()); |
|
| 485 | 485 | } |
| 486 | 486 | return NULL; |
| 487 | 487 | } |
@@ -498,23 +498,23 @@ discard block |
||
| 498 | 498 | * @param string $after |
| 499 | 499 | * @return string |
| 500 | 500 | */ |
| 501 | - public static function edit_event_link( $EVT_ID = 0, $link = '', $before = '', $after = '' ) { |
|
| 502 | - $event = EEH_Event_View::get_event( $EVT_ID ); |
|
| 503 | - if ( $event instanceof EE_Event ) { |
|
| 501 | + public static function edit_event_link($EVT_ID = 0, $link = '', $before = '', $after = '') { |
|
| 502 | + $event = EEH_Event_View::get_event($EVT_ID); |
|
| 503 | + if ($event instanceof EE_Event) { |
|
| 504 | 504 | // can the user edit this post ? |
| 505 | - if ( current_user_can( 'edit_post', $event->ID() )) { |
|
| 505 | + if (current_user_can('edit_post', $event->ID())) { |
|
| 506 | 506 | // set link text |
| 507 | - $link = ! empty( $link ) ? $link : __('edit this event'); |
|
| 507 | + $link = ! empty($link) ? $link : __('edit this event'); |
|
| 508 | 508 | // generate nonce |
| 509 | - $nonce = wp_create_nonce( 'edit_nonce' ); |
|
| 509 | + $nonce = wp_create_nonce('edit_nonce'); |
|
| 510 | 510 | // generate url to event editor for this event |
| 511 | - $url = add_query_arg( array( 'page' => 'espresso_events', 'action' => 'edit', 'post' => $event->ID(), 'edit_nonce' => $nonce ), admin_url() ); |
|
| 511 | + $url = add_query_arg(array('page' => 'espresso_events', 'action' => 'edit', 'post' => $event->ID(), 'edit_nonce' => $nonce), admin_url()); |
|
| 512 | 512 | // get edit CPT text |
| 513 | - $post_type_obj = get_post_type_object( 'espresso_events' ); |
|
| 513 | + $post_type_obj = get_post_type_object('espresso_events'); |
|
| 514 | 514 | // build final link html |
| 515 | - $link = '<a class="post-edit-link" href="' . $url . '" title="' . esc_attr( $post_type_obj->labels->edit_item ) . '">' . $link . '</a>'; |
|
| 515 | + $link = '<a class="post-edit-link" href="'.$url.'" title="'.esc_attr($post_type_obj->labels->edit_item).'">'.$link.'</a>'; |
|
| 516 | 516 | // put it all together |
| 517 | - return $before . apply_filters( 'edit_post_link', $link, $event->ID() ) . $after; |
|
| 517 | + return $before.apply_filters('edit_post_link', $link, $event->ID()).$after; |
|
| 518 | 518 | } |
| 519 | 519 | } |
| 520 | 520 | return ''; |
@@ -8,32 +8,32 @@ |
||
| 8 | 8 | * @subpackage Expression package is undefined on line 19, column 19 in Templates/Scripting/PHPClass.php. |
| 9 | 9 | * @author Mike Nelson |
| 10 | 10 | */ |
| 11 | -class EE_Max_Length_Validation_Strategy extends EE_Validation_Strategy_Base{ |
|
| 11 | +class EE_Max_Length_Validation_Strategy extends EE_Validation_Strategy_Base { |
|
| 12 | 12 | |
| 13 | 13 | protected $_max_length; |
| 14 | 14 | |
| 15 | - public function __construct( $validation_error_message = NULL, $max_length = EE_INF ) { |
|
| 15 | + public function __construct($validation_error_message = NULL, $max_length = EE_INF) { |
|
| 16 | 16 | $this->_max_length = $max_length; |
| 17 | - parent::__construct( $validation_error_message ); |
|
| 17 | + parent::__construct($validation_error_message); |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | 21 | * @param $normalized_value |
| 22 | 22 | */ |
| 23 | 23 | public function validate($normalized_value) { |
| 24 | - if( $this->_max_length !== EE_INF && |
|
| 24 | + if ($this->_max_length !== EE_INF && |
|
| 25 | 25 | $normalized_value && |
| 26 | - is_string( $normalized_value ) && |
|
| 27 | - strlen( $normalized_value ) > $this->_max_length){ |
|
| 28 | - throw new EE_Validation_Error( $this->get_validation_error_message(), 'maxlength' ); |
|
| 26 | + is_string($normalized_value) && |
|
| 27 | + strlen($normalized_value) > $this->_max_length) { |
|
| 28 | + throw new EE_Validation_Error($this->get_validation_error_message(), 'maxlength'); |
|
| 29 | 29 | } |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | /** |
| 33 | 33 | * @return array |
| 34 | 34 | */ |
| 35 | - function get_jquery_validation_rule_array(){ |
|
| 36 | - return array( 'maxlength'=> $this->_max_length, 'messages' => array( 'maxlength' => $this->get_validation_error_message() ) ); |
|
| 35 | + function get_jquery_validation_rule_array() { |
|
| 36 | + return array('maxlength'=> $this->_max_length, 'messages' => array('maxlength' => $this->get_validation_error_message())); |
|
| 37 | 37 | } |
| 38 | 38 | } |
| 39 | 39 | |
@@ -203,14 +203,14 @@ discard block |
||
| 203 | 203 | |
| 204 | 204 | |
| 205 | 205 | /** |
| 206 | - * detect_if_activation_or_upgrade |
|
| 207 | - * |
|
| 208 | - * Takes care of detecting whether this is a brand new install or code upgrade, |
|
| 209 | - * and either setting up the DB or setting up maintenance mode etc. |
|
| 210 | - * |
|
| 211 | - * @access public |
|
| 212 | - * @return void |
|
| 213 | - */ |
|
| 206 | + * detect_if_activation_or_upgrade |
|
| 207 | + * |
|
| 208 | + * Takes care of detecting whether this is a brand new install or code upgrade, |
|
| 209 | + * and either setting up the DB or setting up maintenance mode etc. |
|
| 210 | + * |
|
| 211 | + * @access public |
|
| 212 | + * @return void |
|
| 213 | + */ |
|
| 214 | 214 | public function detect_if_activation_or_upgrade() { |
| 215 | 215 | do_action('AHEE__EE_System___detect_if_activation_or_upgrade__begin'); |
| 216 | 216 | |
@@ -514,11 +514,11 @@ discard block |
||
| 514 | 514 | $query_params = array( 'page' => 'espresso_about' ); |
| 515 | 515 | |
| 516 | 516 | if ( EE_System::instance()->detect_req_type() == EE_System::req_type_new_activation ) { |
| 517 | - $query_params['new_activation'] = TRUE; |
|
| 517 | + $query_params['new_activation'] = TRUE; |
|
| 518 | 518 | } |
| 519 | 519 | |
| 520 | 520 | if ( EE_System::instance()->detect_req_type() == EE_System::req_type_reactivation ) { |
| 521 | - $query_params['reactivation'] = TRUE; |
|
| 521 | + $query_params['reactivation'] = TRUE; |
|
| 522 | 522 | } |
| 523 | 523 | $url = add_query_arg( $query_params, admin_url( 'admin.php' ) ); |
| 524 | 524 | wp_safe_redirect( $url ); |
@@ -621,11 +621,11 @@ discard block |
||
| 621 | 621 | |
| 622 | 622 | |
| 623 | 623 | /** |
| 624 | - * _incompatible_addon_error |
|
| 625 | - * |
|
| 626 | - * @access public |
|
| 627 | - * @return void |
|
| 628 | - */ |
|
| 624 | + * _incompatible_addon_error |
|
| 625 | + * |
|
| 626 | + * @access public |
|
| 627 | + * @return void |
|
| 628 | + */ |
|
| 629 | 629 | private function _incompatible_addon_error() { |
| 630 | 630 | // get array of classes hooking into here |
| 631 | 631 | $class_names = EEH_Class_Tools::get_class_names_for_all_callbacks_on_hook( 'AHEE__EE_System__register_shortcodes_modules_and_addons' ); |
@@ -747,14 +747,14 @@ discard block |
||
| 747 | 747 | |
| 748 | 748 | |
| 749 | 749 | /** |
| 750 | - * load_controllers |
|
| 751 | - * |
|
| 752 | - * this is the best place to load any additional controllers that needs access to EE core. |
|
| 753 | - * it is expected that all basic core EE systems, that are not dependant on the current request are loaded at this time |
|
| 754 | - * |
|
| 755 | - * @access public |
|
| 756 | - * @return void |
|
| 757 | - */ |
|
| 750 | + * load_controllers |
|
| 751 | + * |
|
| 752 | + * this is the best place to load any additional controllers that needs access to EE core. |
|
| 753 | + * it is expected that all basic core EE systems, that are not dependant on the current request are loaded at this time |
|
| 754 | + * |
|
| 755 | + * @access public |
|
| 756 | + * @return void |
|
| 757 | + */ |
|
| 758 | 758 | public function load_controllers() { |
| 759 | 759 | do_action( 'AHEE__EE_System__load_controllers__start' ); |
| 760 | 760 | // let's get it started |
@@ -771,13 +771,13 @@ discard block |
||
| 771 | 771 | |
| 772 | 772 | |
| 773 | 773 | /** |
| 774 | - * core_loaded_and_ready |
|
| 775 | - * |
|
| 776 | - * all of the basic EE core should be loaded at this point and available regardless of M-Mode |
|
| 777 | - * |
|
| 778 | - * @access public |
|
| 779 | - * @return void |
|
| 780 | - */ |
|
| 774 | + * core_loaded_and_ready |
|
| 775 | + * |
|
| 776 | + * all of the basic EE core should be loaded at this point and available regardless of M-Mode |
|
| 777 | + * |
|
| 778 | + * @access public |
|
| 779 | + * @return void |
|
| 780 | + */ |
|
| 781 | 781 | public function core_loaded_and_ready() { |
| 782 | 782 | do_action( 'AHEE__EE_System__core_loaded_and_ready' ); |
| 783 | 783 | do_action( 'AHEE__EE_System__set_hooks_for_shortcodes_modules_and_addons' ); |
@@ -788,13 +788,13 @@ discard block |
||
| 788 | 788 | |
| 789 | 789 | |
| 790 | 790 | /** |
| 791 | - * initialize |
|
| 792 | - * |
|
| 793 | - * this is the best place to begin initializing client code |
|
| 794 | - * |
|
| 795 | - * @access public |
|
| 796 | - * @return void |
|
| 797 | - */ |
|
| 791 | + * initialize |
|
| 792 | + * |
|
| 793 | + * this is the best place to begin initializing client code |
|
| 794 | + * |
|
| 795 | + * @access public |
|
| 796 | + * @return void |
|
| 797 | + */ |
|
| 798 | 798 | public function initialize() { |
| 799 | 799 | do_action( 'AHEE__EE_System__initialize' ); |
| 800 | 800 | } |
@@ -802,13 +802,13 @@ discard block |
||
| 802 | 802 | |
| 803 | 803 | |
| 804 | 804 | /** |
| 805 | - * initialize_last |
|
| 806 | - * |
|
| 807 | - * this is run really late during the WP init hookpoint, and ensures that mostly everything else that needs to initialize has done so |
|
| 808 | - * |
|
| 809 | - * @access public |
|
| 810 | - * @return void |
|
| 811 | - */ |
|
| 805 | + * initialize_last |
|
| 806 | + * |
|
| 807 | + * this is run really late during the WP init hookpoint, and ensures that mostly everything else that needs to initialize has done so |
|
| 808 | + * |
|
| 809 | + * @access public |
|
| 810 | + * @return void |
|
| 811 | + */ |
|
| 812 | 812 | public function initialize_last() { |
| 813 | 813 | do_action( 'AHEE__EE_System__initialize_last' ); |
| 814 | 814 | } |
@@ -817,14 +817,14 @@ discard block |
||
| 817 | 817 | |
| 818 | 818 | |
| 819 | 819 | /** |
| 820 | - * set_hooks_for_shortcodes_modules_and_addons |
|
| 821 | - * |
|
| 822 | - * this is the best place for other systems to set callbacks for hooking into other parts of EE |
|
| 823 | - * this happens at the very beginning of the wp_loaded hookpoint |
|
| 824 | - * |
|
| 825 | - * @access public |
|
| 826 | - * @return void |
|
| 827 | - */ |
|
| 820 | + * set_hooks_for_shortcodes_modules_and_addons |
|
| 821 | + * |
|
| 822 | + * this is the best place for other systems to set callbacks for hooking into other parts of EE |
|
| 823 | + * this happens at the very beginning of the wp_loaded hookpoint |
|
| 824 | + * |
|
| 825 | + * @access public |
|
| 826 | + * @return void |
|
| 827 | + */ |
|
| 828 | 828 | public function set_hooks_for_shortcodes_modules_and_addons() { |
| 829 | 829 | // do_action( 'AHEE__EE_System__set_hooks_for_shortcodes_modules_and_addons' ); |
| 830 | 830 | } |
@@ -833,13 +833,13 @@ discard block |
||
| 833 | 833 | |
| 834 | 834 | |
| 835 | 835 | /** |
| 836 | - * do_not_cache |
|
| 837 | - * |
|
| 838 | - * sets no cache headers and defines no cache constants for WP plugins |
|
| 839 | - * |
|
| 840 | - * @access public |
|
| 841 | - * @return void |
|
| 842 | - */ |
|
| 836 | + * do_not_cache |
|
| 837 | + * |
|
| 838 | + * sets no cache headers and defines no cache constants for WP plugins |
|
| 839 | + * |
|
| 840 | + * @access public |
|
| 841 | + * @return void |
|
| 842 | + */ |
|
| 843 | 843 | public static function do_not_cache() { |
| 844 | 844 | // set no cache constants |
| 845 | 845 | if ( ! defined( 'DONOTCACHEPAGE' ) ) { |
@@ -957,7 +957,7 @@ discard block |
||
| 957 | 957 | //Current post |
| 958 | 958 | global $post; |
| 959 | 959 | |
| 960 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_event', 'ee_admin_bar_menu_espresso-toolbar-events-edit', $post->ID ) ) { |
|
| 960 | + if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_event', 'ee_admin_bar_menu_espresso-toolbar-events-edit', $post->ID ) ) { |
|
| 961 | 961 | //Events Edit Current Event |
| 962 | 962 | $admin_bar->add_menu(array( |
| 963 | 963 | 'id' => 'espresso-toolbar-events-edit', |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | */ |
| 103 | 103 | public static function instance() { |
| 104 | 104 | // check if class object is instantiated |
| 105 | - if ( ! self::$_instance instanceof EE_System ) { |
|
| 105 | + if ( ! self::$_instance instanceof EE_System) { |
|
| 106 | 106 | self::$_instance = new self(); |
| 107 | 107 | } |
| 108 | 108 | return self::$_instance; |
@@ -113,12 +113,12 @@ discard block |
||
| 113 | 113 | * resets the instance and returns it |
| 114 | 114 | * @return EE_System |
| 115 | 115 | */ |
| 116 | - public static function reset(){ |
|
| 116 | + public static function reset() { |
|
| 117 | 117 | self::$_instance->_req_type = NULL; |
| 118 | 118 | //we need to reset the migration manager in order for it to detect DMSs properly |
| 119 | 119 | EE_Data_Migration_Manager::reset(); |
| 120 | 120 | //make sure none of the old hooks are left hanging around |
| 121 | - remove_all_actions( 'AHEE__EE_System__perform_activations_upgrades_and_migrations'); |
|
| 121 | + remove_all_actions('AHEE__EE_System__perform_activations_upgrades_and_migrations'); |
|
| 122 | 122 | self::instance()->detect_activations_or_upgrades(); |
| 123 | 123 | self::instance()->perform_activations_upgrades_and_migrations(); |
| 124 | 124 | return self::instance(); |
@@ -134,26 +134,26 @@ discard block |
||
| 134 | 134 | * @access private |
| 135 | 135 | */ |
| 136 | 136 | private function __construct() { |
| 137 | - do_action( 'AHEE__EE_System__construct__begin', $this ); |
|
| 137 | + do_action('AHEE__EE_System__construct__begin', $this); |
|
| 138 | 138 | // allow addons to load first so that they can register autoloaders, set hooks for running DMS's, etc |
| 139 | - add_action( 'AHEE__EE_Bootstrap__load_espresso_addons', array( $this, 'load_espresso_addons' ) ); |
|
| 139 | + add_action('AHEE__EE_Bootstrap__load_espresso_addons', array($this, 'load_espresso_addons')); |
|
| 140 | 140 | // when an ee addon is activated, we want to call the core hook(s) again |
| 141 | 141 | // because the newly-activated addon didn't get a chance to run at all |
| 142 | - add_action( 'activate_plugin', array( $this, 'load_espresso_addons' ), 1 ); |
|
| 142 | + add_action('activate_plugin', array($this, 'load_espresso_addons'), 1); |
|
| 143 | 143 | // detect whether install or upgrade |
| 144 | - add_action( 'AHEE__EE_Bootstrap__detect_activations_or_upgrades', array( $this, 'detect_activations_or_upgrades' ), 3 ); |
|
| 144 | + add_action('AHEE__EE_Bootstrap__detect_activations_or_upgrades', array($this, 'detect_activations_or_upgrades'), 3); |
|
| 145 | 145 | // load EE_Config, EE_Textdomain, etc |
| 146 | - add_action( 'AHEE__EE_Bootstrap__load_core_configuration', array( $this, 'load_core_configuration' ), 5 ); |
|
| 146 | + add_action('AHEE__EE_Bootstrap__load_core_configuration', array($this, 'load_core_configuration'), 5); |
|
| 147 | 147 | // load EE_Config, EE_Textdomain, etc |
| 148 | - add_action( 'AHEE__EE_Bootstrap__register_shortcodes_modules_and_widgets', array( $this, 'register_shortcodes_modules_and_widgets' ), 7 ); |
|
| 148 | + add_action('AHEE__EE_Bootstrap__register_shortcodes_modules_and_widgets', array($this, 'register_shortcodes_modules_and_widgets'), 7); |
|
| 149 | 149 | // you wanna get going? I wanna get going... let's get going! |
| 150 | - add_action( 'AHEE__EE_Bootstrap__brew_espresso', array( $this, 'brew_espresso' ), 9 ); |
|
| 150 | + add_action('AHEE__EE_Bootstrap__brew_espresso', array($this, 'brew_espresso'), 9); |
|
| 151 | 151 | //other housekeeping |
| 152 | 152 | //exclude EE critical pages from wp_list_pages |
| 153 | - add_filter( 'wp_list_pages_excludes', array( $this, 'remove_pages_from_wp_list_pages' ), 10 ); |
|
| 153 | + add_filter('wp_list_pages_excludes', array($this, 'remove_pages_from_wp_list_pages'), 10); |
|
| 154 | 154 | // ALL EE Addons should use the following hook point to attach their initial setup too |
| 155 | 155 | // it's extremely important for EE Addons to register any class autoloaders so that they can be available when the EE_Config loads |
| 156 | - do_action( 'AHEE__EE_System__construct__complete', $this ); |
|
| 156 | + do_action('AHEE__EE_System__construct__complete', $this); |
|
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | |
@@ -173,10 +173,10 @@ discard block |
||
| 173 | 173 | public function load_espresso_addons() { |
| 174 | 174 | // set autoloaders for all of the classes implementing EEI_Plugin_API |
| 175 | 175 | // which provide helpers for EE plugin authors to more easily register certain components with EE. |
| 176 | - EEH_Autoloader::instance()->register_autoloaders_for_each_file_in_folder( EE_LIBRARIES . 'plugin_api' ); |
|
| 176 | + EEH_Autoloader::instance()->register_autoloaders_for_each_file_in_folder(EE_LIBRARIES.'plugin_api'); |
|
| 177 | 177 | //load and setup EE_Capabilities |
| 178 | - EE_Registry::instance()->load_core( 'Capabilities' ); |
|
| 179 | - do_action( 'AHEE__EE_System__load_espresso_addons' ); |
|
| 178 | + EE_Registry::instance()->load_core('Capabilities'); |
|
| 179 | + do_action('AHEE__EE_System__load_espresso_addons'); |
|
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | |
@@ -191,10 +191,10 @@ discard block |
||
| 191 | 191 | * @access public |
| 192 | 192 | * @return void |
| 193 | 193 | */ |
| 194 | - public function detect_activations_or_upgrades(){ |
|
| 194 | + public function detect_activations_or_upgrades() { |
|
| 195 | 195 | //first off: let's make sure to handle core |
| 196 | 196 | $this->detect_if_activation_or_upgrade(); |
| 197 | - foreach(EE_Registry::instance()->addons as $addon){ |
|
| 197 | + foreach (EE_Registry::instance()->addons as $addon) { |
|
| 198 | 198 | //detect teh request type for that addon |
| 199 | 199 | $addon->detect_activation_or_upgrade(); |
| 200 | 200 | } |
@@ -215,44 +215,44 @@ discard block |
||
| 215 | 215 | do_action('AHEE__EE_System___detect_if_activation_or_upgrade__begin'); |
| 216 | 216 | |
| 217 | 217 | // load M-Mode class |
| 218 | - EE_Registry::instance()->load_core( 'Maintenance_Mode' ); |
|
| 218 | + EE_Registry::instance()->load_core('Maintenance_Mode'); |
|
| 219 | 219 | // check if db has been updated, or if its a brand-new installation |
| 220 | 220 | |
| 221 | 221 | $espresso_db_update = $this->fix_espresso_db_upgrade_option(); |
| 222 | - $request_type = $this->detect_req_type($espresso_db_update); |
|
| 222 | + $request_type = $this->detect_req_type($espresso_db_update); |
|
| 223 | 223 | //EEH_Debug_Tools::printr( $request_type, '$request_type', __FILE__, __LINE__ ); |
| 224 | - if( $request_type != EE_System::req_type_normal){ |
|
| 224 | + if ($request_type != EE_System::req_type_normal) { |
|
| 225 | 225 | EE_Registry::instance()->load_helper('Activation'); |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | - switch($request_type){ |
|
| 228 | + switch ($request_type) { |
|
| 229 | 229 | case EE_System::req_type_new_activation: |
| 230 | - do_action( 'AHEE__EE_System__detect_if_activation_or_upgrade__new_activation' ); |
|
| 231 | - $this->_handle_core_version_change( $espresso_db_update ); |
|
| 230 | + do_action('AHEE__EE_System__detect_if_activation_or_upgrade__new_activation'); |
|
| 231 | + $this->_handle_core_version_change($espresso_db_update); |
|
| 232 | 232 | break; |
| 233 | 233 | case EE_System::req_type_reactivation: |
| 234 | - do_action( 'AHEE__EE_System__detect_if_activation_or_upgrade__reactivation' ); |
|
| 235 | - $this->_handle_core_version_change( $espresso_db_update ); |
|
| 234 | + do_action('AHEE__EE_System__detect_if_activation_or_upgrade__reactivation'); |
|
| 235 | + $this->_handle_core_version_change($espresso_db_update); |
|
| 236 | 236 | break; |
| 237 | 237 | case EE_System::req_type_upgrade: |
| 238 | - do_action( 'AHEE__EE_System__detect_if_activation_or_upgrade__upgrade' ); |
|
| 238 | + do_action('AHEE__EE_System__detect_if_activation_or_upgrade__upgrade'); |
|
| 239 | 239 | //migrations may be required now that we've upgraded |
| 240 | 240 | EE_Maintenance_Mode::instance()->set_maintenance_mode_if_db_old(); |
| 241 | - $this->_handle_core_version_change( $espresso_db_update ); |
|
| 241 | + $this->_handle_core_version_change($espresso_db_update); |
|
| 242 | 242 | // echo "done upgrade";die; |
| 243 | 243 | break; |
| 244 | 244 | case EE_System::req_type_downgrade: |
| 245 | - do_action( 'AHEE__EE_System__detect_if_activation_or_upgrade__downgrade' ); |
|
| 245 | + do_action('AHEE__EE_System__detect_if_activation_or_upgrade__downgrade'); |
|
| 246 | 246 | //its possible migrations are no longer required |
| 247 | 247 | EE_Maintenance_Mode::instance()->set_maintenance_mode_if_db_old(); |
| 248 | - $this->_handle_core_version_change( $espresso_db_update ); |
|
| 248 | + $this->_handle_core_version_change($espresso_db_update); |
|
| 249 | 249 | break; |
| 250 | 250 | case EE_System::req_type_normal: |
| 251 | 251 | default: |
| 252 | 252 | // $this->_maybe_redirect_to_ee_about(); |
| 253 | 253 | break; |
| 254 | 254 | } |
| 255 | - do_action( 'AHEE__EE_System__detect_if_activation_or_upgrade__complete' ); |
|
| 255 | + do_action('AHEE__EE_System__detect_if_activation_or_upgrade__complete'); |
|
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | /** |
@@ -260,10 +260,10 @@ discard block |
||
| 260 | 260 | * initializing the database later during the request |
| 261 | 261 | * @param array $espresso_db_update |
| 262 | 262 | */ |
| 263 | - protected function _handle_core_version_change( $espresso_db_update ){ |
|
| 264 | - $this->update_list_of_installed_versions( $espresso_db_update ); |
|
| 263 | + protected function _handle_core_version_change($espresso_db_update) { |
|
| 264 | + $this->update_list_of_installed_versions($espresso_db_update); |
|
| 265 | 265 | //get ready to verify the DB is ok (provided we aren't in maintenance mode, of course) |
| 266 | - add_action( 'AHEE__EE_System__perform_activations_upgrades_and_migrations', array( $this, 'initialize_db_if_no_migrations_required' )); |
|
| 266 | + add_action('AHEE__EE_System__perform_activations_upgrades_and_migrations', array($this, 'initialize_db_if_no_migrations_required')); |
|
| 267 | 267 | } |
| 268 | 268 | |
| 269 | 269 | |
@@ -278,44 +278,44 @@ discard block |
||
| 278 | 278 | * @internal param array $espresso_db_update_value the value of the WordPress option. If not supplied, fetches it from the options table |
| 279 | 279 | * @return array the correct value of 'espresso_db_upgrade', after saving it, if it needed correction |
| 280 | 280 | */ |
| 281 | - private function fix_espresso_db_upgrade_option($espresso_db_update = null){ |
|
| 282 | - do_action( 'FHEE__EE_System__manage_fix_espresso_db_upgrade_option__begin', $espresso_db_update ); |
|
| 283 | - if( ! $espresso_db_update){ |
|
| 284 | - $espresso_db_update = get_option( 'espresso_db_update' ); |
|
| 281 | + private function fix_espresso_db_upgrade_option($espresso_db_update = null) { |
|
| 282 | + do_action('FHEE__EE_System__manage_fix_espresso_db_upgrade_option__begin', $espresso_db_update); |
|
| 283 | + if ( ! $espresso_db_update) { |
|
| 284 | + $espresso_db_update = get_option('espresso_db_update'); |
|
| 285 | 285 | } |
| 286 | 286 | // check that option is an array |
| 287 | - if( ! is_array( $espresso_db_update )) { |
|
| 287 | + if ( ! is_array($espresso_db_update)) { |
|
| 288 | 288 | // if option is FALSE, then it never existed |
| 289 | - if ( $espresso_db_update === FALSE ) { |
|
| 289 | + if ($espresso_db_update === FALSE) { |
|
| 290 | 290 | // make $espresso_db_update an array and save option with autoload OFF |
| 291 | - $espresso_db_update = array(); |
|
| 292 | - add_option( 'espresso_db_update', $espresso_db_update, '', 'no' ); |
|
| 291 | + $espresso_db_update = array(); |
|
| 292 | + add_option('espresso_db_update', $espresso_db_update, '', 'no'); |
|
| 293 | 293 | } else { |
| 294 | 294 | // option is NOT FALSE but also is NOT an array, so make it an array and save it |
| 295 | - $espresso_db_update = array( $espresso_db_update=>array() ); |
|
| 296 | - update_option( 'espresso_db_update', $espresso_db_update ); |
|
| 295 | + $espresso_db_update = array($espresso_db_update=>array()); |
|
| 296 | + update_option('espresso_db_update', $espresso_db_update); |
|
| 297 | 297 | } |
| 298 | - }else{ |
|
| 298 | + } else { |
|
| 299 | 299 | $corrected_db_update = array(); |
| 300 | 300 | //if IS an array, but is it an array where KEYS are version numbers, and values are arrays? |
| 301 | - foreach($espresso_db_update as $should_be_version_string => $should_be_array){ |
|
| 302 | - if(is_int($should_be_version_string) && ! is_array($should_be_array)){ |
|
| 301 | + foreach ($espresso_db_update as $should_be_version_string => $should_be_array) { |
|
| 302 | + if (is_int($should_be_version_string) && ! is_array($should_be_array)) { |
|
| 303 | 303 | //the key is an int, and the value IS NOT an array |
| 304 | 304 | //so it must be numerically-indexed, where values are versions installed... |
| 305 | 305 | //fix it! |
| 306 | 306 | $version_string = $should_be_array; |
| 307 | 307 | $corrected_db_update[$version_string] = array('unknown-date'); |
| 308 | - }else{ |
|
| 308 | + } else { |
|
| 309 | 309 | //ok it checks out |
| 310 | 310 | $corrected_db_update[$should_be_version_string] = $should_be_array; |
| 311 | 311 | } |
| 312 | 312 | } |
| 313 | 313 | $espresso_db_update = $corrected_db_update; |
| 314 | - update_option( 'espresso_db_update', $espresso_db_update ); |
|
| 314 | + update_option('espresso_db_update', $espresso_db_update); |
|
| 315 | 315 | |
| 316 | 316 | } |
| 317 | 317 | |
| 318 | - do_action( 'FHEE__EE_System__manage_fix_espresso_db_upgrade_option__complete', $espresso_db_update ); |
|
| 318 | + do_action('FHEE__EE_System__manage_fix_espresso_db_upgrade_option__complete', $espresso_db_update); |
|
| 319 | 319 | return $espresso_db_update; |
| 320 | 320 | } |
| 321 | 321 | |
@@ -334,33 +334,33 @@ discard block |
||
| 334 | 334 | * so we prefer to only do it when necessary |
| 335 | 335 | * @return void |
| 336 | 336 | */ |
| 337 | - public function initialize_db_if_no_migrations_required( $initialize_addons_too = FALSE, $verify_schema = true ){ |
|
| 337 | + public function initialize_db_if_no_migrations_required($initialize_addons_too = FALSE, $verify_schema = true) { |
|
| 338 | 338 | $request_type = $this->detect_req_type(); |
| 339 | 339 | //only initialize system if we're not in maintenance mode. |
| 340 | - if( EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance ){ |
|
| 341 | - update_option( 'ee_flush_rewrite_rules', TRUE ); |
|
| 340 | + if (EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance) { |
|
| 341 | + update_option('ee_flush_rewrite_rules', TRUE); |
|
| 342 | 342 | EEH_Activation::system_initialization(); |
| 343 | - if( $verify_schema ) { |
|
| 343 | + if ($verify_schema) { |
|
| 344 | 344 | EEH_Activation::initialize_db_and_folders(); |
| 345 | 345 | } |
| 346 | 346 | EEH_Activation::initialize_db_content(); |
| 347 | - if( $initialize_addons_too ) { |
|
| 347 | + if ($initialize_addons_too) { |
|
| 348 | 348 | $this->initialize_addons(); |
| 349 | 349 | } |
| 350 | - }else{ |
|
| 351 | - EE_Data_Migration_Manager::instance()->enqueue_db_initialization_for( 'Core' ); |
|
| 350 | + } else { |
|
| 351 | + EE_Data_Migration_Manager::instance()->enqueue_db_initialization_for('Core'); |
|
| 352 | 352 | } |
| 353 | - if ( $request_type == EE_System::req_type_new_activation || $request_type == EE_System::req_type_reactivation || $request_type == EE_System::req_type_upgrade ) { |
|
| 354 | - add_action( 'AHEE__EE_System__load_CPTs_and_session__start', array( $this, 'redirect_to_about_ee' ), 9 ); |
|
| 353 | + if ($request_type == EE_System::req_type_new_activation || $request_type == EE_System::req_type_reactivation || $request_type == EE_System::req_type_upgrade) { |
|
| 354 | + add_action('AHEE__EE_System__load_CPTs_and_session__start', array($this, 'redirect_to_about_ee'), 9); |
|
| 355 | 355 | } |
| 356 | 356 | } |
| 357 | 357 | |
| 358 | 358 | /** |
| 359 | 359 | * Initializes the db for all registered addons |
| 360 | 360 | */ |
| 361 | - public function initialize_addons(){ |
|
| 361 | + public function initialize_addons() { |
|
| 362 | 362 | //foreach registered addon, make sure its db is up-to-date too |
| 363 | - foreach(EE_Registry::instance()->addons as $addon){ |
|
| 363 | + foreach (EE_Registry::instance()->addons as $addon) { |
|
| 364 | 364 | $addon->initialize_db_if_no_migrations_required(); |
| 365 | 365 | } |
| 366 | 366 | } |
@@ -372,16 +372,16 @@ discard block |
||
| 372 | 372 | * @param string $current_version_to_add version to be added to the version history |
| 373 | 373 | * @return boolean success as to whether or not this option was changed |
| 374 | 374 | */ |
| 375 | - public function update_list_of_installed_versions($version_history = NULL,$current_version_to_add = NULL) { |
|
| 376 | - if( ! $version_history ) { |
|
| 375 | + public function update_list_of_installed_versions($version_history = NULL, $current_version_to_add = NULL) { |
|
| 376 | + if ( ! $version_history) { |
|
| 377 | 377 | $version_history = $this->fix_espresso_db_upgrade_option($version_history); |
| 378 | 378 | } |
| 379 | - if( $current_version_to_add == NULL){ |
|
| 379 | + if ($current_version_to_add == NULL) { |
|
| 380 | 380 | $current_version_to_add = espresso_version(); |
| 381 | 381 | } |
| 382 | - $version_history[ $current_version_to_add ][] = date( 'Y-m-d H:i:s',time() ); |
|
| 382 | + $version_history[$current_version_to_add][] = date('Y-m-d H:i:s', time()); |
|
| 383 | 383 | // re-save |
| 384 | - return update_option( 'espresso_db_update', $version_history ); |
|
| 384 | + return update_option('espresso_db_update', $version_history); |
|
| 385 | 385 | } |
| 386 | 386 | |
| 387 | 387 | |
@@ -398,10 +398,10 @@ discard block |
||
| 398 | 398 | * but still know if this is a new install or not |
| 399 | 399 | * @return int one of the constants on EE_System::req_type_ |
| 400 | 400 | */ |
| 401 | - public function detect_req_type( $espresso_db_update = NULL ){ |
|
| 402 | - if ( $this->_req_type === NULL ){ |
|
| 403 | - $espresso_db_update = ! empty( $espresso_db_update ) ? $espresso_db_update : $this->fix_espresso_db_upgrade_option(); |
|
| 404 | - $this->_req_type = $this->detect_req_type_given_activation_history( $espresso_db_update, 'ee_espresso_activation', espresso_version() ); |
|
| 401 | + public function detect_req_type($espresso_db_update = NULL) { |
|
| 402 | + if ($this->_req_type === NULL) { |
|
| 403 | + $espresso_db_update = ! empty($espresso_db_update) ? $espresso_db_update : $this->fix_espresso_db_upgrade_option(); |
|
| 404 | + $this->_req_type = $this->detect_req_type_given_activation_history($espresso_db_update, 'ee_espresso_activation', espresso_version()); |
|
| 405 | 405 | } |
| 406 | 406 | return $this->_req_type; |
| 407 | 407 | } |
@@ -417,39 +417,39 @@ discard block |
||
| 417 | 417 | * @param string $version_to_upgrade_to the version that was just upgraded to (for core that will be espresso_version()) |
| 418 | 418 | * @return int one of the constants on EE_System::req_type_* |
| 419 | 419 | */ |
| 420 | - public static function detect_req_type_given_activation_history( $activation_history_for_addon, $activation_indicator_option_name, $version_to_upgrade_to ){ |
|
| 421 | - $version_is_higher = self::_new_version_is_higher( $activation_history_for_addon, $version_to_upgrade_to ); |
|
| 422 | - if( $activation_history_for_addon ){ |
|
| 420 | + public static function detect_req_type_given_activation_history($activation_history_for_addon, $activation_indicator_option_name, $version_to_upgrade_to) { |
|
| 421 | + $version_is_higher = self::_new_version_is_higher($activation_history_for_addon, $version_to_upgrade_to); |
|
| 422 | + if ($activation_history_for_addon) { |
|
| 423 | 423 | //it exists, so this isn't a completely new install |
| 424 | 424 | //check if this version already in that list of previously installed versions |
| 425 | - if ( ! isset( $activation_history_for_addon[ $version_to_upgrade_to ] )) { |
|
| 425 | + if ( ! isset($activation_history_for_addon[$version_to_upgrade_to])) { |
|
| 426 | 426 | //it a version we haven't seen before |
| 427 | - if( $version_is_higher === 1 ){ |
|
| 427 | + if ($version_is_higher === 1) { |
|
| 428 | 428 | $req_type = EE_System::req_type_upgrade; |
| 429 | - }else{ |
|
| 429 | + } else { |
|
| 430 | 430 | $req_type = EE_System::req_type_downgrade; |
| 431 | 431 | } |
| 432 | - delete_option( $activation_indicator_option_name ); |
|
| 432 | + delete_option($activation_indicator_option_name); |
|
| 433 | 433 | } else { |
| 434 | 434 | // its not an update. maybe a reactivation? |
| 435 | - if( get_option( $activation_indicator_option_name, FALSE ) ){ |
|
| 436 | - if ( $version_is_higher === -1 ){ |
|
| 435 | + if (get_option($activation_indicator_option_name, FALSE)) { |
|
| 436 | + if ($version_is_higher === -1) { |
|
| 437 | 437 | $req_type = EE_System::req_type_downgrade; |
| 438 | - }elseif( $version_is_higher === 0 ){ |
|
| 438 | + }elseif ($version_is_higher === 0) { |
|
| 439 | 439 | //we've seen this version before, but it's an activation. must be a reactivation |
| 440 | 440 | $req_type = EE_System::req_type_reactivation; |
| 441 | - }else{//$version_is_higher === 1 |
|
| 441 | + } else {//$version_is_higher === 1 |
|
| 442 | 442 | $req_type = EE_System::req_type_upgrade; |
| 443 | 443 | } |
| 444 | - delete_option( $activation_indicator_option_name ); |
|
| 444 | + delete_option($activation_indicator_option_name); |
|
| 445 | 445 | } else { |
| 446 | 446 | //we've seen this version before and the activation indicate doesn't show it was just activated |
| 447 | - if ( $version_is_higher === -1 ){ |
|
| 447 | + if ($version_is_higher === -1) { |
|
| 448 | 448 | $req_type = EE_System::req_type_downgrade; |
| 449 | - }elseif( $version_is_higher === 0 ){ |
|
| 449 | + }elseif ($version_is_higher === 0) { |
|
| 450 | 450 | //we've seen this version before and it's not an activation. its normal request |
| 451 | 451 | $req_type = EE_System::req_type_normal; |
| 452 | - }else{//$version_is_higher === 1 |
|
| 452 | + } else {//$version_is_higher === 1 |
|
| 453 | 453 | $req_type = EE_System::req_type_upgrade; |
| 454 | 454 | } |
| 455 | 455 | } |
@@ -457,7 +457,7 @@ discard block |
||
| 457 | 457 | } else { |
| 458 | 458 | //brand new install |
| 459 | 459 | $req_type = EE_System::req_type_new_activation; |
| 460 | - delete_option( $activation_indicator_option_name ); |
|
| 460 | + delete_option($activation_indicator_option_name); |
|
| 461 | 461 | } |
| 462 | 462 | return $req_type; |
| 463 | 463 | } |
@@ -475,30 +475,30 @@ discard block |
||
| 475 | 475 | * 0 if $version_to_upgrade_to MATCHES (reactivation or normal request); |
| 476 | 476 | * 1 if $version_to_upgrade_to is HIGHER (upgrade) ; |
| 477 | 477 | */ |
| 478 | - protected static function _new_version_is_higher( $activation_history_for_addon, $version_to_upgrade_to ){ |
|
| 478 | + protected static function _new_version_is_higher($activation_history_for_addon, $version_to_upgrade_to) { |
|
| 479 | 479 | //find the most recently-activated version |
| 480 | 480 | $most_recently_active_version_activation = '1970-01-01 00:00:00'; |
| 481 | 481 | $most_recently_active_version = '0.0.0.dev.000'; |
| 482 | - if( is_array( $activation_history_for_addon ) ){ |
|
| 483 | - foreach( $activation_history_for_addon as $version => $times_activated ){ |
|
| 482 | + if (is_array($activation_history_for_addon)) { |
|
| 483 | + foreach ($activation_history_for_addon as $version => $times_activated) { |
|
| 484 | 484 | //check there is a record of when this version was activated. Otherwise, |
| 485 | 485 | //mark it as unknown |
| 486 | - if( ! $times_activated ){ |
|
| 487 | - $times_activated = array( 'unknown-date'); |
|
| 486 | + if ( ! $times_activated) { |
|
| 487 | + $times_activated = array('unknown-date'); |
|
| 488 | 488 | } |
| 489 | - if( is_string( $times_activated ) ){ |
|
| 490 | - $times_activated = array( $times_activated ); |
|
| 489 | + if (is_string($times_activated)) { |
|
| 490 | + $times_activated = array($times_activated); |
|
| 491 | 491 | } |
| 492 | - foreach( $times_activated as $an_activation ){ |
|
| 493 | - if( $an_activation != 'unknown-date' && |
|
| 494 | - $an_activation > $most_recently_active_version_activation ){ |
|
| 492 | + foreach ($times_activated as $an_activation) { |
|
| 493 | + if ($an_activation != 'unknown-date' && |
|
| 494 | + $an_activation > $most_recently_active_version_activation) { |
|
| 495 | 495 | $most_recently_active_version = $version; |
| 496 | 496 | $most_recently_active_version_activation = $an_activation == 'unknown-date' ? '1970-01-01 00:00:00' : $an_activation; |
| 497 | 497 | } |
| 498 | 498 | } |
| 499 | 499 | } |
| 500 | 500 | } |
| 501 | - return version_compare( $version_to_upgrade_to, $most_recently_active_version ); |
|
| 501 | + return version_compare($version_to_upgrade_to, $most_recently_active_version); |
|
| 502 | 502 | } |
| 503 | 503 | |
| 504 | 504 | |
@@ -508,20 +508,20 @@ discard block |
||
| 508 | 508 | * @return void |
| 509 | 509 | */ |
| 510 | 510 | public function redirect_to_about_ee() { |
| 511 | - $notices = EE_Error::get_notices( FALSE ); |
|
| 511 | + $notices = EE_Error::get_notices(FALSE); |
|
| 512 | 512 | //if current user is an admin and it's not an ajax request |
| 513 | - if(EE_Registry::instance()->CAP->current_user_can( 'manage_options', 'espresso_about_default' ) && ! ( defined('DOING_AJAX') && DOING_AJAX ) && ! isset( $notices[ 'errors' ] ) ){ |
|
| 514 | - $query_params = array( 'page' => 'espresso_about' ); |
|
| 513 | + if (EE_Registry::instance()->CAP->current_user_can('manage_options', 'espresso_about_default') && ! (defined('DOING_AJAX') && DOING_AJAX) && ! isset($notices['errors'])) { |
|
| 514 | + $query_params = array('page' => 'espresso_about'); |
|
| 515 | 515 | |
| 516 | - if ( EE_System::instance()->detect_req_type() == EE_System::req_type_new_activation ) { |
|
| 516 | + if (EE_System::instance()->detect_req_type() == EE_System::req_type_new_activation) { |
|
| 517 | 517 | $query_params['new_activation'] = TRUE; |
| 518 | 518 | } |
| 519 | 519 | |
| 520 | - if ( EE_System::instance()->detect_req_type() == EE_System::req_type_reactivation ) { |
|
| 520 | + if (EE_System::instance()->detect_req_type() == EE_System::req_type_reactivation) { |
|
| 521 | 521 | $query_params['reactivation'] = TRUE; |
| 522 | 522 | } |
| 523 | - $url = add_query_arg( $query_params, admin_url( 'admin.php' ) ); |
|
| 524 | - wp_safe_redirect( $url ); |
|
| 523 | + $url = add_query_arg($query_params, admin_url('admin.php')); |
|
| 524 | + wp_safe_redirect($url); |
|
| 525 | 525 | exit(); |
| 526 | 526 | } |
| 527 | 527 | } |
@@ -535,31 +535,31 @@ discard block |
||
| 535 | 535 | * |
| 536 | 536 | * @return void |
| 537 | 537 | */ |
| 538 | - public function load_core_configuration(){ |
|
| 539 | - do_action( 'AHEE__EE_System__load_core_configuration__begin', $this ); |
|
| 540 | - EE_Registry::instance()->load_core( 'EE_Load_Textdomain' ); |
|
| 538 | + public function load_core_configuration() { |
|
| 539 | + do_action('AHEE__EE_System__load_core_configuration__begin', $this); |
|
| 540 | + EE_Registry::instance()->load_core('EE_Load_Textdomain'); |
|
| 541 | 541 | //load textdomain |
| 542 | 542 | EE_Load_Textdomain::load_textdomain(); |
| 543 | 543 | // load and setup EE_Config and EE_Network_Config |
| 544 | - EE_Registry::instance()->load_core( 'Config' ); |
|
| 545 | - EE_Registry::instance()->load_core( 'Network_Config' ); |
|
| 544 | + EE_Registry::instance()->load_core('Config'); |
|
| 545 | + EE_Registry::instance()->load_core('Network_Config'); |
|
| 546 | 546 | // setup autoloaders |
| 547 | 547 | // enable logging? |
| 548 | - if ( EE_Registry::instance()->CFG->admin->use_full_logging ) { |
|
| 549 | - EE_Registry::instance()->load_core( 'Log' ); |
|
| 548 | + if (EE_Registry::instance()->CFG->admin->use_full_logging) { |
|
| 549 | + EE_Registry::instance()->load_core('Log'); |
|
| 550 | 550 | } |
| 551 | 551 | // check for activation errors |
| 552 | - $activation_errors = get_option( 'ee_plugin_activation_errors', FALSE ); |
|
| 553 | - if ( $activation_errors ) { |
|
| 554 | - EE_Error::add_error( $activation_errors, __FILE__, __FUNCTION__, __LINE__ ); |
|
| 555 | - update_option( 'ee_plugin_activation_errors', FALSE ); |
|
| 552 | + $activation_errors = get_option('ee_plugin_activation_errors', FALSE); |
|
| 553 | + if ($activation_errors) { |
|
| 554 | + EE_Error::add_error($activation_errors, __FILE__, __FUNCTION__, __LINE__); |
|
| 555 | + update_option('ee_plugin_activation_errors', FALSE); |
|
| 556 | 556 | } |
| 557 | 557 | // get model names |
| 558 | 558 | $this->_parse_model_names(); |
| 559 | 559 | |
| 560 | 560 | //load caf stuff a chance to play during the activation process too. |
| 561 | 561 | $this->_maybe_brew_regular(); |
| 562 | - do_action( 'AHEE__EE_System__load_core_configuration__complete', $this ); |
|
| 562 | + do_action('AHEE__EE_System__load_core_configuration__complete', $this); |
|
| 563 | 563 | } |
| 564 | 564 | |
| 565 | 565 | |
@@ -568,23 +568,23 @@ discard block |
||
| 568 | 568 | * |
| 569 | 569 | * @return void |
| 570 | 570 | */ |
| 571 | - private function _parse_model_names(){ |
|
| 571 | + private function _parse_model_names() { |
|
| 572 | 572 | //get all the files in the EE_MODELS folder that end in .model.php |
| 573 | - $models = glob( EE_MODELS.'*.model.php'); |
|
| 573 | + $models = glob(EE_MODELS.'*.model.php'); |
|
| 574 | 574 | $model_names = array(); |
| 575 | 575 | $non_abstract_db_models = array(); |
| 576 | - foreach( $models as $model ){ |
|
| 576 | + foreach ($models as $model) { |
|
| 577 | 577 | // get model classname |
| 578 | - $classname = EEH_File::get_classname_from_filepath_with_standard_filename( $model ); |
|
| 579 | - $shortname = str_replace( 'EEM_', '', $classname ); |
|
| 578 | + $classname = EEH_File::get_classname_from_filepath_with_standard_filename($model); |
|
| 579 | + $shortname = str_replace('EEM_', '', $classname); |
|
| 580 | 580 | $reflectionClass = new ReflectionClass($classname); |
| 581 | - if( $reflectionClass->isSubclassOf('EEM_Base') && ! $reflectionClass->isAbstract()){ |
|
| 581 | + if ($reflectionClass->isSubclassOf('EEM_Base') && ! $reflectionClass->isAbstract()) { |
|
| 582 | 582 | $non_abstract_db_models[$shortname] = $classname; |
| 583 | 583 | } |
| 584 | - $model_names[ $shortname ] = $classname; |
|
| 584 | + $model_names[$shortname] = $classname; |
|
| 585 | 585 | } |
| 586 | - EE_Registry::instance()->models = apply_filters( 'FHEE__EE_System__parse_model_names', $model_names ); |
|
| 587 | - EE_Registry::instance()->non_abstract_db_models = apply_filters( 'FHEE__EE_System__parse_implemented_model_names', $non_abstract_db_models ); |
|
| 586 | + EE_Registry::instance()->models = apply_filters('FHEE__EE_System__parse_model_names', $model_names); |
|
| 587 | + EE_Registry::instance()->non_abstract_db_models = apply_filters('FHEE__EE_System__parse_implemented_model_names', $non_abstract_db_models); |
|
| 588 | 588 | } |
| 589 | 589 | |
| 590 | 590 | |
@@ -594,8 +594,8 @@ discard block |
||
| 594 | 594 | * @return void |
| 595 | 595 | */ |
| 596 | 596 | private function _maybe_brew_regular() { |
| 597 | - if (( ! defined( 'EE_DECAF' ) || EE_DECAF !== TRUE ) && is_readable( EE_CAFF_PATH . 'brewing_regular.php' )) { |
|
| 598 | - require_once EE_CAFF_PATH . 'brewing_regular.php'; |
|
| 597 | + if (( ! defined('EE_DECAF') || EE_DECAF !== TRUE) && is_readable(EE_CAFF_PATH.'brewing_regular.php')) { |
|
| 598 | + require_once EE_CAFF_PATH.'brewing_regular.php'; |
|
| 599 | 599 | } |
| 600 | 600 | } |
| 601 | 601 | |
@@ -612,9 +612,9 @@ discard block |
||
| 612 | 612 | * @return void |
| 613 | 613 | */ |
| 614 | 614 | public function register_shortcodes_modules_and_widgets() { |
| 615 | - do_action( 'AHEE__EE_System__register_shortcodes_modules_and_widgets' ); |
|
| 615 | + do_action('AHEE__EE_System__register_shortcodes_modules_and_widgets'); |
|
| 616 | 616 | // check for addons using old hookpoint |
| 617 | - if ( has_action( 'AHEE__EE_System__register_shortcodes_modules_and_addons' )) { |
|
| 617 | + if (has_action('AHEE__EE_System__register_shortcodes_modules_and_addons')) { |
|
| 618 | 618 | $this->_incompatible_addon_error(); |
| 619 | 619 | } |
| 620 | 620 | } |
@@ -628,19 +628,19 @@ discard block |
||
| 628 | 628 | */ |
| 629 | 629 | private function _incompatible_addon_error() { |
| 630 | 630 | // get array of classes hooking into here |
| 631 | - $class_names = EEH_Class_Tools::get_class_names_for_all_callbacks_on_hook( 'AHEE__EE_System__register_shortcodes_modules_and_addons' ); |
|
| 632 | - if ( ! empty( $class_names )) { |
|
| 633 | - $msg = __( 'The following plugins, addons, or modules appear to be incompatible with this version of Event Espresso and were automatically deactivated to avoid fatal errors:', 'event_espresso' ); |
|
| 631 | + $class_names = EEH_Class_Tools::get_class_names_for_all_callbacks_on_hook('AHEE__EE_System__register_shortcodes_modules_and_addons'); |
|
| 632 | + if ( ! empty($class_names)) { |
|
| 633 | + $msg = __('The following plugins, addons, or modules appear to be incompatible with this version of Event Espresso and were automatically deactivated to avoid fatal errors:', 'event_espresso'); |
|
| 634 | 634 | $msg .= '<ul>'; |
| 635 | - foreach ( $class_names as $class_name ) { |
|
| 636 | - $msg .= '<li><b>Event Espresso - ' . str_replace( array( 'EE_', 'EEM_', 'EED_', 'EES_', 'EEW_' ), '', $class_name ) . '</b></li>'; |
|
| 635 | + foreach ($class_names as $class_name) { |
|
| 636 | + $msg .= '<li><b>Event Espresso - '.str_replace(array('EE_', 'EEM_', 'EED_', 'EES_', 'EEW_'), '', $class_name).'</b></li>'; |
|
| 637 | 637 | } |
| 638 | 638 | $msg .= '</ul>'; |
| 639 | - $msg .= __( 'Compatibility issues can be avoided and/or resolved by keeping addons and plugins updated to the latest version.', 'event_espresso' ); |
|
| 639 | + $msg .= __('Compatibility issues can be avoided and/or resolved by keeping addons and plugins updated to the latest version.', 'event_espresso'); |
|
| 640 | 640 | // save list of incompatible addons to wp-options for later use |
| 641 | - add_option( 'ee_incompatible_addons', $class_names, '', 'no' ); |
|
| 642 | - if ( is_admin() ) { |
|
| 643 | - EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
| 641 | + add_option('ee_incompatible_addons', $class_names, '', 'no'); |
|
| 642 | + if (is_admin()) { |
|
| 643 | + EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__); |
|
| 644 | 644 | } |
| 645 | 645 | } |
| 646 | 646 | } |
@@ -657,25 +657,25 @@ discard block |
||
| 657 | 657 | * |
| 658 | 658 | * @return void |
| 659 | 659 | */ |
| 660 | - public function brew_espresso(){ |
|
| 661 | - do_action( 'AHEE__EE_System__brew_espresso__begin', $this ); |
|
| 660 | + public function brew_espresso() { |
|
| 661 | + do_action('AHEE__EE_System__brew_espresso__begin', $this); |
|
| 662 | 662 | // load some final core systems |
| 663 | - add_action( 'init', array( $this, 'set_hooks_for_core' ), 1 ); |
|
| 664 | - add_action( 'init', array( $this, 'perform_activations_upgrades_and_migrations' ), 3 ); |
|
| 665 | - add_action( 'init', array( $this, 'load_CPTs_and_session' ), 5 ); |
|
| 666 | - add_action( 'init', array( $this, 'load_controllers' ), 7 ); |
|
| 667 | - add_action( 'init', array( $this, 'core_loaded_and_ready' ), 9 ); |
|
| 668 | - add_action( 'init', array( $this, 'initialize' ), 10 ); |
|
| 669 | - add_action( 'init', array( $this, 'initialize_last' ), 100 ); |
|
| 670 | - add_action('wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ), 25 ); |
|
| 671 | - add_action( 'admin_bar_menu', array( $this, 'espresso_toolbar_items' ), 100 ); |
|
| 672 | - |
|
| 673 | - if ( is_admin() && apply_filters( 'FHEE__EE_System__brew_espresso__load_pue', TRUE ) ) { |
|
| 663 | + add_action('init', array($this, 'set_hooks_for_core'), 1); |
|
| 664 | + add_action('init', array($this, 'perform_activations_upgrades_and_migrations'), 3); |
|
| 665 | + add_action('init', array($this, 'load_CPTs_and_session'), 5); |
|
| 666 | + add_action('init', array($this, 'load_controllers'), 7); |
|
| 667 | + add_action('init', array($this, 'core_loaded_and_ready'), 9); |
|
| 668 | + add_action('init', array($this, 'initialize'), 10); |
|
| 669 | + add_action('init', array($this, 'initialize_last'), 100); |
|
| 670 | + add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts'), 25); |
|
| 671 | + add_action('admin_bar_menu', array($this, 'espresso_toolbar_items'), 100); |
|
| 672 | + |
|
| 673 | + if (is_admin() && apply_filters('FHEE__EE_System__brew_espresso__load_pue', TRUE)) { |
|
| 674 | 674 | // pew pew pew |
| 675 | - EE_Registry::instance()->load_core( 'PUE' ); |
|
| 676 | - do_action( 'AHEE__EE_System__brew_espresso__after_pue_init' ); |
|
| 675 | + EE_Registry::instance()->load_core('PUE'); |
|
| 676 | + do_action('AHEE__EE_System__brew_espresso__after_pue_init'); |
|
| 677 | 677 | } |
| 678 | - do_action( 'AHEE__EE_System__brew_espresso__complete', $this ); |
|
| 678 | + do_action('AHEE__EE_System__brew_espresso__complete', $this); |
|
| 679 | 679 | } |
| 680 | 680 | |
| 681 | 681 | |
@@ -689,7 +689,7 @@ discard block |
||
| 689 | 689 | */ |
| 690 | 690 | public function set_hooks_for_core() { |
| 691 | 691 | $this->_deactivate_incompatible_addons(); |
| 692 | - do_action( 'AHEE__EE_System__set_hooks_for_core' ); |
|
| 692 | + do_action('AHEE__EE_System__set_hooks_for_core'); |
|
| 693 | 693 | } |
| 694 | 694 | |
| 695 | 695 | |
@@ -698,15 +698,15 @@ discard block |
||
| 698 | 698 | * Using the information gathered in EE_System::_incompatible_addon_error, |
| 699 | 699 | * deactivates any addons considered incompatible with the current version of EE |
| 700 | 700 | */ |
| 701 | - private function _deactivate_incompatible_addons(){ |
|
| 702 | - $incompatible_addons = get_option( 'ee_incompatible_addons', array() ); |
|
| 703 | - if ( ! empty( $incompatible_addons )) { |
|
| 704 | - $active_plugins = get_option( 'active_plugins', array() ); |
|
| 705 | - foreach ( $active_plugins as $active_plugin ) { |
|
| 706 | - foreach ( $incompatible_addons as $incompatible_addon ) { |
|
| 707 | - if ( strpos( $active_plugin, $incompatible_addon ) !== FALSE ) { |
|
| 708 | - unset( $_GET['activate'] ); |
|
| 709 | - espresso_deactivate_plugin( $active_plugin ); |
|
| 701 | + private function _deactivate_incompatible_addons() { |
|
| 702 | + $incompatible_addons = get_option('ee_incompatible_addons', array()); |
|
| 703 | + if ( ! empty($incompatible_addons)) { |
|
| 704 | + $active_plugins = get_option('active_plugins', array()); |
|
| 705 | + foreach ($active_plugins as $active_plugin) { |
|
| 706 | + foreach ($incompatible_addons as $incompatible_addon) { |
|
| 707 | + if (strpos($active_plugin, $incompatible_addon) !== FALSE) { |
|
| 708 | + unset($_GET['activate']); |
|
| 709 | + espresso_deactivate_plugin($active_plugin); |
|
| 710 | 710 | } |
| 711 | 711 | } |
| 712 | 712 | } |
@@ -723,10 +723,10 @@ discard block |
||
| 723 | 723 | */ |
| 724 | 724 | public function perform_activations_upgrades_and_migrations() { |
| 725 | 725 | //first check if we had previously attempted to setup EE's directories but failed |
| 726 | - if( EEH_Activation::upload_directories_incomplete() ) { |
|
| 726 | + if (EEH_Activation::upload_directories_incomplete()) { |
|
| 727 | 727 | EEH_Activation::create_upload_directories(); |
| 728 | 728 | } |
| 729 | - do_action( 'AHEE__EE_System__perform_activations_upgrades_and_migrations' ); |
|
| 729 | + do_action('AHEE__EE_System__perform_activations_upgrades_and_migrations'); |
|
| 730 | 730 | } |
| 731 | 731 | |
| 732 | 732 | |
@@ -738,10 +738,10 @@ discard block |
||
| 738 | 738 | * @return void |
| 739 | 739 | */ |
| 740 | 740 | public function load_CPTs_and_session() { |
| 741 | - do_action( 'AHEE__EE_System__load_CPTs_and_session__start' ); |
|
| 741 | + do_action('AHEE__EE_System__load_CPTs_and_session__start'); |
|
| 742 | 742 | // register Custom Post Types |
| 743 | - EE_Registry::instance()->load_core( 'Register_CPTs' ); |
|
| 744 | - do_action( 'AHEE__EE_System__load_CPTs_and_session__complete' ); |
|
| 743 | + EE_Registry::instance()->load_core('Register_CPTs'); |
|
| 744 | + do_action('AHEE__EE_System__load_CPTs_and_session__complete'); |
|
| 745 | 745 | } |
| 746 | 746 | |
| 747 | 747 | |
@@ -756,16 +756,16 @@ discard block |
||
| 756 | 756 | * @return void |
| 757 | 757 | */ |
| 758 | 758 | public function load_controllers() { |
| 759 | - do_action( 'AHEE__EE_System__load_controllers__start' ); |
|
| 759 | + do_action('AHEE__EE_System__load_controllers__start'); |
|
| 760 | 760 | // let's get it started |
| 761 | - if ( ! is_admin() && ! EE_Maintenance_Mode::instance()->level() ) { |
|
| 762 | - do_action( 'AHEE__EE_System__load_controllers__load_front_controllers' ); |
|
| 763 | - EE_Registry::instance()->load_core( 'Front_Controller' ); |
|
| 764 | - } else if ( ! EE_FRONT_AJAX ) { |
|
| 765 | - do_action( 'AHEE__EE_System__load_controllers__load_admin_controllers' ); |
|
| 766 | - EE_Registry::instance()->load_core( 'Admin' ); |
|
| 761 | + if ( ! is_admin() && ! EE_Maintenance_Mode::instance()->level()) { |
|
| 762 | + do_action('AHEE__EE_System__load_controllers__load_front_controllers'); |
|
| 763 | + EE_Registry::instance()->load_core('Front_Controller'); |
|
| 764 | + } else if ( ! EE_FRONT_AJAX) { |
|
| 765 | + do_action('AHEE__EE_System__load_controllers__load_admin_controllers'); |
|
| 766 | + EE_Registry::instance()->load_core('Admin'); |
|
| 767 | 767 | } |
| 768 | - do_action( 'AHEE__EE_System__load_controllers__complete' ); |
|
| 768 | + do_action('AHEE__EE_System__load_controllers__complete'); |
|
| 769 | 769 | } |
| 770 | 770 | |
| 771 | 771 | |
@@ -779,10 +779,10 @@ discard block |
||
| 779 | 779 | * @return void |
| 780 | 780 | */ |
| 781 | 781 | public function core_loaded_and_ready() { |
| 782 | - do_action( 'AHEE__EE_System__core_loaded_and_ready' ); |
|
| 783 | - do_action( 'AHEE__EE_System__set_hooks_for_shortcodes_modules_and_addons' ); |
|
| 782 | + do_action('AHEE__EE_System__core_loaded_and_ready'); |
|
| 783 | + do_action('AHEE__EE_System__set_hooks_for_shortcodes_modules_and_addons'); |
|
| 784 | 784 | // add_action( 'wp_loaded', array( $this, 'set_hooks_for_shortcodes_modules_and_addons' ), 1 ); |
| 785 | - EE_Registry::instance()->load_core( 'Session' ); |
|
| 785 | + EE_Registry::instance()->load_core('Session'); |
|
| 786 | 786 | } |
| 787 | 787 | |
| 788 | 788 | |
@@ -796,7 +796,7 @@ discard block |
||
| 796 | 796 | * @return void |
| 797 | 797 | */ |
| 798 | 798 | public function initialize() { |
| 799 | - do_action( 'AHEE__EE_System__initialize' ); |
|
| 799 | + do_action('AHEE__EE_System__initialize'); |
|
| 800 | 800 | } |
| 801 | 801 | |
| 802 | 802 | |
@@ -810,7 +810,7 @@ discard block |
||
| 810 | 810 | * @return void |
| 811 | 811 | */ |
| 812 | 812 | public function initialize_last() { |
| 813 | - do_action( 'AHEE__EE_System__initialize_last' ); |
|
| 813 | + do_action('AHEE__EE_System__initialize_last'); |
|
| 814 | 814 | } |
| 815 | 815 | |
| 816 | 816 | |
@@ -842,21 +842,21 @@ discard block |
||
| 842 | 842 | */ |
| 843 | 843 | public static function do_not_cache() { |
| 844 | 844 | // set no cache constants |
| 845 | - if ( ! defined( 'DONOTCACHEPAGE' ) ) { |
|
| 846 | - define( 'DONOTCACHEPAGE', true ); |
|
| 845 | + if ( ! defined('DONOTCACHEPAGE')) { |
|
| 846 | + define('DONOTCACHEPAGE', true); |
|
| 847 | 847 | } |
| 848 | - if ( ! defined( 'DONOTCACHCEOBJECT' ) ) { |
|
| 849 | - define( 'DONOTCACHCEOBJECT', true ); |
|
| 848 | + if ( ! defined('DONOTCACHCEOBJECT')) { |
|
| 849 | + define('DONOTCACHCEOBJECT', true); |
|
| 850 | 850 | } |
| 851 | - if ( ! defined( 'DONOTCACHEDB' ) ) { |
|
| 852 | - define( 'DONOTCACHEDB', true ); |
|
| 851 | + if ( ! defined('DONOTCACHEDB')) { |
|
| 852 | + define('DONOTCACHEDB', true); |
|
| 853 | 853 | } |
| 854 | 854 | // add no cache headers |
| 855 | - add_action( 'send_headers' , array( 'EE_System', 'nocache_headers' ), 10 ); |
|
| 855 | + add_action('send_headers', array('EE_System', 'nocache_headers'), 10); |
|
| 856 | 856 | // plus a little extra for nginx |
| 857 | - add_filter( 'nocache_headers', array( 'EE_System', 'nocache_headers_nginx' ), 10, 1 ); |
|
| 857 | + add_filter('nocache_headers', array('EE_System', 'nocache_headers_nginx'), 10, 1); |
|
| 858 | 858 | // prevent browsers from prefetching of the rel='next' link, because it may contain content that interferes with the registration process |
| 859 | - remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head' ); |
|
| 859 | + remove_action('wp_head', 'adjacent_posts_rel_link_wp_head'); |
|
| 860 | 860 | } |
| 861 | 861 | |
| 862 | 862 | |
@@ -868,7 +868,7 @@ discard block |
||
| 868 | 868 | * @param $headers |
| 869 | 869 | * @return array |
| 870 | 870 | */ |
| 871 | - public static function nocache_headers_nginx ( $headers ) { |
|
| 871 | + public static function nocache_headers_nginx($headers) { |
|
| 872 | 872 | $headers['X-Accel-Expires'] = 0; |
| 873 | 873 | return $headers; |
| 874 | 874 | } |
@@ -894,15 +894,15 @@ discard block |
||
| 894 | 894 | * @param $admin_bar |
| 895 | 895 | * @return void |
| 896 | 896 | */ |
| 897 | - public function espresso_toolbar_items( $admin_bar ) { |
|
| 897 | + public function espresso_toolbar_items($admin_bar) { |
|
| 898 | 898 | |
| 899 | 899 | // if in full M-Mode, or its an AJAX request, or user is NOT an admin |
| 900 | - if ( EE_Maintenance_Mode::instance()->level() == EE_Maintenance_Mode::level_2_complete_maintenance || defined( 'DOING_AJAX' ) || ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_ee', 'ee_admin_bar_menu_top_level' )) { |
|
| 900 | + if (EE_Maintenance_Mode::instance()->level() == EE_Maintenance_Mode::level_2_complete_maintenance || defined('DOING_AJAX') || ! EE_Registry::instance()->CAP->current_user_can('ee_read_ee', 'ee_admin_bar_menu_top_level')) { |
|
| 901 | 901 | return; |
| 902 | 902 | } |
| 903 | 903 | |
| 904 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
| 905 | - EE_Registry::instance()->load_helper( 'URL' ); |
|
| 904 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
| 905 | + EE_Registry::instance()->load_helper('URL'); |
|
| 906 | 906 | $menu_class = 'espresso_menu_item_class'; |
| 907 | 907 | //we don't use the constants EVENTS_ADMIN_URL or REG_ADMIN_URL |
| 908 | 908 | //because they're only defined in each of their respective constructors |
@@ -914,20 +914,20 @@ discard block |
||
| 914 | 914 | //Top Level |
| 915 | 915 | $admin_bar->add_menu(array( |
| 916 | 916 | 'id' => 'espresso-toolbar', |
| 917 | - 'title' => '<span class="ee-icon ee-icon-ee-cup-thick ee-icon-size-20"></span><span class="ab-label">' . _x('Event Espresso', 'admin bar menu group label', 'event_espresso') . '</span>', |
|
| 917 | + 'title' => '<span class="ee-icon ee-icon-ee-cup-thick ee-icon-size-20"></span><span class="ab-label">'._x('Event Espresso', 'admin bar menu group label', 'event_espresso').'</span>', |
|
| 918 | 918 | 'href' => $events_admin_url, |
| 919 | 919 | 'meta' => array( |
| 920 | 920 | 'title' => __('Event Espresso', 'event_espresso'), |
| 921 | - 'class' => $menu_class . 'first' |
|
| 921 | + 'class' => $menu_class.'first' |
|
| 922 | 922 | ), |
| 923 | 923 | )); |
| 924 | 924 | |
| 925 | 925 | //Events |
| 926 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_events', 'ee_admin_bar_menu_espresso-toolbar-events' ) ) { |
|
| 926 | + if (EE_Registry::instance()->CAP->current_user_can('ee_read_events', 'ee_admin_bar_menu_espresso-toolbar-events')) { |
|
| 927 | 927 | $admin_bar->add_menu(array( |
| 928 | 928 | 'id' => 'espresso-toolbar-events', |
| 929 | 929 | 'parent' => 'espresso-toolbar', |
| 930 | - 'title' => __( 'Events', 'event_espresso' ), |
|
| 930 | + 'title' => __('Events', 'event_espresso'), |
|
| 931 | 931 | 'href' => $events_admin_url, |
| 932 | 932 | 'meta' => array( |
| 933 | 933 | 'title' => __('Events', 'event_espresso'), |
@@ -938,13 +938,13 @@ discard block |
||
| 938 | 938 | } |
| 939 | 939 | |
| 940 | 940 | |
| 941 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_events', 'ee_admin_bar_menu_espresso-toolbar-events-new' ) ) { |
|
| 941 | + if (EE_Registry::instance()->CAP->current_user_can('ee_edit_events', 'ee_admin_bar_menu_espresso-toolbar-events-new')) { |
|
| 942 | 942 | //Events Add New |
| 943 | 943 | $admin_bar->add_menu(array( |
| 944 | 944 | 'id' => 'espresso-toolbar-events-new', |
| 945 | 945 | 'parent' => 'espresso-toolbar-events', |
| 946 | 946 | 'title' => __('Add New', 'event_espresso'), |
| 947 | - 'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'create_new' ), $events_admin_url ), |
|
| 947 | + 'href' => EEH_URL::add_query_args_and_nonce(array('action'=>'create_new'), $events_admin_url), |
|
| 948 | 948 | 'meta' => array( |
| 949 | 949 | 'title' => __('Add New', 'event_espresso'), |
| 950 | 950 | 'target' => '', |
@@ -953,18 +953,18 @@ discard block |
||
| 953 | 953 | )); |
| 954 | 954 | } |
| 955 | 955 | |
| 956 | - if ( is_single() && ( get_post_type() == 'espresso_events' ) ) { |
|
| 956 | + if (is_single() && (get_post_type() == 'espresso_events')) { |
|
| 957 | 957 | |
| 958 | 958 | //Current post |
| 959 | 959 | global $post; |
| 960 | 960 | |
| 961 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_event', 'ee_admin_bar_menu_espresso-toolbar-events-edit', $post->ID ) ) { |
|
| 961 | + if (EE_Registry::instance()->CAP->current_user_can('ee_edit_event', 'ee_admin_bar_menu_espresso-toolbar-events-edit', $post->ID)) { |
|
| 962 | 962 | //Events Edit Current Event |
| 963 | 963 | $admin_bar->add_menu(array( |
| 964 | 964 | 'id' => 'espresso-toolbar-events-edit', |
| 965 | 965 | 'parent' => 'espresso-toolbar-events', |
| 966 | 966 | 'title' => __('Edit Event', 'event_espresso'), |
| 967 | - 'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'edit', 'post'=>$post->ID ), $events_admin_url ), |
|
| 967 | + 'href' => EEH_URL::add_query_args_and_nonce(array('action'=>'edit', 'post'=>$post->ID), $events_admin_url), |
|
| 968 | 968 | 'meta' => array( |
| 969 | 969 | 'title' => __('Edit Event', 'event_espresso'), |
| 970 | 970 | 'target' => '', |
@@ -976,11 +976,11 @@ discard block |
||
| 976 | 976 | } |
| 977 | 977 | |
| 978 | 978 | //Events View |
| 979 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_events', 'ee_admin_bar_menu_espresso-toolbar-events-view' ) ) { |
|
| 979 | + if (EE_Registry::instance()->CAP->current_user_can('ee_read_events', 'ee_admin_bar_menu_espresso-toolbar-events-view')) { |
|
| 980 | 980 | $admin_bar->add_menu(array( |
| 981 | 981 | 'id' => 'espresso-toolbar-events-view', |
| 982 | 982 | 'parent' => 'espresso-toolbar-events', |
| 983 | - 'title' => __( 'View', 'event_espresso' ), |
|
| 983 | + 'title' => __('View', 'event_espresso'), |
|
| 984 | 984 | 'href' => $events_admin_url, |
| 985 | 985 | 'meta' => array( |
| 986 | 986 | 'title' => __('View', 'event_espresso'), |
@@ -990,12 +990,12 @@ discard block |
||
| 990 | 990 | )); |
| 991 | 991 | } |
| 992 | 992 | |
| 993 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_events', 'ee_admin_bar_menu_espresso-toolbar-events-all' ) ) { |
|
| 993 | + if (EE_Registry::instance()->CAP->current_user_can('ee_read_events', 'ee_admin_bar_menu_espresso-toolbar-events-all')) { |
|
| 994 | 994 | //Events View All |
| 995 | 995 | $admin_bar->add_menu(array( |
| 996 | 996 | 'id' => 'espresso-toolbar-events-all', |
| 997 | 997 | 'parent' => 'espresso-toolbar-events-view', |
| 998 | - 'title' => __( 'All', 'event_espresso' ), |
|
| 998 | + 'title' => __('All', 'event_espresso'), |
|
| 999 | 999 | 'href' => $events_admin_url, |
| 1000 | 1000 | 'meta' => array( |
| 1001 | 1001 | 'title' => __('All', 'event_espresso'), |
@@ -1006,13 +1006,13 @@ discard block |
||
| 1006 | 1006 | } |
| 1007 | 1007 | |
| 1008 | 1008 | |
| 1009 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_events', 'ee_admin_bar_menu_espresso-toolbar-events-today' ) ) { |
|
| 1009 | + if (EE_Registry::instance()->CAP->current_user_can('ee_read_events', 'ee_admin_bar_menu_espresso-toolbar-events-today')) { |
|
| 1010 | 1010 | //Events View Today |
| 1011 | 1011 | $admin_bar->add_menu(array( |
| 1012 | 1012 | 'id' => 'espresso-toolbar-events-today', |
| 1013 | 1013 | 'parent' => 'espresso-toolbar-events-view', |
| 1014 | 1014 | 'title' => __('Today', 'event_espresso'), |
| 1015 | - 'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'today' ), $events_admin_url ), |
|
| 1015 | + 'href' => EEH_URL::add_query_args_and_nonce(array('action'=>'default', 'status'=>'today'), $events_admin_url), |
|
| 1016 | 1016 | 'meta' => array( |
| 1017 | 1017 | 'title' => __('Today', 'event_espresso'), |
| 1018 | 1018 | 'target' => '', |
@@ -1022,13 +1022,13 @@ discard block |
||
| 1022 | 1022 | } |
| 1023 | 1023 | |
| 1024 | 1024 | |
| 1025 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_events', 'ee_admin_bar_menu_espresso-toolbar-events-month' ) ) { |
|
| 1025 | + if (EE_Registry::instance()->CAP->current_user_can('ee_read_events', 'ee_admin_bar_menu_espresso-toolbar-events-month')) { |
|
| 1026 | 1026 | //Events View This Month |
| 1027 | 1027 | $admin_bar->add_menu(array( |
| 1028 | 1028 | 'id' => 'espresso-toolbar-events-month', |
| 1029 | 1029 | 'parent' => 'espresso-toolbar-events-view', |
| 1030 | - 'title' => __( 'This Month', 'event_espresso'), |
|
| 1031 | - 'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'month' ), $events_admin_url ), |
|
| 1030 | + 'title' => __('This Month', 'event_espresso'), |
|
| 1031 | + 'href' => EEH_URL::add_query_args_and_nonce(array('action'=>'default', 'status'=>'month'), $events_admin_url), |
|
| 1032 | 1032 | 'meta' => array( |
| 1033 | 1033 | 'title' => __('This Month', 'event_espresso'), |
| 1034 | 1034 | 'target' => '', |
@@ -1038,11 +1038,11 @@ discard block |
||
| 1038 | 1038 | } |
| 1039 | 1039 | |
| 1040 | 1040 | //Registration Overview |
| 1041 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations' ) ) { |
|
| 1041 | + if (EE_Registry::instance()->CAP->current_user_can('ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations')) { |
|
| 1042 | 1042 | $admin_bar->add_menu(array( |
| 1043 | 1043 | 'id' => 'espresso-toolbar-registrations', |
| 1044 | 1044 | 'parent' => 'espresso-toolbar', |
| 1045 | - 'title' => __( 'Registrations', 'event_espresso' ), |
|
| 1045 | + 'title' => __('Registrations', 'event_espresso'), |
|
| 1046 | 1046 | 'href' => $reg_admin_url, |
| 1047 | 1047 | 'meta' => array( |
| 1048 | 1048 | 'title' => __('Registrations', 'event_espresso'), |
@@ -1053,12 +1053,12 @@ discard block |
||
| 1053 | 1053 | } |
| 1054 | 1054 | |
| 1055 | 1055 | //Registration Overview Today |
| 1056 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-today' ) ) { |
|
| 1056 | + if (EE_Registry::instance()->CAP->current_user_can('ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-today')) { |
|
| 1057 | 1057 | $admin_bar->add_menu(array( |
| 1058 | 1058 | 'id' => 'espresso-toolbar-registrations-today', |
| 1059 | 1059 | 'parent' => 'espresso-toolbar-registrations', |
| 1060 | - 'title' => __( 'Today', 'event_espresso'), |
|
| 1061 | - 'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'today' ), $reg_admin_url ), |
|
| 1060 | + 'title' => __('Today', 'event_espresso'), |
|
| 1061 | + 'href' => EEH_URL::add_query_args_and_nonce(array('action'=>'default', 'status'=>'today'), $reg_admin_url), |
|
| 1062 | 1062 | 'meta' => array( |
| 1063 | 1063 | 'title' => __('Today', 'event_espresso'), |
| 1064 | 1064 | 'target' => '', |
@@ -1068,14 +1068,14 @@ discard block |
||
| 1068 | 1068 | } |
| 1069 | 1069 | |
| 1070 | 1070 | //Registration Overview Today Completed |
| 1071 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-today-approved' ) ) { |
|
| 1071 | + if (EE_Registry::instance()->CAP->current_user_can('ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-today-approved')) { |
|
| 1072 | 1072 | $admin_bar->add_menu(array( |
| 1073 | 1073 | 'id' => 'espresso-toolbar-registrations-today-approved', |
| 1074 | 1074 | 'parent' => 'espresso-toolbar-registrations-today', |
| 1075 | - 'title' => __( 'Approved', 'event_espresso' ), |
|
| 1076 | - 'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'today', '_reg_status'=>EEM_Registration::status_id_approved ), $reg_admin_url ), |
|
| 1075 | + 'title' => __('Approved', 'event_espresso'), |
|
| 1076 | + 'href' => EEH_URL::add_query_args_and_nonce(array('action'=>'default', 'status'=>'today', '_reg_status'=>EEM_Registration::status_id_approved), $reg_admin_url), |
|
| 1077 | 1077 | 'meta' => array( |
| 1078 | - 'title' => __('Approved', 'event_espresso' ), |
|
| 1078 | + 'title' => __('Approved', 'event_espresso'), |
|
| 1079 | 1079 | 'target' => '', |
| 1080 | 1080 | 'class' => $menu_class |
| 1081 | 1081 | ), |
@@ -1083,14 +1083,14 @@ discard block |
||
| 1083 | 1083 | } |
| 1084 | 1084 | |
| 1085 | 1085 | //Registration Overview Today Pending\ |
| 1086 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-today-pending' ) ) { |
|
| 1086 | + if (EE_Registry::instance()->CAP->current_user_can('ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-today-pending')) { |
|
| 1087 | 1087 | $admin_bar->add_menu(array( |
| 1088 | 1088 | 'id' => 'espresso-toolbar-registrations-today-pending', |
| 1089 | 1089 | 'parent' => 'espresso-toolbar-registrations-today', |
| 1090 | - 'title' => __( 'Pending', 'event_espresso' ), |
|
| 1091 | - 'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'today', 'reg_status'=>EEM_Registration::status_id_pending_payment ), $reg_admin_url ), |
|
| 1090 | + 'title' => __('Pending', 'event_espresso'), |
|
| 1091 | + 'href' => EEH_URL::add_query_args_and_nonce(array('action'=>'default', 'status'=>'today', 'reg_status'=>EEM_Registration::status_id_pending_payment), $reg_admin_url), |
|
| 1092 | 1092 | 'meta' => array( |
| 1093 | - 'title' => __('Pending Payment', 'event_espresso' ), |
|
| 1093 | + 'title' => __('Pending Payment', 'event_espresso'), |
|
| 1094 | 1094 | 'target' => '', |
| 1095 | 1095 | 'class' => $menu_class |
| 1096 | 1096 | ), |
@@ -1098,14 +1098,14 @@ discard block |
||
| 1098 | 1098 | } |
| 1099 | 1099 | |
| 1100 | 1100 | //Registration Overview Today Incomplete |
| 1101 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-today-not-approved' ) ) { |
|
| 1101 | + if (EE_Registry::instance()->CAP->current_user_can('ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-today-not-approved')) { |
|
| 1102 | 1102 | $admin_bar->add_menu(array( |
| 1103 | 1103 | 'id' => 'espresso-toolbar-registrations-today-not-approved', |
| 1104 | 1104 | 'parent' => 'espresso-toolbar-registrations-today', |
| 1105 | - 'title' => __( 'Not Approved', 'event_espresso' ), |
|
| 1106 | - 'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'today', '_reg_status'=>EEM_Registration::status_id_not_approved ), $reg_admin_url ), |
|
| 1105 | + 'title' => __('Not Approved', 'event_espresso'), |
|
| 1106 | + 'href' => EEH_URL::add_query_args_and_nonce(array('action'=>'default', 'status'=>'today', '_reg_status'=>EEM_Registration::status_id_not_approved), $reg_admin_url), |
|
| 1107 | 1107 | 'meta' => array( |
| 1108 | - 'title' => __('Not Approved', 'event_espresso' ), |
|
| 1108 | + 'title' => __('Not Approved', 'event_espresso'), |
|
| 1109 | 1109 | 'target' => '', |
| 1110 | 1110 | 'class' => $menu_class |
| 1111 | 1111 | ), |
@@ -1113,12 +1113,12 @@ discard block |
||
| 1113 | 1113 | } |
| 1114 | 1114 | |
| 1115 | 1115 | //Registration Overview Today Incomplete |
| 1116 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-today-cancelled' ) ) { |
|
| 1116 | + if (EE_Registry::instance()->CAP->current_user_can('ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-today-cancelled')) { |
|
| 1117 | 1117 | $admin_bar->add_menu(array( |
| 1118 | 1118 | 'id' => 'espresso-toolbar-registrations-today-cancelled', |
| 1119 | 1119 | 'parent' => 'espresso-toolbar-registrations-today', |
| 1120 | - 'title' => __( 'Cancelled', 'event_espresso'), |
|
| 1121 | - 'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'today', '_reg_status'=>EEM_Registration::status_id_cancelled ), $reg_admin_url ), |
|
| 1120 | + 'title' => __('Cancelled', 'event_espresso'), |
|
| 1121 | + 'href' => EEH_URL::add_query_args_and_nonce(array('action'=>'default', 'status'=>'today', '_reg_status'=>EEM_Registration::status_id_cancelled), $reg_admin_url), |
|
| 1122 | 1122 | 'meta' => array( |
| 1123 | 1123 | 'title' => __('Cancelled', 'event_espresso'), |
| 1124 | 1124 | 'target' => '', |
@@ -1128,12 +1128,12 @@ discard block |
||
| 1128 | 1128 | } |
| 1129 | 1129 | |
| 1130 | 1130 | //Registration Overview This Month |
| 1131 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-month' ) ) { |
|
| 1131 | + if (EE_Registry::instance()->CAP->current_user_can('ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-month')) { |
|
| 1132 | 1132 | $admin_bar->add_menu(array( |
| 1133 | 1133 | 'id' => 'espresso-toolbar-registrations-month', |
| 1134 | 1134 | 'parent' => 'espresso-toolbar-registrations', |
| 1135 | - 'title' => __( 'This Month', 'event_espresso' ), |
|
| 1136 | - 'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'month' ), $reg_admin_url ), |
|
| 1135 | + 'title' => __('This Month', 'event_espresso'), |
|
| 1136 | + 'href' => EEH_URL::add_query_args_and_nonce(array('action'=>'default', 'status'=>'month'), $reg_admin_url), |
|
| 1137 | 1137 | 'meta' => array( |
| 1138 | 1138 | 'title' => __('This Month', 'event_espresso'), |
| 1139 | 1139 | 'target' => '', |
@@ -1143,12 +1143,12 @@ discard block |
||
| 1143 | 1143 | } |
| 1144 | 1144 | |
| 1145 | 1145 | //Registration Overview This Month Approved |
| 1146 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-month-approved' ) ) { |
|
| 1146 | + if (EE_Registry::instance()->CAP->current_user_can('ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-month-approved')) { |
|
| 1147 | 1147 | $admin_bar->add_menu(array( |
| 1148 | 1148 | 'id' => 'espresso-toolbar-registrations-month-approved', |
| 1149 | 1149 | 'parent' => 'espresso-toolbar-registrations-month', |
| 1150 | - 'title' => __( 'Approved', 'event_espresso' ), |
|
| 1151 | - 'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'month', '_reg_status'=>EEM_Registration::status_id_approved ), $reg_admin_url ), |
|
| 1150 | + 'title' => __('Approved', 'event_espresso'), |
|
| 1151 | + 'href' => EEH_URL::add_query_args_and_nonce(array('action'=>'default', 'status'=>'month', '_reg_status'=>EEM_Registration::status_id_approved), $reg_admin_url), |
|
| 1152 | 1152 | 'meta' => array( |
| 1153 | 1153 | 'title' => __('Approved', 'event_espresso'), |
| 1154 | 1154 | 'target' => '', |
@@ -1158,12 +1158,12 @@ discard block |
||
| 1158 | 1158 | } |
| 1159 | 1159 | |
| 1160 | 1160 | //Registration Overview This Month Pending |
| 1161 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-month-pending' ) ) { |
|
| 1161 | + if (EE_Registry::instance()->CAP->current_user_can('ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-month-pending')) { |
|
| 1162 | 1162 | $admin_bar->add_menu(array( |
| 1163 | 1163 | 'id' => 'espresso-toolbar-registrations-month-pending', |
| 1164 | 1164 | 'parent' => 'espresso-toolbar-registrations-month', |
| 1165 | - 'title' => __( 'Pending', 'event_espresso'), |
|
| 1166 | - 'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'month', '_reg_status'=>EEM_Registration::status_id_pending_payment ), $reg_admin_url ), |
|
| 1165 | + 'title' => __('Pending', 'event_espresso'), |
|
| 1166 | + 'href' => EEH_URL::add_query_args_and_nonce(array('action'=>'default', 'status'=>'month', '_reg_status'=>EEM_Registration::status_id_pending_payment), $reg_admin_url), |
|
| 1167 | 1167 | 'meta' => array( |
| 1168 | 1168 | 'title' => __('Pending', 'event_espresso'), |
| 1169 | 1169 | 'target' => '', |
@@ -1173,14 +1173,14 @@ discard block |
||
| 1173 | 1173 | } |
| 1174 | 1174 | |
| 1175 | 1175 | //Registration Overview This Month Not Approved |
| 1176 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-month-not-approved' ) ) { |
|
| 1176 | + if (EE_Registry::instance()->CAP->current_user_can('ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-month-not-approved')) { |
|
| 1177 | 1177 | $admin_bar->add_menu(array( |
| 1178 | 1178 | 'id' => 'espresso-toolbar-registrations-month-not-approved', |
| 1179 | 1179 | 'parent' => 'espresso-toolbar-registrations-month', |
| 1180 | - 'title' => __( 'Not Approved', 'event_espresso'), |
|
| 1181 | - 'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'month', '_reg_status'=>EEM_Registration::status_id_not_approved ), $reg_admin_url ), |
|
| 1180 | + 'title' => __('Not Approved', 'event_espresso'), |
|
| 1181 | + 'href' => EEH_URL::add_query_args_and_nonce(array('action'=>'default', 'status'=>'month', '_reg_status'=>EEM_Registration::status_id_not_approved), $reg_admin_url), |
|
| 1182 | 1182 | 'meta' => array( |
| 1183 | - 'title' => __('Not Approved', 'event_espresso' ), |
|
| 1183 | + 'title' => __('Not Approved', 'event_espresso'), |
|
| 1184 | 1184 | 'target' => '', |
| 1185 | 1185 | 'class' => $menu_class |
| 1186 | 1186 | ), |
@@ -1189,12 +1189,12 @@ discard block |
||
| 1189 | 1189 | |
| 1190 | 1190 | |
| 1191 | 1191 | //Registration Overview This Month Cancelled |
| 1192 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-month-cancelled' ) ) { |
|
| 1192 | + if (EE_Registry::instance()->CAP->current_user_can('ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-month-cancelled')) { |
|
| 1193 | 1193 | $admin_bar->add_menu(array( |
| 1194 | 1194 | 'id' => 'espresso-toolbar-registrations-month-cancelled', |
| 1195 | 1195 | 'parent' => 'espresso-toolbar-registrations-month', |
| 1196 | 1196 | 'title' => __('Cancelled', 'event_espresso'), |
| 1197 | - 'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'month', '_reg_status'=>EEM_Registration::status_id_cancelled ), $reg_admin_url ), |
|
| 1197 | + 'href' => EEH_URL::add_query_args_and_nonce(array('action'=>'default', 'status'=>'month', '_reg_status'=>EEM_Registration::status_id_cancelled), $reg_admin_url), |
|
| 1198 | 1198 | 'meta' => array( |
| 1199 | 1199 | 'title' => __('Cancelled', 'event_espresso'), |
| 1200 | 1200 | 'target' => '', |
@@ -1204,11 +1204,11 @@ discard block |
||
| 1204 | 1204 | } |
| 1205 | 1205 | |
| 1206 | 1206 | //Extensions & Services |
| 1207 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_ee', 'ee_admin_bar_menu_espresso-toolbar-extensions-and-services' ) ) { |
|
| 1207 | + if (EE_Registry::instance()->CAP->current_user_can('ee_read_ee', 'ee_admin_bar_menu_espresso-toolbar-extensions-and-services')) { |
|
| 1208 | 1208 | $admin_bar->add_menu(array( |
| 1209 | 1209 | 'id' => 'espresso-toolbar-extensions-and-services', |
| 1210 | 1210 | 'parent' => 'espresso-toolbar', |
| 1211 | - 'title' => __( 'Extensions & Services', 'event_espresso' ), |
|
| 1211 | + 'title' => __('Extensions & Services', 'event_espresso'), |
|
| 1212 | 1212 | 'href' => $extensions_admin_url, |
| 1213 | 1213 | 'meta' => array( |
| 1214 | 1214 | 'title' => __('Extensions & Services', 'event_espresso'), |
@@ -1230,8 +1230,8 @@ discard block |
||
| 1230 | 1230 | * @param array $exclude_array any existing pages being excluded are in this array. |
| 1231 | 1231 | * @return array |
| 1232 | 1232 | */ |
| 1233 | - public function remove_pages_from_wp_list_pages( $exclude_array ) { |
|
| 1234 | - return array_merge( $exclude_array, EE_Registry::instance()->CFG->core->get_critical_pages_array() ); |
|
| 1233 | + public function remove_pages_from_wp_list_pages($exclude_array) { |
|
| 1234 | + return array_merge($exclude_array, EE_Registry::instance()->CFG->core->get_critical_pages_array()); |
|
| 1235 | 1235 | } |
| 1236 | 1236 | |
| 1237 | 1237 | |
@@ -1251,11 +1251,11 @@ discard block |
||
| 1251 | 1251 | */ |
| 1252 | 1252 | public function wp_enqueue_scripts() { |
| 1253 | 1253 | // unlike other systems, EE_System_scripts loading is turned ON by default, but prior to the init hook, can be turned off via: add_filter( 'FHEE_load_EE_System_scripts', '__return_false' ); |
| 1254 | - if ( apply_filters( 'FHEE_load_EE_System_scripts', TRUE ) ) { |
|
| 1254 | + if (apply_filters('FHEE_load_EE_System_scripts', TRUE)) { |
|
| 1255 | 1255 | // jquery_validate loading is turned OFF by default, but prior to the wp_enqueue_scripts hook, can be turned back on again via: add_filter( 'FHEE_load_jquery_validate', '__return_true' ); |
| 1256 | - if ( apply_filters( 'FHEE_load_jquery_validate', FALSE ) ) { |
|
| 1256 | + if (apply_filters('FHEE_load_jquery_validate', FALSE)) { |
|
| 1257 | 1257 | // register jQuery Validate |
| 1258 | - wp_register_script( 'jquery-validate', EE_GLOBAL_ASSETS_URL . 'scripts/jquery.validate.min.js', array('jquery'), '1.11.1', TRUE ); |
|
| 1258 | + wp_register_script('jquery-validate', EE_GLOBAL_ASSETS_URL.'scripts/jquery.validate.min.js', array('jquery'), '1.11.1', TRUE); |
|
| 1259 | 1259 | } |
| 1260 | 1260 | } |
| 1261 | 1261 | } |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * @return EED_Event_Single |
| 36 | 36 | */ |
| 37 | 37 | public static function instance() { |
| 38 | - return parent::get_instance( __CLASS__ ); |
|
| 38 | + return parent::get_instance(__CLASS__); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | |
@@ -47,9 +47,9 @@ discard block |
||
| 47 | 47 | * @return void |
| 48 | 48 | */ |
| 49 | 49 | public static function set_hooks() { |
| 50 | - add_filter( 'FHEE_run_EE_wp', '__return_true' ); |
|
| 51 | - add_action( 'wp_loaded', array( 'EED_Event_Single', 'set_definitions' ), 2 ); |
|
| 52 | - EE_Config::register_route( __( 'event', 'event_espresso' ), 'Event_Single', 'run' ); |
|
| 50 | + add_filter('FHEE_run_EE_wp', '__return_true'); |
|
| 51 | + add_action('wp_loaded', array('EED_Event_Single', 'set_definitions'), 2); |
|
| 52 | + EE_Config::register_route(__('event', 'event_espresso'), 'Event_Single', 'run'); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | /** |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | * @return void |
| 60 | 60 | */ |
| 61 | 61 | public static function set_hooks_admin() { |
| 62 | - add_action( 'wp_loaded', array( 'EED_Event_Single', 'set_definitions' ), 2 ); |
|
| 62 | + add_action('wp_loaded', array('EED_Event_Single', 'set_definitions'), 2); |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | |
@@ -73,8 +73,8 @@ discard block |
||
| 73 | 73 | * @return void |
| 74 | 74 | */ |
| 75 | 75 | public static function set_definitions() { |
| 76 | - define( 'EVENT_SINGLE_ASSETS_URL', plugin_dir_url( __FILE__ ) . 'assets' . DS ); |
|
| 77 | - define( 'EVENT_SINGLE_TEMPLATES_PATH', plugin_dir_path( __FILE__ ) . 'templates' . DS ); |
|
| 76 | + define('EVENT_SINGLE_ASSETS_URL', plugin_dir_url(__FILE__).'assets'.DS); |
|
| 77 | + define('EVENT_SINGLE_TEMPLATES_PATH', plugin_dir_path(__FILE__).'templates'.DS); |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | |
@@ -84,10 +84,10 @@ discard block |
||
| 84 | 84 | * |
| 85 | 85 | * @void |
| 86 | 86 | */ |
| 87 | - protected function set_config(){ |
|
| 88 | - $this->set_config_section( 'template_settings' ); |
|
| 89 | - $this->set_config_class( 'EE_Event_Single_Config' ); |
|
| 90 | - $this->set_config_name( 'EED_Event_Single' ); |
|
| 87 | + protected function set_config() { |
|
| 88 | + $this->set_config_section('template_settings'); |
|
| 89 | + $this->set_config_class('EE_Event_Single_Config'); |
|
| 90 | + $this->set_config_name('EED_Event_Single'); |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | |
@@ -100,35 +100,35 @@ discard block |
||
| 100 | 100 | * @param \EE_Event_Single_Config $config |
| 101 | 101 | * @return \EE_Template_Part_Manager |
| 102 | 102 | */ |
| 103 | - public function initialize_template_parts( EE_Event_Single_Config $config = null ) { |
|
| 103 | + public function initialize_template_parts(EE_Event_Single_Config $config = null) { |
|
| 104 | 104 | $config = $config instanceof EE_Event_Single_Config ? $config : $this->config(); |
| 105 | 105 | EEH_Autoloader::instance()->register_template_part_autoloaders(); |
| 106 | 106 | $template_parts = new EE_Template_Part_Manager(); |
| 107 | 107 | $template_parts->add_template_part( |
| 108 | 108 | 'tickets', |
| 109 | - __( 'Ticket Selector', 'event_espresso' ), |
|
| 109 | + __('Ticket Selector', 'event_espresso'), |
|
| 110 | 110 | 'content-espresso_events-tickets.php', |
| 111 | 111 | $config->display_order_tickets |
| 112 | 112 | ); |
| 113 | 113 | $template_parts->add_template_part( |
| 114 | 114 | 'datetimes', |
| 115 | - __( 'Dates and Times', 'event_espresso' ), |
|
| 115 | + __('Dates and Times', 'event_espresso'), |
|
| 116 | 116 | 'content-espresso_events-datetimes.php', |
| 117 | 117 | $config->display_order_datetimes |
| 118 | 118 | ); |
| 119 | 119 | $template_parts->add_template_part( |
| 120 | 120 | 'event', |
| 121 | - __( 'Event Description', 'event_espresso' ), |
|
| 121 | + __('Event Description', 'event_espresso'), |
|
| 122 | 122 | 'content-espresso_events-details.php', |
| 123 | 123 | $config->display_order_event |
| 124 | 124 | ); |
| 125 | 125 | $template_parts->add_template_part( |
| 126 | 126 | 'venue', |
| 127 | - __( 'Venue Information', 'event_espresso' ), |
|
| 127 | + __('Venue Information', 'event_espresso'), |
|
| 128 | 128 | 'content-espresso_events-venues.php', |
| 129 | 129 | $config->display_order_venue |
| 130 | 130 | ); |
| 131 | - do_action( 'AHEE__EED_Event_Single__initialize_template_parts', $template_parts ); |
|
| 131 | + do_action('AHEE__EED_Event_Single__initialize_template_parts', $template_parts); |
|
| 132 | 132 | return $template_parts; |
| 133 | 133 | } |
| 134 | 134 | |
@@ -142,15 +142,15 @@ discard block |
||
| 142 | 142 | * @param WP $WP |
| 143 | 143 | * @return void |
| 144 | 144 | */ |
| 145 | - public function run( $WP ) { |
|
| 145 | + public function run($WP) { |
|
| 146 | 146 | // ensure valid EE_Events_Single_Config() object exists |
| 147 | 147 | $this->set_config(); |
| 148 | 148 | // check what template is loaded |
| 149 | - add_filter( 'template_include', array( $this, 'template_include' ), 999, 1 ); |
|
| 150 | - add_filter( 'FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true' ); |
|
| 149 | + add_filter('template_include', array($this, 'template_include'), 999, 1); |
|
| 150 | + add_filter('FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true'); |
|
| 151 | 151 | // load css |
| 152 | - add_action('wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ), 10 ); |
|
| 153 | - EE_Registry::instance()->load_helper( 'Venue_View' ); |
|
| 152 | + add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts'), 10); |
|
| 153 | + EE_Registry::instance()->load_helper('Venue_View'); |
|
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | |
@@ -162,25 +162,25 @@ discard block |
||
| 162 | 162 | * @param string $template |
| 163 | 163 | * @return string |
| 164 | 164 | */ |
| 165 | - public function template_include( $template ) { |
|
| 165 | + public function template_include($template) { |
|
| 166 | 166 | global $post; |
| 167 | 167 | /** @type EE_Event_Single_Config $config */ |
| 168 | 168 | $config = $this->config(); |
| 169 | - if ( $config->display_status_banner_single ) { |
|
| 170 | - add_filter( 'the_title', array( 'EED_Event_Single', 'the_title' ), 100, 2 ); |
|
| 169 | + if ($config->display_status_banner_single) { |
|
| 170 | + add_filter('the_title', array('EED_Event_Single', 'the_title'), 100, 2); |
|
| 171 | 171 | } |
| 172 | 172 | // not a custom template? |
| 173 | 173 | if ( |
| 174 | 174 | EE_Front_Controller::instance()->get_selected_template() != 'single-espresso_events.php' |
| 175 | - && ! post_password_required( $post ) |
|
| 175 | + && ! post_password_required($post) |
|
| 176 | 176 | ) { |
| 177 | 177 | EEH_Template::load_espresso_theme_functions(); |
| 178 | 178 | // then add extra event data via hooks |
| 179 | - add_action( 'loop_start', array( 'EED_Event_Single', 'loop_start' )); |
|
| 180 | - add_filter( 'the_content', array( 'EED_Event_Single', 'event_details' ), 100 ); |
|
| 181 | - add_action( 'loop_end', array( 'EED_Event_Single', 'loop_end' )); |
|
| 179 | + add_action('loop_start', array('EED_Event_Single', 'loop_start')); |
|
| 180 | + add_filter('the_content', array('EED_Event_Single', 'event_details'), 100); |
|
| 181 | + add_action('loop_end', array('EED_Event_Single', 'loop_end')); |
|
| 182 | 182 | // don't display entry meta because the existing theme will take car of that |
| 183 | - add_filter( 'FHEE__content_espresso_events_details_template__display_entry_meta', '__return_false' ); |
|
| 183 | + add_filter('FHEE__content_espresso_events_details_template__display_entry_meta', '__return_false'); |
|
| 184 | 184 | } |
| 185 | 185 | return $template; |
| 186 | 186 | } |
@@ -194,9 +194,9 @@ discard block |
||
| 194 | 194 | * @param array $wp_query_array an array containing the WP_Query object |
| 195 | 195 | * @return void |
| 196 | 196 | */ |
| 197 | - public static function loop_start( $wp_query_array ) { |
|
| 197 | + public static function loop_start($wp_query_array) { |
|
| 198 | 198 | global $post; |
| 199 | - do_action( 'AHEE_event_details_before_post', $post, $wp_query_array ); |
|
| 199 | + do_action('AHEE_event_details_before_post', $post, $wp_query_array); |
|
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | |
@@ -209,9 +209,9 @@ discard block |
||
| 209 | 209 | * @param int $id |
| 210 | 210 | * @return string |
| 211 | 211 | */ |
| 212 | - public static function the_title( $title = '', $id = 0 ) { |
|
| 212 | + public static function the_title($title = '', $id = 0) { |
|
| 213 | 213 | global $post; |
| 214 | - return in_the_loop() && $post->ID == $id ? espresso_event_status_banner( $post->ID ) . $title : $title; |
|
| 214 | + return in_the_loop() && $post->ID == $id ? espresso_event_status_banner($post->ID).$title : $title; |
|
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | * @param string $content |
| 223 | 223 | * @return string |
| 224 | 224 | */ |
| 225 | - public static function event_details( $content ) { |
|
| 225 | + public static function event_details($content) { |
|
| 226 | 226 | global $post; |
| 227 | 227 | static $current_post_ID = 0; |
| 228 | 228 | if ( |
@@ -236,15 +236,15 @@ discard block |
||
| 236 | 236 | // We want to allow those plugins to still do their thing and have access to our content, but depending on |
| 237 | 237 | // how your event content is being displayed (shortcode, CPT route, etc), this filter can get applied twice, |
| 238 | 238 | // so the following allows this filter to be applied multiple times, but only once for real |
| 239 | - $current_post_ID = did_action( 'loop_start' ) ? $post->ID : 0; |
|
| 240 | - if ( EE_Registry::instance()->CFG->template_settings->EED_Event_Single->use_sortable_display_order ) { |
|
| 239 | + $current_post_ID = did_action('loop_start') ? $post->ID : 0; |
|
| 240 | + if (EE_Registry::instance()->CFG->template_settings->EED_Event_Single->use_sortable_display_order) { |
|
| 241 | 241 | // we need to first remove this callback from being applied to the_content() |
| 242 | 242 | // (otherwise it will recurse and blow up the interweb) |
| 243 | - remove_filter( 'the_content', array( 'EED_Event_Single', 'event_details' ), 100 ); |
|
| 243 | + remove_filter('the_content', array('EED_Event_Single', 'event_details'), 100); |
|
| 244 | 244 | EED_Event_Single::instance()->template_parts = EED_Event_Single::instance()->initialize_template_parts(); |
| 245 | - $content = EEH_Template::locate_template( 'content-espresso_events-details.php' ); |
|
| 246 | - $content = EED_Event_Single::instance()->template_parts->apply_template_part_filters( $content ); |
|
| 247 | - add_filter( 'the_content', array( 'EED_Event_Single', 'event_details' ), 100 ); |
|
| 245 | + $content = EEH_Template::locate_template('content-espresso_events-details.php'); |
|
| 246 | + $content = EED_Event_Single::instance()->template_parts->apply_template_part_filters($content); |
|
| 247 | + add_filter('the_content', array('EED_Event_Single', 'event_details'), 100); |
|
| 248 | 248 | } else { |
| 249 | 249 | $content = EED_Event_Single::use_filterable_display_order(); |
| 250 | 250 | } |
@@ -265,19 +265,19 @@ discard block |
||
| 265 | 265 | // it uses the_content() for displaying the $post->post_content |
| 266 | 266 | // so in order to load a template that uses the_content() from within a callback being used to filter the_content(), |
| 267 | 267 | // we need to first remove this callback from being applied to the_content() (otherwise it will recurse and blow up the interweb) |
| 268 | - remove_filter( 'the_content', array( 'EED_Event_Single', 'event_details' ), 100 ); |
|
| 268 | + remove_filter('the_content', array('EED_Event_Single', 'event_details'), 100); |
|
| 269 | 269 | //now add additional content |
| 270 | - add_filter( 'the_content', array( 'EED_Event_Single', 'event_datetimes' ), 110, 1 ); |
|
| 271 | - add_filter( 'the_content', array( 'EED_Event_Single', 'event_tickets' ), 120, 1 ); |
|
| 272 | - add_filter( 'the_content', array( 'EED_Event_Single', 'event_venues' ), 130, 1 ); |
|
| 273 | - do_action( 'AHEE__EED_Event_Single__use_filterable_display_order__after_add_filters' ); |
|
| 270 | + add_filter('the_content', array('EED_Event_Single', 'event_datetimes'), 110, 1); |
|
| 271 | + add_filter('the_content', array('EED_Event_Single', 'event_tickets'), 120, 1); |
|
| 272 | + add_filter('the_content', array('EED_Event_Single', 'event_venues'), 130, 1); |
|
| 273 | + do_action('AHEE__EED_Event_Single__use_filterable_display_order__after_add_filters'); |
|
| 274 | 274 | // now load our template |
| 275 | - $content = EEH_Template::locate_template( 'content-espresso_events-details.php' ); |
|
| 275 | + $content = EEH_Template::locate_template('content-espresso_events-details.php'); |
|
| 276 | 276 | //now add our filter back in, plus some others |
| 277 | - add_filter( 'the_content', array( 'EED_Event_Single', 'event_details' ), 100 ); |
|
| 278 | - remove_filter( 'the_content', array( 'EED_Event_Single', 'event_datetimes' ), 110 ); |
|
| 279 | - remove_filter( 'the_content', array( 'EED_Event_Single', 'event_tickets' ), 120 ); |
|
| 280 | - remove_filter( 'the_content', array( 'EED_Event_Single', 'event_venues' ), 130 ); |
|
| 277 | + add_filter('the_content', array('EED_Event_Single', 'event_details'), 100); |
|
| 278 | + remove_filter('the_content', array('EED_Event_Single', 'event_datetimes'), 110); |
|
| 279 | + remove_filter('the_content', array('EED_Event_Single', 'event_tickets'), 120); |
|
| 280 | + remove_filter('the_content', array('EED_Event_Single', 'event_venues'), 130); |
|
| 281 | 281 | // we're not returning the $content directly because the template we are loading uses the_content (or the_excerpt) |
| 282 | 282 | return $content; |
| 283 | 283 | } |
@@ -291,8 +291,8 @@ discard block |
||
| 291 | 291 | * @param string $content |
| 292 | 292 | * @return string |
| 293 | 293 | */ |
| 294 | - public static function event_datetimes( $content ) { |
|
| 295 | - return EEH_Template::locate_template( 'content-espresso_events-datetimes.php' ) . $content; |
|
| 294 | + public static function event_datetimes($content) { |
|
| 295 | + return EEH_Template::locate_template('content-espresso_events-datetimes.php').$content; |
|
| 296 | 296 | } |
| 297 | 297 | |
| 298 | 298 | |
@@ -304,8 +304,8 @@ discard block |
||
| 304 | 304 | * @param string $content |
| 305 | 305 | * @return string |
| 306 | 306 | */ |
| 307 | - public static function event_tickets( $content ) { |
|
| 308 | - return EEH_Template::locate_template( 'content-espresso_events-tickets.php' ) . $content; |
|
| 307 | + public static function event_tickets($content) { |
|
| 308 | + return EEH_Template::locate_template('content-espresso_events-tickets.php').$content; |
|
| 309 | 309 | } |
| 310 | 310 | |
| 311 | 311 | |
@@ -317,8 +317,8 @@ discard block |
||
| 317 | 317 | * @param string $content |
| 318 | 318 | * @return string |
| 319 | 319 | */ |
| 320 | - public static function event_venue( $content ) { |
|
| 321 | - return EED_Event_Single::event_venues( $content ); |
|
| 320 | + public static function event_venue($content) { |
|
| 321 | + return EED_Event_Single::event_venues($content); |
|
| 322 | 322 | } |
| 323 | 323 | |
| 324 | 324 | |
@@ -330,8 +330,8 @@ discard block |
||
| 330 | 330 | * @param string $content |
| 331 | 331 | * @return string |
| 332 | 332 | */ |
| 333 | - public static function event_venues( $content ) { |
|
| 334 | - return $content . EEH_Template::locate_template( 'content-espresso_events-venues.php' ); |
|
| 333 | + public static function event_venues($content) { |
|
| 334 | + return $content.EEH_Template::locate_template('content-espresso_events-venues.php'); |
|
| 335 | 335 | } |
| 336 | 336 | |
| 337 | 337 | |
@@ -343,9 +343,9 @@ discard block |
||
| 343 | 343 | * @param array $wp_query_array an array containing the WP_Query object |
| 344 | 344 | * @return void |
| 345 | 345 | */ |
| 346 | - public static function loop_end( $wp_query_array ) { |
|
| 346 | + public static function loop_end($wp_query_array) { |
|
| 347 | 347 | global $post; |
| 348 | - do_action( 'AHEE_event_details_after_post', $post, $wp_query_array ); |
|
| 348 | + do_action('AHEE_event_details_after_post', $post, $wp_query_array); |
|
| 349 | 349 | } |
| 350 | 350 | |
| 351 | 351 | |
@@ -358,18 +358,18 @@ discard block |
||
| 358 | 358 | */ |
| 359 | 359 | public function wp_enqueue_scripts() { |
| 360 | 360 | // get some style |
| 361 | - if ( apply_filters( 'FHEE_enable_default_espresso_css', TRUE ) && apply_filters( 'FHEE__EED_Event_Single__wp_enqueue_scripts__enable_css', TRUE )) { |
|
| 362 | - EE_Registry::instance()->load_helper( 'File' ); |
|
| 361 | + if (apply_filters('FHEE_enable_default_espresso_css', TRUE) && apply_filters('FHEE__EED_Event_Single__wp_enqueue_scripts__enable_css', TRUE)) { |
|
| 362 | + EE_Registry::instance()->load_helper('File'); |
|
| 363 | 363 | // first check uploads folder |
| 364 | - if ( is_readable( get_stylesheet_directory() . $this->theme . DS . 'style.css' )) { |
|
| 365 | - wp_register_style( $this->theme, get_stylesheet_directory_uri() . $this->theme . DS . 'style.css', array( 'dashicons', 'espresso_default' )); |
|
| 364 | + if (is_readable(get_stylesheet_directory().$this->theme.DS.'style.css')) { |
|
| 365 | + wp_register_style($this->theme, get_stylesheet_directory_uri().$this->theme.DS.'style.css', array('dashicons', 'espresso_default')); |
|
| 366 | 366 | } else { |
| 367 | - wp_register_style( $this->theme, EE_TEMPLATES_URL . $this->theme . DS . 'style.css', array( 'dashicons', 'espresso_default' )); |
|
| 367 | + wp_register_style($this->theme, EE_TEMPLATES_URL.$this->theme.DS.'style.css', array('dashicons', 'espresso_default')); |
|
| 368 | 368 | } |
| 369 | - wp_enqueue_script( $this->theme ); |
|
| 370 | - if ( EE_Registry::instance()->CFG->map_settings->use_google_maps ) { |
|
| 371 | - EE_Registry::instance()->load_helper( 'Maps' ); |
|
| 372 | - add_action('wp_enqueue_scripts', array( 'EEH_Maps', 'espresso_google_map_js' ), 11 ); |
|
| 369 | + wp_enqueue_script($this->theme); |
|
| 370 | + if (EE_Registry::instance()->CFG->map_settings->use_google_maps) { |
|
| 371 | + EE_Registry::instance()->load_helper('Maps'); |
|
| 372 | + add_action('wp_enqueue_scripts', array('EEH_Maps', 'espresso_google_map_js'), 11); |
|
| 373 | 373 | } |
| 374 | 374 | } |
| 375 | 375 | } |
@@ -388,12 +388,12 @@ discard block |
||
| 388 | 388 | * @return bool |
| 389 | 389 | */ |
| 390 | 390 | public static function display_venue() { |
| 391 | - EE_Registry::instance()->load_helper( 'Venue_View' ); |
|
| 391 | + EE_Registry::instance()->load_helper('Venue_View'); |
|
| 392 | 392 | /** @type EE_Event_Single_Config $config */ |
| 393 | 393 | $config = EED_Event_Single::instance()->config(); |
| 394 | - $display_venue= isset( $config->display_venue ) ? $config->display_venue : TRUE; |
|
| 394 | + $display_venue = isset($config->display_venue) ? $config->display_venue : TRUE; |
|
| 395 | 395 | $venue_name = EEH_Venue_View::venue_name(); |
| 396 | - return $display_venue && ! empty( $venue_name ) ? TRUE : FALSE; |
|
| 396 | + return $display_venue && ! empty($venue_name) ? TRUE : FALSE; |
|
| 397 | 397 | } |
| 398 | 398 | |
| 399 | 399 | |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | * @return EED_Events_Archive |
| 39 | 39 | */ |
| 40 | 40 | public static function instance() { |
| 41 | - return parent::get_instance( __CLASS__ ); |
|
| 41 | + return parent::get_instance(__CLASS__); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | |
@@ -50,9 +50,9 @@ discard block |
||
| 50 | 50 | * @return void |
| 51 | 51 | */ |
| 52 | 52 | public static function set_hooks() { |
| 53 | - EE_Config::register_route( EE_Registry::instance()->CFG->core->event_cpt_slug, 'Events_Archive', 'run' ); |
|
| 54 | - EE_Config::register_route( 'event_list', 'Events_Archive', 'event_list' ); |
|
| 55 | - add_action( 'wp_loaded', array( 'EED_Events_Archive', 'set_definitions' ), 2 ); |
|
| 53 | + EE_Config::register_route(EE_Registry::instance()->CFG->core->event_cpt_slug, 'Events_Archive', 'run'); |
|
| 54 | + EE_Config::register_route('event_list', 'Events_Archive', 'event_list'); |
|
| 55 | + add_action('wp_loaded', array('EED_Events_Archive', 'set_definitions'), 2); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | /** |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | * @return void |
| 63 | 63 | */ |
| 64 | 64 | public static function set_hooks_admin() { |
| 65 | - add_action( 'wp_loaded', array( 'EED_Events_Archive', 'set_definitions' ), 2 ); |
|
| 65 | + add_action('wp_loaded', array('EED_Events_Archive', 'set_definitions'), 2); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | |
@@ -75,8 +75,8 @@ discard block |
||
| 75 | 75 | * @return void |
| 76 | 76 | */ |
| 77 | 77 | public static function set_definitions() { |
| 78 | - define( 'EVENTS_ARCHIVE_ASSETS_URL', plugin_dir_url( __FILE__ ) . 'assets' . DS ); |
|
| 79 | - define( 'EVENTS_ARCHIVE_TEMPLATES_PATH', str_replace( '\\', DS, plugin_dir_path( __FILE__ )) . 'templates' . DS ); |
|
| 78 | + define('EVENTS_ARCHIVE_ASSETS_URL', plugin_dir_url(__FILE__).'assets'.DS); |
|
| 79 | + define('EVENTS_ARCHIVE_TEMPLATES_PATH', str_replace('\\', DS, plugin_dir_path(__FILE__)).'templates'.DS); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | |
@@ -86,10 +86,10 @@ discard block |
||
| 86 | 86 | * |
| 87 | 87 | * @return \EE_Events_Archive_Config |
| 88 | 88 | */ |
| 89 | - protected function set_config(){ |
|
| 90 | - $this->set_config_section( 'template_settings' ); |
|
| 91 | - $this->set_config_class( 'EE_Events_Archive_Config' ); |
|
| 92 | - $this->set_config_name( 'EED_Events_Archive' ); |
|
| 89 | + protected function set_config() { |
|
| 90 | + $this->set_config_section('template_settings'); |
|
| 91 | + $this->set_config_class('EE_Events_Archive_Config'); |
|
| 92 | + $this->set_config_name('EED_Events_Archive'); |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | |
@@ -101,35 +101,35 @@ discard block |
||
| 101 | 101 | * @param \EE_Events_Archive_Config $config |
| 102 | 102 | * @return \EE_Template_Part_Manager |
| 103 | 103 | */ |
| 104 | - public function initialize_template_parts( EE_Events_Archive_Config $config = null ) { |
|
| 104 | + public function initialize_template_parts(EE_Events_Archive_Config $config = null) { |
|
| 105 | 105 | $config = $config instanceof EE_Events_Archive_Config ? $config : $this->config(); |
| 106 | 106 | EEH_Autoloader::instance()->register_template_part_autoloaders(); |
| 107 | 107 | $template_parts = new EE_Template_Part_Manager(); |
| 108 | 108 | $template_parts->add_template_part( |
| 109 | 109 | 'tickets', |
| 110 | - __( 'Ticket Selector', 'event_espresso' ), |
|
| 110 | + __('Ticket Selector', 'event_espresso'), |
|
| 111 | 111 | 'content-espresso_events-tickets.php', |
| 112 | 112 | $config->display_order_tickets |
| 113 | 113 | ); |
| 114 | 114 | $template_parts->add_template_part( |
| 115 | 115 | 'datetimes', |
| 116 | - __( 'Dates and Times', 'event_espresso' ), |
|
| 116 | + __('Dates and Times', 'event_espresso'), |
|
| 117 | 117 | 'content-espresso_events-datetimes.php', |
| 118 | 118 | $config->display_order_datetimes |
| 119 | 119 | ); |
| 120 | 120 | $template_parts->add_template_part( |
| 121 | 121 | 'event', |
| 122 | - __( 'Event Description', 'event_espresso' ), |
|
| 122 | + __('Event Description', 'event_espresso'), |
|
| 123 | 123 | 'content-espresso_events-details.php', |
| 124 | 124 | $config->display_order_event |
| 125 | 125 | ); |
| 126 | 126 | $template_parts->add_template_part( |
| 127 | 127 | 'venue', |
| 128 | - __( 'Venue Information', 'event_espresso' ), |
|
| 128 | + __('Venue Information', 'event_espresso'), |
|
| 129 | 129 | 'content-espresso_events-venues.php', |
| 130 | 130 | $config->display_order_venue |
| 131 | 131 | ); |
| 132 | - do_action( 'AHEE__EED_Event_Archive__initialize_template_parts', $template_parts ); |
|
| 132 | + do_action('AHEE__EED_Event_Archive__initialize_template_parts', $template_parts); |
|
| 133 | 133 | return $template_parts; |
| 134 | 134 | } |
| 135 | 135 | |
@@ -142,8 +142,8 @@ discard block |
||
| 142 | 142 | * @param WP $WP |
| 143 | 143 | * @return void |
| 144 | 144 | */ |
| 145 | - public function run( $WP ) { |
|
| 146 | - do_action( 'AHEE__EED_Events_Archive__before_run' ); |
|
| 145 | + public function run($WP) { |
|
| 146 | + do_action('AHEE__EED_Events_Archive__before_run'); |
|
| 147 | 147 | // ensure valid EE_Events_Archive_Config() object exists |
| 148 | 148 | $this->set_config(); |
| 149 | 149 | /** @type EE_Events_Archive_Config $config */ |
@@ -151,19 +151,19 @@ discard block |
||
| 151 | 151 | // load other required components |
| 152 | 152 | $this->load_event_list_assets(); |
| 153 | 153 | // filter the WP posts_join, posts_where, and posts_orderby SQL clauses |
| 154 | - EE_Registry::instance()->load_helper( 'Event_Query' ); |
|
| 154 | + EE_Registry::instance()->load_helper('Event_Query'); |
|
| 155 | 155 | //add query filters |
| 156 | 156 | EEH_Event_Query::add_query_filters(); |
| 157 | 157 | // set params that will get used by the filters |
| 158 | 158 | EEH_Event_Query::set_query_params( |
| 159 | - '', // month |
|
| 160 | - '', // category |
|
| 161 | - $config->display_expired_events, // show_expired |
|
| 162 | - 'start_date', // orderby |
|
| 159 | + '', // month |
|
| 160 | + '', // category |
|
| 161 | + $config->display_expired_events, // show_expired |
|
| 162 | + 'start_date', // orderby |
|
| 163 | 163 | 'ASC' // sort |
| 164 | 164 | ); |
| 165 | 165 | // check what template is loaded |
| 166 | - add_filter( 'template_include', array( $this, 'template_include' ), 999, 1 ); |
|
| 166 | + add_filter('template_include', array($this, 'template_include'), 999, 1); |
|
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | |
@@ -195,30 +195,30 @@ discard block |
||
| 195 | 195 | * @param string $template |
| 196 | 196 | * @return string |
| 197 | 197 | */ |
| 198 | - public function template_include( $template = '' ) { |
|
| 198 | + public function template_include($template = '') { |
|
| 199 | 199 | // don't add content filter for dedicated EE child themes or private posts |
| 200 | - EE_Registry::instance()->load_helper( 'Template' ); |
|
| 201 | - if ( ! EEH_Template::is_espresso_theme() ) { |
|
| 200 | + EE_Registry::instance()->load_helper('Template'); |
|
| 201 | + if ( ! EEH_Template::is_espresso_theme()) { |
|
| 202 | 202 | /** @type EE_Events_Archive_Config $config */ |
| 203 | 203 | $config = $this->config(); |
| 204 | 204 | // add status banner ? |
| 205 | - if ( $config->display_status_banner ) { |
|
| 206 | - add_filter( 'the_title', array( 'EED_Events_Archive', 'the_title' ), 100, 2 ); |
|
| 205 | + if ($config->display_status_banner) { |
|
| 206 | + add_filter('the_title', array('EED_Events_Archive', 'the_title'), 100, 2); |
|
| 207 | 207 | } |
| 208 | 208 | // if NOT a custom template |
| 209 | - if ( EE_Front_Controller::instance()->get_selected_template() != 'archive-espresso_events.php' ) { |
|
| 209 | + if (EE_Front_Controller::instance()->get_selected_template() != 'archive-espresso_events.php') { |
|
| 210 | 210 | // don't display entry meta because the existing theme will take care of that |
| 211 | - add_filter( 'FHEE__EED_Events_Archive__template_include__events_list_active', '__return_true' ); |
|
| 211 | + add_filter('FHEE__EED_Events_Archive__template_include__events_list_active', '__return_true'); |
|
| 212 | 212 | // load functions.php file for the theme (loaded by WP if using child theme) |
| 213 | 213 | EEH_Template::load_espresso_theme_functions(); |
| 214 | 214 | // because we don't know if the theme is using the_excerpt() |
| 215 | - add_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_details' ), 100, 1 ); |
|
| 215 | + add_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100, 1); |
|
| 216 | 216 | // or the_content |
| 217 | - add_filter( 'the_content', array( 'EED_Events_Archive', 'event_details' ), 100, 1 ); |
|
| 217 | + add_filter('the_content', array('EED_Events_Archive', 'event_details'), 100, 1); |
|
| 218 | 218 | // and just in case they are running get_the_excerpt() which DESTROYS things |
| 219 | - add_filter( 'get_the_excerpt', array( 'EED_Events_Archive', 'get_the_excerpt' ), 1, 1 ); |
|
| 219 | + add_filter('get_the_excerpt', array('EED_Events_Archive', 'get_the_excerpt'), 1, 1); |
|
| 220 | 220 | // don't display entry meta because the existing theme will take care of that |
| 221 | - add_filter( 'FHEE__content_espresso_events_details_template__display_entry_meta', '__return_false' ); |
|
| 221 | + add_filter('FHEE__content_espresso_events_details_template__display_entry_meta', '__return_false'); |
|
| 222 | 222 | } |
| 223 | 223 | } |
| 224 | 224 | return $template; |
@@ -233,14 +233,14 @@ discard block |
||
| 233 | 233 | * @param string $excerpt |
| 234 | 234 | * @return string |
| 235 | 235 | */ |
| 236 | - public static function get_the_excerpt( $excerpt = '' ) { |
|
| 237 | - if ( post_password_required() ) { |
|
| 236 | + public static function get_the_excerpt($excerpt = '') { |
|
| 237 | + if (post_password_required()) { |
|
| 238 | 238 | return $excerpt; |
| 239 | 239 | } |
| 240 | - if ( apply_filters( 'FHEE__EED_Events_Archive__get_the_excerpt__theme_uses_get_the_excerpt', false ) ) { |
|
| 241 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_details' ), 100 ); |
|
| 242 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_details' ), 100 ); |
|
| 243 | - $excerpt = EED_Events_Archive::event_details( $excerpt ); |
|
| 240 | + if (apply_filters('FHEE__EED_Events_Archive__get_the_excerpt__theme_uses_get_the_excerpt', false)) { |
|
| 241 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100); |
|
| 242 | + remove_filter('the_content', array('EED_Events_Archive', 'event_details'), 100); |
|
| 243 | + $excerpt = EED_Events_Archive::event_details($excerpt); |
|
| 244 | 244 | } |
| 245 | 245 | return $excerpt; |
| 246 | 246 | } |
@@ -255,10 +255,10 @@ discard block |
||
| 255 | 255 | * @param string $id |
| 256 | 256 | * @return string |
| 257 | 257 | */ |
| 258 | - public static function the_title( $title = '', $id = '' ) { |
|
| 258 | + public static function the_title($title = '', $id = '') { |
|
| 259 | 259 | global $post; |
| 260 | - if ( $post instanceof WP_Post ) { |
|
| 261 | - return in_the_loop() && $post->ID == $id ? espresso_event_status_banner( $post->ID ) . $title : $title; |
|
| 260 | + if ($post instanceof WP_Post) { |
|
| 261 | + return in_the_loop() && $post->ID == $id ? espresso_event_status_banner($post->ID).$title : $title; |
|
| 262 | 262 | } |
| 263 | 263 | return $title; |
| 264 | 264 | } |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | * @param string $content |
| 273 | 273 | * @return string |
| 274 | 274 | */ |
| 275 | - public static function event_details( $content ) { |
|
| 275 | + public static function event_details($content) { |
|
| 276 | 276 | global $post; |
| 277 | 277 | static $current_post_ID = 0; |
| 278 | 278 | if ( |
@@ -280,8 +280,8 @@ discard block |
||
| 280 | 280 | $post->post_type == 'espresso_events' && |
| 281 | 281 | ! post_password_required() && |
| 282 | 282 | ( |
| 283 | - apply_filters( 'FHEE__EES_Espresso_Events__process_shortcode__true', false ) |
|
| 284 | - || ! apply_filters( 'FHEE__content_espresso_events__template_loaded', false ) |
|
| 283 | + apply_filters('FHEE__EES_Espresso_Events__process_shortcode__true', false) |
|
| 284 | + || ! apply_filters('FHEE__content_espresso_events__template_loaded', false) |
|
| 285 | 285 | ) |
| 286 | 286 | ) { |
| 287 | 287 | // Set current post ID to prevent showing content twice, but only if headers have definitely been sent. |
@@ -290,8 +290,8 @@ discard block |
||
| 290 | 290 | // We want to allow those plugins to still do their thing and have access to our content, but depending on |
| 291 | 291 | // how your event content is being displayed (shortcode, CPT route, etc), this filter can get applied twice, |
| 292 | 292 | // so the following allows this filter to be applied multiple times, but only once for real |
| 293 | - $current_post_ID = did_action( 'loop_start' ) ? $post->ID : 0; |
|
| 294 | - if ( EE_Registry::instance()->CFG->template_settings->EED_Events_Archive->use_sortable_display_order ) { |
|
| 293 | + $current_post_ID = did_action('loop_start') ? $post->ID : 0; |
|
| 294 | + if (EE_Registry::instance()->CFG->template_settings->EED_Events_Archive->use_sortable_display_order) { |
|
| 295 | 295 | $content = \EED_Events_Archive::use_sortable_display_order(); |
| 296 | 296 | } else { |
| 297 | 297 | $content = \EED_Events_Archive::use_filterable_display_order(); |
@@ -310,20 +310,20 @@ discard block |
||
| 310 | 310 | */ |
| 311 | 311 | protected static function use_sortable_display_order() { |
| 312 | 312 | // no further password checks required atm |
| 313 | - add_filter( 'FHEE__EED_Events_Archive__event_details__no_post_password_required', '__return_true' ); |
|
| 313 | + add_filter('FHEE__EED_Events_Archive__event_details__no_post_password_required', '__return_true'); |
|
| 314 | 314 | // we need to first remove this callback from being applied to the_content() or the_excerpt() (otherwise it will recurse and blow up the interweb) |
| 315 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_details' ), 100 ); |
|
| 316 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_details' ), 100 ); |
|
| 317 | - remove_filter( 'get_the_excerpt', array( 'EED_Events_Archive', 'get_the_excerpt' ), 1 ); |
|
| 315 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100); |
|
| 316 | + remove_filter('the_content', array('EED_Events_Archive', 'event_details'), 100); |
|
| 317 | + remove_filter('get_the_excerpt', array('EED_Events_Archive', 'get_the_excerpt'), 1); |
|
| 318 | 318 | // now add additional content depending on whether event is using the_excerpt() or the_content() |
| 319 | 319 | EED_Events_Archive::instance()->template_parts = EED_Events_Archive::instance()->initialize_template_parts(); |
| 320 | - $content = EEH_Template::locate_template( 'content-espresso_events-details.php' ); |
|
| 321 | - $content = EED_Events_Archive::instance()->template_parts->apply_template_part_filters( $content ); |
|
| 320 | + $content = EEH_Template::locate_template('content-espresso_events-details.php'); |
|
| 321 | + $content = EED_Events_Archive::instance()->template_parts->apply_template_part_filters($content); |
|
| 322 | 322 | // re-add our main filters (or else the next event won't have them) |
| 323 | - add_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_details' ), 100, 1 ); |
|
| 324 | - add_filter( 'the_content', array( 'EED_Events_Archive', 'event_details' ), 100, 1 ); |
|
| 325 | - add_filter( 'get_the_excerpt', array( 'EED_Events_Archive', 'get_the_excerpt' ), 1, 1 ); |
|
| 326 | - remove_filter( 'FHEE__EED_Events_Archive__event_details__no_post_password_required', '__return_true' ); |
|
| 323 | + add_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100, 1); |
|
| 324 | + add_filter('the_content', array('EED_Events_Archive', 'event_details'), 100, 1); |
|
| 325 | + add_filter('get_the_excerpt', array('EED_Events_Archive', 'get_the_excerpt'), 1, 1); |
|
| 326 | + remove_filter('FHEE__EED_Events_Archive__event_details__no_post_password_required', '__return_true'); |
|
| 327 | 327 | return $content; |
| 328 | 328 | } |
| 329 | 329 | |
@@ -338,22 +338,22 @@ discard block |
||
| 338 | 338 | protected static function use_filterable_display_order() { |
| 339 | 339 | // we need to first remove this callback from being applied to the_content() |
| 340 | 340 | // (otherwise it will recurse and blow up the interweb) |
| 341 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_details' ), 100 ); |
|
| 342 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_details' ), 100 ); |
|
| 343 | - remove_filter( 'get_the_excerpt', array( 'EED_Events_Archive', 'get_the_excerpt' ), 1 ); |
|
| 341 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100); |
|
| 342 | + remove_filter('the_content', array('EED_Events_Archive', 'event_details'), 100); |
|
| 343 | + remove_filter('get_the_excerpt', array('EED_Events_Archive', 'get_the_excerpt'), 1); |
|
| 344 | 344 | //now add additional content depending on whether event is using the_excerpt() or the_content() |
| 345 | 345 | EED_Events_Archive::_add_additional_excerpt_filters(); |
| 346 | 346 | EED_Events_Archive::_add_additional_content_filters(); |
| 347 | - do_action( 'AHEE__EED_Events_Archive__use_filterable_display_order__after_add_filters' ); |
|
| 347 | + do_action('AHEE__EED_Events_Archive__use_filterable_display_order__after_add_filters'); |
|
| 348 | 348 | // now load our template |
| 349 | - $content = EEH_Template::locate_template( 'content-espresso_events-details.php' ); |
|
| 349 | + $content = EEH_Template::locate_template('content-espresso_events-details.php'); |
|
| 350 | 350 | // re-add our main filters (or else the next event won't have them) |
| 351 | - add_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_details' ), 100, 1 ); |
|
| 352 | - add_filter( 'the_content', array( 'EED_Events_Archive', 'event_details' ), 100, 1 ); |
|
| 353 | - add_filter( 'get_the_excerpt', array( 'EED_Events_Archive', 'get_the_excerpt' ), 1, 1 ); |
|
| 351 | + add_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100, 1); |
|
| 352 | + add_filter('the_content', array('EED_Events_Archive', 'event_details'), 100, 1); |
|
| 353 | + add_filter('get_the_excerpt', array('EED_Events_Archive', 'get_the_excerpt'), 1, 1); |
|
| 354 | 354 | // but remove the other filters so that they don't get applied to the next post |
| 355 | 355 | EED_Events_Archive::_remove_additional_events_archive_filters(); |
| 356 | - do_action( 'AHEE__EED_Events_Archive__use_filterable_display_order__after_remove_filters' ); |
|
| 356 | + do_action('AHEE__EED_Events_Archive__use_filterable_display_order__after_remove_filters'); |
|
| 357 | 357 | // we're not returning the $content directly because the template we are loading uses the_content (or the_excerpt) |
| 358 | 358 | //return ! empty( $template ) ? $template : $content; |
| 359 | 359 | return $content; |
@@ -368,11 +368,11 @@ discard block |
||
| 368 | 368 | * @param string $content |
| 369 | 369 | * @return string |
| 370 | 370 | */ |
| 371 | - public static function event_datetimes( $content ) { |
|
| 372 | - if ( post_password_required() ) { |
|
| 371 | + public static function event_datetimes($content) { |
|
| 372 | + if (post_password_required()) { |
|
| 373 | 373 | return $content; |
| 374 | 374 | } |
| 375 | - return EEH_Template::locate_template( 'content-espresso_events-datetimes.php' ) . $content; |
|
| 375 | + return EEH_Template::locate_template('content-espresso_events-datetimes.php').$content; |
|
| 376 | 376 | } |
| 377 | 377 | |
| 378 | 378 | /** |
@@ -382,11 +382,11 @@ discard block |
||
| 382 | 382 | * @param string $content |
| 383 | 383 | * @return string |
| 384 | 384 | */ |
| 385 | - public static function event_tickets( $content ) { |
|
| 386 | - if ( post_password_required() ) { |
|
| 385 | + public static function event_tickets($content) { |
|
| 386 | + if (post_password_required()) { |
|
| 387 | 387 | return $content; |
| 388 | 388 | } |
| 389 | - return EEH_Template::locate_template( 'content-espresso_events-tickets.php' ) . $content; |
|
| 389 | + return EEH_Template::locate_template('content-espresso_events-tickets.php').$content; |
|
| 390 | 390 | } |
| 391 | 391 | |
| 392 | 392 | |
@@ -398,8 +398,8 @@ discard block |
||
| 398 | 398 | * @param string $content |
| 399 | 399 | * @return string |
| 400 | 400 | */ |
| 401 | - public static function event_venue( $content ) { |
|
| 402 | - return EED_Events_Archive::event_venues( $content ); |
|
| 401 | + public static function event_venue($content) { |
|
| 402 | + return EED_Events_Archive::event_venues($content); |
|
| 403 | 403 | } |
| 404 | 404 | |
| 405 | 405 | /** |
@@ -409,11 +409,11 @@ discard block |
||
| 409 | 409 | * @param string $content |
| 410 | 410 | * @return string |
| 411 | 411 | */ |
| 412 | - public static function event_venues( $content ) { |
|
| 413 | - if ( post_password_required() ) { |
|
| 412 | + public static function event_venues($content) { |
|
| 413 | + if (post_password_required()) { |
|
| 414 | 414 | return $content; |
| 415 | 415 | } |
| 416 | - return $content . EEH_Template::locate_template( 'content-espresso_events-venues.php' ); |
|
| 416 | + return $content.EEH_Template::locate_template('content-espresso_events-venues.php'); |
|
| 417 | 417 | } |
| 418 | 418 | |
| 419 | 419 | |
@@ -425,9 +425,9 @@ discard block |
||
| 425 | 425 | * @return void |
| 426 | 426 | */ |
| 427 | 427 | private static function _add_additional_excerpt_filters() { |
| 428 | - add_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_datetimes' ), 110, 1 ); |
|
| 429 | - add_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_tickets' ), 120, 1 ); |
|
| 430 | - add_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_venues' ), 130, 1 ); |
|
| 428 | + add_filter('the_excerpt', array('EED_Events_Archive', 'event_datetimes'), 110, 1); |
|
| 429 | + add_filter('the_excerpt', array('EED_Events_Archive', 'event_tickets'), 120, 1); |
|
| 430 | + add_filter('the_excerpt', array('EED_Events_Archive', 'event_venues'), 130, 1); |
|
| 431 | 431 | } |
| 432 | 432 | |
| 433 | 433 | |
@@ -439,9 +439,9 @@ discard block |
||
| 439 | 439 | * @return void |
| 440 | 440 | */ |
| 441 | 441 | private static function _add_additional_content_filters() { |
| 442 | - add_filter( 'the_content', array( 'EED_Events_Archive', 'event_datetimes' ), 110, 1 ); |
|
| 443 | - add_filter( 'the_content', array( 'EED_Events_Archive', 'event_tickets' ), 120, 1 ); |
|
| 444 | - add_filter( 'the_content', array( 'EED_Events_Archive', 'event_venues' ), 130, 1 ); |
|
| 442 | + add_filter('the_content', array('EED_Events_Archive', 'event_datetimes'), 110, 1); |
|
| 443 | + add_filter('the_content', array('EED_Events_Archive', 'event_tickets'), 120, 1); |
|
| 444 | + add_filter('the_content', array('EED_Events_Archive', 'event_venues'), 130, 1); |
|
| 445 | 445 | } |
| 446 | 446 | |
| 447 | 447 | |
@@ -453,12 +453,12 @@ discard block |
||
| 453 | 453 | * @return void |
| 454 | 454 | */ |
| 455 | 455 | private static function _remove_additional_events_archive_filters() { |
| 456 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_datetimes' ), 110 ); |
|
| 457 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_tickets' ), 120 ); |
|
| 458 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_venues' ), 130 ); |
|
| 459 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_datetimes' ), 110 ); |
|
| 460 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_tickets' ), 120 ); |
|
| 461 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_venues' ), 130 ); |
|
| 456 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_datetimes'), 110); |
|
| 457 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_tickets'), 120); |
|
| 458 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_venues'), 130); |
|
| 459 | + remove_filter('the_content', array('EED_Events_Archive', 'event_datetimes'), 110); |
|
| 460 | + remove_filter('the_content', array('EED_Events_Archive', 'event_tickets'), 120); |
|
| 461 | + remove_filter('the_content', array('EED_Events_Archive', 'event_venues'), 130); |
|
| 462 | 462 | } |
| 463 | 463 | |
| 464 | 464 | |
@@ -471,17 +471,17 @@ discard block |
||
| 471 | 471 | */ |
| 472 | 472 | public static function remove_all_events_archive_filters() { |
| 473 | 473 | //remove_filter( 'get_the_excerpt', array( 'EED_Events_Archive', 'get_the_excerpt' ), 1 ); |
| 474 | - remove_filter( 'the_title', array( 'EED_Events_Archive', 'the_title' ), 100 ); |
|
| 475 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_details' ), 100 ); |
|
| 476 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_datetimes' ), 110 ); |
|
| 477 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_tickets' ), 120 ); |
|
| 478 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_venues' ), 130 ); |
|
| 479 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_details' ), 100 ); |
|
| 480 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_datetimes' ), 110 ); |
|
| 481 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_tickets' ), 120 ); |
|
| 482 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_venues' ), 130 ); |
|
| 474 | + remove_filter('the_title', array('EED_Events_Archive', 'the_title'), 100); |
|
| 475 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100); |
|
| 476 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_datetimes'), 110); |
|
| 477 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_tickets'), 120); |
|
| 478 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_venues'), 130); |
|
| 479 | + remove_filter('the_content', array('EED_Events_Archive', 'event_details'), 100); |
|
| 480 | + remove_filter('the_content', array('EED_Events_Archive', 'event_datetimes'), 110); |
|
| 481 | + remove_filter('the_content', array('EED_Events_Archive', 'event_tickets'), 120); |
|
| 482 | + remove_filter('the_content', array('EED_Events_Archive', 'event_venues'), 130); |
|
| 483 | 483 | // don't display entry meta because the existing theme will take care of that |
| 484 | - remove_filter( 'FHEE__content_espresso_events_details_template__display_entry_meta', '__return_false' ); |
|
| 484 | + remove_filter('FHEE__content_espresso_events_details_template__display_entry_meta', '__return_false'); |
|
| 485 | 485 | } |
| 486 | 486 | |
| 487 | 487 | |
@@ -496,15 +496,15 @@ discard block |
||
| 496 | 496 | * @return void |
| 497 | 497 | */ |
| 498 | 498 | public function load_event_list_assets() { |
| 499 | - do_action( 'AHEE__EED_Events_Archive__before_load_assets' ); |
|
| 500 | - add_filter( 'FHEE_load_EE_Session', '__return_true' ); |
|
| 501 | - add_filter( 'FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true' ); |
|
| 502 | - add_action('wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ), 10 ); |
|
| 503 | - if ( EE_Registry::instance()->CFG->map_settings->use_google_maps ) { |
|
| 504 | - EE_Registry::instance()->load_helper( 'Maps' ); |
|
| 505 | - add_action('wp_enqueue_scripts', array( 'EEH_Maps', 'espresso_google_map_js' ), 11 ); |
|
| 499 | + do_action('AHEE__EED_Events_Archive__before_load_assets'); |
|
| 500 | + add_filter('FHEE_load_EE_Session', '__return_true'); |
|
| 501 | + add_filter('FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true'); |
|
| 502 | + add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts'), 10); |
|
| 503 | + if (EE_Registry::instance()->CFG->map_settings->use_google_maps) { |
|
| 504 | + EE_Registry::instance()->load_helper('Maps'); |
|
| 505 | + add_action('wp_enqueue_scripts', array('EEH_Maps', 'espresso_google_map_js'), 11); |
|
| 506 | 506 | } |
| 507 | - EE_Registry::instance()->load_helper( 'Event_View' ); |
|
| 507 | + EE_Registry::instance()->load_helper('Event_View'); |
|
| 508 | 508 | } |
| 509 | 509 | |
| 510 | 510 | |
@@ -520,14 +520,14 @@ discard block |
||
| 520 | 520 | */ |
| 521 | 521 | public function wp_enqueue_scripts() { |
| 522 | 522 | // get some style |
| 523 | - if ( apply_filters( 'FHEE_enable_default_espresso_css', FALSE ) ) { |
|
| 523 | + if (apply_filters('FHEE_enable_default_espresso_css', FALSE)) { |
|
| 524 | 524 | // first check uploads folder |
| 525 | - EE_Registry::instance()->load_helper( 'File' ); |
|
| 526 | - if ( EEH_File::is_readable( get_stylesheet_directory() . $this->theme . DS . 'style.css' )) { |
|
| 527 | - wp_register_style( $this->theme, get_stylesheet_directory_uri() . $this->theme . DS . 'style.css', array( 'dashicons', 'espresso_default' )); |
|
| 525 | + EE_Registry::instance()->load_helper('File'); |
|
| 526 | + if (EEH_File::is_readable(get_stylesheet_directory().$this->theme.DS.'style.css')) { |
|
| 527 | + wp_register_style($this->theme, get_stylesheet_directory_uri().$this->theme.DS.'style.css', array('dashicons', 'espresso_default')); |
|
| 528 | 528 | } else { |
| 529 | 529 | } |
| 530 | - wp_enqueue_style( $this->theme ); |
|
| 530 | + wp_enqueue_style($this->theme); |
|
| 531 | 531 | |
| 532 | 532 | } |
| 533 | 533 | } |
@@ -545,8 +545,8 @@ discard block |
||
| 545 | 545 | */ |
| 546 | 546 | public static function template_settings_form() { |
| 547 | 547 | $template_settings = EE_Registry::instance()->CFG->template_settings; |
| 548 | - $template_settings->EED_Events_Archive = isset( $template_settings->EED_Events_Archive ) ? $template_settings->EED_Events_Archive : new EE_Events_Archive_Config(); |
|
| 549 | - $template_settings->EED_Events_Archive = apply_filters( 'FHEE__EED_Events_Archive__template_settings_form__event_list_config', $template_settings->EED_Events_Archive ); |
|
| 548 | + $template_settings->EED_Events_Archive = isset($template_settings->EED_Events_Archive) ? $template_settings->EED_Events_Archive : new EE_Events_Archive_Config(); |
|
| 549 | + $template_settings->EED_Events_Archive = apply_filters('FHEE__EED_Events_Archive__template_settings_form__event_list_config', $template_settings->EED_Events_Archive); |
|
| 550 | 550 | $events_archive_settings = array( |
| 551 | 551 | 'display_status_banner' => 0, |
| 552 | 552 | 'display_description' => 1, |
@@ -555,8 +555,8 @@ discard block |
||
| 555 | 555 | 'display_venue' => 0, |
| 556 | 556 | 'display_expired_events' => 0 |
| 557 | 557 | ); |
| 558 | - $events_archive_settings = array_merge( $events_archive_settings, (array)$template_settings->EED_Events_Archive ); |
|
| 559 | - EEH_Template::display_template( EVENTS_ARCHIVE_TEMPLATES_PATH . 'admin-event-list-settings.template.php', $events_archive_settings ); |
|
| 558 | + $events_archive_settings = array_merge($events_archive_settings, (array) $template_settings->EED_Events_Archive); |
|
| 559 | + EEH_Template::display_template(EVENTS_ARCHIVE_TEMPLATES_PATH.'admin-event-list-settings.template.php', $events_archive_settings); |
|
| 560 | 560 | } |
| 561 | 561 | |
| 562 | 562 | |
@@ -572,16 +572,16 @@ discard block |
||
| 572 | 572 | * @param EE_Request_Handler $REQ |
| 573 | 573 | * @return EE_Template_Config |
| 574 | 574 | */ |
| 575 | - public static function update_template_settings( $CFG, $REQ ) { |
|
| 575 | + public static function update_template_settings($CFG, $REQ) { |
|
| 576 | 576 | $CFG->EED_Events_Archive = new EE_Events_Archive_Config(); |
| 577 | 577 | // unless we are resetting the config... |
| 578 | - if ( ! isset( $REQ['EED_Events_Archive_reset_event_list_settings'] ) || absint( $REQ['EED_Events_Archive_reset_event_list_settings'] ) !== 1 ) { |
|
| 579 | - $CFG->EED_Events_Archive->display_status_banner = isset( $REQ['EED_Events_Archive_display_status_banner'] ) ? absint( $REQ['EED_Events_Archive_display_status_banner'] ) : 0; |
|
| 580 | - $CFG->EED_Events_Archive->display_description = isset( $REQ['EED_Events_Archive_display_description'] ) ? absint( $REQ['EED_Events_Archive_display_description'] ) : 1; |
|
| 581 | - $CFG->EED_Events_Archive->display_ticket_selector = isset( $REQ['EED_Events_Archive_display_ticket_selector'] ) ? absint( $REQ['EED_Events_Archive_display_ticket_selector'] ) : 0; |
|
| 582 | - $CFG->EED_Events_Archive->display_datetimes = isset( $REQ['EED_Events_Archive_display_datetimes'] ) ? absint( $REQ['EED_Events_Archive_display_datetimes'] ) : 1; |
|
| 583 | - $CFG->EED_Events_Archive->display_venue = isset( $REQ['EED_Events_Archive_display_venue'] ) ? absint( $REQ['EED_Events_Archive_display_venue'] ) : 0; |
|
| 584 | - $CFG->EED_Events_Archive->display_expired_events = isset( $REQ['EED_Events_Archive_display_expired_events'] ) ? absint( $REQ['EED_Events_Archive_display_expired_events'] ) : 0; } |
|
| 578 | + if ( ! isset($REQ['EED_Events_Archive_reset_event_list_settings']) || absint($REQ['EED_Events_Archive_reset_event_list_settings']) !== 1) { |
|
| 579 | + $CFG->EED_Events_Archive->display_status_banner = isset($REQ['EED_Events_Archive_display_status_banner']) ? absint($REQ['EED_Events_Archive_display_status_banner']) : 0; |
|
| 580 | + $CFG->EED_Events_Archive->display_description = isset($REQ['EED_Events_Archive_display_description']) ? absint($REQ['EED_Events_Archive_display_description']) : 1; |
|
| 581 | + $CFG->EED_Events_Archive->display_ticket_selector = isset($REQ['EED_Events_Archive_display_ticket_selector']) ? absint($REQ['EED_Events_Archive_display_ticket_selector']) : 0; |
|
| 582 | + $CFG->EED_Events_Archive->display_datetimes = isset($REQ['EED_Events_Archive_display_datetimes']) ? absint($REQ['EED_Events_Archive_display_datetimes']) : 1; |
|
| 583 | + $CFG->EED_Events_Archive->display_venue = isset($REQ['EED_Events_Archive_display_venue']) ? absint($REQ['EED_Events_Archive_display_venue']) : 0; |
|
| 584 | + $CFG->EED_Events_Archive->display_expired_events = isset($REQ['EED_Events_Archive_display_expired_events']) ? absint($REQ['EED_Events_Archive_display_expired_events']) : 0; } |
|
| 585 | 585 | return $CFG; |
| 586 | 586 | } |
| 587 | 587 | |
@@ -594,10 +594,10 @@ discard block |
||
| 594 | 594 | * @param string $extra_class |
| 595 | 595 | * @return string |
| 596 | 596 | */ |
| 597 | - public static function event_list_css( $extra_class = '' ) { |
|
| 598 | - $event_list_css = ! empty( $extra_class ) ? array( $extra_class ) : array(); |
|
| 597 | + public static function event_list_css($extra_class = '') { |
|
| 598 | + $event_list_css = ! empty($extra_class) ? array($extra_class) : array(); |
|
| 599 | 599 | $event_list_css[] = 'espresso-event-list-event'; |
| 600 | - return implode( ' ', $event_list_css ); |
|
| 600 | + return implode(' ', $event_list_css); |
|
| 601 | 601 | } |
| 602 | 602 | |
| 603 | 603 | |
@@ -624,9 +624,9 @@ discard block |
||
| 624 | 624 | * @param $value |
| 625 | 625 | * @return bool |
| 626 | 626 | */ |
| 627 | - public static function display_description( $value ) { |
|
| 627 | + public static function display_description($value) { |
|
| 628 | 628 | $config = EE_Registry::instance()->CFG->template_settings->EED_Events_Archive; |
| 629 | - $display_description= isset( $config->display_description ) ? $config->display_description : 1; |
|
| 629 | + $display_description = isset($config->display_description) ? $config->display_description : 1; |
|
| 630 | 630 | return $display_description === $value ? TRUE : FALSE; |
| 631 | 631 | } |
| 632 | 632 | |
@@ -639,7 +639,7 @@ discard block |
||
| 639 | 639 | */ |
| 640 | 640 | public static function display_ticket_selector() { |
| 641 | 641 | $config = EE_Registry::instance()->CFG->template_settings->EED_Events_Archive; |
| 642 | - return isset( $config->display_ticket_selector ) && $config->display_ticket_selector ? TRUE : FALSE; |
|
| 642 | + return isset($config->display_ticket_selector) && $config->display_ticket_selector ? TRUE : FALSE; |
|
| 643 | 643 | } |
| 644 | 644 | |
| 645 | 645 | |
@@ -651,9 +651,9 @@ discard block |
||
| 651 | 651 | * @return bool |
| 652 | 652 | */ |
| 653 | 653 | public static function display_venue() { |
| 654 | - EE_Registry::instance()->load_helper( 'Venue_View' ); |
|
| 654 | + EE_Registry::instance()->load_helper('Venue_View'); |
|
| 655 | 655 | $config = EE_Registry::instance()->CFG->template_settings->EED_Events_Archive; |
| 656 | - return isset( $config->display_venue ) && $config->display_venue && EEH_Venue_View::venue_name() ? TRUE : FALSE; |
|
| 656 | + return isset($config->display_venue) && $config->display_venue && EEH_Venue_View::venue_name() ? TRUE : FALSE; |
|
| 657 | 657 | } |
| 658 | 658 | |
| 659 | 659 | |
@@ -665,7 +665,7 @@ discard block |
||
| 665 | 665 | */ |
| 666 | 666 | public static function display_datetimes() { |
| 667 | 667 | $config = EE_Registry::instance()->CFG->template_settings->EED_Events_Archive; |
| 668 | - return isset( $config->display_datetimes ) && $config->display_datetimes ? TRUE : FALSE; |
|
| 668 | + return isset($config->display_datetimes) && $config->display_datetimes ? TRUE : FALSE; |
|
| 669 | 669 | } |
| 670 | 670 | |
| 671 | 671 | |
@@ -680,7 +680,7 @@ discard block |
||
| 680 | 680 | * @return string |
| 681 | 681 | */ |
| 682 | 682 | public static function event_list_title() { |
| 683 | - return apply_filters( 'FHEE__archive_espresso_events_template__upcoming_events_h1', __( 'Upcoming Events', 'event_espresso' )); |
|
| 683 | + return apply_filters('FHEE__archive_espresso_events_template__upcoming_events_h1', __('Upcoming Events', 'event_espresso')); |
|
| 684 | 684 | } |
| 685 | 685 | |
| 686 | 686 | |
@@ -689,11 +689,11 @@ discard block |
||
| 689 | 689 | /** |
| 690 | 690 | * @since 4.4.0 |
| 691 | 691 | */ |
| 692 | - public static function _doing_it_wrong_notice( $function = '' ) { |
|
| 692 | + public static function _doing_it_wrong_notice($function = '') { |
|
| 693 | 693 | EE_Error::doing_it_wrong( |
| 694 | 694 | __FUNCTION__, |
| 695 | 695 | sprintf( |
| 696 | - __( 'EED_Events_Archive::%1$s was moved to EEH_Event_Query::%1$s:%2$sPlease update your existing code because the method it calls will be removed in version %3$s', 'event_espresso' ), |
|
| 696 | + __('EED_Events_Archive::%1$s was moved to EEH_Event_Query::%1$s:%2$sPlease update your existing code because the method it calls will be removed in version %3$s', 'event_espresso'), |
|
| 697 | 697 | $function, |
| 698 | 698 | '<br />', |
| 699 | 699 | '4.6.0' |
@@ -709,107 +709,107 @@ discard block |
||
| 709 | 709 | * @since 4.4.0 |
| 710 | 710 | */ |
| 711 | 711 | public function get_post_data() { |
| 712 | - EE_Registry::instance()->load_helper( 'Event_Query' ); |
|
| 712 | + EE_Registry::instance()->load_helper('Event_Query'); |
|
| 713 | 713 | EEH_Event_Query::set_query_params(); |
| 714 | 714 | } |
| 715 | 715 | /** |
| 716 | 716 | * @deprecated |
| 717 | 717 | * @since 4.4.0 |
| 718 | 718 | */ |
| 719 | - public function posts_fields( $SQL, WP_Query $wp_query ) { |
|
| 720 | - EE_Registry::instance()->load_helper( 'Event_Query' ); |
|
| 721 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
| 722 | - return EEH_Event_Query::posts_fields( $SQL, $wp_query ); |
|
| 719 | + public function posts_fields($SQL, WP_Query $wp_query) { |
|
| 720 | + EE_Registry::instance()->load_helper('Event_Query'); |
|
| 721 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
| 722 | + return EEH_Event_Query::posts_fields($SQL, $wp_query); |
|
| 723 | 723 | } |
| 724 | 724 | /** |
| 725 | 725 | * @deprecated |
| 726 | 726 | * @since 4.4.0 |
| 727 | 727 | */ |
| 728 | - public static function posts_fields_sql_for_orderby( $orderby_params = array() ) { |
|
| 729 | - EE_Registry::instance()->load_helper( 'Event_Query' ); |
|
| 730 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
| 731 | - return EEH_Event_Query::posts_fields_sql_for_orderby( $orderby_params ); |
|
| 728 | + public static function posts_fields_sql_for_orderby($orderby_params = array()) { |
|
| 729 | + EE_Registry::instance()->load_helper('Event_Query'); |
|
| 730 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
| 731 | + return EEH_Event_Query::posts_fields_sql_for_orderby($orderby_params); |
|
| 732 | 732 | } |
| 733 | 733 | /** |
| 734 | 734 | * @deprecated |
| 735 | 735 | * @since 4.4.0 |
| 736 | 736 | */ |
| 737 | - public function posts_join( $SQL, WP_Query $wp_query ) { |
|
| 738 | - EE_Registry::instance()->load_helper( 'Event_Query' ); |
|
| 739 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
| 740 | - return EEH_Event_Query::posts_join( $SQL, $wp_query ); |
|
| 737 | + public function posts_join($SQL, WP_Query $wp_query) { |
|
| 738 | + EE_Registry::instance()->load_helper('Event_Query'); |
|
| 739 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
| 740 | + return EEH_Event_Query::posts_join($SQL, $wp_query); |
|
| 741 | 741 | } |
| 742 | 742 | /** |
| 743 | 743 | * @deprecated |
| 744 | 744 | * @since 4.4.0 |
| 745 | 745 | */ |
| 746 | - public static function posts_join_sql_for_terms( $join_terms = NULL ) { |
|
| 747 | - EE_Registry::instance()->load_helper( 'Event_Query' ); |
|
| 748 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
| 749 | - return EEH_Event_Query::posts_join_sql_for_terms( $join_terms ); |
|
| 746 | + public static function posts_join_sql_for_terms($join_terms = NULL) { |
|
| 747 | + EE_Registry::instance()->load_helper('Event_Query'); |
|
| 748 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
| 749 | + return EEH_Event_Query::posts_join_sql_for_terms($join_terms); |
|
| 750 | 750 | } |
| 751 | 751 | /** |
| 752 | 752 | * @deprecated |
| 753 | 753 | * @since 4.4.0 |
| 754 | 754 | */ |
| 755 | - public static function posts_join_for_orderby( $orderby_params = array() ) { |
|
| 756 | - EE_Registry::instance()->load_helper( 'Event_Query' ); |
|
| 757 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
| 758 | - return EEH_Event_Query::posts_join_for_orderby( $orderby_params ); |
|
| 755 | + public static function posts_join_for_orderby($orderby_params = array()) { |
|
| 756 | + EE_Registry::instance()->load_helper('Event_Query'); |
|
| 757 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
| 758 | + return EEH_Event_Query::posts_join_for_orderby($orderby_params); |
|
| 759 | 759 | } |
| 760 | 760 | /** |
| 761 | 761 | * @deprecated |
| 762 | 762 | * @since 4.4.0 |
| 763 | 763 | */ |
| 764 | - public function posts_where( $SQL, WP_Query $wp_query ) { |
|
| 765 | - EE_Registry::instance()->load_helper( 'Event_Query' ); |
|
| 766 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
| 767 | - return EEH_Event_Query::posts_where( $SQL, $wp_query ); |
|
| 764 | + public function posts_where($SQL, WP_Query $wp_query) { |
|
| 765 | + EE_Registry::instance()->load_helper('Event_Query'); |
|
| 766 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
| 767 | + return EEH_Event_Query::posts_where($SQL, $wp_query); |
|
| 768 | 768 | } |
| 769 | 769 | /** |
| 770 | 770 | * @deprecated |
| 771 | 771 | * @since 4.4.0 |
| 772 | 772 | */ |
| 773 | - public static function posts_where_sql_for_show_expired( $show_expired = FALSE ) { |
|
| 774 | - EE_Registry::instance()->load_helper( 'Event_Query' ); |
|
| 775 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
| 776 | - return EEH_Event_Query::posts_where_sql_for_show_expired( $show_expired ); |
|
| 773 | + public static function posts_where_sql_for_show_expired($show_expired = FALSE) { |
|
| 774 | + EE_Registry::instance()->load_helper('Event_Query'); |
|
| 775 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
| 776 | + return EEH_Event_Query::posts_where_sql_for_show_expired($show_expired); |
|
| 777 | 777 | } |
| 778 | 778 | /** |
| 779 | 779 | * @deprecated |
| 780 | 780 | * @since 4.4.0 |
| 781 | 781 | */ |
| 782 | - public static function posts_where_sql_for_event_category_slug( $event_category_slug = NULL ) { |
|
| 783 | - EE_Registry::instance()->load_helper( 'Event_Query' ); |
|
| 784 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
| 785 | - return EEH_Event_Query::posts_where_sql_for_event_category_slug( $event_category_slug ); |
|
| 782 | + public static function posts_where_sql_for_event_category_slug($event_category_slug = NULL) { |
|
| 783 | + EE_Registry::instance()->load_helper('Event_Query'); |
|
| 784 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
| 785 | + return EEH_Event_Query::posts_where_sql_for_event_category_slug($event_category_slug); |
|
| 786 | 786 | } |
| 787 | 787 | /** |
| 788 | 788 | * @deprecated |
| 789 | 789 | * @since 4.4.0 |
| 790 | 790 | */ |
| 791 | - public static function posts_where_sql_for_event_list_month( $month = NULL ) { |
|
| 792 | - EE_Registry::instance()->load_helper( 'Event_Query' ); |
|
| 793 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
| 794 | - return EEH_Event_Query::posts_where_sql_for_event_list_month( $month ); |
|
| 791 | + public static function posts_where_sql_for_event_list_month($month = NULL) { |
|
| 792 | + EE_Registry::instance()->load_helper('Event_Query'); |
|
| 793 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
| 794 | + return EEH_Event_Query::posts_where_sql_for_event_list_month($month); |
|
| 795 | 795 | } |
| 796 | 796 | /** |
| 797 | 797 | * @deprecated |
| 798 | 798 | * @since 4.4.0 |
| 799 | 799 | */ |
| 800 | - public function posts_orderby( $SQL, WP_Query $wp_query ) { |
|
| 801 | - EE_Registry::instance()->load_helper( 'Event_Query' ); |
|
| 802 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
| 803 | - return EEH_Event_Query::posts_orderby( $SQL, $wp_query ); |
|
| 800 | + public function posts_orderby($SQL, WP_Query $wp_query) { |
|
| 801 | + EE_Registry::instance()->load_helper('Event_Query'); |
|
| 802 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
| 803 | + return EEH_Event_Query::posts_orderby($SQL, $wp_query); |
|
| 804 | 804 | } |
| 805 | 805 | /** |
| 806 | 806 | * @deprecated |
| 807 | 807 | * @since 4.4.0 |
| 808 | 808 | */ |
| 809 | - public static function posts_orderby_sql( $orderby_params = array(), $sort = 'ASC' ) { |
|
| 810 | - EE_Registry::instance()->load_helper( 'Event_Query' ); |
|
| 811 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
| 812 | - return EEH_Event_Query::posts_orderby_sql( $orderby_params, $sort ); |
|
| 809 | + public static function posts_orderby_sql($orderby_params = array(), $sort = 'ASC') { |
|
| 810 | + EE_Registry::instance()->load_helper('Event_Query'); |
|
| 811 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
| 812 | + return EEH_Event_Query::posts_orderby_sql($orderby_params, $sort); |
|
| 813 | 813 | } |
| 814 | 814 | |
| 815 | 815 | |
@@ -840,8 +840,8 @@ discard block |
||
| 840 | 840 | * @param string $extra_class |
| 841 | 841 | * @return string |
| 842 | 842 | */ |
| 843 | -function espresso_event_list_css( $extra_class = '' ) { |
|
| 844 | - return EED_Events_Archive::event_list_css( $extra_class ); |
|
| 843 | +function espresso_event_list_css($extra_class = '') { |
|
| 844 | + return EED_Events_Archive::event_list_css($extra_class); |
|
| 845 | 845 | } |
| 846 | 846 | |
| 847 | 847 | /** |
@@ -855,14 +855,14 @@ discard block |
||
| 855 | 855 | * @return bool |
| 856 | 856 | */ |
| 857 | 857 | function espresso_display_full_description_in_event_list() { |
| 858 | - return EED_Events_Archive::display_description( 2 ); |
|
| 858 | + return EED_Events_Archive::display_description(2); |
|
| 859 | 859 | } |
| 860 | 860 | |
| 861 | 861 | /** |
| 862 | 862 | * @return bool |
| 863 | 863 | */ |
| 864 | 864 | function espresso_display_excerpt_in_event_list() { |
| 865 | - return EED_Events_Archive::display_description( 1 ); |
|
| 865 | + return EED_Events_Archive::display_description(1); |
|
| 866 | 866 | } |
| 867 | 867 | |
| 868 | 868 | /** |
@@ -21,22 +21,22 @@ discard block |
||
| 21 | 21 | * and/or use any of the template tags functions found in: |
| 22 | 22 | * \wp-content\plugins\event-espresso-core\public\template_tags.php |
| 23 | 23 | ************************** IMPORTANT **************************/ |
| 24 | -add_filter( 'FHEE__content_espresso_events__template_loaded', '__return_false' ); |
|
| 24 | +add_filter('FHEE__content_espresso_events__template_loaded', '__return_false'); |
|
| 25 | 25 | |
| 26 | 26 | //echo '<br/><h6 style="color:#2EA2CC;">'. __FILE__ . ' <span style="font-weight:normal;color:#E76700"> Line #: ' . __LINE__ . '</span></h6>'; |
| 27 | 27 | |
| 28 | 28 | global $post; |
| 29 | -$event_class = has_excerpt( $post->ID ) ? ' has-excerpt' : ''; |
|
| 30 | -$event_class = apply_filters( 'FHEE__content_espresso_events__event_class', $event_class ); |
|
| 29 | +$event_class = has_excerpt($post->ID) ? ' has-excerpt' : ''; |
|
| 30 | +$event_class = apply_filters('FHEE__content_espresso_events__event_class', $event_class); |
|
| 31 | 31 | ?> |
| 32 | -<?php do_action( 'AHEE_event_details_before_post', $post ); ?> |
|
| 33 | -<article id="post-<?php the_ID(); ?>" <?php post_class( $event_class ); ?>> |
|
| 32 | +<?php do_action('AHEE_event_details_before_post', $post); ?> |
|
| 33 | +<article id="post-<?php the_ID(); ?>" <?php post_class($event_class); ?>> |
|
| 34 | 34 | |
| 35 | -<?php if ( is_single() ) : ?> |
|
| 35 | +<?php if (is_single()) : ?> |
|
| 36 | 36 | |
| 37 | - <div id="espresso-event-header-dv-<?php echo $post->ID;?>" class="espresso-event-header-dv"> |
|
| 38 | - <?php espresso_get_template_part( 'content', 'espresso_events-thumbnail' ); ?> |
|
| 39 | - <?php espresso_get_template_part( 'content', 'espresso_events-header' ); ?> |
|
| 37 | + <div id="espresso-event-header-dv-<?php echo $post->ID; ?>" class="espresso-event-header-dv"> |
|
| 38 | + <?php espresso_get_template_part('content', 'espresso_events-thumbnail'); ?> |
|
| 39 | + <?php espresso_get_template_part('content', 'espresso_events-header'); ?> |
|
| 40 | 40 | </div> |
| 41 | 41 | |
| 42 | 42 | <div class="espresso-event-wrapper-dv"> |
@@ -46,16 +46,16 @@ discard block |
||
| 46 | 46 | <?php //espresso_get_template_part( 'content', 'espresso_events-details' ); ?> |
| 47 | 47 | <?php //espresso_get_template_part( 'content', 'espresso_events-venues' ); ?> |
| 48 | 48 | <footer class="event-meta"> |
| 49 | - <?php do_action( 'AHEE_event_details_footer_top', $post ); ?> |
|
| 50 | - <?php do_action( 'AHEE_event_details_footer_bottom', $post ); ?> |
|
| 49 | + <?php do_action('AHEE_event_details_footer_top', $post); ?> |
|
| 50 | + <?php do_action('AHEE_event_details_footer_bottom', $post); ?> |
|
| 51 | 51 | </footer> |
| 52 | 52 | </div> |
| 53 | 53 | |
| 54 | -<?php elseif ( is_archive() ) : ?> |
|
| 54 | +<?php elseif (is_archive()) : ?> |
|
| 55 | 55 | |
| 56 | - <div id="espresso-event-list-header-dv-<?php echo $post->ID;?>" class="espresso-event-header-dv"> |
|
| 57 | - <?php espresso_get_template_part( 'content', 'espresso_events-thumbnail' ); ?> |
|
| 58 | - <?php espresso_get_template_part( 'content', 'espresso_events-header' ); ?> |
|
| 56 | + <div id="espresso-event-list-header-dv-<?php echo $post->ID; ?>" class="espresso-event-header-dv"> |
|
| 57 | + <?php espresso_get_template_part('content', 'espresso_events-thumbnail'); ?> |
|
| 58 | + <?php espresso_get_template_part('content', 'espresso_events-header'); ?> |
|
| 59 | 59 | </div> |
| 60 | 60 | |
| 61 | 61 | <div class="espresso-event-list-wrapper-dv"> |
@@ -70,5 +70,5 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | </article> |
| 72 | 72 | <!-- #post --> |
| 73 | -<?php do_action( 'AHEE_event_details_after_post', $post ); |
|
| 73 | +<?php do_action('AHEE_event_details_after_post', $post); |
|
| 74 | 74 | |
@@ -1,14 +1,14 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * This template will display a single event - copy it to your theme folder |
|
| 4 | - * |
|
| 5 | - * @ package Event Espresso |
|
| 6 | - * @ author Seth Shoultes |
|
| 7 | - * @ copyright (c) 2008-2013 Event Espresso All Rights Reserved. |
|
| 8 | - * @ license http://eventespresso.com/support/terms-conditions/ * see Plugin Licensing * |
|
| 9 | - * @ link http://www.eventespresso.com |
|
| 10 | - * @ version 4+ |
|
| 11 | - */ |
|
| 3 | + * This template will display a single event - copy it to your theme folder |
|
| 4 | + * |
|
| 5 | + * @ package Event Espresso |
|
| 6 | + * @ author Seth Shoultes |
|
| 7 | + * @ copyright (c) 2008-2013 Event Espresso All Rights Reserved. |
|
| 8 | + * @ license http://eventespresso.com/support/terms-conditions/ * see Plugin Licensing * |
|
| 9 | + * @ link http://www.eventespresso.com |
|
| 10 | + * @ version 4+ |
|
| 11 | + */ |
|
| 12 | 12 | |
| 13 | 13 | /*************************** IMPORTANT ************************* |
| 14 | 14 | * if you are creating a custom template based on this file, |
@@ -1,54 +1,54 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | //echo '<br/><h6 style="color:#2EA2CC;">'. __FILE__ . ' <span style="font-weight:normal;color:#E76700"> Line #: ' . __LINE__ . '</span></h6>'; |
| 3 | -if (( is_single() && espresso_display_venue_in_event_details() ) || ( is_archive() && espresso_display_venue_in_event_list() ) ) : |
|
| 3 | +if ((is_single() && espresso_display_venue_in_event_details()) || (is_archive() && espresso_display_venue_in_event_list())) : |
|
| 4 | 4 | global $post; |
| 5 | - do_action( 'AHEE_event_details_before_venue_details', $post ); |
|
| 6 | - $venue_name = espresso_venue_name( 0, 'details', FALSE ); |
|
| 7 | - if ( empty( $venue_name ) && espresso_is_venue_private() ) { |
|
| 8 | - do_action( 'AHEE_event_details_after_venue_details', $post ); |
|
| 5 | + do_action('AHEE_event_details_before_venue_details', $post); |
|
| 6 | + $venue_name = espresso_venue_name(0, 'details', FALSE); |
|
| 7 | + if (empty($venue_name) && espresso_is_venue_private()) { |
|
| 8 | + do_action('AHEE_event_details_after_venue_details', $post); |
|
| 9 | 9 | return ''; |
| 10 | 10 | } |
| 11 | 11 | ?> |
| 12 | 12 | |
| 13 | 13 | <div class="espresso-venue-dv<?php echo espresso_is_venue_private() ? ' espresso-private-venue-dv' : ''; ?>"> |
| 14 | 14 | <h3 class="event-venues-h3 ee-event-h3"> |
| 15 | - <?php _e( 'Location', 'event_espresso' ); ?> |
|
| 15 | + <?php _e('Location', 'event_espresso'); ?> |
|
| 16 | 16 | </h3> |
| 17 | - <h4><strong><?php _e( 'Venue:', 'event_espresso' ); ?></strong> <strong> <?php echo $venue_name; ?></strong></h4> |
|
| 17 | + <h4><strong><?php _e('Venue:', 'event_espresso'); ?></strong> <strong> <?php echo $venue_name; ?></strong></h4> |
|
| 18 | 18 | <p><span class="smaller-text tags-links"><?php echo espresso_venue_categories(); ?></span></p> |
| 19 | -<?php if ( $venue_phone = espresso_venue_phone( $post->ID, FALSE )) : ?> |
|
| 19 | +<?php if ($venue_phone = espresso_venue_phone($post->ID, FALSE)) : ?> |
|
| 20 | 20 | <p> |
| 21 | - <span class="small-text"><strong><?php _e( 'Venue Phone:', 'event_espresso' ); ?></strong></span> <?php echo $venue_phone; ?> |
|
| 21 | + <span class="small-text"><strong><?php _e('Venue Phone:', 'event_espresso'); ?></strong></span> <?php echo $venue_phone; ?> |
|
| 22 | 22 | </p> |
| 23 | -<?php endif; ?> |
|
| 24 | -<?php if ( espresso_venue_has_address( $post->ID )) : ?> |
|
| 25 | - <strong><span class="dashicons dashicons-location-alt"></span><?php _e( 'Address:', 'event_espresso' ); ?></strong> |
|
| 26 | - <?php espresso_venue_address( 'inline' ); ?> |
|
| 27 | - <?php espresso_venue_gmap( $post->ID ); ?> |
|
| 23 | +<?php endif; ?> |
|
| 24 | +<?php if (espresso_venue_has_address($post->ID)) : ?> |
|
| 25 | + <strong><span class="dashicons dashicons-location-alt"></span><?php _e('Address:', 'event_espresso'); ?></strong> |
|
| 26 | + <?php espresso_venue_address('inline'); ?> |
|
| 27 | + <?php espresso_venue_gmap($post->ID); ?> |
|
| 28 | 28 | <div class="clear"><br/></div> |
| 29 | -<?php endif; ?> |
|
| 29 | +<?php endif; ?> |
|
| 30 | 30 | |
| 31 | - <?php $VNU_ID = espresso_venue_id( $post->ID ); ?> |
|
| 32 | - <?php if ( is_single() ) : ?> |
|
| 33 | - <?php $venue_description = espresso_venue_description( $VNU_ID, FALSE ); ?> |
|
| 34 | - <?php if ( $venue_description ) : ?> |
|
| 31 | + <?php $VNU_ID = espresso_venue_id($post->ID); ?> |
|
| 32 | + <?php if (is_single()) : ?> |
|
| 33 | + <?php $venue_description = espresso_venue_description($VNU_ID, FALSE); ?> |
|
| 34 | + <?php if ($venue_description) : ?> |
|
| 35 | 35 | <p> |
| 36 | - <strong><?php _e( 'Description:', 'event_espresso' ); ?></strong><br/> |
|
| 37 | - <?php echo do_shortcode( $venue_description ); ?> |
|
| 36 | + <strong><?php _e('Description:', 'event_espresso'); ?></strong><br/> |
|
| 37 | + <?php echo do_shortcode($venue_description); ?> |
|
| 38 | 38 | </p> |
| 39 | - <?php endif; ?> |
|
| 39 | + <?php endif; ?> |
|
| 40 | 40 | <?php else : ?> |
| 41 | - <?php $venue_excerpt = espresso_venue_excerpt( $VNU_ID, FALSE ); ?> |
|
| 42 | - <?php if ( $venue_excerpt ) : ?> |
|
| 41 | + <?php $venue_excerpt = espresso_venue_excerpt($VNU_ID, FALSE); ?> |
|
| 42 | + <?php if ($venue_excerpt) : ?> |
|
| 43 | 43 | <p> |
| 44 | - <strong><?php _e( 'Description:', 'event_espresso' ); ?></strong><br/> |
|
| 44 | + <strong><?php _e('Description:', 'event_espresso'); ?></strong><br/> |
|
| 45 | 45 | <?php echo $venue_excerpt; ?> |
| 46 | 46 | </p> |
| 47 | - <?php endif; ?> |
|
| 48 | - <?php endif; ?> |
|
| 47 | + <?php endif; ?> |
|
| 48 | + <?php endif; ?> |
|
| 49 | 49 | </div> |
| 50 | 50 | <!-- .espresso-venue-dv --> |
| 51 | 51 | <?php |
| 52 | -do_action( 'AHEE_event_details_after_venue_details', $post ); |
|
| 52 | +do_action('AHEE_event_details_after_venue_details', $post); |
|
| 53 | 53 | endif; |
| 54 | 54 | ?> |
@@ -18,52 +18,52 @@ |
||
| 18 | 18 | * and/or use any of the template tags functions found in: |
| 19 | 19 | * \wp-content\plugins\event-espresso-core\public\template_tags.php |
| 20 | 20 | ************************** IMPORTANT **************************/ |
| 21 | -add_filter( 'FHEE__content_espresso_events__template_loaded', '__return_true' ); |
|
| 21 | +add_filter('FHEE__content_espresso_events__template_loaded', '__return_true'); |
|
| 22 | 22 | |
| 23 | 23 | //echo '<br/><h6 style="color:#2EA2CC;">'. __FILE__ . ' <span style="font-weight:normal;color:#E76700"> Line #: ' . __LINE__ . '</span></h6>'; |
| 24 | 24 | |
| 25 | 25 | global $post; |
| 26 | -$event_class = has_excerpt( $post->ID ) ? ' has-excerpt' : ''; |
|
| 27 | -$event_class = apply_filters( 'FHEE__content_espresso_events__event_class', $event_class ); |
|
| 26 | +$event_class = has_excerpt($post->ID) ? ' has-excerpt' : ''; |
|
| 27 | +$event_class = apply_filters('FHEE__content_espresso_events__event_class', $event_class); |
|
| 28 | 28 | ?> |
| 29 | -<?php do_action( 'AHEE_event_details_before_post', $post ); ?> |
|
| 30 | -<article id="post-<?php the_ID(); ?>" <?php post_class( $event_class ); ?>> |
|
| 29 | +<?php do_action('AHEE_event_details_before_post', $post); ?> |
|
| 30 | +<article id="post-<?php the_ID(); ?>" <?php post_class($event_class); ?>> |
|
| 31 | 31 | |
| 32 | -<?php if ( is_single() ) : ?> |
|
| 32 | +<?php if (is_single()) : ?> |
|
| 33 | 33 | |
| 34 | - <div id="espresso-event-header-dv-<?php echo $post->ID;?>" class="espresso-event-header-dv"> |
|
| 35 | - <?php espresso_get_template_part( 'content', 'espresso_events-thumbnail' ); ?> |
|
| 36 | - <?php espresso_get_template_part( 'content', 'espresso_events-header' ); ?> |
|
| 34 | + <div id="espresso-event-header-dv-<?php echo $post->ID; ?>" class="espresso-event-header-dv"> |
|
| 35 | + <?php espresso_get_template_part('content', 'espresso_events-thumbnail'); ?> |
|
| 36 | + <?php espresso_get_template_part('content', 'espresso_events-header'); ?> |
|
| 37 | 37 | </div> |
| 38 | 38 | |
| 39 | 39 | <div class="espresso-event-wrapper-dv"> |
| 40 | - <?php espresso_get_template_part( 'content', 'espresso_events-tickets' ); ?> |
|
| 41 | - <?php espresso_get_template_part( 'content', 'espresso_events-datetimes' ); ?> |
|
| 42 | - <?php espresso_get_template_part( 'content', 'espresso_events-details' ); ?> |
|
| 43 | - <?php espresso_get_template_part( 'content', 'espresso_events-venues' ); ?> |
|
| 40 | + <?php espresso_get_template_part('content', 'espresso_events-tickets'); ?> |
|
| 41 | + <?php espresso_get_template_part('content', 'espresso_events-datetimes'); ?> |
|
| 42 | + <?php espresso_get_template_part('content', 'espresso_events-details'); ?> |
|
| 43 | + <?php espresso_get_template_part('content', 'espresso_events-venues'); ?> |
|
| 44 | 44 | <footer class="event-meta"> |
| 45 | - <?php do_action( 'AHEE_event_details_footer_top', $post ); ?> |
|
| 46 | - <?php do_action( 'AHEE_event_details_footer_bottom', $post ); ?> |
|
| 45 | + <?php do_action('AHEE_event_details_footer_top', $post); ?> |
|
| 46 | + <?php do_action('AHEE_event_details_footer_bottom', $post); ?> |
|
| 47 | 47 | </footer> |
| 48 | 48 | </div> |
| 49 | 49 | |
| 50 | -<?php elseif ( is_archive() ) : ?> |
|
| 50 | +<?php elseif (is_archive()) : ?> |
|
| 51 | 51 | |
| 52 | - <div id="espresso-event-list-header-dv-<?php echo $post->ID;?>" class="espresso-event-header-dv"> |
|
| 53 | - <?php espresso_get_template_part( 'content', 'espresso_events-thumbnail' ); ?> |
|
| 54 | - <?php espresso_get_template_part( 'content', 'espresso_events-header' ); ?> |
|
| 52 | + <div id="espresso-event-list-header-dv-<?php echo $post->ID; ?>" class="espresso-event-header-dv"> |
|
| 53 | + <?php espresso_get_template_part('content', 'espresso_events-thumbnail'); ?> |
|
| 54 | + <?php espresso_get_template_part('content', 'espresso_events-header'); ?> |
|
| 55 | 55 | </div> |
| 56 | 56 | |
| 57 | 57 | <div class="espresso-event-list-wrapper-dv"> |
| 58 | - <?php espresso_get_template_part( 'content', 'espresso_events-tickets' ); ?> |
|
| 59 | - <?php espresso_get_template_part( 'content', 'espresso_events-datetimes' ); ?> |
|
| 60 | - <?php espresso_get_template_part( 'content', 'espresso_events-details' ); ?> |
|
| 61 | - <?php espresso_get_template_part( 'content', 'espresso_events-venues' ); ?> |
|
| 58 | + <?php espresso_get_template_part('content', 'espresso_events-tickets'); ?> |
|
| 59 | + <?php espresso_get_template_part('content', 'espresso_events-datetimes'); ?> |
|
| 60 | + <?php espresso_get_template_part('content', 'espresso_events-details'); ?> |
|
| 61 | + <?php espresso_get_template_part('content', 'espresso_events-venues'); ?> |
|
| 62 | 62 | </div> |
| 63 | 63 | |
| 64 | 64 | <?php endif; ?> |
| 65 | 65 | |
| 66 | 66 | </article> |
| 67 | 67 | <!-- #post --> |
| 68 | -<?php do_action( 'AHEE_event_details_after_post', $post ); |
|
| 68 | +<?php do_action('AHEE_event_details_after_post', $post); |
|
| 69 | 69 | |
@@ -1,14 +1,14 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * This template will display a single event - copy it to your theme folder |
|
| 4 | - * |
|
| 5 | - * @ package Event Espresso |
|
| 6 | - * @ author Seth Shoultes |
|
| 7 | - * @ copyright (c) 2008-2013 Event Espresso All Rights Reserved. |
|
| 8 | - * @ license http://eventespresso.com/support/terms-conditions/ * see Plugin Licensing * |
|
| 9 | - * @ link http://www.eventespresso.com |
|
| 10 | - * @ version 4+ |
|
| 11 | - */ |
|
| 3 | + * This template will display a single event - copy it to your theme folder |
|
| 4 | + * |
|
| 5 | + * @ package Event Espresso |
|
| 6 | + * @ author Seth Shoultes |
|
| 7 | + * @ copyright (c) 2008-2013 Event Espresso All Rights Reserved. |
|
| 8 | + * @ license http://eventespresso.com/support/terms-conditions/ * see Plugin Licensing * |
|
| 9 | + * @ link http://www.eventespresso.com |
|
| 10 | + * @ version 4+ |
|
| 11 | + */ |
|
| 12 | 12 | |
| 13 | 13 | /*************************** IMPORTANT ************************* |
| 14 | 14 | * if you are creating a custom template based on this file, |