@@ -1,11 +1,11 @@ discard block |
||
1 | 1 | <?php //echo '<h1>' . __FILE__ . '</h1>'; ?> |
2 | 2 | <?php global $post; ?> |
3 | -<?php do_action( 'AHEE__content_espresso_venues_template__before_featured_img', $post ); ?> |
|
3 | +<?php do_action('AHEE__content_espresso_venues_template__before_featured_img', $post); ?> |
|
4 | 4 | <?php |
5 | -if ( has_post_thumbnail( $post->ID )) : |
|
6 | - if ( $img_ID = get_post_thumbnail_id( $post->ID )) : |
|
7 | - if ( $featured_img = wp_get_attachment_image_src( $img_ID, 'large' )) : |
|
8 | - $caption = esc_attr( get_post( get_post( $img_ID ))->post_excerpt ); |
|
5 | +if (has_post_thumbnail($post->ID)) : |
|
6 | + if ($img_ID = get_post_thumbnail_id($post->ID)) : |
|
7 | + if ($featured_img = wp_get_attachment_image_src($img_ID, 'large')) : |
|
8 | + $caption = esc_attr(get_post(get_post($img_ID))->post_excerpt); |
|
9 | 9 | $wrap_class .= ' has-img'; |
10 | 10 | ?> |
11 | 11 | <div id="ee-venue-img-dv-<?php echo $post->ID; ?>" class="ee-venue-img-dv"> |
@@ -18,5 +18,5 @@ discard block |
||
18 | 18 | endif; |
19 | 19 | endif; |
20 | 20 | ?> |
21 | -<?php do_action( 'AHEE__content_espresso_venues_template__after_featured_img', $post );?> |
|
21 | +<?php do_action('AHEE__content_espresso_venues_template__after_featured_img', $post); ?> |
|
22 | 22 | <!-- .venue-content --> |
@@ -11,41 +11,41 @@ |
||
11 | 11 | */ |
12 | 12 | |
13 | 13 | global $post; |
14 | -$wrap_class = has_excerpt( $post->ID ) ? ' has-excerpt' : ''; |
|
14 | +$wrap_class = has_excerpt($post->ID) ? ' has-excerpt' : ''; |
|
15 | 15 | ?> |
16 | -<?php do_action( 'AHEE__content_espresso_venues_template__before_post', $post ); ?> |
|
17 | -<article id="post-<?php the_ID(); ?>" <?php post_class( 'espresso-venue-details entry-content ' . $wrap_class ); ?>> |
|
16 | +<?php do_action('AHEE__content_espresso_venues_template__before_post', $post); ?> |
|
17 | +<article id="post-<?php the_ID(); ?>" <?php post_class('espresso-venue-details entry-content '.$wrap_class); ?>> |
|
18 | 18 | |
19 | -<?php if ( is_single() ) : ?> |
|
19 | +<?php if (is_single()) : ?> |
|
20 | 20 | |
21 | - <div id="espresso-venue-header-dv-<?php echo $post->ID;?>" class="espresso-venue-header-dv"> |
|
22 | - <?php espresso_get_template_part( 'content', 'espresso_venues-thumbnail' ); ?> |
|
23 | - <?php espresso_get_template_part( 'content', 'espresso_venues-header' ); ?> |
|
21 | + <div id="espresso-venue-header-dv-<?php echo $post->ID; ?>" class="espresso-venue-header-dv"> |
|
22 | + <?php espresso_get_template_part('content', 'espresso_venues-thumbnail'); ?> |
|
23 | + <?php espresso_get_template_part('content', 'espresso_venues-header'); ?> |
|
24 | 24 | </div> |
25 | 25 | |
26 | 26 | <div class="espresso-venue-wrapper-dv"> |
27 | - <?php espresso_get_template_part( 'content', 'espresso_venues-details' ); ?> |
|
28 | - <?php espresso_get_template_part( 'content', 'espresso_venues-location' ); ?> |
|
27 | + <?php espresso_get_template_part('content', 'espresso_venues-details'); ?> |
|
28 | + <?php espresso_get_template_part('content', 'espresso_venues-location'); ?> |
|
29 | 29 | <footer class="venue-meta"> |
30 | - <?php do_action( 'AHEE__content_espresso_venues_template__footer_top', $post ); ?> |
|
31 | - <?php do_action( 'AHEE__content_espresso_venues_template__footer_bottom', $post ); ?> |
|
30 | + <?php do_action('AHEE__content_espresso_venues_template__footer_top', $post); ?> |
|
31 | + <?php do_action('AHEE__content_espresso_venues_template__footer_bottom', $post); ?> |
|
32 | 32 | </footer> |
33 | 33 | </div> |
34 | 34 | |
35 | -<?php elseif ( is_archive() ) : ?> |
|
35 | +<?php elseif (is_archive()) : ?> |
|
36 | 36 | |
37 | - <div id="espresso-venue-header-dv-<?php echo $post->ID;?>" class="espresso-venue-header-dv"> |
|
38 | - <?php espresso_get_template_part( 'content', 'espresso_venues-thumbnail' ); ?> |
|
39 | - <?php espresso_get_template_part( 'content', 'espresso_venues-header' ); ?> |
|
37 | + <div id="espresso-venue-header-dv-<?php echo $post->ID; ?>" class="espresso-venue-header-dv"> |
|
38 | + <?php espresso_get_template_part('content', 'espresso_venues-thumbnail'); ?> |
|
39 | + <?php espresso_get_template_part('content', 'espresso_venues-header'); ?> |
|
40 | 40 | </div> |
41 | 41 | |
42 | 42 | <div class="espresso-venue-wrapper-dv"> |
43 | - <?php espresso_get_template_part( 'content', 'espresso_venues-details' ); ?> |
|
43 | + <?php espresso_get_template_part('content', 'espresso_venues-details'); ?> |
|
44 | 44 | </div> |
45 | 45 | |
46 | 46 | <?php endif; ?> |
47 | 47 | |
48 | 48 | </article> |
49 | 49 | <!-- #post --> |
50 | -<?php do_action( 'AHEE__content_espresso_venues_template__after_post', $post ); |
|
50 | +<?php do_action('AHEE__content_espresso_venues_template__after_post', $post); |
|
51 | 51 |
@@ -10,30 +10,30 @@ |
||
10 | 10 | * @ version 4+ |
11 | 11 | */ |
12 | 12 | |
13 | -if ( have_posts() ) : ?> |
|
13 | +if (have_posts()) : ?> |
|
14 | 14 | |
15 | 15 | <header class="page-header"> |
16 | 16 | <h1 class="page-title"> |
17 | - <?php echo __( 'Event Venues', 'event_espresso' ); ?> |
|
17 | + <?php echo __('Event Venues', 'event_espresso'); ?> |
|
18 | 18 | </h1> |
19 | 19 | </header><!-- .page-header --> |
20 | 20 | |
21 | 21 | <?php |
22 | 22 | // allow other stuff |
23 | - do_action( 'AHEE__archive_espresso_venues_template__before_loop' ); |
|
23 | + do_action('AHEE__archive_espresso_venues_template__before_loop'); |
|
24 | 24 | // Start the Loop. |
25 | - while ( have_posts() ) : the_post(); |
|
25 | + while (have_posts()) : the_post(); |
|
26 | 26 | // Include the post TYPE-specific template for the content. |
27 | - espresso_get_template_part( 'content', 'espresso_venues' ); |
|
27 | + espresso_get_template_part('content', 'espresso_venues'); |
|
28 | 28 | endwhile; |
29 | 29 | // Previous/next page navigation. |
30 | 30 | espresso_pagination(); |
31 | 31 | // allow moar other stuff |
32 | - do_action( 'AHEE__archive_espresso_venues_template__after_loop' ); |
|
32 | + do_action('AHEE__archive_espresso_venues_template__after_loop'); |
|
33 | 33 | |
34 | 34 | |
35 | 35 | else : |
36 | 36 | // If no content, include the "No posts found" template. |
37 | - espresso_get_template_part( 'content', 'none' ); |
|
37 | + espresso_get_template_part('content', 'none'); |
|
38 | 38 | |
39 | 39 | endif; |
@@ -32,8 +32,10 @@ |
||
32 | 32 | do_action( 'AHEE__archive_espresso_venues_template__after_loop' ); |
33 | 33 | |
34 | 34 | |
35 | -else : |
|
35 | +else { |
|
36 | + : |
|
36 | 37 | // If no content, include the "No posts found" template. |
37 | 38 | espresso_get_template_part( 'content', 'none' ); |
39 | +} |
|
38 | 40 | |
39 | 41 | endif; |
@@ -18,11 +18,11 @@ discard block |
||
18 | 18 | <div id="espresso-venue-details-dv" class="" > |
19 | 19 | <?php |
20 | 20 | // Start the Loop. |
21 | - while ( have_posts() ) : the_post(); |
|
21 | + while (have_posts()) : the_post(); |
|
22 | 22 | // Include the post TYPE-specific template for the content. |
23 | - espresso_get_template_part( 'content', 'espresso_venues' ); |
|
23 | + espresso_get_template_part('content', 'espresso_venues'); |
|
24 | 24 | // If comments are open or we have at least one comment, load up the comment template. |
25 | - if ( comments_open() || get_comments_number() ) { |
|
25 | + if (comments_open() || get_comments_number()) { |
|
26 | 26 | comments_template(); |
27 | 27 | } |
28 | 28 | endwhile; |
@@ -34,6 +34,6 @@ discard block |
||
34 | 34 | </div><!-- #primary --> |
35 | 35 | |
36 | 36 | <?php |
37 | -get_sidebar( 'content' ); |
|
37 | +get_sidebar('content'); |
|
38 | 38 | get_sidebar(); |
39 | 39 | get_footer(); |
40 | 40 | \ No newline at end of file |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * Event Attendees shortcode class |
4 | 6 | * |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | * @param WP $WP |
20 | 20 | * @return void |
21 | 21 | */ |
22 | - public function run( WP $WP ) {} |
|
22 | + public function run(WP $WP) {} |
|
23 | 23 | |
24 | 24 | |
25 | 25 | /** |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * @param array $attributes |
70 | 70 | * @return string |
71 | 71 | */ |
72 | - public function process_shortcode( $attributes = array() ) { |
|
72 | + public function process_shortcode($attributes = array()) { |
|
73 | 73 | |
74 | 74 | //set default attributes |
75 | 75 | $default_shortcode_attributes = array( |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $default_shortcode_attributes |
87 | 87 | ); |
88 | 88 | // grab attributes and merge with defaults, then extract |
89 | - $attributes = array_merge( (array) $default_shortcode_attributes, (array) $attributes ); |
|
89 | + $attributes = array_merge((array) $default_shortcode_attributes, (array) $attributes); |
|
90 | 90 | |
91 | 91 | $template_args = array( |
92 | 92 | 'contacts' => array(), |
@@ -102,31 +102,31 @@ discard block |
||
102 | 102 | $error = false; |
103 | 103 | |
104 | 104 | //what event? |
105 | - if ( empty( $attributes['event_id'] ) && empty( $attributes['datetime_id'] ) && empty( $attributes['ticket_id'] ) ) { |
|
105 | + if (empty($attributes['event_id']) && empty($attributes['datetime_id']) && empty($attributes['ticket_id'])) { |
|
106 | 106 | //seems like is_espresso_event_single() isn't working as expected. So using alternate method. |
107 | - if ( is_single() && is_espresso_event() ) { |
|
107 | + if (is_single() && is_espresso_event()) { |
|
108 | 108 | $event = EEH_Event_View::get_event(); |
109 | - if ( $event instanceof EE_Event ) { |
|
109 | + if ($event instanceof EE_Event) { |
|
110 | 110 | $template_args['event'] = $event; |
111 | 111 | $query[0]['Registration.EVT_ID'] = $event->ID(); |
112 | 112 | } |
113 | 113 | } else { |
114 | 114 | //try getting the earliest active event if none then get the |
115 | - $events = EEM_Event::instance()->get_active_events( array( 'limit' => 1, |
|
116 | - 'order_by' => array( 'Datetime.DTT_EVT_start' => 'ASC' ) |
|
117 | - ) ); |
|
118 | - $events = empty( $events ) ? EEM_Event::instance()->get_upcoming_events( array( 'limit' => 1, |
|
119 | - 'order_by' => array( 'Datetime.DTT_EVT_start' => 'ASC' ) |
|
120 | - ) ) : $events; |
|
121 | - $event = reset( $events ); |
|
122 | - if ( $event instanceof EE_Event ) { |
|
115 | + $events = EEM_Event::instance()->get_active_events(array('limit' => 1, |
|
116 | + 'order_by' => array('Datetime.DTT_EVT_start' => 'ASC') |
|
117 | + )); |
|
118 | + $events = empty($events) ? EEM_Event::instance()->get_upcoming_events(array('limit' => 1, |
|
119 | + 'order_by' => array('Datetime.DTT_EVT_start' => 'ASC') |
|
120 | + )) : $events; |
|
121 | + $event = reset($events); |
|
122 | + if ($event instanceof EE_Event) { |
|
123 | 123 | $query[0]['Registration.EVT_ID'] = $event->ID(); |
124 | 124 | $template_args['event'] = $event; |
125 | 125 | } |
126 | 126 | } |
127 | - } elseif ( ! empty( $attributes['event_id'] ) ) { |
|
128 | - $event = EEM_Event::instance()->get_one_by_ID( $attributes['event_id'] ); |
|
129 | - if ( $event instanceof EE_Event ) { |
|
127 | + } elseif ( ! empty($attributes['event_id'])) { |
|
128 | + $event = EEM_Event::instance()->get_one_by_ID($attributes['event_id']); |
|
129 | + if ($event instanceof EE_Event) { |
|
130 | 130 | $query[0]['Registration.EVT_ID'] = $attributes['event_id']; |
131 | 131 | $template_args['event'] = $event; |
132 | 132 | } else { |
@@ -135,9 +135,9 @@ discard block |
||
135 | 135 | } |
136 | 136 | |
137 | 137 | //datetime? |
138 | - if ( ! empty( $attributes['datetime_id'] ) && empty( $attributes['event_id'] ) ) { |
|
139 | - $datetime = EEM_Datetime::instance()->get_one_by_ID( $attributes['datetime_id'] ); |
|
140 | - if ( $datetime instanceof EE_Datetime ) { |
|
138 | + if ( ! empty($attributes['datetime_id']) && empty($attributes['event_id'])) { |
|
139 | + $datetime = EEM_Datetime::instance()->get_one_by_ID($attributes['datetime_id']); |
|
140 | + if ($datetime instanceof EE_Datetime) { |
|
141 | 141 | $query[0]['Registration.Ticket.Datetime.DTT_ID'] = $attributes['datetime_id']; |
142 | 142 | $query['default_where_conditions'] = 'this_model_only'; |
143 | 143 | $template_args['datetime'] = $datetime; |
@@ -148,9 +148,9 @@ discard block |
||
148 | 148 | } |
149 | 149 | |
150 | 150 | //ticket?just |
151 | - if ( ! empty( $attributes['ticket_id'] ) && empty( $attributes['event_id'] ) && empty( $attributes['datetime_id'] ) ) { |
|
152 | - $ticket = EEM_Ticket::instance()->get_one_by_ID( $attributes['ticket_id'] ); |
|
153 | - if ( $ticket instanceof EE_Ticket ) { |
|
151 | + if ( ! empty($attributes['ticket_id']) && empty($attributes['event_id']) && empty($attributes['datetime_id'])) { |
|
152 | + $ticket = EEM_Ticket::instance()->get_one_by_ID($attributes['ticket_id']); |
|
153 | + if ($ticket instanceof EE_Ticket) { |
|
154 | 154 | $query[0]['Registration.TKT_ID'] = $attributes['ticket_id']; |
155 | 155 | $template_args['ticket'] = $ticket; |
156 | 156 | $template_args['event'] = $ticket->first_datetime() instanceof EE_Datetime ? $ticket->first_datetime()->event() : null; |
@@ -161,17 +161,17 @@ discard block |
||
161 | 161 | |
162 | 162 | //status |
163 | 163 | $reg_status_array = EEM_Registration::reg_status_array(); |
164 | - if ( $attributes['status'] != 'all' && isset( $reg_status_array[$attributes['status']] ) ) { |
|
164 | + if ($attributes['status'] != 'all' && isset($reg_status_array[$attributes['status']])) { |
|
165 | 165 | $query[0]['Registration.STS_ID'] = $attributes['status']; |
166 | 166 | } |
167 | - $query['group_by'] = array( 'ATT_ID' ); |
|
168 | - $query['order_by'] = apply_filters( 'FHEE__EES_Espresso_Event_Attendees__process_shortcode__order_by', array( 'ATT_lname' => 'ASC', 'ATT_fname' => 'ASC' ) ); |
|
167 | + $query['group_by'] = array('ATT_ID'); |
|
168 | + $query['order_by'] = apply_filters('FHEE__EES_Espresso_Event_Attendees__process_shortcode__order_by', array('ATT_lname' => 'ASC', 'ATT_fname' => 'ASC')); |
|
169 | 169 | |
170 | 170 | //if we have NO query where conditions, then there was an invalid parameter or the shortcode was used incorrectly |
171 | 171 | //so when WP_DEBUG is set and true, we'll show a message, otherwise we'll just return an empty string. |
172 | - if ( ( ! isset( $query[0] ) || ! is_array( $query[0] ) ) || $error ) { |
|
173 | - if ( WP_DEBUG ) { |
|
174 | - return '<div class="important-notice ee-attention">' . __( 'The [ESPRESSO_EVENT_ATTENDEES] shortcode has been used incorrectly. Please double check the arguments you used for any typos. In the case of ID type arguments, its possible the given ID does not correspond to existing data in the database.', 'event_espresso' ) . '</div>'; |
|
172 | + if (( ! isset($query[0]) || ! is_array($query[0])) || $error) { |
|
173 | + if (WP_DEBUG) { |
|
174 | + return '<div class="important-notice ee-attention">'.__('The [ESPRESSO_EVENT_ATTENDEES] shortcode has been used incorrectly. Please double check the arguments you used for any typos. In the case of ID type arguments, its possible the given ID does not correspond to existing data in the database.', 'event_espresso').'</div>'; |
|
175 | 175 | } else { |
176 | 176 | return ''; |
177 | 177 | } |
@@ -179,11 +179,11 @@ discard block |
||
179 | 179 | |
180 | 180 | |
181 | 181 | //get contacts! |
182 | - $template_args['contacts'] = EEM_Attendee::instance()->get_all( $query ); |
|
182 | + $template_args['contacts'] = EEM_Attendee::instance()->get_all($query); |
|
183 | 183 | |
184 | 184 | |
185 | 185 | //all set let's load up the template and return. |
186 | - return EEH_Template::locate_template( 'loop-espresso_event_attendees.php', $template_args, true, true ); |
|
186 | + return EEH_Template::locate_template('loop-espresso_event_attendees.php', $template_args, true, true); |
|
187 | 187 | |
188 | 188 | } |
189 | 189 |
@@ -113,10 +113,10 @@ |
||
113 | 113 | } else { |
114 | 114 | //try getting the earliest active event if none then get the |
115 | 115 | $events = EEM_Event::instance()->get_active_events( array( 'limit' => 1, |
116 | - 'order_by' => array( 'Datetime.DTT_EVT_start' => 'ASC' ) |
|
116 | + 'order_by' => array( 'Datetime.DTT_EVT_start' => 'ASC' ) |
|
117 | 117 | ) ); |
118 | 118 | $events = empty( $events ) ? EEM_Event::instance()->get_upcoming_events( array( 'limit' => 1, |
119 | - 'order_by' => array( 'Datetime.DTT_EVT_start' => 'ASC' ) |
|
119 | + 'order_by' => array( 'Datetime.DTT_EVT_start' => 'ASC' ) |
|
120 | 120 | ) ) : $events; |
121 | 121 | $event = reset( $events ); |
122 | 122 | if ( $event instanceof EE_Event ) { |
@@ -1,30 +1,30 @@ discard block |
||
1 | 1 | <h2 class="section-heading display-box-heading"> |
2 | 2 | <?php _e('Payment Overview', 'event_espresso'); ?> |
3 | 3 | </h2> |
4 | -<?php do_action( 'AHEE__thank_you_page_payment_details_template__after_heading' ); ?> |
|
4 | +<?php do_action('AHEE__thank_you_page_payment_details_template__after_heading'); ?> |
|
5 | 5 | |
6 | 6 | <div id="espresso-thank-you-page-payment-details-dv"> |
7 | -<?php if ( ! empty( $payments )){ ?> |
|
7 | +<?php if ( ! empty($payments)) { ?> |
|
8 | 8 | <table class="ee-table"> |
9 | 9 | <thead> |
10 | 10 | <tr> |
11 | 11 | <th width="35%" class="jst-left"> |
12 | - <?php _e('Payment Date','event_espresso')?> |
|
12 | + <?php _e('Payment Date', 'event_espresso')?> |
|
13 | 13 | </th> |
14 | 14 | <th width="17.5%" class="jst-left"> |
15 | - <?php _e('Type','event_espresso');?> |
|
15 | + <?php _e('Type', 'event_espresso'); ?> |
|
16 | 16 | </th> |
17 | 17 | <th width="17.5%" class="jst-rght"> |
18 | - <?php _e('Amount','event_espresso');?> |
|
18 | + <?php _e('Amount', 'event_espresso'); ?> |
|
19 | 19 | </th> |
20 | 20 | <th width="30%" class="jst-rght"> |
21 | - <?php _e('Status','event_espresso');?> |
|
21 | + <?php _e('Status', 'event_espresso'); ?> |
|
22 | 22 | </th> |
23 | 23 | </tr> |
24 | 24 | </thead> |
25 | 25 | <tbody> |
26 | 26 | <?php |
27 | - foreach ( $payments as $payment ) { |
|
27 | + foreach ($payments as $payment) { |
|
28 | 28 | echo $payment; |
29 | 29 | } |
30 | 30 | ?> |
@@ -33,38 +33,38 @@ discard block |
||
33 | 33 | <?php |
34 | 34 | } else { |
35 | 35 | |
36 | - if ( $transaction->total() ){ |
|
36 | + if ($transaction->total()) { |
|
37 | 37 | |
38 | 38 | echo apply_filters( |
39 | 39 | 'FHEE__payment_overview_template__no_payments_made', |
40 | - sprintf ( |
|
41 | - __('%sNo payments towards this transaction have been received.%s', 'event_espresso' ), |
|
40 | + sprintf( |
|
41 | + __('%sNo payments towards this transaction have been received.%s', 'event_espresso'), |
|
42 | 42 | '<p class="important-notice">', |
43 | 43 | '</p>' |
44 | 44 | ) |
45 | 45 | ); |
46 | - do_action( 'AHEE__thank_you_page_payment_details_template__no_payments_made', $transaction ); |
|
46 | + do_action('AHEE__thank_you_page_payment_details_template__no_payments_made', $transaction); |
|
47 | 47 | |
48 | 48 | } else { |
49 | 49 | |
50 | 50 | echo apply_filters( |
51 | 51 | 'FHEE__payment_overview_template__no_payment_required', |
52 | - sprintf ( |
|
53 | - __('%sNo payment is required for this transaction.%s', 'event_espresso' ), |
|
52 | + sprintf( |
|
53 | + __('%sNo payment is required for this transaction.%s', 'event_espresso'), |
|
54 | 54 | '<p>', |
55 | 55 | '</p>' |
56 | 56 | ) |
57 | 57 | ); |
58 | - do_action( 'AHEE__thank_you_page_payment_details_template__no_payment_required' ); |
|
58 | + do_action('AHEE__thank_you_page_payment_details_template__no_payment_required'); |
|
59 | 59 | |
60 | 60 | } |
61 | 61 | |
62 | 62 | } |
63 | 63 | echo $gateway_content; |
64 | - do_action( 'AHEE__thank_you_page_payment_details_template__after_gateway_content', $gateway_content ); |
|
64 | + do_action('AHEE__thank_you_page_payment_details_template__after_gateway_content', $gateway_content); |
|
65 | 65 | |
66 | 66 | ?> |
67 | 67 | |
68 | 68 | <br/> |
69 | - <?php do_action( 'AHEE__thank_you_page_payment_details_template__after_payment_details' ); ?> |
|
69 | + <?php do_action('AHEE__thank_you_page_payment_details_template__after_payment_details'); ?> |
|
70 | 70 |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <h3><?php _e('Transaction Details', 'event_espresso'); ?></h3> |
2 | -<?php do_action( 'AHEE__thank_you_page_transaction_details_template__after_heading' ); ?> |
|
2 | +<?php do_action('AHEE__thank_you_page_transaction_details_template__after_heading'); ?> |
|
3 | 3 | |
4 | 4 | <div id="espresso-thank-you-page-transaction-details-dv"> |
5 | 5 | <table class='ee-table'> |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | <label><?php _e('Total Cost: ', 'event_espresso'); ?></label> |
10 | 10 | </td> |
11 | 11 | <td> |
12 | - <?php echo EEH_Template::format_currency( $transaction->total() ); ?> |
|
12 | + <?php echo EEH_Template::format_currency($transaction->total()); ?> |
|
13 | 13 | </td> |
14 | 14 | </tr> |
15 | 15 | <tr> |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | <label><?php _e('Amount Owing: ', 'event_espresso'); ?></label> |
18 | 18 | </td> |
19 | 19 | <td class="<?php echo ($transaction->paid() == $transaction->total()) ? 'ee-transaction-paid' : 'ee-transaction-unpaid' ?>"> |
20 | - <?php echo EEH_Template::format_currency( $transaction->remaining() ); ?> |
|
20 | + <?php echo EEH_Template::format_currency($transaction->remaining()); ?> |
|
21 | 21 | </td> |
22 | 22 | </tr> |
23 | 23 | <tr> |
@@ -25,8 +25,8 @@ discard block |
||
25 | 25 | <label><?php _e('Transaction Status: ', 'event_espresso'); ?></label> |
26 | 26 | </td> |
27 | 27 | <td> |
28 | - <?php $transaction->e_pretty_status( TRUE ); |
|
29 | - if ( $show_try_pay_again_link && ! $transaction->is_completed() ) { ?> |
|
28 | + <?php $transaction->e_pretty_status(TRUE); |
|
29 | + if ($show_try_pay_again_link && ! $transaction->is_completed()) { ?> |
|
30 | 30 | <span class="small-text"><a href='<?php echo $SPCO_payment_options_url?>'><?php _e('View Payment Options', 'event_espresso'); ?></a></span> |
31 | 31 | <?php } ?> |
32 | 32 | </td> |
@@ -39,11 +39,11 @@ discard block |
||
39 | 39 | <?php echo $primary_registrant_name; ?> |
40 | 40 | </td> |
41 | 41 | </tr> |
42 | - <?php do_action( 'AHEE__thank_you_page_transaction_details_template__after_transaction_table_row', $transaction ); ?> |
|
42 | + <?php do_action('AHEE__thank_you_page_transaction_details_template__after_transaction_table_row', $transaction); ?> |
|
43 | 43 | </tbody> |
44 | 44 | </table> |
45 | 45 | |
46 | -<?php if ( $show_try_pay_again_link && ! $transaction->is_completed() ) { ?> |
|
46 | +<?php if ($show_try_pay_again_link && ! $transaction->is_completed()) { ?> |
|
47 | 47 | <p class="small-text jst-rght"> |
48 | 48 | <a href='<?php echo $SPCO_payment_options_url?>'><?php _e("Click here to view Payment Options", 'event_espresso'); ?></a> |
49 | 49 | </p> |
@@ -52,6 +52,6 @@ discard block |
||
52 | 52 | |
53 | 53 | <?php }?> |
54 | 54 | |
55 | - <?php do_action( 'AHEE__thank_you_page_transaction_details_template__after_transaction_details' ); ?> |
|
55 | + <?php do_action('AHEE__thank_you_page_transaction_details_template__after_transaction_details'); ?> |
|
56 | 56 | |
57 | 57 | </div> |
@@ -192,14 +192,14 @@ discard block |
||
192 | 192 | <?php _e('Show on all Pages:', 'event_espresso'); ?> |
193 | 193 | </label> |
194 | 194 | <?php |
195 | - echo EEH_Form_Fields::select( |
|
196 | - __('Show on all Pages:', 'event_espresso'), |
|
197 | - $instance['show_everywhere'], |
|
198 | - $yes_no_values, |
|
199 | - $this->get_field_name('show_everywhere'), |
|
200 | - $this->get_field_id('show_everywhere') |
|
201 | - ); |
|
202 | - ?> |
|
195 | + echo EEH_Form_Fields::select( |
|
196 | + __('Show on all Pages:', 'event_espresso'), |
|
197 | + $instance['show_everywhere'], |
|
198 | + $yes_no_values, |
|
199 | + $this->get_field_name('show_everywhere'), |
|
200 | + $this->get_field_id('show_everywhere') |
|
201 | + ); |
|
202 | + ?> |
|
203 | 203 | </p> |
204 | 204 | <p> |
205 | 205 | <label for="<?php echo $this->get_field_id('date_limit'); ?>"> |
@@ -282,13 +282,13 @@ discard block |
||
282 | 282 | extract($args); |
283 | 283 | |
284 | 284 | // add function to make the title a link |
285 | - add_filter('widget_title', array($this, 'make_the_title_a_link'), 15); |
|
285 | + add_filter('widget_title', array($this, 'make_the_title_a_link'), 15); |
|
286 | 286 | |
287 | 287 | // filter the title |
288 | 288 | $title = apply_filters('widget_title', $instance['title']); |
289 | 289 | |
290 | 290 | // remove the function from the filter, so it does not affect other widgets |
291 | - remove_filter('widget_title', array($this, 'make_the_title_a_link'), 15); |
|
291 | + remove_filter('widget_title', array($this, 'make_the_title_a_link'), 15); |
|
292 | 292 | |
293 | 293 | // Before widget (defined by themes). |
294 | 294 | echo $before_widget; |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | * @return string |
386 | 386 | */ |
387 | 387 | public function make_the_title_a_link($title) { |
388 | - return '<a href="' . EEH_Event_View::event_archive_url() . '">' . $title . '</a>'; |
|
388 | + return '<a href="' . EEH_Event_View::event_archive_url() . '">' . $title . '</a>'; |
|
389 | 389 | } |
390 | 390 | |
391 | 391 | } |
@@ -1,4 +1,6 @@ discard block |
||
1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * Event Espresso |
4 | 6 | * |
@@ -360,7 +362,7 @@ discard block |
||
360 | 362 | $single_time_format = apply_filters( 'FHEE__espresso_event_date_range__single_time_format', get_option( 'time_format' )); |
361 | 363 | if ( $date_range == TRUE ) { |
362 | 364 | echo espresso_event_date_range( $date_format, $time_format, $single_date_format, $single_time_format, $event->ID() ); |
363 | - }else{ |
|
365 | + } else{ |
|
364 | 366 | echo espresso_list_of_event_dates( $event->ID(), $date_format, $time_format, FALSE, NULL, TRUE, TRUE, $date_limit ); |
365 | 367 | } |
366 | 368 | } |
@@ -30,8 +30,8 @@ discard block |
||
30 | 30 | function __construct() { |
31 | 31 | parent::__construct( |
32 | 32 | 'ee-upcoming-events-widget', |
33 | - __( 'Event Espresso Upcoming Events', 'event_espresso' ), |
|
34 | - array( 'description' => __( 'A widget to display your upcoming events.', 'event_espresso' )), |
|
33 | + __('Event Espresso Upcoming Events', 'event_espresso'), |
|
34 | + array('description' => __('A widget to display your upcoming events.', 'event_espresso')), |
|
35 | 35 | array( |
36 | 36 | 'width' => 300, |
37 | 37 | 'height' => 350, |
@@ -49,9 +49,9 @@ discard block |
||
49 | 49 | * @param array $instance Previously saved values from database. |
50 | 50 | * @return string|void |
51 | 51 | */ |
52 | - public function form( $instance ) { |
|
52 | + public function form($instance) { |
|
53 | 53 | |
54 | - EE_Registry::instance()->load_class( 'Question_Option', array(), FALSE, FALSE, TRUE ); |
|
54 | + EE_Registry::instance()->load_class('Question_Option', array(), FALSE, FALSE, TRUE); |
|
55 | 55 | // Set up some default widget settings. |
56 | 56 | $defaults = array( |
57 | 57 | 'title' => __('Upcoming Events', 'event_espresso'), |
@@ -66,12 +66,12 @@ discard block |
||
66 | 66 | 'image_size' => 'medium' |
67 | 67 | ); |
68 | 68 | |
69 | - $instance = wp_parse_args( (array) $instance, $defaults ); |
|
69 | + $instance = wp_parse_args((array) $instance, $defaults); |
|
70 | 70 | // don't add HTML labels for EE_Form_Fields generated inputs |
71 | - add_filter( 'FHEE__EEH_Form_Fields__label_html', '__return_empty_string' ); |
|
71 | + add_filter('FHEE__EEH_Form_Fields__label_html', '__return_empty_string'); |
|
72 | 72 | $yes_no_values = array( |
73 | - EE_Question_Option::new_instance( array( 'QSO_value' => FALSE, 'QSO_desc' => __('No', 'event_espresso'))), |
|
74 | - EE_Question_Option::new_instance( array( 'QSO_value' => TRUE, 'QSO_desc' => __('Yes', 'event_espresso'))) |
|
73 | + EE_Question_Option::new_instance(array('QSO_value' => FALSE, 'QSO_desc' => __('No', 'event_espresso'))), |
|
74 | + EE_Question_Option::new_instance(array('QSO_value' => TRUE, 'QSO_desc' => __('Yes', 'event_espresso'))) |
|
75 | 75 | ); |
76 | 76 | |
77 | 77 | ?> |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | <label for="<?php echo $this->get_field_id('title'); ?>"> |
83 | 83 | <?php _e('Title:', 'event_espresso'); ?> |
84 | 84 | </label> |
85 | - <input id="<?php echo $this->get_field_id('title'); ?>" class="widefat" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo esc_attr( $instance['title'] ); ?>" type="text" /> |
|
85 | + <input id="<?php echo $this->get_field_id('title'); ?>" class="widefat" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo esc_attr($instance['title']); ?>" type="text" /> |
|
86 | 86 | </p> |
87 | 87 | <p> |
88 | 88 | <label for="<?php echo $this->get_field_id('category_name'); ?>"> |
@@ -91,16 +91,16 @@ discard block |
||
91 | 91 | <?php |
92 | 92 | $event_categories = array(); |
93 | 93 | /** @type EEM_Term $EEM_Term */ |
94 | - $EEM_Term = EE_Registry::instance()->load_model( 'Term' ); |
|
95 | - $categories = $EEM_Term->get_all_ee_categories( TRUE ); |
|
96 | - if ( $categories ) { |
|
97 | - foreach ( $categories as $category ) { |
|
98 | - if ( $category instanceof EE_Term ) { |
|
99 | - $event_categories[] = EE_Question_Option::new_instance( array( 'QSO_value' => $category->get( 'slug' ), 'QSO_desc' => $category->get( 'name' ))); |
|
94 | + $EEM_Term = EE_Registry::instance()->load_model('Term'); |
|
95 | + $categories = $EEM_Term->get_all_ee_categories(TRUE); |
|
96 | + if ($categories) { |
|
97 | + foreach ($categories as $category) { |
|
98 | + if ($category instanceof EE_Term) { |
|
99 | + $event_categories[] = EE_Question_Option::new_instance(array('QSO_value' => $category->get('slug'), 'QSO_desc' => $category->get('name'))); |
|
100 | 100 | } |
101 | 101 | } |
102 | 102 | } |
103 | - array_unshift( $event_categories, EE_Question_Option::new_instance( array( 'QSO_value' => '', 'QSO_desc' => __(' - display all - ', 'event_espresso')))); |
|
103 | + array_unshift($event_categories, EE_Question_Option::new_instance(array('QSO_value' => '', 'QSO_desc' => __(' - display all - ', 'event_espresso')))); |
|
104 | 104 | echo EEH_Form_Fields::select( |
105 | 105 | __('Event Category:', 'event_espresso'), |
106 | 106 | $instance['category_name'], |
@@ -137,16 +137,16 @@ discard block |
||
137 | 137 | <?php |
138 | 138 | $image_sizes = array(); |
139 | 139 | $sizes = get_intermediate_image_sizes(); |
140 | - if ( $sizes ) { |
|
140 | + if ($sizes) { |
|
141 | 141 | // loop thru images and create option objects out of them |
142 | - foreach ( $sizes as $image_size ) { |
|
143 | - $image_size = trim( $image_size ); |
|
142 | + foreach ($sizes as $image_size) { |
|
143 | + $image_size = trim($image_size); |
|
144 | 144 | // no big images plz |
145 | - if ( ! in_array( $image_size, array( 'large', 'post-thumbnail' ))) { |
|
146 | - $image_sizes[] = EE_Question_Option::new_instance( array( 'QSO_value' => $image_size, 'QSO_desc' => $image_size )); |
|
145 | + if ( ! in_array($image_size, array('large', 'post-thumbnail'))) { |
|
146 | + $image_sizes[] = EE_Question_Option::new_instance(array('QSO_value' => $image_size, 'QSO_desc' => $image_size)); |
|
147 | 147 | } |
148 | 148 | } |
149 | - $image_sizes[] = EE_Question_Option::new_instance( array( 'QSO_value' => 'none', 'QSO_desc' => __('don\'t show images', 'event_espresso') )); |
|
149 | + $image_sizes[] = EE_Question_Option::new_instance(array('QSO_value' => 'none', 'QSO_desc' => __('don\'t show images', 'event_espresso'))); |
|
150 | 150 | } |
151 | 151 | echo EEH_Form_Fields::select( |
152 | 152 | __('Image Size:', 'event_espresso'), |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | <label for="<?php echo $this->get_field_id('date_limit'); ?>"> |
205 | 205 | <?php _e('Number of Dates to Display:', 'event_espresso'); ?> |
206 | 206 | </label> |
207 | - <input id="<?php echo $this->get_field_id('date_limit'); ?>" name="<?php echo $this->get_field_name('date_limit'); ?>" value="<?php echo esc_attr( $instance['date_limit'] ); ?>" size="3" type="text" /> |
|
207 | + <input id="<?php echo $this->get_field_id('date_limit'); ?>" name="<?php echo $this->get_field_name('date_limit'); ?>" value="<?php echo esc_attr($instance['date_limit']); ?>" size="3" type="text" /> |
|
208 | 208 | </p> |
209 | 209 | <p> |
210 | 210 | <label for="<?php echo $this->get_field_id('date_range'); ?>"> |
@@ -236,9 +236,9 @@ discard block |
||
236 | 236 | * |
237 | 237 | * @return array Updated safe values to be saved. |
238 | 238 | */ |
239 | - public function update( $new_instance, $old_instance ) { |
|
239 | + public function update($new_instance, $old_instance) { |
|
240 | 240 | $instance = $old_instance; |
241 | - $instance['title'] = ! empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : ''; |
|
241 | + $instance['title'] = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : ''; |
|
242 | 242 | $instance['category_name'] = $new_instance['category_name']; |
243 | 243 | $instance['show_expired'] = $new_instance['show_expired']; |
244 | 244 | $instance['limit'] = $new_instance['limit']; |
@@ -261,18 +261,18 @@ discard block |
||
261 | 261 | * @param array $args Widget arguments. |
262 | 262 | * @param array $instance Saved values from database. |
263 | 263 | */ |
264 | - public function widget( $args, $instance ) { |
|
264 | + public function widget($args, $instance) { |
|
265 | 265 | |
266 | 266 | global $post; |
267 | 267 | // make sure there is some kinda post object |
268 | - if ( $post instanceof WP_Post ) { |
|
268 | + if ($post instanceof WP_Post) { |
|
269 | 269 | $before_widget = ''; |
270 | 270 | $before_title = ''; |
271 | 271 | $after_title = ''; |
272 | 272 | $after_widget = ''; |
273 | 273 | // but NOT an events archives page, cuz that would be like two event lists on the same page |
274 | - $show_everywhere = isset( $instance['show_everywhere'] ) ? (bool) absint( $instance['show_everywhere'] ) : TRUE; |
|
275 | - if ( $show_everywhere || ! ( $post->post_type == 'espresso_events' && is_archive() )) { |
|
274 | + $show_everywhere = isset($instance['show_everywhere']) ? (bool) absint($instance['show_everywhere']) : TRUE; |
|
275 | + if ($show_everywhere || ! ($post->post_type == 'espresso_events' && is_archive())) { |
|
276 | 276 | // let's use some of the event helper functions' |
277 | 277 | // make separate vars out of attributes |
278 | 278 | |
@@ -291,83 +291,83 @@ discard block |
||
291 | 291 | // Before widget (defined by themes). |
292 | 292 | echo $before_widget; |
293 | 293 | // Display the widget title if one was input (before and after defined by themes). |
294 | - if ( ! empty( $title )) { |
|
295 | - echo $before_title . $title . $after_title; |
|
294 | + if ( ! empty($title)) { |
|
295 | + echo $before_title.$title.$after_title; |
|
296 | 296 | } |
297 | 297 | // grab widget settings |
298 | - $category = isset( $instance['category_name'] ) && ! empty( $instance['category_name'] ) ? $instance['category_name'] : FALSE; |
|
299 | - $show_expired = isset( $instance['show_expired'] ) ? (bool) absint( $instance['show_expired'] ) : FALSE; |
|
300 | - $image_size = isset( $instance['image_size'] ) && ! empty( $instance['image_size'] ) ? $instance['image_size'] : 'medium'; |
|
301 | - $show_desc = isset( $instance['show_desc'] ) ? (bool) absint( $instance['show_desc'] ) : TRUE; |
|
302 | - $show_dates = isset( $instance['show_dates'] ) ? (bool) absint( $instance['show_dates'] ) : TRUE; |
|
303 | - $date_limit = isset( $instance['date_limit'] ) && ! empty( $instance['date_limit'] ) ? $instance['date_limit'] : NULL; |
|
304 | - $date_range = isset( $instance['date_range'] ) && ! empty( $instance['date_range'] ) ? $instance['date_range'] : FALSE; |
|
298 | + $category = isset($instance['category_name']) && ! empty($instance['category_name']) ? $instance['category_name'] : FALSE; |
|
299 | + $show_expired = isset($instance['show_expired']) ? (bool) absint($instance['show_expired']) : FALSE; |
|
300 | + $image_size = isset($instance['image_size']) && ! empty($instance['image_size']) ? $instance['image_size'] : 'medium'; |
|
301 | + $show_desc = isset($instance['show_desc']) ? (bool) absint($instance['show_desc']) : TRUE; |
|
302 | + $show_dates = isset($instance['show_dates']) ? (bool) absint($instance['show_dates']) : TRUE; |
|
303 | + $date_limit = isset($instance['date_limit']) && ! empty($instance['date_limit']) ? $instance['date_limit'] : NULL; |
|
304 | + $date_range = isset($instance['date_range']) && ! empty($instance['date_range']) ? $instance['date_range'] : FALSE; |
|
305 | 305 | // start to build our where clause |
306 | 306 | $where = array( |
307 | 307 | // 'Datetime.DTT_is_primary' => 1, |
308 | - 'status' => array( 'IN', array( 'publish', 'sold_out' ) ) |
|
308 | + 'status' => array('IN', array('publish', 'sold_out')) |
|
309 | 309 | ); |
310 | 310 | // add category |
311 | - if ( $category ) { |
|
311 | + if ($category) { |
|
312 | 312 | $where['Term_Taxonomy.taxonomy'] = 'espresso_event_categories'; |
313 | 313 | $where['Term_Taxonomy.Term.slug'] = $category; |
314 | 314 | } |
315 | 315 | // if NOT expired then we want events that start today or in the future |
316 | - if ( ! $show_expired ) { |
|
317 | - $where['Datetime.DTT_EVT_end'] = array( '>=', EEM_Datetime::instance()->current_time_for_query( 'DTT_EVT_end' ) ); |
|
316 | + if ( ! $show_expired) { |
|
317 | + $where['Datetime.DTT_EVT_end'] = array('>=', EEM_Datetime::instance()->current_time_for_query('DTT_EVT_end')); |
|
318 | 318 | } |
319 | 319 | // allow $where to be filtered |
320 | - $where = apply_filters( 'FHEE__EEW_Upcoming_Events__widget__where', $where, $category, $show_expired ); |
|
320 | + $where = apply_filters('FHEE__EEW_Upcoming_Events__widget__where', $where, $category, $show_expired); |
|
321 | 321 | // run the query |
322 | - $events = EE_Registry::instance()->load_model( 'Event' )->get_all( array( |
|
322 | + $events = EE_Registry::instance()->load_model('Event')->get_all(array( |
|
323 | 323 | $where, |
324 | - 'limit' => $instance['limit'] > 0 ? '0,' . $instance['limit'] : '0,10', |
|
324 | + 'limit' => $instance['limit'] > 0 ? '0,'.$instance['limit'] : '0,10', |
|
325 | 325 | 'order_by' => 'Datetime.DTT_EVT_start', |
326 | 326 | 'order' => 'ASC', |
327 | 327 | 'group_by' => 'EVT_ID' |
328 | 328 | )); |
329 | 329 | |
330 | - if ( ! empty( $events )) { |
|
330 | + if ( ! empty($events)) { |
|
331 | 331 | echo '<ul class="ee-upcoming-events-widget-ul">'; |
332 | - foreach ( $events as $event ) { |
|
333 | - if ( $event instanceof EE_Event && ( !is_single() || $post->ID != $event->ID() ) ) { |
|
332 | + foreach ($events as $event) { |
|
333 | + if ($event instanceof EE_Event && ( ! is_single() || $post->ID != $event->ID())) { |
|
334 | 334 | //printr( $event, '$event <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
335 | - echo '<li id="ee-upcoming-events-widget-li-' . $event->ID() . '" class="ee-upcoming-events-widget-li">'; |
|
335 | + echo '<li id="ee-upcoming-events-widget-li-'.$event->ID().'" class="ee-upcoming-events-widget-li">'; |
|
336 | 336 | // how big is the event name ? |
337 | - $name_length = strlen( $event->name() ); |
|
338 | - switch( $name_length ) { |
|
337 | + $name_length = strlen($event->name()); |
|
338 | + switch ($name_length) { |
|
339 | 339 | case $name_length > 70 : |
340 | - $len_class = ' three-line'; |
|
340 | + $len_class = ' three-line'; |
|
341 | 341 | break; |
342 | 342 | case $name_length > 35 : |
343 | - $len_class = ' two-line'; |
|
343 | + $len_class = ' two-line'; |
|
344 | 344 | break; |
345 | 345 | default : |
346 | - $len_class = ' one-line'; |
|
346 | + $len_class = ' one-line'; |
|
347 | 347 | } |
348 | - $event_url = apply_filters( 'FHEE_EEW_Upcoming_Events__widget__event_url', $event->get_permalink(), $event ); |
|
349 | - echo '<h5 class="ee-upcoming-events-widget-title-h5"><a class="ee-widget-event-name-a' . $len_class . '" href="' . $event_url . '">' . $event->name() . '</a></h5>'; |
|
350 | - if ( post_password_required( $event->ID() ) ) { |
|
351 | - $pswd_form = apply_filters( 'FHEE_EEW_Upcoming_Events__widget__password_form', get_the_password_form( $event->ID() ), $event ); |
|
348 | + $event_url = apply_filters('FHEE_EEW_Upcoming_Events__widget__event_url', $event->get_permalink(), $event); |
|
349 | + echo '<h5 class="ee-upcoming-events-widget-title-h5"><a class="ee-widget-event-name-a'.$len_class.'" href="'.$event_url.'">'.$event->name().'</a></h5>'; |
|
350 | + if (post_password_required($event->ID())) { |
|
351 | + $pswd_form = apply_filters('FHEE_EEW_Upcoming_Events__widget__password_form', get_the_password_form($event->ID()), $event); |
|
352 | 352 | echo $pswd_form; |
353 | 353 | } else { |
354 | - if ( has_post_thumbnail( $event->ID() ) && $image_size != 'none' ) { |
|
355 | - echo '<div class="ee-upcoming-events-widget-img-dv"><a class="ee-upcoming-events-widget-img" href="' . $event_url . '">' . get_the_post_thumbnail( $event->ID(), $image_size ) . '</a></div>'; |
|
354 | + if (has_post_thumbnail($event->ID()) && $image_size != 'none') { |
|
355 | + echo '<div class="ee-upcoming-events-widget-img-dv"><a class="ee-upcoming-events-widget-img" href="'.$event_url.'">'.get_the_post_thumbnail($event->ID(), $image_size).'</a></div>'; |
|
356 | 356 | } |
357 | - $desc = $event->short_description( 25 ); |
|
358 | - if ( $show_dates ) { |
|
359 | - $date_format = apply_filters( 'FHEE__espresso_event_date_range__date_format', get_option( 'date_format' )); |
|
360 | - $time_format = apply_filters( 'FHEE__espresso_event_date_range__time_format', get_option( 'time_format' )); |
|
361 | - $single_date_format = apply_filters( 'FHEE__espresso_event_date_range__single_date_format', get_option( 'date_format' )); |
|
362 | - $single_time_format = apply_filters( 'FHEE__espresso_event_date_range__single_time_format', get_option( 'time_format' )); |
|
363 | - if ( $date_range == TRUE ) { |
|
364 | - echo espresso_event_date_range( $date_format, $time_format, $single_date_format, $single_time_format, $event->ID() ); |
|
365 | - }else{ |
|
366 | - echo espresso_list_of_event_dates( $event->ID(), $date_format, $time_format, FALSE, NULL, TRUE, TRUE, $date_limit ); |
|
357 | + $desc = $event->short_description(25); |
|
358 | + if ($show_dates) { |
|
359 | + $date_format = apply_filters('FHEE__espresso_event_date_range__date_format', get_option('date_format')); |
|
360 | + $time_format = apply_filters('FHEE__espresso_event_date_range__time_format', get_option('time_format')); |
|
361 | + $single_date_format = apply_filters('FHEE__espresso_event_date_range__single_date_format', get_option('date_format')); |
|
362 | + $single_time_format = apply_filters('FHEE__espresso_event_date_range__single_time_format', get_option('time_format')); |
|
363 | + if ($date_range == TRUE) { |
|
364 | + echo espresso_event_date_range($date_format, $time_format, $single_date_format, $single_time_format, $event->ID()); |
|
365 | + } else { |
|
366 | + echo espresso_list_of_event_dates($event->ID(), $date_format, $time_format, FALSE, NULL, TRUE, TRUE, $date_limit); |
|
367 | 367 | } |
368 | 368 | } |
369 | - if ( $show_desc && $desc ) { |
|
370 | - echo '<p style="margin-top: .5em">' . $desc . '</p>'; |
|
369 | + if ($show_desc && $desc) { |
|
370 | + echo '<p style="margin-top: .5em">'.$desc.'</p>'; |
|
371 | 371 | } |
372 | 372 | } |
373 | 373 | echo '</li>'; |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | * @return string |
392 | 392 | */ |
393 | 393 | public function make_the_title_a_link($title) { |
394 | - return '<a href="' . EEH_Event_View::event_archive_url() . '">' . $title . '</a>'; |
|
394 | + return '<a href="'.EEH_Event_View::event_archive_url().'">'.$title.'</a>'; |
|
395 | 395 | } |
396 | 396 | |
397 | 397 | } |
@@ -767,7 +767,7 @@ |
||
767 | 767 | * Takes care of setting up the addressee object(s) for the primary attendee. |
768 | 768 | * |
769 | 769 | * @access protected |
770 | - * @return array of EE_Addressee objects |
|
770 | + * @return EE_Messages_Addressee[] of EE_Addressee objects |
|
771 | 771 | */ |
772 | 772 | protected function _primary_attendee_addressees() { |
773 | 773 | $aee = $this->_default_addressee_data; |
@@ -864,8 +864,8 @@ |
||
864 | 864 | //set the attendee array to blank on each loop; |
865 | 865 | $aee = array(); |
866 | 866 | if ( isset( $this->_data->reg_obj ) |
867 | - && ( $this->_data->reg_obj->attendee_ID() != $att_id ) |
|
868 | - && $this->_single_message |
|
867 | + && ( $this->_data->reg_obj->attendee_ID() != $att_id ) |
|
868 | + && $this->_single_message |
|
869 | 869 | ) { |
870 | 870 | continue; |
871 | 871 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
3 | - exit( 'NO direct script access allowed' ); |
|
2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
3 | + exit('NO direct script access allowed'); |
|
4 | 4 | } |
5 | 5 | |
6 | 6 | |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | * EE_Base_Class_Object |
280 | 280 | * @return mixed ( EE_Base_Class||EE_Base_Class[] ) |
281 | 281 | */ |
282 | - abstract protected function _get_data_for_context( $context, EE_Registration $registration, $id ); |
|
282 | + abstract protected function _get_data_for_context($context, EE_Registration $registration, $id); |
|
283 | 283 | |
284 | 284 | |
285 | 285 | |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | * @deprecated 4.9.0 |
307 | 307 | * @return int |
308 | 308 | */ |
309 | - protected function _get_id_for_msg_url( $context, EE_Registration $registration ) { |
|
309 | + protected function _get_id_for_msg_url($context, EE_Registration $registration) { |
|
310 | 310 | return 0; |
311 | 311 | } |
312 | 312 | |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | * sending. |
336 | 336 | * @since 4.9.0 |
337 | 337 | */ |
338 | - public function do_messenger_hooks( $messenger = null ) { |
|
338 | + public function do_messenger_hooks($messenger = null) { |
|
339 | 339 | $this->_active_messenger = $messenger; |
340 | 340 | $this->_do_messenger_hooks(); |
341 | 341 | } |
@@ -384,10 +384,10 @@ discard block |
||
384 | 384 | * @param mixed $data This sets the data property for the message type with the incoming data used for generating. |
385 | 385 | * @return string (the reference for the data handler) (will be an empty string if could not be determined). |
386 | 386 | */ |
387 | - public function get_data_handler( $data ) { |
|
387 | + public function get_data_handler($data) { |
|
388 | 388 | $this->_data = $data; |
389 | 389 | $this->_set_data_handler(); |
390 | - return apply_filters( 'FHEE__EE_message_type__get_data_handler', $this->_data_handler, $this ); |
|
390 | + return apply_filters('FHEE__EE_message_type__get_data_handler', $this->_data_handler, $this); |
|
391 | 391 | } |
392 | 392 | |
393 | 393 | |
@@ -424,26 +424,26 @@ discard block |
||
424 | 424 | * @deprecated 4.9.0 Likely 4.9.10 or 4.10.0 will remove this method completely |
425 | 425 | * @return string generated url |
426 | 426 | */ |
427 | - public function get_url_trigger( $context, $sending_messenger, EE_Registration $registration ) { |
|
427 | + public function get_url_trigger($context, $sending_messenger, EE_Registration $registration) { |
|
428 | 428 | //validate context |
429 | 429 | //valid context? |
430 | - if ( ! isset( $this->_contexts[ $context ] ) ) { |
|
430 | + if ( ! isset($this->_contexts[$context])) { |
|
431 | 431 | throw new EE_Error( |
432 | 432 | sprintf( |
433 | - __( 'The context %s is not a valid context for %s.', 'event_espresso' ), |
|
433 | + __('The context %s is not a valid context for %s.', 'event_espresso'), |
|
434 | 434 | $context, |
435 | - get_class( $this ) |
|
435 | + get_class($this) |
|
436 | 436 | ) |
437 | 437 | ); |
438 | 438 | } |
439 | 439 | //valid sending_messenger? |
440 | 440 | $not_valid_msgr = false; |
441 | - foreach ( $this->_with_messengers as $generating => $sendings ) { |
|
442 | - if ( empty( $sendings ) || array_search( $sending_messenger, $sendings ) === false ) { |
|
441 | + foreach ($this->_with_messengers as $generating => $sendings) { |
|
442 | + if (empty($sendings) || array_search($sending_messenger, $sendings) === false) { |
|
443 | 443 | $not_valid_msgr = true; |
444 | 444 | } |
445 | 445 | } |
446 | - if ( $not_valid_msgr ) { |
|
446 | + if ($not_valid_msgr) { |
|
447 | 447 | throw new EE_Error( |
448 | 448 | sprintf( |
449 | 449 | __( |
@@ -451,7 +451,7 @@ discard block |
||
451 | 451 | 'event_espresso' |
452 | 452 | ), |
453 | 453 | $sending_messenger, |
454 | - get_class( $this ) |
|
454 | + get_class($this) |
|
455 | 455 | ) |
456 | 456 | ); |
457 | 457 | } |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | $this->name, |
463 | 463 | $registration, |
464 | 464 | $this->_GRP_ID, |
465 | - $this->_get_id_for_msg_url( $context, $registration ) |
|
465 | + $this->_get_id_for_msg_url($context, $registration) |
|
466 | 466 | ); |
467 | 467 | } |
468 | 468 | |
@@ -481,26 +481,26 @@ discard block |
||
481 | 481 | * EE_Base_Class_Object |
482 | 482 | * @return mixed (EE_Base_Class||EE_Base_Class[]) |
483 | 483 | */ |
484 | - public function get_data_for_context( $context, EE_Registration $registration, $id = 0 ) { |
|
484 | + public function get_data_for_context($context, EE_Registration $registration, $id = 0) { |
|
485 | 485 | //valid context? |
486 | - if ( ! isset( $this->_contexts[ $context ] ) ) { |
|
486 | + if ( ! isset($this->_contexts[$context])) { |
|
487 | 487 | throw new EE_Error( |
488 | 488 | sprintf( |
489 | - __( 'The context %s is not a valid context for %s.', 'event_espresso' ), |
|
489 | + __('The context %s is not a valid context for %s.', 'event_espresso'), |
|
490 | 490 | $context, |
491 | - get_class( $this ) |
|
491 | + get_class($this) |
|
492 | 492 | ) |
493 | 493 | ); |
494 | 494 | } |
495 | 495 | //get data and apply global and class specific filters on it. |
496 | 496 | $data = apply_filters( |
497 | 497 | 'FHEE__EE_message_type__get_data_for_context__data', |
498 | - $this->_get_data_for_context( $context, $registration, $id ), |
|
498 | + $this->_get_data_for_context($context, $registration, $id), |
|
499 | 499 | $this |
500 | 500 | ); |
501 | - $data = apply_filters( 'FHEE__' . get_class( $this ) . '__get_data_for_context__data', $data, $this ); |
|
501 | + $data = apply_filters('FHEE__'.get_class($this).'__get_data_for_context__data', $data, $this); |
|
502 | 502 | //if empty then something went wrong! |
503 | - if ( empty( $data ) ) { |
|
503 | + if (empty($data)) { |
|
504 | 504 | throw new EE_Error( |
505 | 505 | sprintf( |
506 | 506 | __( |
@@ -544,7 +544,7 @@ discard block |
||
544 | 544 | */ |
545 | 545 | protected function _set_with_messengers() { |
546 | 546 | $this->_with_messengers = array( |
547 | - 'email' => array( 'html' ), |
|
547 | + 'email' => array('html'), |
|
548 | 548 | ); |
549 | 549 | } |
550 | 550 | |
@@ -558,7 +558,7 @@ discard block |
||
558 | 558 | */ |
559 | 559 | public function with_messengers() { |
560 | 560 | return apply_filters( |
561 | - 'FHEE__EE_message_type__get_with_messengers__with_messengers__' . get_class( $this ), |
|
561 | + 'FHEE__EE_message_type__get_with_messengers__with_messengers__'.get_class($this), |
|
562 | 562 | $this->_with_messengers |
563 | 563 | ); |
564 | 564 | } |
@@ -585,7 +585,7 @@ discard block |
||
585 | 585 | $messengers = array() |
586 | 586 | ) { |
587 | 587 | //we can also further refine the context by action (if present). |
588 | - return $this->_get_admin_page_content( $page, $action, $extra, $messengers ); |
|
588 | + return $this->_get_admin_page_content($page, $action, $extra, $messengers); |
|
589 | 589 | } |
590 | 590 | |
591 | 591 | |
@@ -620,10 +620,10 @@ discard block |
||
620 | 620 | public function get_master_templates() { |
621 | 621 | //first class specific filter then filter that by the global filter. |
622 | 622 | $master_templates = apply_filters( |
623 | - 'FHEE__' . get_class( $this ) . '__get_master_templates', |
|
623 | + 'FHEE__'.get_class($this).'__get_master_templates', |
|
624 | 624 | $this->_master_templates |
625 | 625 | ); |
626 | - return apply_filters( 'FHEE__EE_message_type__get_master_templates', $master_templates, $this ); |
|
626 | + return apply_filters('FHEE__EE_message_type__get_master_templates', $master_templates, $this); |
|
627 | 627 | } |
628 | 628 | |
629 | 629 | |
@@ -637,20 +637,20 @@ discard block |
||
637 | 637 | * @return array An array indexed by context where each context is an array of EE_Messages_Addressee objects for |
638 | 638 | * that context |
639 | 639 | */ |
640 | - public function get_addressees( EE_Messages_incoming_data $data, $context = '' ) { |
|
640 | + public function get_addressees(EE_Messages_incoming_data $data, $context = '') { |
|
641 | 641 | //override _data |
642 | 642 | $this->_data = $data; |
643 | 643 | $addressees = array(); |
644 | 644 | //if incoming context then limit to that context |
645 | - if ( ! empty( $context ) ) { |
|
646 | - $cntxt = ! empty( $this->_contexts[ $context ] ) ? $this->_contexts[ $context ] : ''; |
|
647 | - if ( ! empty( $cntxt ) ) { |
|
645 | + if ( ! empty($context)) { |
|
646 | + $cntxt = ! empty($this->_contexts[$context]) ? $this->_contexts[$context] : ''; |
|
647 | + if ( ! empty($cntxt)) { |
|
648 | 648 | $this->_contexts = array(); |
649 | - $this->_contexts[ $context ] = $cntxt; |
|
649 | + $this->_contexts[$context] = $cntxt; |
|
650 | 650 | } |
651 | 651 | } |
652 | 652 | $this->_set_default_addressee_data(); |
653 | - if ( $this->_process_data() ) { |
|
653 | + if ($this->_process_data()) { |
|
654 | 654 | $addressees = $this->_addressees; |
655 | 655 | } |
656 | 656 | return $addressees; |
@@ -666,14 +666,14 @@ discard block |
||
666 | 666 | */ |
667 | 667 | protected function _process_data() { |
668 | 668 | //at a minimum, we NEED EE_Attendee objects. |
669 | - if ( empty( $this->_data->attendees ) ) { |
|
670 | - return false; //there's no data to process! |
|
669 | + if (empty($this->_data->attendees)) { |
|
670 | + return false; //there's no data to process! |
|
671 | 671 | } |
672 | 672 | // process addressees for each context. Child classes will have to have methods for |
673 | 673 | // each context defined to handle the processing of the data object within them |
674 | - foreach ( $this->_contexts as $context => $details ) { |
|
675 | - $xpctd_method = '_' . $context . '_addressees'; |
|
676 | - if ( ! method_exists( $this, $xpctd_method ) ) { |
|
674 | + foreach ($this->_contexts as $context => $details) { |
|
675 | + $xpctd_method = '_'.$context.'_addressees'; |
|
676 | + if ( ! method_exists($this, $xpctd_method)) { |
|
677 | 677 | throw new EE_Error( |
678 | 678 | sprintf( |
679 | 679 | __( |
@@ -685,7 +685,7 @@ discard block |
||
685 | 685 | ) |
686 | 686 | ); |
687 | 687 | } |
688 | - $this->_addressees[ $context ] = call_user_func( array( $this, $xpctd_method ) ); |
|
688 | + $this->_addressees[$context] = call_user_func(array($this, $xpctd_method)); |
|
689 | 689 | } |
690 | 690 | return true; //data was processed successfully. |
691 | 691 | } |
@@ -707,7 +707,7 @@ discard block |
||
707 | 707 | 'grand_total_line_item' => $this->_data->grand_total_line_item, |
708 | 708 | 'txn' => $this->_data->txn, |
709 | 709 | 'payments' => $this->_data->payments, |
710 | - 'payment' => isset( $this->_data->payment ) && $this->_data->payment instanceof EE_Payment |
|
710 | + 'payment' => isset($this->_data->payment) && $this->_data->payment instanceof EE_Payment |
|
711 | 711 | ? $this->_data->payment |
712 | 712 | : null, |
713 | 713 | 'reg_objs' => $this->_data->reg_objs, |
@@ -720,7 +720,7 @@ discard block |
||
720 | 720 | 'txn_status' => $this->_data->txn_status, |
721 | 721 | 'total_ticket_count' => $this->_data->total_ticket_count, |
722 | 722 | ); |
723 | - if ( is_array( $this->_data->primary_attendee_data ) ) { |
|
723 | + if (is_array($this->_data->primary_attendee_data)) { |
|
724 | 724 | $this->_default_addressee_data = array_merge( |
725 | 725 | $this->_default_addressee_data, |
726 | 726 | $this->_data->primary_attendee_data |
@@ -764,24 +764,24 @@ discard block |
||
764 | 764 | 'messenger', |
765 | 765 | ); |
766 | 766 | $contexts = $this->get_contexts(); |
767 | - foreach ( $contexts as $context => $details ) { |
|
768 | - $this->_valid_shortcodes[ $context ] = $all_shortcodes; |
|
767 | + foreach ($contexts as $context => $details) { |
|
768 | + $this->_valid_shortcodes[$context] = $all_shortcodes; |
|
769 | 769 | //make sure non admin context does not include the event_author shortcodes |
770 | - if ( $context != 'admin' ) { |
|
771 | - if ( ( $key = array_search( 'event_author', $this->_valid_shortcodes[ $context ] ) ) !== false ) { |
|
772 | - unset( $this->_valid_shortcodes[ $context ][ $key ] ); |
|
770 | + if ($context != 'admin') { |
|
771 | + if (($key = array_search('event_author', $this->_valid_shortcodes[$context])) !== false) { |
|
772 | + unset($this->_valid_shortcodes[$context][$key]); |
|
773 | 773 | } |
774 | 774 | } |
775 | 775 | } |
776 | 776 | // make sure admin context does not include the recipient_details shortcodes |
777 | 777 | // IF we have admin context hooked in message types might not have that context. |
778 | - if ( ! empty( $this->_valid_shortcodes['admin'] ) ) { |
|
779 | - if ( ( $key = array_search( 'recipient_details', $this->_valid_shortcodes['admin'] ) ) !== false ) { |
|
780 | - unset( $this->_valid_shortcodes['admin'][ $key ] ); |
|
778 | + if ( ! empty($this->_valid_shortcodes['admin'])) { |
|
779 | + if (($key = array_search('recipient_details', $this->_valid_shortcodes['admin'])) !== false) { |
|
780 | + unset($this->_valid_shortcodes['admin'][$key]); |
|
781 | 781 | } |
782 | 782 | //make sure admin context does not include the recipient_details shortcodes |
783 | - if ( ( $key = array_search( 'recipient_list', $this->_valid_shortcodes['admin'] ) ) !== false ) { |
|
784 | - unset( $this->_valid_shortcodes['admin'][ $key ] ); |
|
783 | + if (($key = array_search('recipient_list', $this->_valid_shortcodes['admin'])) !== false) { |
|
784 | + unset($this->_valid_shortcodes['admin'][$key]); |
|
785 | 785 | } |
786 | 786 | } |
787 | 787 | } |
@@ -794,9 +794,9 @@ discard block |
||
794 | 794 | * @param array $new_config array of valid shortcodes (by context) |
795 | 795 | * @return void sets valid_shortcodes property |
796 | 796 | */ |
797 | - public function reset_valid_shortcodes_config( $new_config ) { |
|
798 | - foreach ( $new_config as $context => $shortcodes ) { |
|
799 | - $this->_valid_shortcodes[ $context ] = $shortcodes; |
|
797 | + public function reset_valid_shortcodes_config($new_config) { |
|
798 | + foreach ($new_config as $context => $shortcodes) { |
|
799 | + $this->_valid_shortcodes[$context] = $shortcodes; |
|
800 | 800 | } |
801 | 801 | } |
802 | 802 | |
@@ -813,13 +813,13 @@ discard block |
||
813 | 813 | $addressees = array(); |
814 | 814 | // first we need to get the event admin user id for all the events |
815 | 815 | // and setup an addressee object for each unique admin user. |
816 | - foreach ( $this->_data->events as $line_ref => $event ) { |
|
817 | - $admin_id = $this->_get_event_admin_id( $event['ID'] ); |
|
816 | + foreach ($this->_data->events as $line_ref => $event) { |
|
817 | + $admin_id = $this->_get_event_admin_id($event['ID']); |
|
818 | 818 | //make sure we are just including the events that belong to this admin! |
819 | - $admin_events[ $admin_id ][ $line_ref ] = $event; |
|
819 | + $admin_events[$admin_id][$line_ref] = $event; |
|
820 | 820 | } |
821 | 821 | //k now we can loop through the event_admins and setup the addressee data. |
822 | - foreach ( $admin_events as $admin_id => $event_details ) { |
|
822 | + foreach ($admin_events as $admin_id => $event_details) { |
|
823 | 823 | $aee = array( |
824 | 824 | 'user_id' => $admin_id, |
825 | 825 | 'events' => $event_details, |
@@ -827,8 +827,8 @@ discard block |
||
827 | 827 | 'recipient_id' => $admin_id, |
828 | 828 | 'recipient_type' => 'WP_User', |
829 | 829 | ); |
830 | - $aee = array_merge( $this->_default_addressee_data, $aee ); |
|
831 | - $addressees[] = new EE_Messages_Addressee( $aee ); |
|
830 | + $aee = array_merge($this->_default_addressee_data, $aee); |
|
831 | + $addressees[] = new EE_Messages_Addressee($aee); |
|
832 | 832 | } |
833 | 833 | return $addressees; |
834 | 834 | } |
@@ -848,7 +848,7 @@ discard block |
||
848 | 848 | $aee['recipient_id'] = $aee['primary_att_obj'] instanceof EE_Attendee ? $aee['primary_att_obj']->ID() : 0; |
849 | 849 | $aee['recipient_type'] = 'Attendee'; |
850 | 850 | //great now we can instantiate the $addressee object and return (as an array); |
851 | - $add[] = new EE_Messages_Addressee( $aee ); |
|
851 | + $add[] = new EE_Messages_Addressee($aee); |
|
852 | 852 | return $add; |
853 | 853 | } |
854 | 854 | |
@@ -865,25 +865,25 @@ discard block |
||
865 | 865 | //we just have to loop through the attendees. We'll also set the attached events for each attendee. |
866 | 866 | //use to verify unique attendee emails... we don't want to sent multiple copies to the same attendee do we? |
867 | 867 | $already_processed = array(); |
868 | - foreach ( $this->_data->attendees as $att_id => $details ) { |
|
868 | + foreach ($this->_data->attendees as $att_id => $details) { |
|
869 | 869 | //set the attendee array to blank on each loop; |
870 | 870 | $aee = array(); |
871 | - if ( isset( $this->_data->reg_obj ) |
|
872 | - && ( $this->_data->reg_obj->attendee_ID() != $att_id ) |
|
871 | + if (isset($this->_data->reg_obj) |
|
872 | + && ($this->_data->reg_obj->attendee_ID() != $att_id) |
|
873 | 873 | && $this->_single_message |
874 | 874 | ) { |
875 | 875 | continue; |
876 | 876 | } |
877 | 877 | // is $this->_regs_for_sending present? |
878 | 878 | // If so, let's make sure we ONLY generate addressee for registrations in that array. |
879 | - if ( ! empty( $this->_regs_for_sending ) && is_array( $this->_regs_for_sending ) ) { |
|
880 | - $regs_allowed = array_intersect_key( array_flip( $this->_regs_for_sending ), $details['reg_objs'] ); |
|
881 | - if ( empty( $regs_allowed ) ) { |
|
879 | + if ( ! empty($this->_regs_for_sending) && is_array($this->_regs_for_sending)) { |
|
880 | + $regs_allowed = array_intersect_key(array_flip($this->_regs_for_sending), $details['reg_objs']); |
|
881 | + if (empty($regs_allowed)) { |
|
882 | 882 | continue; |
883 | 883 | } |
884 | 884 | } |
885 | 885 | if ( |
886 | - in_array( $details['attendee_email'], $already_processed ) |
|
886 | + in_array($details['attendee_email'], $already_processed) |
|
887 | 887 | && apply_filters( |
888 | 888 | 'FHEE__EE_message_type___attendee_addressees__prevent_duplicate_email_sends', |
889 | 889 | true, |
@@ -894,14 +894,14 @@ discard block |
||
894 | 894 | continue; |
895 | 895 | } |
896 | 896 | $already_processed[] = $details['attendee_email']; |
897 | - foreach ( $details as $item => $value ) { |
|
898 | - $aee[ $item ] = $value; |
|
899 | - if ( $item == 'line_ref' ) { |
|
900 | - foreach ( $value as $event_id ) { |
|
901 | - $aee['events'][ $event_id ] = $this->_data->events[ $event_id ]; |
|
897 | + foreach ($details as $item => $value) { |
|
898 | + $aee[$item] = $value; |
|
899 | + if ($item == 'line_ref') { |
|
900 | + foreach ($value as $event_id) { |
|
901 | + $aee['events'][$event_id] = $this->_data->events[$event_id]; |
|
902 | 902 | } |
903 | 903 | } |
904 | - if ( $item == 'attendee_email' ) { |
|
904 | + if ($item == 'attendee_email') { |
|
905 | 905 | $aee['attendee_email'] = $value; |
906 | 906 | } |
907 | 907 | /*if ( $item == 'registration_id' ) { |
@@ -910,13 +910,13 @@ discard block |
||
910 | 910 | } |
911 | 911 | // note the FIRST reg object in this array is the one |
912 | 912 | // we'll use for this attendee as the primary registration for this attendee. |
913 | - $aee['reg_obj'] = reset( $this->_data->attendees[ $att_id ]['reg_objs'] ); |
|
913 | + $aee['reg_obj'] = reset($this->_data->attendees[$att_id]['reg_objs']); |
|
914 | 914 | $aee['attendees'] = $this->_data->attendees; |
915 | 915 | $aee['recipient_id'] = $att_id; |
916 | 916 | $aee['recipient_type'] = 'Attendee'; |
917 | 917 | //merge in the primary attendee data |
918 | - $aee = array_merge( $this->_default_addressee_data, $aee ); |
|
919 | - $add[] = new EE_Messages_Addressee( $aee ); |
|
918 | + $aee = array_merge($this->_default_addressee_data, $aee); |
|
919 | + $add[] = new EE_Messages_Addressee($aee); |
|
920 | 920 | } |
921 | 921 | return $add; |
922 | 922 | } |
@@ -927,8 +927,8 @@ discard block |
||
927 | 927 | * @param $event_id |
928 | 928 | * @return int |
929 | 929 | */ |
930 | - protected function _get_event_admin_id( $event_id ) { |
|
931 | - $event = EEM_Event::instance()->get_one_by_ID( $event_id ); |
|
930 | + protected function _get_event_admin_id($event_id) { |
|
931 | + $event = EEM_Event::instance()->get_one_by_ID($event_id); |
|
932 | 932 | return $event instanceof EE_Event ? $event->wp_user() : 0; |
933 | 933 | } |
934 | 934 |