Completed
Branch BUG-9647-cpt-queries (303307)
by
unknown
31:50 queued 15:24
created
core/libraries/shortcodes/EE_Messenger_Shortcodes.lib.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -41,22 +41,22 @@  discard block
 block discarded – undo
41 41
 		$this->label = __('Messenger Shortcodes', 'event_espresso');
42 42
 		$this->description = __('All shortcodes that are messenger specific.', 'event_espresso');
43 43
 		/** @type EE_Message_Resource_Manager $message_resource_manager */
44
-		$message_resource_manager = EE_Registry::instance()->load_lib( 'Message_Resource_Manager' );
44
+		$message_resource_manager = EE_Registry::instance()->load_lib('Message_Resource_Manager');
45 45
 		//add messages about what happens  when the messenger is active.
46 46
 		$this->_active_messengers = $message_resource_manager->active_messengers();
47 47
 
48
-		$this->_shortcodes['[DISPLAY_HTML_URL]'] =__('This will return a link to view the template in a browser if the html messenger is active.', 'event_espresso');
49
-		$this->_shortcodes['[DISPLAY_PDF_URL]'] = __('This will return a link to generate a pdf for the template if the pdf messenger is active.', 'event_espresso' );
48
+		$this->_shortcodes['[DISPLAY_HTML_URL]'] = __('This will return a link to view the template in a browser if the html messenger is active.', 'event_espresso');
49
+		$this->_shortcodes['[DISPLAY_PDF_URL]'] = __('This will return a link to generate a pdf for the template if the pdf messenger is active.', 'event_espresso');
50 50
 		$this->_shortcodes['[DISPLAY_PDF_BUTTON]'] = __('This will return html for a download pdf button trigger if the pdf messenger is active.', 'event_espresso');
51 51
 
52 52
 		//show error message about buttons/urls not working as expected if messenger deactivated.
53
-		if ( is_admin() && isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'update_message_template' ) {
54
-			if ( ! isset( $this->_active_messengers['pdf'] ) ) {
55
-				EE_Error::add_attention( __('Be aware that the pdf messenger is inactive.  This means that any pdf related shortcodes will parse to an empty string.', 'event_espresso' ) );
53
+		if (is_admin() && isset($_REQUEST['action']) && $_REQUEST['action'] == 'update_message_template') {
54
+			if ( ! isset($this->_active_messengers['pdf'])) {
55
+				EE_Error::add_attention(__('Be aware that the pdf messenger is inactive.  This means that any pdf related shortcodes will parse to an empty string.', 'event_espresso'));
56 56
 			}
57 57
 
58
-			if ( !isset( $this->_active_messengers['html'] ) ) {
59
-				EE_Error::add_attention( __('Be aware that the html messenger is inactive. This means that any html related shortcodes will parse to an empty string.', 'event_espresso' ) );
58
+			if ( ! isset($this->_active_messengers['html'])) {
59
+				EE_Error::add_attention(__('Be aware that the html messenger is inactive. This means that any html related shortcodes will parse to an empty string.', 'event_espresso'));
60 60
 			}
61 61
 		}
62 62
 
@@ -64,24 +64,24 @@  discard block
 block discarded – undo
64 64
 
65 65
 
66 66
 
67
-	protected function _parser( $shortcode ) {
67
+	protected function _parser($shortcode) {
68 68
 		//make sure we end up with a copy of the EE_Messages_Addressee object
69 69
 		$recipient = $this->_data instanceof EE_Messages_Addressee ? $this->_data : NULL;
70
-		$recipient = ! $recipient instanceof EE_Messages_Addressee && is_array($this->_data) && isset( $this->_data['data'] ) && $this->_data['data'] instanceof EE_Messages_Addressee ? $this->_data['data'] : $recipient;
71
-		$recipient = ! $recipient instanceof EE_Messages_Addressee && !empty( $this->_extra_data['data'] ) && $this->_extra_data['data'] instanceof EE_Messages_Addressee ? $this->_extra_data['data'] : $recipient;
70
+		$recipient = ! $recipient instanceof EE_Messages_Addressee && is_array($this->_data) && isset($this->_data['data']) && $this->_data['data'] instanceof EE_Messages_Addressee ? $this->_data['data'] : $recipient;
71
+		$recipient = ! $recipient instanceof EE_Messages_Addressee && ! empty($this->_extra_data['data']) && $this->_extra_data['data'] instanceof EE_Messages_Addressee ? $this->_extra_data['data'] : $recipient;
72 72
 
73
-		if ( ! $recipient instanceof EE_Messages_Addressee )
73
+		if ( ! $recipient instanceof EE_Messages_Addressee)
74 74
 			return '';
75 75
 
76
-		switch ( $shortcode ) {
76
+		switch ($shortcode) {
77 77
 			case '[DISPLAY_HTML_URL]' :
78
-				return  isset( $this->_active_messengers['html'] ) ? $this->_get_url( $recipient, 'html' ) : '';
78
+				return  isset($this->_active_messengers['html']) ? $this->_get_url($recipient, 'html') : '';
79 79
 				break;
80 80
 			case '[DISPLAY_PDF_URL]' :
81
-				return  isset( $this->_active_messengers['pdf'] ) ? $this->_get_url( $recipient, 'pdf' ) : '';
81
+				return  isset($this->_active_messengers['pdf']) ? $this->_get_url($recipient, 'pdf') : '';
82 82
 				break;
83 83
 			case '[DISPLAY_PDF_BUTTON]' :
84
-				return  isset( $this->_active_messengers['pdf'] ) ? $this->_get_button( $recipient, 'pdf' ) : '';
84
+				return  isset($this->_active_messengers['pdf']) ? $this->_get_button($recipient, 'pdf') : '';
85 85
 				break;
86 86
 		}
87 87
 		return '';
@@ -99,11 +99,11 @@  discard block
 block discarded – undo
99 99
 	 *
100 100
 	 * @return string                Generated html
101 101
 	 */
102
-	private function _get_button( EE_Messages_Addressee $recipient, $sending_messenger ) {
103
-		$download_text = $sending_messenger == 'pdf' ? __('Download PDF', 'event_espresso') : __('Show HTML', 'event_espresso' );
102
+	private function _get_button(EE_Messages_Addressee $recipient, $sending_messenger) {
103
+		$download_text = $sending_messenger == 'pdf' ? __('Download PDF', 'event_espresso') : __('Show HTML', 'event_espresso');
104 104
 		$content = '
105
-<form method="post" action="' . $this->_get_url( $recipient, $sending_messenger ) . '" >
106
-	<input class="print_button" type="submit" value="' . $download_text . '" />
105
+<form method="post" action="' . $this->_get_url($recipient, $sending_messenger).'" >
106
+	<input class="print_button" type="submit" value="' . $download_text.'" />
107 107
 </form>
108 108
 		';
109 109
 		return $content;
@@ -122,18 +122,18 @@  discard block
 block discarded – undo
122 122
 	 * @return string The generated url for displaying the link.
123 123
 	 * @throws EE_Error
124 124
 	 */
125
-	private function _get_url( EE_Messages_Addressee $recipient, $sending_messenger ) {
125
+	private function _get_url(EE_Messages_Addressee $recipient, $sending_messenger) {
126 126
 
127 127
 		$reg = $recipient->reg_obj;
128 128
 		$reg = ! $reg instanceof EE_Registration ? $recipient->primary_reg_obj : $reg;
129 129
 
130 130
 
131
-		if ( $this->_message_type instanceof EE_message_type && $this->_message instanceof EE_Message ) {
132
-			EE_Registry::instance()->load_helper( 'MSG_Template' );
131
+		if ($this->_message_type instanceof EE_message_type && $this->_message instanceof EE_Message) {
132
+			EE_Registry::instance()->load_helper('MSG_Template');
133 133
 			try {
134
-				return EEH_MSG_Template::get_url_trigger( $this->_message_type, $this->_message, $reg, $sending_messenger );
135
-			} catch( EE_Error $e ) {
136
-				if ( WP_DEBUG ) {
134
+				return EEH_MSG_Template::get_url_trigger($this->_message_type, $this->_message, $reg, $sending_messenger);
135
+			} catch (EE_Error $e) {
136
+				if (WP_DEBUG) {
137 137
 					$e->get_error();
138 138
 				}
139 139
 			}
Please login to merge, or discard this patch.
EE_Messages_Email_Declined_Registration_Validator.class.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION') )
3
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
4 4
 	exit('NO direct script access allowed');
5 5
 
6 6
 /**
@@ -30,11 +30,11 @@  discard block
 block discarded – undo
30 30
 class EE_Messages_Email_Cancelled_Registration_Validator extends EE_Messages_Validator {
31 31
 
32 32
 
33
-	public function __construct( $fields, $context ) {
33
+	public function __construct($fields, $context) {
34 34
 		$this->_m_name = 'email';
35 35
 		$this->_mt_name = 'cancelled_registration';
36 36
 
37
-		parent::__construct( $fields, $context );
37
+		parent::__construct($fields, $context);
38 38
 	}
39 39
 
40 40
 	/**
@@ -46,9 +46,9 @@  discard block
 block discarded – undo
46 46
 			'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'),
47 47
 			'required' => array('[EVENT_LIST]')
48 48
 			);
49
-		$this->_messenger->set_validator_config( $new_config );
49
+		$this->_messenger->set_validator_config($new_config);
50 50
 
51
-		if ( $this->_context != 'admin' )
51
+		if ($this->_context != 'admin')
52 52
 			$this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list');
53 53
 
54 54
 		$this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]');
Please login to merge, or discard this patch.
payment_failed/EE_Messages_Email_Payment_Failed_Validator.class.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION') )
3
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
4 4
 	exit('NO direct script access allowed');
5 5
 
6 6
 /**
@@ -30,11 +30,11 @@  discard block
 block discarded – undo
30 30
 class EE_Messages_Email_Payment_Reminder_Validator extends EE_Messages_Validator {
31 31
 
32 32
 
33
-	public function __construct( $fields, $context ) {
33
+	public function __construct($fields, $context) {
34 34
 		$this->_m_name = 'email';
35 35
 		$this->_mt_name = 'payment_reminder';
36 36
 
37
-		parent::__construct( $fields, $context );
37
+		parent::__construct($fields, $context);
38 38
 	}
39 39
 
40 40
 	/**
@@ -45,17 +45,17 @@  discard block
 block discarded – undo
45 45
 
46 46
 		//modify just event_list
47 47
 		$new_config['event_list'] = array(
48
-			'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization','recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list')
48
+			'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list')
49 49
 			);
50 50
 		$new_config['ticket_list'] = array(
51 51
 			'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'recipient_details', 'transaction')
52 52
 			);
53 53
 		$new_config['content'] = array(
54
-			'shortcodes' => array('event_list','attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger')
54
+			'shortcodes' => array('event_list', 'attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger')
55 55
 			);
56
-		$this->_messenger->set_validator_config( $new_config );
56
+		$this->_messenger->set_validator_config($new_config);
57 57
 
58
-		if ( $this->_context != 'admin' )
58
+		if ($this->_context != 'admin')
59 59
 			$this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list');
60 60
 
61 61
 		$this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]');
Please login to merge, or discard this patch.
payment_declined/EE_Messages_Email_Payment_Declined_Validator.class.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION') )
3
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
4 4
 	exit('NO direct script access allowed');
5 5
 
6 6
 /**
@@ -30,11 +30,11 @@  discard block
 block discarded – undo
30 30
 class EE_Messages_Email_Payment_Reminder_Validator extends EE_Messages_Validator {
31 31
 
32 32
 
33
-	public function __construct( $fields, $context ) {
33
+	public function __construct($fields, $context) {
34 34
 		$this->_m_name = 'email';
35 35
 		$this->_mt_name = 'payment_reminder';
36 36
 
37
-		parent::__construct( $fields, $context );
37
+		parent::__construct($fields, $context);
38 38
 	}
39 39
 
40 40
 	/**
@@ -45,17 +45,17 @@  discard block
 block discarded – undo
45 45
 
46 46
 		//modify just event_list
47 47
 		$new_config['event_list'] = array(
48
-			'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization','recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list')
48
+			'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list')
49 49
 			);
50 50
 		$new_config['ticket_list'] = array(
51 51
 			'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'recipient_details', 'transaction')
52 52
 			);
53 53
 		$new_config['content'] = array(
54
-			'shortcodes' => array('event_list','attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger')
54
+			'shortcodes' => array('event_list', 'attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger')
55 55
 			);
56
-		$this->_messenger->set_validator_config( $new_config );
56
+		$this->_messenger->set_validator_config($new_config);
57 57
 
58
-		if ( $this->_context != 'admin' )
58
+		if ($this->_context != 'admin')
59 59
 			$this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list');
60 60
 
61 61
 		$this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]');
Please login to merge, or discard this patch.
payment_cancelled/EE_Messages_Email_Payment_Cancelled_Validator.class.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION') )
3
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
4 4
 	exit('NO direct script access allowed');
5 5
 
6 6
 /**
@@ -30,11 +30,11 @@  discard block
 block discarded – undo
30 30
 class EE_Messages_Email_Payment_Reminder_Validator extends EE_Messages_Validator {
31 31
 
32 32
 
33
-	public function __construct( $fields, $context ) {
33
+	public function __construct($fields, $context) {
34 34
 		$this->_m_name = 'email';
35 35
 		$this->_mt_name = 'payment_reminder';
36 36
 
37
-		parent::__construct( $fields, $context );
37
+		parent::__construct($fields, $context);
38 38
 	}
39 39
 
40 40
 	/**
@@ -45,17 +45,17 @@  discard block
 block discarded – undo
45 45
 
46 46
 		//modify just event_list
47 47
 		$new_config['event_list'] = array(
48
-			'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization','recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list')
48
+			'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list')
49 49
 			);
50 50
 		$new_config['ticket_list'] = array(
51 51
 			'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'recipient_details', 'transaction')
52 52
 			);
53 53
 		$new_config['content'] = array(
54
-			'shortcodes' => array('event_list','attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger')
54
+			'shortcodes' => array('event_list', 'attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger')
55 55
 			);
56
-		$this->_messenger->set_validator_config( $new_config );
56
+		$this->_messenger->set_validator_config($new_config);
57 57
 
58
-		if ( $this->_context != 'admin' )
58
+		if ($this->_context != 'admin')
59 59
 			$this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list');
60 60
 
61 61
 		$this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]');
Please login to merge, or discard this patch.
admin_pages/events/Events_Admin_List_Table.class.php 1 patch
Spacing   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -43,9 +43,9 @@  discard block
 block discarded – undo
43 43
 	 *
44 44
 	 * @param EE_Admin_Page $admin_page
45 45
 	 */
46
-	public function __construct( $admin_page ) {
46
+	public function __construct($admin_page) {
47 47
 		parent::__construct($admin_page);
48
-		require_once( EE_HELPERS . 'EEH_DTT_Helper.helper.php' );
48
+		require_once(EE_HELPERS.'EEH_DTT_Helper.helper.php');
49 49
 	}
50 50
 
51 51
 
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 	 */
55 55
 	protected function _setup_data() {
56 56
 		$this->_data = $this->_admin_page->get_events($this->_per_page, $this->_current_page);
57
- 		$this->_all_data_count = $this->_admin_page->get_events(0,0, TRUE);
57
+ 		$this->_all_data_count = $this->_admin_page->get_events(0, 0, TRUE);
58 58
 	}
59 59
 
60 60
 
@@ -85,17 +85,17 @@  discard block
 block discarded – undo
85 85
 
86 86
 
87 87
 		$this->_sortable_columns = array(
88
-			'id' => array( 'EVT_ID' => true ),
89
-			'name' => array( 'EVT_name' => false ),
90
-			'author' => array( 'EVT_wp_user' => false ),
91
-			'venue' => array( 'Venue.VNU_name' => false ),
88
+			'id' => array('EVT_ID' => true),
89
+			'name' => array('EVT_name' => false),
90
+			'author' => array('EVT_wp_user' => false),
91
+			'venue' => array('Venue.VNU_name' => false),
92 92
 			'start_date_time' => array('Datetime.DTT_EVT_start' => false),
93 93
 			'reg_begins' => array('Datetime.Ticket.TKT_start_date' => false),
94 94
 			);
95 95
 
96 96
 		$this->_primary_column = 'id';
97 97
 
98
-		$this->_hidden_columns = array( 'author' );
98
+		$this->_hidden_columns = array('author');
99 99
 	}
100 100
 
101 101
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 	protected function _add_view_counts() {
114 114
 		$this->_views['all']['count'] = $this->_admin_page->total_events();
115 115
 		$this->_views['draft']['count'] = $this->_admin_page->total_events_draft();
116
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_events', 'espresso_events_trash_events' ) ) {
116
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_events', 'espresso_events_trash_events')) {
117 117
 			$this->_views['trash']['count'] = $this->_admin_page->total_trashed_events();
118 118
 		}
119 119
 	}
@@ -124,11 +124,11 @@  discard block
 block discarded – undo
124 124
 	 *
125 125
 	 * @return string
126 126
 	 */
127
-	protected function _get_row_class( $item ) {
128
-		$class = parent::_get_row_class( $item );
127
+	protected function _get_row_class($item) {
128
+		$class = parent::_get_row_class($item);
129 129
 		//add status class
130
-		$class .= $item instanceof EE_Event ? ' ee-status-strip event-status-' . $item->get_active_status() : '';
131
-		if ( $this->_has_checkbox_column ) {
130
+		$class .= $item instanceof EE_Event ? ' ee-status-strip event-status-'.$item->get_active_status() : '';
131
+		if ($this->_has_checkbox_column) {
132 132
 			$class .= ' has-checkbox-column';
133 133
 		}
134 134
 		return $class;
@@ -140,8 +140,8 @@  discard block
 block discarded – undo
140 140
 	 *
141 141
 	 * @return string
142 142
 	 */
143
-	public function column_status( EE_Event $item ) {
144
-		return '<span class="ee-status-strip ee-status-strip-td event-status-' . $item->get_active_status() . '"></span>';
143
+	public function column_status(EE_Event $item) {
144
+		return '<span class="ee-status-strip ee-status-strip-td event-status-'.$item->get_active_status().'"></span>';
145 145
 	}/**/
146 146
 
147 147
 
@@ -150,14 +150,14 @@  discard block
 block discarded – undo
150 150
 	 *
151 151
 	 * @return string
152 152
 	 */
153
-	public function column_cb( $item ) {
154
-		if ( ! $item instanceof EE_Event ) {
153
+	public function column_cb($item) {
154
+		if ( ! $item instanceof EE_Event) {
155 155
 			return '';
156 156
 		}
157 157
 		$this->_dtt = $item->primary_datetime(); //set this for use in other columns
158 158
 
159 159
 		//does event have any attached registrations?
160
-		$regs = $item->count_related( 'Registration' );
160
+		$regs = $item->count_related('Registration');
161 161
 		return $regs > 0 && $this->_view == 'trash' ? '<span class="ee-lock-icon"></span>' : sprintf(
162 162
 			'<input type="checkbox" name="EVT_IDs[]" value="%s" />', $item->ID()
163 163
 		);
@@ -169,9 +169,9 @@  discard block
 block discarded – undo
169 169
 	 *
170 170
 	 * @return mixed|string
171 171
 	 */
172
-	public function column_id( EE_Event $item ) {
172
+	public function column_id(EE_Event $item) {
173 173
 		$content = $item->ID();
174
-		$content .= '  <span class="show-on-mobile-view-only">' . $item->name() . '</span>';
174
+		$content .= '  <span class="show-on-mobile-view-only">'.$item->name().'</span>';
175 175
 		return $content;
176 176
 	}
177 177
 
@@ -181,16 +181,16 @@  discard block
 block discarded – undo
181 181
 	 *
182 182
 	 * @return string
183 183
 	 */
184
-	public function column_name( EE_Event $item ) {
184
+	public function column_name(EE_Event $item) {
185 185
 		$edit_query_args = array(
186 186
 				'action' => 'edit',
187 187
 				'post' => $item->ID()
188 188
 			);
189
-		$edit_link = EE_Admin_Page::add_query_args_and_nonce( $edit_query_args, EVENTS_ADMIN_URL );
190
-		$actions = $this->_column_name_action_setup( $item );
189
+		$edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EVENTS_ADMIN_URL);
190
+		$actions = $this->_column_name_action_setup($item);
191 191
 		$status = ''; //$item->status() !== 'publish' ? ' (' . $item->status() . ')' : '';
192
-		$content = '<strong><a class="row-title" href="' . $edit_link . '">' . $item->name() . '</a></strong>' . $status;
193
-		$content .= '<br><span class="ee-status-text-small">' . EEH_Template::pretty_status( $item->get_active_status(), false, 'sentence' ) . '</span>';
192
+		$content = '<strong><a class="row-title" href="'.$edit_link.'">'.$item->name().'</a></strong>'.$status;
193
+		$content .= '<br><span class="ee-status-text-small">'.EEH_Template::pretty_status($item->get_active_status(), false, 'sentence').'</span>';
194 194
 		$content .= $this->row_actions($actions);
195 195
 		return $content;
196 196
 
@@ -207,72 +207,72 @@  discard block
 block discarded – undo
207 207
 	 *
208 208
 	 * @return array array of actions
209 209
 	 */
210
-	protected function _column_name_action_setup( EE_Event $item ) {
210
+	protected function _column_name_action_setup(EE_Event $item) {
211 211
 		//todo: remove when attendees is active
212
-		if ( !defined('REG_ADMIN_URL') )
212
+		if ( ! defined('REG_ADMIN_URL'))
213 213
 			define('REG_ADMIN_URL', EVENTS_ADMIN_URL);
214 214
 
215 215
 		$actions = array();
216 216
 
217
-		if ( EE_Registry::instance()->CAP->current_user_can('ee_edit_event', 'espresso_events_edit', $item->ID() ) ) {
217
+		if (EE_Registry::instance()->CAP->current_user_can('ee_edit_event', 'espresso_events_edit', $item->ID())) {
218 218
 			$edit_query_args = array(
219 219
 					'action' => 'edit',
220 220
 					'post' => $item->ID()
221 221
 				);
222
-			$edit_link = EE_Admin_Page::add_query_args_and_nonce( $edit_query_args, EVENTS_ADMIN_URL );
223
-			$actions['edit'] = '<a href="' . $edit_link . '" title="' . esc_attr__('Edit Event', 'event_espresso') . '">' . __('Edit', 'event_espresso') . '</a>';
222
+			$edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EVENTS_ADMIN_URL);
223
+			$actions['edit'] = '<a href="'.$edit_link.'" title="'.esc_attr__('Edit Event', 'event_espresso').'">'.__('Edit', 'event_espresso').'</a>';
224 224
 
225 225
 		}
226 226
 
227
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registration', 'espresso_registrations_view_registration', $item->ID() ) ) {
227
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_registration', 'espresso_registrations_view_registration', $item->ID())) {
228 228
 			$attendees_query_args = array(
229 229
 					'action' => 'default',
230 230
 					'event_id' => $item->ID()
231 231
 				);
232
-			$attendees_link = EE_Admin_Page::add_query_args_and_nonce( $attendees_query_args, REG_ADMIN_URL );
233
-			$actions['attendees'] = '<a href="' . $attendees_link . '" title="' . esc_attr__('View Registrations', 'event_espresso') . '">' . __('Registrations', 'event_espresso') . '</a>';
232
+			$attendees_link = EE_Admin_Page::add_query_args_and_nonce($attendees_query_args, REG_ADMIN_URL);
233
+			$actions['attendees'] = '<a href="'.$attendees_link.'" title="'.esc_attr__('View Registrations', 'event_espresso').'">'.__('Registrations', 'event_espresso').'</a>';
234 234
 		}
235 235
 
236
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_event', 'espresso_events_trash_event', $item->ID() ) ) {
236
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_event', 'espresso_events_trash_event', $item->ID())) {
237 237
 			$trash_event_query_args = array(
238 238
 					'action' => 'trash_event',
239 239
 					'EVT_ID' => $item->ID()
240 240
 				);
241
-			$trash_event_link = EE_Admin_Page::add_query_args_and_nonce( $trash_event_query_args, EVENTS_ADMIN_URL );
241
+			$trash_event_link = EE_Admin_Page::add_query_args_and_nonce($trash_event_query_args, EVENTS_ADMIN_URL);
242 242
 		}
243 243
 
244
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_event', 'espresso_events_restore_event', $item->ID() ) ) {
244
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_event', 'espresso_events_restore_event', $item->ID())) {
245 245
 			$restore_event_query_args = array(
246 246
 					'action' => 'restore_event',
247 247
 					'EVT_ID' => $item->ID()
248 248
 				);
249
-			$restore_event_link = EE_Admin_Page::add_query_args_and_nonce( $restore_event_query_args, EVENTS_ADMIN_URL );
249
+			$restore_event_link = EE_Admin_Page::add_query_args_and_nonce($restore_event_query_args, EVENTS_ADMIN_URL);
250 250
 		}
251 251
 
252
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_event', 'espresso_events_delete_event', $item->ID() ) ) {
252
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_event', 'espresso_events_delete_event', $item->ID())) {
253 253
 			$delete_event_query_args = array(
254 254
 					'action' => 'delete_event',
255 255
 					'EVT_ID' => $item->ID()
256 256
 				);
257
-			$delete_event_link = EE_Admin_Page::add_query_args_and_nonce( $delete_event_query_args, EVENTS_ADMIN_URL );
257
+			$delete_event_link = EE_Admin_Page::add_query_args_and_nonce($delete_event_query_args, EVENTS_ADMIN_URL);
258 258
 		}
259 259
 
260 260
 		$view_link = get_permalink($item->ID());
261 261
 
262
-		$actions['view'] = '<a href="' . $view_link . '" title="' . esc_attr__('View Event', 'event_espresso') . '">' . __('View', 'event_espresso') . '</a>';
262
+		$actions['view'] = '<a href="'.$view_link.'" title="'.esc_attr__('View Event', 'event_espresso').'">'.__('View', 'event_espresso').'</a>';
263 263
 
264
-		switch ( $item->get( 'status' ) ) {
264
+		switch ($item->get('status')) {
265 265
 			case 'trash' :
266
-					if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_event', 'espresso_events_restore_event', $item->ID() ) ) {
267
-						$actions['restore_from_trash'] = '<a href="' . $restore_event_link . '" title="' . esc_attr__('Restore from Trash', 'event_espresso') . '">' . __('Restore from Trash', 'event_espresso') . '</a>';
266
+					if (EE_Registry::instance()->CAP->current_user_can('ee_delete_event', 'espresso_events_restore_event', $item->ID())) {
267
+						$actions['restore_from_trash'] = '<a href="'.$restore_event_link.'" title="'.esc_attr__('Restore from Trash', 'event_espresso').'">'.__('Restore from Trash', 'event_espresso').'</a>';
268 268
 					}
269
-					if ( $item->count_related('Registration') === 0 && EE_Registry::instance()->CAP->current_user_can( 'ee_delete_event', 'espresso_events_delete_event', $item->ID() ) ) {
270
-						$actions['delete'] = '<a href="' . $delete_event_link . '" title="' . esc_attr__('Delete Permanently', 'event_espresso') . '">' . __('Delete Permanently', 'event_espresso') . '</a>';
269
+					if ($item->count_related('Registration') === 0 && EE_Registry::instance()->CAP->current_user_can('ee_delete_event', 'espresso_events_delete_event', $item->ID())) {
270
+						$actions['delete'] = '<a href="'.$delete_event_link.'" title="'.esc_attr__('Delete Permanently', 'event_espresso').'">'.__('Delete Permanently', 'event_espresso').'</a>';
271 271
 					}
272 272
 				break;
273 273
 			default :
274
-					if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_event', 'espresso_events_trash_event', $item->ID() ) ) {
275
-						$actions['move to trash'] = '<a href="' . $trash_event_link . '" title="' . esc_attr__('Trash Event', 'event_espresso') . '">' . __('Trash', 'event_espresso') . '</a>';
274
+					if (EE_Registry::instance()->CAP->current_user_can('ee_delete_event', 'espresso_events_trash_event', $item->ID())) {
275
+						$actions['move to trash'] = '<a href="'.$trash_event_link.'" title="'.esc_attr__('Trash Event', 'event_espresso').'">'.__('Trash', 'event_espresso').'</a>';
276 276
 					}
277 277
 		}
278 278
 		return $actions;
@@ -284,17 +284,17 @@  discard block
 block discarded – undo
284 284
 	 *
285 285
 	 * @return string
286 286
 	 */
287
-	public function column_author( EE_Event $item ) {
287
+	public function column_author(EE_Event $item) {
288 288
 		//user author info
289
-		$event_author = get_userdata( $item->wp_user() );
290
-		$gravatar = get_avatar( $item->wp_user(), '15' );
289
+		$event_author = get_userdata($item->wp_user());
290
+		$gravatar = get_avatar($item->wp_user(), '15');
291 291
 		//filter link
292 292
 		$query_args = array(
293 293
 			'action' => 'default',
294 294
 			'EVT_wp_user' => $item->wp_user()
295 295
 			);
296
-		$filter_url = EE_Admin_Page::add_query_args_and_nonce( $query_args, EVENTS_ADMIN_URL );
297
-		return $gravatar . '  <a href="' . $filter_url . '" title="' . esc_attr__('Click to filter events by this author.', 'event_espresso') . '">' . $event_author->display_name . '</a>';
296
+		$filter_url = EE_Admin_Page::add_query_args_and_nonce($query_args, EVENTS_ADMIN_URL);
297
+		return $gravatar.'  <a href="'.$filter_url.'" title="'.esc_attr__('Click to filter events by this author.', 'event_espresso').'">'.$event_author->display_name.'</a>';
298 298
 	}
299 299
 
300 300
 
@@ -303,9 +303,9 @@  discard block
 block discarded – undo
303 303
 	 *
304 304
 	 * @return string
305 305
 	 */
306
-	public function column_venue( EE_Event $item ) {
307
-		$venue = $item->get_first_related( 'Venue' );
308
-		return !empty( $venue ) ? $venue->name() : '';
306
+	public function column_venue(EE_Event $item) {
307
+		$venue = $item->get_first_related('Venue');
308
+		return ! empty($venue) ? $venue->name() : '';
309 309
 	}
310 310
 
311 311
 
@@ -314,10 +314,10 @@  discard block
 block discarded – undo
314 314
 	 *
315 315
 	 * @throws EE_Error
316 316
 	 */
317
-	public function column_start_date_time( EE_Event $item ) {
318
-		echo !empty( $this->_dtt ) ?  $this->_dtt->get_i18n_datetime('DTT_EVT_start') : __('No Date was saved for this Event', 'event_espresso');
317
+	public function column_start_date_time(EE_Event $item) {
318
+		echo ! empty($this->_dtt) ? $this->_dtt->get_i18n_datetime('DTT_EVT_start') : __('No Date was saved for this Event', 'event_espresso');
319 319
 		//display in user's timezone?
320
-		echo !empty( $this->_dtt ) ? $this->_dtt->display_in_my_timezone('DTT_EVT_start', 'get_i18n_datetime', '', 'My Timezone: ' ) : '';
320
+		echo ! empty($this->_dtt) ? $this->_dtt->display_in_my_timezone('DTT_EVT_start', 'get_i18n_datetime', '', 'My Timezone: ') : '';
321 321
 
322 322
 	}
323 323
 
@@ -327,11 +327,11 @@  discard block
 block discarded – undo
327 327
 	 *
328 328
 	 * @throws EE_Error
329 329
 	 */
330
-	public function column_reg_begins( EE_Event $item ) {
330
+	public function column_reg_begins(EE_Event $item) {
331 331
 		$reg_start = $item->get_ticket_with_earliest_start_time();
332
-		echo !empty( $reg_start ) ? $reg_start->get_i18n_datetime('TKT_start_date') : __('No Tickets have been setup for this Event', 'event_espresso');
332
+		echo ! empty($reg_start) ? $reg_start->get_i18n_datetime('TKT_start_date') : __('No Tickets have been setup for this Event', 'event_espresso');
333 333
 		//display in user's timezone?
334
-		echo !empty( $reg_start ) ? $reg_start->display_in_my_timezone('TKT_start_date', 'get_i18n_datetime', '', 'My Timezone: ' ) : '';/**/
334
+		echo ! empty($reg_start) ? $reg_start->display_in_my_timezone('TKT_start_date', 'get_i18n_datetime', '', 'My Timezone: ') : ''; /**/
335 335
 	}
336 336
 
337 337
 
@@ -340,14 +340,14 @@  discard block
 block discarded – undo
340 340
 	 *
341 341
 	 * @return int|string
342 342
 	 */
343
-	public function column_attendees( EE_Event $item ) {
343
+	public function column_attendees(EE_Event $item) {
344 344
 		$attendees_query_args = array(
345 345
 				'action' => 'default',
346 346
 				'event_id' => $item->ID()
347 347
 			);
348
-		$attendees_link = EE_Admin_Page::add_query_args_and_nonce( $attendees_query_args, REG_ADMIN_URL );
349
-		$registered_attendees = EEM_Registration::instance()->get_event_registration_count( $item->ID() );
350
-		return  EE_Registry::instance()->CAP->current_user_can( 'ee_read_registration', 'espresso_registrations_view_registration', $item->ID() ) ? '<a href="' . $attendees_link . '">' . $registered_attendees . '</a>' : $registered_attendees;
348
+		$attendees_link = EE_Admin_Page::add_query_args_and_nonce($attendees_query_args, REG_ADMIN_URL);
349
+		$registered_attendees = EEM_Registration::instance()->get_event_registration_count($item->ID());
350
+		return  EE_Registry::instance()->CAP->current_user_can('ee_read_registration', 'espresso_registrations_view_registration', $item->ID()) ? '<a href="'.$attendees_link.'">'.$registered_attendees.'</a>' : $registered_attendees;
351 351
 	}
352 352
 
353 353
 
@@ -356,8 +356,8 @@  discard block
 block discarded – undo
356 356
 	 *
357 357
 	 * @return float
358 358
 	 */
359
-	public function column_tkts_sold( EE_Event $item ) {
360
-		return EEM_Ticket::instance()->sum(array( array('Datetime.EVT_ID' => $item->ID() )), 'TKT_sold' );
359
+	public function column_tkts_sold(EE_Event $item) {
360
+		return EEM_Ticket::instance()->sum(array(array('Datetime.EVT_ID' => $item->ID())), 'TKT_sold');
361 361
 	}
362 362
 
363 363
 
@@ -366,38 +366,38 @@  discard block
 block discarded – undo
366 366
 	 *
367 367
 	 * @return string
368 368
 	 */
369
-	public function column_actions( EE_Event $item ) {
369
+	public function column_actions(EE_Event $item) {
370 370
 		//todo: remove when attendees is active
371
-		if ( !defined('REG_ADMIN_URL') )
371
+		if ( ! defined('REG_ADMIN_URL'))
372 372
 			define('REG_ADMIN_URL', EVENTS_ADMIN_URL);
373 373
 		$actionlinks = array();
374 374
 
375 375
 		$view_link = get_permalink($item->ID());
376 376
 
377
-		$actionlinks[] = '<a href="' .  $view_link . '" title="' . esc_attr__('View Event', 'event_espresso') . '" target="_blank">';
377
+		$actionlinks[] = '<a href="'.$view_link.'" title="'.esc_attr__('View Event', 'event_espresso').'" target="_blank">';
378 378
 		$actionlinks[] = '<div class="dashicons dashicons-search"></div></a>';
379 379
 
380
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_event', 'espresso_events_edit', $item->ID() ) ) {
380
+		if (EE_Registry::instance()->CAP->current_user_can('ee_edit_event', 'espresso_events_edit', $item->ID())) {
381 381
 			$edit_query_args = array(
382 382
 					'action' => 'edit',
383 383
 					'post' => $item->ID()
384 384
 				);
385
-			$edit_link = EE_Admin_Page::add_query_args_and_nonce( $edit_query_args, EVENTS_ADMIN_URL );
386
-			$actionlinks[] = '<a href="' . $edit_link . '" title="' . esc_attr__('Edit Event', 'event_espresso') . '"><div class="ee-icon ee-icon-calendar-edit"></div></a>';
385
+			$edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EVENTS_ADMIN_URL);
386
+			$actionlinks[] = '<a href="'.$edit_link.'" title="'.esc_attr__('Edit Event', 'event_espresso').'"><div class="ee-icon ee-icon-calendar-edit"></div></a>';
387 387
 		}
388 388
 
389
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registration', 'espresso_registrations_view_registration', $item->ID() ) ) {
389
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_registration', 'espresso_registrations_view_registration', $item->ID())) {
390 390
 			$attendees_query_args = array(
391 391
 				'action' => 'default',
392 392
 				'event_id' => $item->ID()
393 393
 			);
394
-			$attendees_link = EE_Admin_Page::add_query_args_and_nonce( $attendees_query_args, REG_ADMIN_URL );
395
-			$actionlinks[] = '<a href="' . $attendees_link . '" title="' . esc_attr__('View Registrants', 'event_espresso') . '"><div class="dashicons dashicons-groups"></div></a>';
394
+			$attendees_link = EE_Admin_Page::add_query_args_and_nonce($attendees_query_args, REG_ADMIN_URL);
395
+			$actionlinks[] = '<a href="'.$attendees_link.'" title="'.esc_attr__('View Registrants', 'event_espresso').'"><div class="dashicons dashicons-groups"></div></a>';
396 396
 		}
397 397
 
398
-		$actionlinks = apply_filters( 'FHEE__Events_Admin_List_Table__column_actions__action_links', $actionlinks, $item );
398
+		$actionlinks = apply_filters('FHEE__Events_Admin_List_Table__column_actions__action_links', $actionlinks, $item);
399 399
 
400
-		return $this->_action_string( implode( "\n\t", $actionlinks ), $item, 'div' );
400
+		return $this->_action_string(implode("\n\t", $actionlinks), $item, 'div');
401 401
 	}
402 402
 
403 403
 
Please login to merge, or discard this patch.
admin_pages/messages/Messages_Admin_Page_Init.core.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php if (!defined('EVENT_ESPRESSO_VERSION') )
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION'))
2 2
 	exit('NO direct script access allowed');
3 3
 /**
4 4
  * Event Espresso
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
  *
25 25
  * ------------------------------------------------------------------------
26 26
  */
27
-class Messages_Admin_Page_Init extends EE_Admin_Page_Init  {
27
+class Messages_Admin_Page_Init extends EE_Admin_Page_Init {
28 28
 	/**
29 29
 	 *constructor
30 30
 	 *@Constructor
@@ -33,18 +33,18 @@  discard block
 block discarded – undo
33 33
 	 */
34 34
 	public function __construct() {
35 35
 
36
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
36
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
37 37
 
38
-		if ( ! defined( 'EE_MSG_PG_SLUG' ) ) {
38
+		if ( ! defined('EE_MSG_PG_SLUG')) {
39 39
 
40
-			define( 'EE_MSG_PG_SLUG', 'espresso_messages' );
41
-			define( 'EE_MSG_PG_NAME', ucwords( str_replace( '_', '', EE_MSG_PG_SLUG ) ) );
42
-			define( 'EE_MSG_ADMIN', EE_ADMIN_PAGES . 'messages' . DS );
43
-			define( 'EE_MSG_ADMIN_URL', admin_url( 'admin.php?page=' . EE_MSG_PG_SLUG ) );
44
-			define( 'EE_MSG_ASSETS_PATH', EE_MSG_ADMIN . 'assets' . DS );
45
-			define( 'EE_MSG_ASSETS_URL', EE_ADMIN_PAGES_URL . 'messages/assets/' );
46
-			define( 'EE_MSG_TEMPLATE_PATH', EE_MSG_ADMIN . 'templates' . DS );
47
-			define( 'EE_MSG_TEMPLATE_URL', EE_ADMIN_PAGES_URL . 'messages/templates/' );
40
+			define('EE_MSG_PG_SLUG', 'espresso_messages');
41
+			define('EE_MSG_PG_NAME', ucwords(str_replace('_', '', EE_MSG_PG_SLUG)));
42
+			define('EE_MSG_ADMIN', EE_ADMIN_PAGES.'messages'.DS);
43
+			define('EE_MSG_ADMIN_URL', admin_url('admin.php?page='.EE_MSG_PG_SLUG));
44
+			define('EE_MSG_ASSETS_PATH', EE_MSG_ADMIN.'assets'.DS);
45
+			define('EE_MSG_ASSETS_URL', EE_ADMIN_PAGES_URL.'messages/assets/');
46
+			define('EE_MSG_TEMPLATE_PATH', EE_MSG_ADMIN.'templates'.DS);
47
+			define('EE_MSG_TEMPLATE_URL', EE_ADMIN_PAGES_URL.'messages/templates/');
48 48
 		}
49 49
 
50 50
 		parent::__construct();
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 
61 61
 
62 62
 	protected function _set_menu_map() {
63
-		$this->_menu_map = new EE_Admin_Page_Sub_Menu( array(
63
+		$this->_menu_map = new EE_Admin_Page_Sub_Menu(array(
64 64
 			'menu_group' => 'management',
65 65
 			'menu_order' => 10,
66 66
 			'show_on_menu' => EE_Admin_Page_Menu_Map::BLOG_ADMIN_ONLY,
Please login to merge, or discard this patch.
caffeinated/core/libraries/shortcodes/EE_Question_List_Shortcodes.lib.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION') )
3
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
4 4
 	exit('NO direct script access allowed');
5 5
 
6 6
 /**
@@ -47,10 +47,10 @@  discard block
 block discarded – undo
47 47
 	}
48 48
 
49 49
 
50
-	protected function _parser( $shortcode ) {
50
+	protected function _parser($shortcode) {
51 51
 
52 52
 
53
-		switch ( $shortcode ) {
53
+		switch ($shortcode) {
54 54
 			case '[QUESTION_LIST]' :
55 55
 				return $this->_get_question_list();
56 56
 				break;
@@ -64,12 +64,12 @@  discard block
 block discarded – undo
64 64
 		$this->_validate_list_requirements();
65 65
 
66 66
 		//for when [QUESTION_LIST] is used in the [attendee_list] field.
67
-		if ( $this->_data['data'] instanceof EE_Registration ) {
67
+		if ($this->_data['data'] instanceof EE_Registration) {
68 68
 			return $this->_get_question_answer_list_for_attendee();
69 69
 		}
70 70
 		//for when [QUESTION_LIST] is used in the main content field.
71
-		else if ( $this->_data['data'] instanceof EE_Messages_Addressee && $this->_data['data']->reg_obj instanceof EE_Registration ) {
72
-			return $this->_get_question_answer_list_for_attendee( $this->_data['data']->reg_obj );
71
+		else if ($this->_data['data'] instanceof EE_Messages_Addressee && $this->_data['data']->reg_obj instanceof EE_Registration) {
72
+			return $this->_get_question_answer_list_for_attendee($this->_data['data']->reg_obj);
73 73
 		} else {
74 74
 			return '';
75 75
 		}
@@ -81,19 +81,19 @@  discard block
 block discarded – undo
81 81
 	 * Note when we parse the "[question_list]" shortcode for attendees we're actually going to retrieve the list of answers for that attendee since that is what we really need (we can derive the questions from the answers);
82 82
 	 * @return string parsed template.
83 83
 	 */
84
-	private function _get_question_answer_list_for_attendee( $reg_obj = null ) {
84
+	private function _get_question_answer_list_for_attendee($reg_obj = null) {
85 85
 		$valid_shortcodes = array('question');
86 86
 		$reg_obj = $reg_obj instanceof EE_Registration ? $reg_obj : $this->_data['data'];
87
-		$template = is_array( $this->_data['template'] ) && isset( $this->_data['template']['question_list'] ) ? $this->_data['template']['question_list'] : '';
88
-		$template = empty( $template ) && isset( $this->_extra_data['template']['question_list'] ) ? $this->_extra_data['template']['question_list'] : $template;
87
+		$template = is_array($this->_data['template']) && isset($this->_data['template']['question_list']) ? $this->_data['template']['question_list'] : '';
88
+		$template = empty($template) && isset($this->_extra_data['template']['question_list']) ? $this->_extra_data['template']['question_list'] : $template;
89 89
 		$ans_result = '';
90 90
 		$answers = ! empty($this->_extra_data['data']->registrations[$reg_obj->ID()]['ans_objs']) ? $this->_extra_data['data']->registrations[$reg_obj->ID()]['ans_objs'] : array();
91
-		foreach ( $answers as $answer ) {
91
+		foreach ($answers as $answer) {
92 92
 			$question = $answer->question();
93
-			if ( $question instanceof EE_Question and $question->admin_only() ) {
93
+			if ($question instanceof EE_Question and $question->admin_only()) {
94 94
 						continue;
95 95
 					}
96
-			$ans_result .= $this->_shortcode_helper->parse_question_list_template( $template, $answer, $valid_shortcodes, $this->_extra_data);
96
+			$ans_result .= $this->_shortcode_helper->parse_question_list_template($template, $answer, $valid_shortcodes, $this->_extra_data);
97 97
 		}
98 98
 
99 99
 		return $ans_result;
Please login to merge, or discard this patch.
core/db_classes/EE_Attendee.class.php 2 patches
Spacing   +101 added lines, -101 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1
-<?php if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) {
2
-	exit( 'No direct script access allowed' );
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3 3
 }
4 4
 /**
5 5
  * Event Espresso
@@ -33,20 +33,20 @@  discard block
 block discarded – undo
33 33
 	 * @param string $timezone
34 34
 	 * @param array $date_formats
35 35
 	 */
36
-	protected function __construct( $fieldValues = NULL, $bydb = FALSE, $timezone = NULL, $date_formats = array() ) {
37
-		if ( !isset( $fieldValues[ 'ATT_full_name' ] ) ) {
38
-			$fname = isset( $fieldValues[ 'ATT_fname' ] ) ? $fieldValues[ 'ATT_fname' ] . ' ' : '';
39
-			$lname = isset( $fieldValues[ 'ATT_lname' ] ) ? $fieldValues[ 'ATT_lname' ] : '';
40
-			$fieldValues[ 'ATT_full_name' ] = $fname . $lname;
36
+	protected function __construct($fieldValues = NULL, $bydb = FALSE, $timezone = NULL, $date_formats = array()) {
37
+		if ( ! isset($fieldValues['ATT_full_name'])) {
38
+			$fname = isset($fieldValues['ATT_fname']) ? $fieldValues['ATT_fname'].' ' : '';
39
+			$lname = isset($fieldValues['ATT_lname']) ? $fieldValues['ATT_lname'] : '';
40
+			$fieldValues['ATT_full_name'] = $fname.$lname;
41 41
 		}
42
-		if ( !isset( $fieldValues[ 'ATT_slug' ] ) ) {
42
+		if ( ! isset($fieldValues['ATT_slug'])) {
43 43
 			//			$fieldValues['ATT_slug'] = sanitize_key(wp_generate_password(20));
44
-			$fieldValues[ 'ATT_slug' ] = sanitize_title( $fieldValues[ 'ATT_full_name' ] );
44
+			$fieldValues['ATT_slug'] = sanitize_title($fieldValues['ATT_full_name']);
45 45
 		}
46
-		if ( !isset( $fieldValues[ 'ATT_short_bio' ] ) && isset( $fieldValues[ 'ATT_bio' ] ) ) {
47
-			$fieldValues[ 'ATT_short_bio' ] = substr( $fieldValues[ 'ATT_bio' ], 0, 50 );
46
+		if ( ! isset($fieldValues['ATT_short_bio']) && isset($fieldValues['ATT_bio'])) {
47
+			$fieldValues['ATT_short_bio'] = substr($fieldValues['ATT_bio'], 0, 50);
48 48
 		}
49
-		parent::__construct( $fieldValues, $bydb, $timezone, $date_formats );
49
+		parent::__construct($fieldValues, $bydb, $timezone, $date_formats);
50 50
 	}
51 51
 
52 52
 
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
 	 *                             		    date_format and the second value is the time format
61 61
 	 * @return EE_Attendee
62 62
 	 */
63
-	public static function new_instance( $props_n_values = array(), $timezone = null, $date_formats = array() ) {
64
-		$has_object = parent::_check_for_object( $props_n_values, __CLASS__, $timezone, $date_formats );
65
-		return $has_object ? $has_object : new self( $props_n_values, false, $timezone, $date_formats );
63
+	public static function new_instance($props_n_values = array(), $timezone = null, $date_formats = array()) {
64
+		$has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone, $date_formats);
65
+		return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats);
66 66
 	}
67 67
 
68 68
 
@@ -73,8 +73,8 @@  discard block
 block discarded – undo
73 73
 	 *                          		the website will be used.
74 74
 	 * @return EE_Attendee
75 75
 	 */
76
-	public static function new_instance_from_db( $props_n_values = array(), $timezone = null ) {
77
-		return new self( $props_n_values, TRUE, $timezone );
76
+	public static function new_instance_from_db($props_n_values = array(), $timezone = null) {
77
+		return new self($props_n_values, TRUE, $timezone);
78 78
 	}
79 79
 
80 80
 
@@ -85,8 +85,8 @@  discard block
 block discarded – undo
85 85
 	 * @access        public
86 86
 	 * @param string $fname
87 87
 	 */
88
-	public function set_fname( $fname = '' ) {
89
-		$this->set( 'ATT_fname', $fname );
88
+	public function set_fname($fname = '') {
89
+		$this->set('ATT_fname', $fname);
90 90
 	}
91 91
 
92 92
 
@@ -97,8 +97,8 @@  discard block
 block discarded – undo
97 97
 	 * @access        public
98 98
 	 * @param string $lname
99 99
 	 */
100
-	public function set_lname( $lname = '' ) {
101
-		$this->set( 'ATT_lname', $lname );
100
+	public function set_lname($lname = '') {
101
+		$this->set('ATT_lname', $lname);
102 102
 	}
103 103
 
104 104
 
@@ -109,8 +109,8 @@  discard block
 block discarded – undo
109 109
 	 * @access        public
110 110
 	 * @param string $address
111 111
 	 */
112
-	public function set_address( $address = '' ) {
113
-		$this->set( 'ATT_address', $address );
112
+	public function set_address($address = '') {
113
+		$this->set('ATT_address', $address);
114 114
 	}
115 115
 
116 116
 
@@ -121,8 +121,8 @@  discard block
 block discarded – undo
121 121
 	 * @access        public
122 122
 	 * @param        string $address2
123 123
 	 */
124
-	public function set_address2( $address2 = '' ) {
125
-		$this->set( 'ATT_address2', $address2 );
124
+	public function set_address2($address2 = '') {
125
+		$this->set('ATT_address2', $address2);
126 126
 	}
127 127
 
128 128
 
@@ -133,8 +133,8 @@  discard block
 block discarded – undo
133 133
 	 * @access        public
134 134
 	 * @param        string $city
135 135
 	 */
136
-	public function set_city( $city = '' ) {
137
-		$this->set( 'ATT_city', $city );
136
+	public function set_city($city = '') {
137
+		$this->set('ATT_city', $city);
138 138
 	}
139 139
 
140 140
 
@@ -145,8 +145,8 @@  discard block
 block discarded – undo
145 145
 	 * @access        public
146 146
 	 * @param        int $STA_ID
147 147
 	 */
148
-	public function set_state( $STA_ID = 0 ) {
149
-		$this->set( 'STA_ID', $STA_ID );
148
+	public function set_state($STA_ID = 0) {
149
+		$this->set('STA_ID', $STA_ID);
150 150
 	}
151 151
 
152 152
 
@@ -157,8 +157,8 @@  discard block
 block discarded – undo
157 157
 	 * @access        public
158 158
 	 * @param        string $CNT_ISO
159 159
 	 */
160
-	public function set_country( $CNT_ISO = '' ) {
161
-		$this->set( 'CNT_ISO', $CNT_ISO );
160
+	public function set_country($CNT_ISO = '') {
161
+		$this->set('CNT_ISO', $CNT_ISO);
162 162
 	}
163 163
 
164 164
 
@@ -169,8 +169,8 @@  discard block
 block discarded – undo
169 169
 	 * @access        public
170 170
 	 * @param        string $zip
171 171
 	 */
172
-	public function set_zip( $zip = '' ) {
173
-		$this->set( 'ATT_zip', $zip );
172
+	public function set_zip($zip = '') {
173
+		$this->set('ATT_zip', $zip);
174 174
 	}
175 175
 
176 176
 
@@ -181,8 +181,8 @@  discard block
 block discarded – undo
181 181
 	 * @access        public
182 182
 	 * @param        string $email
183 183
 	 */
184
-	public function set_email( $email = '' ) {
185
-		$this->set( 'ATT_email', $email );
184
+	public function set_email($email = '') {
185
+		$this->set('ATT_email', $email);
186 186
 	}
187 187
 
188 188
 
@@ -193,8 +193,8 @@  discard block
 block discarded – undo
193 193
 	 * @access        public
194 194
 	 * @param        string $phone
195 195
 	 */
196
-	public function set_phone( $phone = '' ) {
197
-		$this->set( 'ATT_phone', $phone );
196
+	public function set_phone($phone = '') {
197
+		$this->set('ATT_phone', $phone);
198 198
 	}
199 199
 
200 200
 
@@ -205,8 +205,8 @@  discard block
 block discarded – undo
205 205
 	 * @access        public
206 206
 	 * @param        bool $ATT_deleted
207 207
 	 */
208
-	public function set_deleted( $ATT_deleted = FALSE ) {
209
-		$this->set( 'ATT_deleted', $ATT_deleted );
208
+	public function set_deleted($ATT_deleted = FALSE) {
209
+		$this->set('ATT_deleted', $ATT_deleted);
210 210
 	}
211 211
 
212 212
 
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 	 * @return int
220 220
 	 */
221 221
 	public function wp_user() {
222
-		return $this->get( 'ATT_author' );
222
+		return $this->get('ATT_author');
223 223
 	}
224 224
 
225 225
 
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 	 * @return string
231 231
 	 */
232 232
 	public function fname() {
233
-		return $this->get( 'ATT_fname' );
233
+		return $this->get('ATT_fname');
234 234
 	}
235 235
 
236 236
 
@@ -250,9 +250,9 @@  discard block
 block discarded – undo
250 250
 	 * @param bool $apply_html_entities
251 251
 	 * @return string
252 252
 	 */
253
-	public function full_name( $apply_html_entities = FALSE ) {
254
-		$full_name = $this->fname() . ' ' . $this->lname();
255
-		return $apply_html_entities ? htmlentities( $full_name, ENT_QUOTES, 'UTF-8' ) : $full_name;
253
+	public function full_name($apply_html_entities = FALSE) {
254
+		$full_name = $this->fname().' '.$this->lname();
255
+		return $apply_html_entities ? htmlentities($full_name, ENT_QUOTES, 'UTF-8') : $full_name;
256 256
 	}
257 257
 
258 258
 
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
 	 * @return string
264 264
 	 */
265 265
 	public function lname() {
266
-		return $this->get( 'ATT_lname' );
266
+		return $this->get('ATT_lname');
267 267
 	}
268 268
 
269 269
 
@@ -277,26 +277,26 @@  discard block
 block discarded – undo
277 277
 	 */
278 278
 	public function full_address_as_array() {
279 279
 		$full_address_array = array();
280
-		$initial_address_fields = array( 'ATT_address', 'ATT_address2', 'ATT_city', );
281
-		foreach ( $initial_address_fields as $address_field_name ) {
282
-			$address_fields_value = $this->get( $address_field_name );
283
-			if ( !empty( $address_fields_value ) ) {
284
-				$full_address_array[ ] = $address_fields_value;
280
+		$initial_address_fields = array('ATT_address', 'ATT_address2', 'ATT_city',);
281
+		foreach ($initial_address_fields as $address_field_name) {
282
+			$address_fields_value = $this->get($address_field_name);
283
+			if ( ! empty($address_fields_value)) {
284
+				$full_address_array[] = $address_fields_value;
285 285
 			}
286 286
 		}
287 287
 		//now handle state and country
288 288
 		$state_obj = $this->state_obj();
289
-		if ( !empty( $state_obj ) ) {
290
-			$full_address_array[ ] = $state_obj->name();
289
+		if ( ! empty($state_obj)) {
290
+			$full_address_array[] = $state_obj->name();
291 291
 		}
292 292
 		$country_obj = $this->country_obj();
293
-		if ( !empty( $country_obj ) ) {
294
-			$full_address_array[ ] = $country_obj->name();
293
+		if ( ! empty($country_obj)) {
294
+			$full_address_array[] = $country_obj->name();
295 295
 		}
296 296
 		//lastly get the xip
297 297
 		$zip_value = $this->zip();
298
-		if ( !empty( $zip_value ) ) {
299
-			$full_address_array[ ] = $zip_value;
298
+		if ( ! empty($zip_value)) {
299
+			$full_address_array[] = $zip_value;
300 300
 		}
301 301
 		return $full_address_array;
302 302
 	}
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
 	 * @return string
309 309
 	 */
310 310
 	public function address() {
311
-		return $this->get( 'ATT_address' );
311
+		return $this->get('ATT_address');
312 312
 	}
313 313
 
314 314
 
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 	 * @return string
319 319
 	 */
320 320
 	public function address2() {
321
-		return $this->get( 'ATT_address2' );
321
+		return $this->get('ATT_address2');
322 322
 	}
323 323
 
324 324
 
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 	 * @return string
329 329
 	 */
330 330
 	public function city() {
331
-		return $this->get( 'ATT_city' );
331
+		return $this->get('ATT_city');
332 332
 	}
333 333
 
334 334
 
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
 	 * @return string
339 339
 	 */
340 340
 	public function state_ID() {
341
-		return $this->get( 'STA_ID' );
341
+		return $this->get('STA_ID');
342 342
 	}
343 343
 
344 344
 
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
 	 * @return string
348 348
 	 */
349 349
 	public function state_abbrev() {
350
-		return $this->state_obj() instanceof EE_State ? $this->state_obj()->abbrev() : __( 'Unknown', 'event_espresso' );
350
+		return $this->state_obj() instanceof EE_State ? $this->state_obj()->abbrev() : __('Unknown', 'event_espresso');
351 351
 	}
352 352
 
353 353
 
@@ -357,18 +357,18 @@  discard block
 block discarded – undo
357 357
 	 * @return EE_State
358 358
 	 */
359 359
 	public function state_obj() {
360
-		return $this->get_first_related( 'State' );
360
+		return $this->get_first_related('State');
361 361
 	}
362 362
 
363 363
 	/**
364 364
 	 * Returns the state's name, otherwise 'Unknown'
365 365
 	 * @return string
366 366
 	 */
367
-	public function state_name(){
368
-		if( $this->state_obj() ){
367
+	public function state_name() {
368
+		if ($this->state_obj()) {
369 369
 			return $this->state_obj()->name();
370
-		}else{
371
-			return __( 'Unknown', 'event_espresso' );
370
+		} else {
371
+			return __('Unknown', 'event_espresso');
372 372
 		}
373 373
 	}
374 374
 
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
 	 * @return string
382 382
 	 */
383 383
 	public function state() {
384
-		if ( apply_filters( 'FHEE__EEI_Address__state__use_abbreviation', true, $this->state_obj() ) ) {
384
+		if (apply_filters('FHEE__EEI_Address__state__use_abbreviation', true, $this->state_obj())) {
385 385
 			return $this->state_abbrev();
386 386
 		} else {
387 387
 			return $this->state_name();
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
 	 * @return string
396 396
 	 */
397 397
 	public function country_ID() {
398
-		return $this->get( 'CNT_ISO' );
398
+		return $this->get('CNT_ISO');
399 399
 	}
400 400
 
401 401
 
@@ -405,18 +405,18 @@  discard block
 block discarded – undo
405 405
 	 * @return EE_Country
406 406
 	 */
407 407
 	public function country_obj() {
408
-		return $this->get_first_related( 'Country' );
408
+		return $this->get_first_related('Country');
409 409
 	}
410 410
 
411 411
 	/**
412 412
 	 * Returns the country's name if known, otherwise 'Unknown'
413 413
 	 * @return string
414 414
 	 */
415
-	public function country_name(){
416
-		if( $this->country_obj() ){
415
+	public function country_name() {
416
+		if ($this->country_obj()) {
417 417
 			return $this->country_obj()->name();
418
-		}else{
419
-			return __( 'Unknown', 'event_espresso' );
418
+		} else {
419
+			return __('Unknown', 'event_espresso');
420 420
 		}
421 421
 	}
422 422
 
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
 	 * @return string
430 430
 	 */
431 431
 	public function country() {
432
-		if ( apply_filters( 'FHEE__EEI_Address__country__use_abbreviation', true, $this->country_obj() ) ) {
432
+		if (apply_filters('FHEE__EEI_Address__country__use_abbreviation', true, $this->country_obj())) {
433 433
 			return $this->country_ID();
434 434
 		} else {
435 435
 			return $this->country_name();
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
 	 * @return string
444 444
 	 */
445 445
 	public function zip() {
446
-		return $this->get( 'ATT_zip' );
446
+		return $this->get('ATT_zip');
447 447
 	}
448 448
 
449 449
 
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
 	 * @return string
454 454
 	 */
455 455
 	public function email() {
456
-		return $this->get( 'ATT_email' );
456
+		return $this->get('ATT_email');
457 457
 	}
458 458
 
459 459
 
@@ -463,7 +463,7 @@  discard block
 block discarded – undo
463 463
 	 * @return string
464 464
 	 */
465 465
 	public function phone() {
466
-		return $this->get( 'ATT_phone' );
466
+		return $this->get('ATT_phone');
467 467
 	}
468 468
 
469 469
 
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
 	 * @return        bool
474 474
 	 */
475 475
 	public function deleted() {
476
-		return $this->get( 'ATT_deleted' );
476
+		return $this->get('ATT_deleted');
477 477
 	}
478 478
 
479 479
 
@@ -483,8 +483,8 @@  discard block
 block discarded – undo
483 483
 	 * @param array $query_params
484 484
 	 * @return EE_Registration[]
485 485
 	 */
486
-	public function get_registrations( $query_params = array() ) {
487
-		return $this->get_many_related( 'Registration', $query_params );
486
+	public function get_registrations($query_params = array()) {
487
+		return $this->get_many_related('Registration', $query_params);
488 488
 	}
489 489
 
490 490
 
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
 	 * @return EE_Registration
495 495
 	 */
496 496
 	public function get_most_recent_registration() {
497
-		return $this->get_first_related( 'Registration', array( 'order_by' => array( 'REG_date' => 'DESC' ) ) ); //null, 'REG_date', 'DESC', '=', 'OBJECT_K');
497
+		return $this->get_first_related('Registration', array('order_by' => array('REG_date' => 'DESC'))); //null, 'REG_date', 'DESC', '=', 'OBJECT_K');
498 498
 	}
499 499
 
500 500
 
@@ -504,8 +504,8 @@  discard block
 block discarded – undo
504 504
 	 * @param int $event_id
505 505
 	 * @return EE_Registration
506 506
 	 */
507
-	public function get_most_recent_registration_for_event( $event_id ) {
508
-		return $this->get_first_related( 'Registration', array(array( 'EVT_ID' => $event_id ), 'order_by' => array('REG_date' => 'DESC')));//, '=', 'OBJECT_K' );
507
+	public function get_most_recent_registration_for_event($event_id) {
508
+		return $this->get_first_related('Registration', array(array('EVT_ID' => $event_id), 'order_by' => array('REG_date' => 'DESC'))); //, '=', 'OBJECT_K' );
509 509
 	}
510 510
 
511 511
 
@@ -515,7 +515,7 @@  discard block
 block discarded – undo
515 515
 	 * @return array
516 516
 	 */
517 517
 	public function events() {
518
-		return $this->get_many_related( 'Event' );
518
+		return $this->get_many_related('Event');
519 519
 	}
520 520
 
521 521
 	/**
@@ -524,17 +524,17 @@  discard block
 block discarded – undo
524 524
 	 * @param EE_Payment_Method $payment_method the _gateway_name property on the gateway class
525 525
 	 * @return EE_Form_Section_Proper
526 526
 	 */
527
-	public function billing_info_for_payment_method($payment_method){
527
+	public function billing_info_for_payment_method($payment_method) {
528 528
 		$pm_type = $payment_method->type_obj();
529
-		if( ! $pm_type instanceof EE_PMT_Base ){
529
+		if ( ! $pm_type instanceof EE_PMT_Base) {
530 530
 			return NULL;
531 531
 		}
532
-		$billing_info =  $this->get_post_meta( $this->get_billing_info_postmeta_name( $payment_method ), true );
533
-		if ( ! $billing_info){
532
+		$billing_info = $this->get_post_meta($this->get_billing_info_postmeta_name($payment_method), true);
533
+		if ( ! $billing_info) {
534 534
 			return NULL;
535 535
 		}
536 536
 		$billing_form = $pm_type->billing_form();
537
-		$billing_form->receive_form_submission( array( $billing_form->name() => $billing_info ), FALSE );
537
+		$billing_form->receive_form_submission(array($billing_form->name() => $billing_info), FALSE);
538 538
 		return $billing_form;
539 539
 	}
540 540
 
@@ -544,10 +544,10 @@  discard block
 block discarded – undo
544 544
 	 * @param EE_Payment_Method $payment_method
545 545
 	 * @return string
546 546
 	 */
547
-	public function get_billing_info_postmeta_name($payment_method){
548
-		if( $payment_method->type_obj() instanceof EE_PMT_Base ){
549
-			return 'billing_info_' . $payment_method->type_obj()->system_name();
550
-		}else{
547
+	public function get_billing_info_postmeta_name($payment_method) {
548
+		if ($payment_method->type_obj() instanceof EE_PMT_Base) {
549
+			return 'billing_info_'.$payment_method->type_obj()->system_name();
550
+		} else {
551 551
 			return NULL;
552 552
 		}
553 553
 	}
@@ -558,13 +558,13 @@  discard block
 block discarded – undo
558 558
 	 * @param EE_Payment_Method $payment_method
559 559
 	 * @return boolean
560 560
 	 */
561
-	public function save_and_clean_billing_info_for_payment_method($billing_form, $payment_method){
562
-		if( ! $billing_form instanceof EE_Billing_Attendee_Info_Form ){
563
-			EE_Error::add_error( __( 'Cannot save billing info because there is none.', 'event_espresso' ) );
561
+	public function save_and_clean_billing_info_for_payment_method($billing_form, $payment_method) {
562
+		if ( ! $billing_form instanceof EE_Billing_Attendee_Info_Form) {
563
+			EE_Error::add_error(__('Cannot save billing info because there is none.', 'event_espresso'));
564 564
 			return false;
565 565
 		}
566 566
 		$billing_form->clean_sensitive_data();
567
-		return update_post_meta($this->ID(), $this->get_billing_info_postmeta_name( $payment_method ), $billing_form->input_values( true ) );
567
+		return update_post_meta($this->ID(), $this->get_billing_info_postmeta_name($payment_method), $billing_form->input_values(true));
568 568
 	}
569 569
 
570 570
 	/**
@@ -580,14 +580,14 @@  discard block
 block discarded – undo
580 580
 	 * @return string
581 581
 	 */
582 582
 	public function get_admin_edit_link() {
583
-		EE_Registry::instance()->load_helper( 'URL' );
583
+		EE_Registry::instance()->load_helper('URL');
584 584
 		return EEH_URL::add_query_args_and_nonce(
585 585
 			array(
586 586
 				'page' => 'espresso_registrations',
587 587
 				'action' => 'edit_attendee',
588 588
 				'post' => $this->ID()
589 589
 			),
590
-			admin_url( 'admin.php' )
590
+			admin_url('admin.php')
591 591
 		);
592 592
 	}
593 593
 
@@ -604,13 +604,13 @@  discard block
 block discarded – undo
604 604
 	 * @return string
605 605
 	 */
606 606
 	public function get_admin_overview_link() {
607
-		EE_Registry::instance()->load_helper( 'URL' );
607
+		EE_Registry::instance()->load_helper('URL');
608 608
 		return EEH_URL::add_query_args_and_nonce(
609 609
 			array(
610 610
 				'page' => 'espresso_registrations',
611 611
 				'action' => 'contact_list'
612 612
 			),
613
-			admin_url( 'admin.php' )
613
+			admin_url('admin.php')
614 614
 		);
615 615
 	}
616 616
 
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
 
513 513
 	/**
514 514
 	 * returns any events attached to this attendee ($_Event property);
515
-	 * @return array
515
+	 * @return EE_Base_Class[]
516 516
 	 */
517 517
 	public function events() {
518 518
 		return $this->get_many_related( 'Event' );
@@ -522,7 +522,7 @@  discard block
 block discarded – undo
522 522
 	 * Gets the billing info array where keys match espresso_reg_page_billing_inputs(),
523 523
 	 * and keys are their cleaned values. @see EE_Attendee::save_and_clean_billing_info_for_payment_method() which was used to save the billing info
524 524
 	 * @param EE_Payment_Method $payment_method the _gateway_name property on the gateway class
525
-	 * @return EE_Form_Section_Proper
525
+	 * @return null|EE_Billing_Info_Form
526 526
 	 */
527 527
 	public function billing_info_for_payment_method($payment_method){
528 528
 		$pm_type = $payment_method->type_obj();
Please login to merge, or discard this patch.