| @@ -10,7 +10,7 @@ discard block | ||
| 10 | 10 | */ | 
| 11 | 11 | |
| 12 | 12 | // Exit if accessed directly. | 
| 13 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 13 | +if ( ! defined('ABSPATH')) { | |
| 14 | 14 | exit; | 
| 15 | 15 | } | 
| 16 | 16 | |
| @@ -21,12 +21,12 @@ discard block | ||
| 21 | 21 | * @return void | 
| 22 | 22 | */ | 
| 23 | 23 |  function give_register_dashboard_widgets() { | 
| 24 | -	if ( current_user_can( apply_filters( 'give_dashboard_stats_cap', 'view_give_reports' ) ) ) { | |
| 25 | - wp_add_dashboard_widget( 'give_dashboard_sales', esc_html__( 'Give: Donation Statistics', 'give' ), 'give_dashboard_sales_widget' ); | |
| 24 | +	if (current_user_can(apply_filters('give_dashboard_stats_cap', 'view_give_reports'))) { | |
| 25 | +		wp_add_dashboard_widget('give_dashboard_sales', esc_html__('Give: Donation Statistics', 'give'), 'give_dashboard_sales_widget'); | |
| 26 | 26 | } | 
| 27 | 27 | } | 
| 28 | 28 | |
| 29 | -add_action( 'wp_dashboard_setup', 'give_register_dashboard_widgets', 10 ); | |
| 29 | +add_action('wp_dashboard_setup', 'give_register_dashboard_widgets', 10); | |
| 30 | 30 | |
| 31 | 31 | /** | 
| 32 | 32 | * Sales Summary Dashboard Widget | 
| @@ -38,7 +38,7 @@ discard block | ||
| 38 | 38 | */ | 
| 39 | 39 |  function give_dashboard_sales_widget() { | 
| 40 | 40 | |
| 41 | -	if ( ! current_user_can( apply_filters( 'give_dashboard_stats_cap', 'view_give_reports' ) ) ) { | |
| 41 | +	if ( ! current_user_can(apply_filters('give_dashboard_stats_cap', 'view_give_reports'))) { | |
| 42 | 42 | return; | 
| 43 | 43 | } | 
| 44 | 44 | $stats = new Give_Payment_Stats; ?> | 
| @@ -46,27 +46,27 @@ discard block | ||
| 46 | 46 | <div class="give-dashboard-widget"> | 
| 47 | 47 | |
| 48 | 48 | <div class="give-dashboard-today give-clearfix"> | 
| 49 | - <h3 class="give-dashboard-date-today"><?php echo date( _x( 'F j, Y', 'dashboard widget', 'give' ) ); ?></h3> | |
| 49 | +			<h3 class="give-dashboard-date-today"><?php echo date(_x('F j, Y', 'dashboard widget', 'give')); ?></h3> | |
| 50 | 50 | |
| 51 | 51 | <p class="give-dashboard-happy-day"><?php | 
| 52 | 52 | printf( | 
| 53 | 53 | /* translators: %s: day of the week */ | 
| 54 | - esc_html__( 'Happy %s!', 'give' ), | |
| 55 | - date( 'l', current_time( 'timestamp' ) ) | |
| 54 | +					esc_html__('Happy %s!', 'give'), | |
| 55 | +					date('l', current_time('timestamp')) | |
| 56 | 56 | ); | 
| 57 | 57 | ?></p> | 
| 58 | 58 | |
| 59 | 59 | <p class="give-dashboard-today-earnings"><?php | 
| 60 | - $earnings_today = $stats->get_earnings( 0, 'today', false ); | |
| 61 | - echo give_currency_filter( give_format_amount( $earnings_today ) ); | |
| 60 | + $earnings_today = $stats->get_earnings(0, 'today', false); | |
| 61 | + echo give_currency_filter(give_format_amount($earnings_today)); | |
| 62 | 62 | ?></p> | 
| 63 | 63 | |
| 64 | 64 | <p class="give-orders-today"><?php | 
| 65 | - $donations_today = $stats->get_sales( 0, 'today', false ); | |
| 65 | + $donations_today = $stats->get_sales(0, 'today', false); | |
| 66 | 66 | printf( | 
| 67 | 67 | /* translators: %s: daily donation count */ | 
| 68 | - esc_html__( '%s donations today', 'give' ), | |
| 69 | - give_format_amount( $donations_today, false ) | |
| 68 | +					esc_html__('%s donations today', 'give'), | |
| 69 | + give_format_amount($donations_today, false) | |
| 70 | 70 | ); | 
| 71 | 71 | ?></p> | 
| 72 | 72 | |
| @@ -76,34 +76,34 @@ discard block | ||
| 76 | 76 | <table class="give-table-stats"> | 
| 77 | 77 | <thead style="display: none;"> | 
| 78 | 78 | <tr> | 
| 79 | - <th><?php esc_html_e( 'This Week', 'give' ); ?></th> | |
| 80 | - <th><?php esc_html_e( 'This Month', 'give' ); ?></th> | |
| 81 | - <th><?php esc_html_e( 'Past 30 Days', 'give' ); ?></th> | |
| 79 | +				<th><?php esc_html_e('This Week', 'give'); ?></th> | |
| 80 | +				<th><?php esc_html_e('This Month', 'give'); ?></th> | |
| 81 | +				<th><?php esc_html_e('Past 30 Days', 'give'); ?></th> | |
| 82 | 82 | </tr> | 
| 83 | 83 | </thead> | 
| 84 | 84 | <tbody> | 
| 85 | 85 | <tr id="give-table-stats-tr-1"> | 
| 86 | 86 | <td> | 
| 87 | - <p class="give-dashboard-stat-total"><?php echo give_currency_filter( give_format_amount( $stats->get_earnings( 0, 'this_week' ) ) ); ?></p> | |
| 87 | + <p class="give-dashboard-stat-total"><?php echo give_currency_filter(give_format_amount($stats->get_earnings(0, 'this_week'))); ?></p> | |
| 88 | 88 | |
| 89 | - <p class="give-dashboard-stat-total-label"><?php esc_html_e( 'This Week', 'give' ); ?></p> | |
| 89 | +					<p class="give-dashboard-stat-total-label"><?php esc_html_e('This Week', 'give'); ?></p> | |
| 90 | 90 | </td> | 
| 91 | 91 | <td> | 
| 92 | - <p class="give-dashboard-stat-total"><?php echo give_currency_filter( give_format_amount( $stats->get_earnings( 0, 'this_month' ) ) ); ?></p> | |
| 92 | + <p class="give-dashboard-stat-total"><?php echo give_currency_filter(give_format_amount($stats->get_earnings(0, 'this_month'))); ?></p> | |
| 93 | 93 | |
| 94 | - <p class="give-dashboard-stat-total-label"><?php esc_html_e( 'This Month', 'give' ); ?></p> | |
| 94 | +					<p class="give-dashboard-stat-total-label"><?php esc_html_e('This Month', 'give'); ?></p> | |
| 95 | 95 | </td> | 
| 96 | 96 | </tr> | 
| 97 | 97 | <tr id="give-table-stats-tr-2"> | 
| 98 | 98 | <td> | 
| 99 | - <p class="give-dashboard-stat-total"><?php echo give_currency_filter( give_format_amount( $stats->get_earnings( 0, 'last_month' ) ) ) ?></p> | |
| 99 | + <p class="give-dashboard-stat-total"><?php echo give_currency_filter(give_format_amount($stats->get_earnings(0, 'last_month'))) ?></p> | |
| 100 | 100 | |
| 101 | - <p class="give-dashboard-stat-total-label"><?php esc_html_e( 'Last Month', 'give' ); ?></p> | |
| 101 | +					<p class="give-dashboard-stat-total-label"><?php esc_html_e('Last Month', 'give'); ?></p> | |
| 102 | 102 | </td> | 
| 103 | 103 | <td> | 
| 104 | - <p class="give-dashboard-stat-total"><?php echo give_currency_filter( give_format_amount( $stats->get_earnings( 0, 'this_year', false ) ) ) ?></p> | |
| 104 | + <p class="give-dashboard-stat-total"><?php echo give_currency_filter(give_format_amount($stats->get_earnings(0, 'this_year', false))) ?></p> | |
| 105 | 105 | |
| 106 | - <p class="give-dashboard-stat-total-label"><?php esc_html_e( 'This Year', 'give' ); ?></p> | |
| 106 | +					<p class="give-dashboard-stat-total-label"><?php esc_html_e('This Year', 'give'); ?></p> | |
| 107 | 107 | </td> | 
| 108 | 108 | </tr> | 
| 109 | 109 | </tbody> | 
| @@ -123,23 +123,23 @@ discard block | ||
| 123 | 123 | * | 
| 124 | 124 | * @return array | 
| 125 | 125 | */ | 
| 126 | -function give_dashboard_at_a_glance_widget( $items ) { | |
| 127 | - $num_posts = wp_count_posts( 'give_forms' ); | |
| 126 | +function give_dashboard_at_a_glance_widget($items) { | |
| 127 | +	$num_posts = wp_count_posts('give_forms'); | |
| 128 | 128 | |
| 129 | -	if ( $num_posts && $num_posts->publish ) { | |
| 129 | +	if ($num_posts && $num_posts->publish) { | |
| 130 | 130 | |
| 131 | 131 | $text = sprintf( | 
| 132 | 132 | /* translators: %s: number of posts published */ | 
| 133 | - _n( '%s Give Form', '%s Give Forms', $num_posts->publish, 'give' ), | |
| 133 | +			_n('%s Give Form', '%s Give Forms', $num_posts->publish, 'give'), | |
| 134 | 134 | $num_posts->publish | 
| 135 | 135 | ); | 
| 136 | 136 | |
| 137 | - $text = sprintf( $text, number_format_i18n( $num_posts->publish ) ); | |
| 137 | + $text = sprintf($text, number_format_i18n($num_posts->publish)); | |
| 138 | 138 | |
| 139 | -		if ( current_user_can( 'edit_give_forms', get_current_user_id() ) ) { | |
| 139 | +		if (current_user_can('edit_give_forms', get_current_user_id())) { | |
| 140 | 140 | $text = sprintf( | 
| 141 | 141 | '<a class="give-forms-count" href="%1$s">%2$s</a>', | 
| 142 | - admin_url( 'edit.php?post_type=give_forms' ), | |
| 142 | +				admin_url('edit.php?post_type=give_forms'), | |
| 143 | 143 | $text | 
| 144 | 144 | ); | 
| 145 | 145 |  		} else { | 
| @@ -155,4 +155,4 @@ discard block | ||
| 155 | 155 | return $items; | 
| 156 | 156 | } | 
| 157 | 157 | |
| 158 | -add_filter( 'dashboard_glance_items', 'give_dashboard_at_a_glance_widget', 1, 1 ); | |
| 158 | +add_filter('dashboard_glance_items', 'give_dashboard_at_a_glance_widget', 1, 1); | |
| @@ -10,7 +10,7 @@ discard block | ||
| 10 | 10 | */ | 
| 11 | 11 | |
| 12 | 12 | // Exit if accessed directly. | 
| 13 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 13 | +if ( ! defined('ABSPATH')) { | |
| 14 | 14 | exit; | 
| 15 | 15 | } | 
| 16 | 16 | |
| @@ -23,9 +23,9 @@ discard block | ||
| 23 | 23 | */ | 
| 24 | 24 |  function give_get_country() { | 
| 25 | 25 | $give_options = give_get_settings(); | 
| 26 | - $country = isset( $give_options['base_country'] ) ? $give_options['base_country'] : 'US'; | |
| 26 | + $country = isset($give_options['base_country']) ? $give_options['base_country'] : 'US'; | |
| 27 | 27 | |
| 28 | - return apply_filters( 'give_give_country', $country ); | |
| 28 | +	return apply_filters('give_give_country', $country); | |
| 29 | 29 | } | 
| 30 | 30 | |
| 31 | 31 | /** | 
| @@ -36,9 +36,9 @@ discard block | ||
| 36 | 36 | */ | 
| 37 | 37 |  function give_get_state() { | 
| 38 | 38 | $give_options = give_get_settings(); | 
| 39 | - $state = isset( $give_options['base_state'] ) ? $give_options['base_state'] : false; | |
| 39 | + $state = isset($give_options['base_state']) ? $give_options['base_state'] : false; | |
| 40 | 40 | |
| 41 | - return apply_filters( 'give_give_state', $state ); | |
| 41 | +	return apply_filters('give_give_state', $state); | |
| 42 | 42 | } | 
| 43 | 43 | |
| 44 | 44 | /** | 
| @@ -50,13 +50,13 @@ discard block | ||
| 50 | 50 | * | 
| 51 | 51 | * @return mixed|void A list of states for the shop's base country | 
| 52 | 52 | */ | 
| 53 | -function give_get_states( $country = null ) { | |
| 53 | +function give_get_states($country = null) { | |
| 54 | 54 | |
| 55 | -	if ( empty( $country ) ) { | |
| 55 | +	if (empty($country)) { | |
| 56 | 56 | $country = give_get_country(); | 
| 57 | 57 | } | 
| 58 | 58 | |
| 59 | - switch ( $country ) : | |
| 59 | + switch ($country) : | |
| 60 | 60 | |
| 61 | 61 | case 'US' : | 
| 62 | 62 | $states = give_get_states_list(); | 
| @@ -106,7 +106,7 @@ discard block | ||
| 106 | 106 | |
| 107 | 107 | endswitch; | 
| 108 | 108 | |
| 109 | - return apply_filters( 'give_give_states', $states ); | |
| 109 | +	return apply_filters('give_give_states', $states); | |
| 110 | 110 | } | 
| 111 | 111 | |
| 112 | 112 | |
| @@ -119,253 +119,253 @@ discard block | ||
| 119 | 119 |  function give_get_country_list() { | 
| 120 | 120 | $countries = array( | 
| 121 | 121 | '' => '', | 
| 122 | - 'US' => esc_html__( 'United States', 'give' ), | |
| 123 | - 'CA' => esc_html__( 'Canada', 'give' ), | |
| 124 | - 'GB' => esc_html__( 'United Kingdom', 'give' ), | |
| 125 | - 'AF' => esc_html__( 'Afghanistan', 'give' ), | |
| 126 | - 'AL' => esc_html__( 'Albania', 'give' ), | |
| 127 | - 'DZ' => esc_html__( 'Algeria', 'give' ), | |
| 128 | - 'AS' => esc_html__( 'American Samoa', 'give' ), | |
| 129 | - 'AD' => esc_html__( 'Andorra', 'give' ), | |
| 130 | - 'AO' => esc_html__( 'Angola', 'give' ), | |
| 131 | - 'AI' => esc_html__( 'Anguilla', 'give' ), | |
| 132 | - 'AQ' => esc_html__( 'Antarctica', 'give' ), | |
| 133 | - 'AG' => esc_html__( 'Antigua and Barbuda', 'give' ), | |
| 134 | - 'AR' => esc_html__( 'Argentina', 'give' ), | |
| 135 | - 'AM' => esc_html__( 'Armenia', 'give' ), | |
| 136 | - 'AW' => esc_html__( 'Aruba', 'give' ), | |
| 137 | - 'AU' => esc_html__( 'Australia', 'give' ), | |
| 138 | - 'AT' => esc_html__( 'Austria', 'give' ), | |
| 139 | - 'AZ' => esc_html__( 'Azerbaijan', 'give' ), | |
| 140 | - 'BS' => esc_html__( 'Bahamas', 'give'), | |
| 141 | - 'BH' => esc_html__( 'Bahrain', 'give' ), | |
| 142 | - 'BD' => esc_html__( 'Bangladesh', 'give' ), | |
| 143 | - 'BB' => esc_html__( 'Barbados', 'give' ), | |
| 144 | - 'BY' => esc_html__( 'Belarus', 'give' ), | |
| 145 | - 'BE' => esc_html__( 'Belgium', 'give' ), | |
| 146 | - 'BZ' => esc_html__( 'Belize', 'give' ), | |
| 147 | - 'BJ' => esc_html__( 'Benin', 'give' ), | |
| 148 | - 'BM' => esc_html__( 'Bermuda', 'give' ), | |
| 149 | - 'BT' => esc_html__( 'Bhutan', 'give' ), | |
| 150 | - 'BO' => esc_html__( 'Bolivia', 'give' ), | |
| 151 | - 'BA' => esc_html__( 'Bosnia and Herzegovina', 'give' ), | |
| 152 | - 'BW' => esc_html__( 'Botswana', 'give' ), | |
| 153 | - 'BV' => esc_html__( 'Bouvet Island', 'give' ), | |
| 154 | - 'BR' => esc_html__( 'Brazil', 'give' ), | |
| 155 | - 'IO' => esc_html__( 'British Indian Ocean Territory', 'give' ), | |
| 156 | - 'BN' => esc_html__( 'Brunei Darrussalam', 'give' ), | |
| 157 | - 'BG' => esc_html__( 'Bulgaria', 'give' ), | |
| 158 | - 'BF' => esc_html__( 'Burkina Faso', 'give' ), | |
| 159 | - 'BI' => esc_html__( 'Burundi', 'give' ), | |
| 160 | - 'KH' => esc_html__( 'Cambodia', 'give' ), | |
| 161 | - 'CM' => esc_html__( 'Cameroon', 'give' ), | |
| 162 | - 'CV' => esc_html__( 'Cape Verde', 'give' ), | |
| 163 | - 'KY' => esc_html__( 'Cayman Islands', 'give' ), | |
| 164 | - 'CF' => esc_html__( 'Central African Republic', 'give' ), | |
| 165 | - 'TD' => esc_html__( 'Chad', 'give' ), | |
| 166 | - 'CL' => esc_html__( 'Chile', 'give' ), | |
| 167 | - 'CN' => esc_html__( 'China', 'give' ), | |
| 168 | - 'CX' => esc_html__( 'Christmas Island', 'give' ), | |
| 169 | - 'CC' => esc_html__( 'Cocos Islands', 'give' ), | |
| 170 | - 'CO' => esc_html__( 'Colombia', 'give' ), | |
| 171 | - 'KM' => esc_html__( 'Comoros', 'give' ), | |
| 172 | - 'CD' => esc_html__( 'Congo, Democratic People\'s Republic', 'give' ), | |
| 173 | - 'CG' => esc_html__( 'Congo, Republic of', 'give' ), | |
| 174 | - 'CK' => esc_html__( 'Cook Islands', 'give' ), | |
| 175 | - 'CR' => esc_html__( 'Costa Rica', 'give' ), | |
| 176 | - 'CI' => esc_html__( 'Cote d\'Ivoire', 'give' ), | |
| 177 | - 'HR' => esc_html__( 'Croatia/Hrvatska', 'give' ), | |
| 178 | - 'CU' => esc_html__( 'Cuba', 'give' ), | |
| 179 | - 'CY' => esc_html__( 'Cyprus Island', 'give' ), | |
| 180 | - 'CZ' => esc_html__( 'Czech Republic', 'give' ), | |
| 181 | - 'DK' => esc_html__( 'Denmark', 'give' ), | |
| 182 | - 'DJ' => esc_html__( 'Djibouti', 'give' ), | |
| 183 | - 'DM' => esc_html__( 'Dominica', 'give' ), | |
| 184 | - 'DO' => esc_html__( 'Dominican Republic', 'give' ), | |
| 185 | - 'TP' => esc_html__( 'East Timor', 'give' ), | |
| 186 | - 'EC' => esc_html__( 'Ecuador', 'give' ), | |
| 187 | - 'EG' => esc_html__( 'Egypt', 'give' ), | |
| 188 | - 'GQ' => esc_html__( 'Equatorial Guinea', 'give' ), | |
| 189 | - 'SV' => esc_html__( 'El Salvador', 'give' ), | |
| 190 | - 'ER' => esc_html__( 'Eritrea', 'give' ), | |
| 191 | - 'EE' => esc_html__( 'Estonia', 'give' ), | |
| 192 | - 'ET' => esc_html__( 'Ethiopia', 'give' ), | |
| 193 | - 'FK' => esc_html__( 'Falkland Islands', 'give' ), | |
| 194 | - 'FO' => esc_html__( 'Faroe Islands', 'give' ), | |
| 195 | - 'FJ' => esc_html__( 'Fiji', 'give' ), | |
| 196 | - 'FI' => esc_html__( 'Finland', 'give' ), | |
| 197 | - 'FR' => esc_html__( 'France', 'give' ), | |
| 198 | - 'GF' => esc_html__( 'French Guiana', 'give' ), | |
| 199 | - 'PF' => esc_html__( 'French Polynesia', 'give' ), | |
| 200 | - 'TF' => esc_html__( 'French Southern Territories', 'give' ), | |
| 201 | - 'GA' => esc_html__( 'Gabon', 'give' ), | |
| 202 | - 'GM' => esc_html__( 'Gambia', 'give' ), | |
| 203 | - 'GE' => esc_html__( 'Georgia', 'give' ), | |
| 204 | - 'DE' => esc_html__( 'Germany', 'give' ), | |
| 205 | - 'GR' => esc_html__( 'Greece', 'give' ), | |
| 206 | - 'GH' => esc_html__( 'Ghana', 'give' ), | |
| 207 | - 'GI' => esc_html__( 'Gibraltar', 'give' ), | |
| 208 | - 'GL' => esc_html__( 'Greenland', 'give' ), | |
| 209 | - 'GD' => esc_html__( 'Grenada', 'give' ), | |
| 210 | - 'GP' => esc_html__( 'Guadeloupe', 'give' ), | |
| 211 | - 'GU' => esc_html__( 'Guam', 'give' ), | |
| 212 | - 'GT' => esc_html__( 'Guatemala', 'give' ), | |
| 213 | - 'GG' => esc_html__( 'Guernsey', 'give' ), | |
| 214 | - 'GN' => esc_html__( 'Guinea', 'give' ), | |
| 215 | - 'GW' => esc_html__( 'Guinea-Bissau', 'give' ), | |
| 216 | - 'GY' => esc_html__( 'Guyana', 'give' ), | |
| 217 | - 'HT' => esc_html__( 'Haiti', 'give' ), | |
| 218 | - 'HM' => esc_html__( 'Heard and McDonald Islands', 'give' ), | |
| 219 | - 'VA' => esc_html__( 'Holy See (City Vatican State)', 'give' ), | |
| 220 | - 'HN' => esc_html__( 'Honduras', 'give' ), | |
| 221 | - 'HK' => esc_html__( 'Hong Kong', 'give' ), | |
| 222 | - 'HU' => esc_html__( 'Hungary', 'give' ), | |
| 223 | - 'IS' => esc_html__( 'Iceland', 'give' ), | |
| 224 | - 'IN' => esc_html__( 'India', 'give' ), | |
| 225 | - 'ID' => esc_html__( 'Indonesia', 'give' ), | |
| 226 | - 'IR' => esc_html__( 'Iran', 'give' ), | |
| 227 | - 'IQ' => esc_html__( 'Iraq', 'give' ), | |
| 228 | - 'IE' => esc_html__( 'Ireland', 'give' ), | |
| 229 | - 'IM' => esc_html__( 'Isle of Man', 'give' ), | |
| 230 | - 'IL' => esc_html__( 'Israel', 'give' ), | |
| 231 | - 'IT' => esc_html__( 'Italy', 'give' ), | |
| 232 | - 'JM' => esc_html__( 'Jamaica', 'give' ), | |
| 233 | - 'JP' => esc_html__( 'Japan', 'give' ), | |
| 234 | - 'JE' => esc_html__( 'Jersey', 'give' ), | |
| 235 | - 'JO' => esc_html__( 'Jordan', 'give' ), | |
| 236 | - 'KZ' => esc_html__( 'Kazakhstan', 'give' ), | |
| 237 | - 'KE' => esc_html__( 'Kenya', 'give' ), | |
| 238 | - 'KI' => esc_html__( 'Kiribati', 'give' ), | |
| 239 | - 'KW' => esc_html__( 'Kuwait', 'give' ), | |
| 240 | - 'KG' => esc_html__( 'Kyrgyzstan', 'give' ), | |
| 241 | - 'LA' => esc_html__( 'Lao People\'s Democratic Republic', 'give' ), | |
| 242 | - 'LV' => esc_html__( 'Latvia', 'give' ), | |
| 243 | - 'LB' => esc_html__( 'Lebanon', 'give' ), | |
| 244 | - 'LS' => esc_html__( 'Lesotho', 'give' ), | |
| 245 | - 'LR' => esc_html__( 'Liberia', 'give' ), | |
| 246 | - 'LY' => esc_html__( 'Libyan Arab Jamahiriya', 'give' ), | |
| 247 | - 'LI' => esc_html__( 'Liechtenstein', 'give' ), | |
| 248 | - 'LT' => esc_html__( 'Lithuania', 'give' ), | |
| 249 | - 'LU' => esc_html__( 'Luxembourg', 'give' ), | |
| 250 | - 'MO' => esc_html__( 'Macau', 'give' ), | |
| 251 | - 'MK' => esc_html__( 'Macedonia', 'give' ), | |
| 252 | - 'MG' => esc_html__( 'Madagascar', 'give' ), | |
| 253 | - 'MW' => esc_html__( 'Malawi', 'give' ), | |
| 254 | - 'MY' => esc_html__( 'Malaysia', 'give' ), | |
| 255 | - 'MV' => esc_html__( 'Maldives', 'give' ), | |
| 256 | - 'ML' => esc_html__( 'Mali', 'give' ), | |
| 257 | - 'MT' => esc_html__( 'Malta', 'give' ), | |
| 258 | - 'MH' => esc_html__( 'Marshall Islands', 'give' ), | |
| 259 | - 'MQ' => esc_html__( 'Martinique', 'give' ), | |
| 260 | - 'MR' => esc_html__( 'Mauritania', 'give' ), | |
| 261 | - 'MU' => esc_html__( 'Mauritius', 'give' ), | |
| 262 | - 'YT' => esc_html__( 'Mayotte', 'give' ), | |
| 263 | - 'MX' => esc_html__( 'Mexico', 'give' ), | |
| 264 | - 'FM' => esc_html__( 'Micronesia', 'give' ), | |
| 265 | - 'MD' => esc_html__( 'Moldova, Republic of', 'give' ), | |
| 266 | - 'MC' => esc_html__( 'Monaco', 'give' ), | |
| 267 | - 'MN' => esc_html__( 'Mongolia', 'give' ), | |
| 268 | - 'ME' => esc_html__( 'Montenegro', 'give' ), | |
| 269 | - 'MS' => esc_html__( 'Montserrat', 'give' ), | |
| 270 | - 'MA' => esc_html__( 'Morocco', 'give' ), | |
| 271 | - 'MZ' => esc_html__( 'Mozambique', 'give' ), | |
| 272 | - 'MM' => esc_html__( 'Myanmar', 'give' ), | |
| 273 | - 'NA' => esc_html__( 'Namibia', 'give' ), | |
| 274 | - 'NR' => esc_html__( 'Nauru', 'give' ), | |
| 275 | - 'NP' => esc_html__( 'Nepal', 'give' ), | |
| 276 | - 'NL' => esc_html__( 'Netherlands', 'give' ), | |
| 277 | - 'AN' => esc_html__( 'Netherlands Antilles', 'give' ), | |
| 278 | - 'NC' => esc_html__( 'New Caledonia', 'give' ), | |
| 279 | - 'NZ' => esc_html__( 'New Zealand', 'give' ), | |
| 280 | - 'NI' => esc_html__( 'Nicaragua', 'give' ), | |
| 281 | - 'NE' => esc_html__( 'Niger', 'give' ), | |
| 282 | - 'NG' => esc_html__( 'Nigeria', 'give' ), | |
| 283 | - 'NU' => esc_html__( 'Niue', 'give' ), | |
| 284 | - 'NF' => esc_html__( 'Norfolk Island', 'give' ), | |
| 285 | - 'KP' => esc_html__( 'North Korea', 'give' ), | |
| 286 | - 'MP' => esc_html__( 'Northern Mariana Islands', 'give' ), | |
| 287 | - 'NO' => esc_html__( 'Norway', 'give' ), | |
| 288 | - 'OM' => esc_html__( 'Oman', 'give' ), | |
| 289 | - 'PK' => esc_html__( 'Pakistan', 'give' ), | |
| 290 | - 'PW' => esc_html__( 'Palau', 'give' ), | |
| 291 | - 'PS' => esc_html__( 'Palestinian Territories', 'give' ), | |
| 292 | - 'PA' => esc_html__( 'Panama', 'give' ), | |
| 293 | - 'PG' => esc_html__( 'Papua New Guinea', 'give' ), | |
| 294 | - 'PY' => esc_html__( 'Paraguay', 'give' ), | |
| 295 | - 'PE' => esc_html__( 'Peru', 'give' ), | |
| 296 | - 'PH' => esc_html__( 'Phillipines', 'give' ), | |
| 297 | - 'PN' => esc_html__( 'Pitcairn Island', 'give' ), | |
| 298 | - 'PL' => esc_html__( 'Poland', 'give' ), | |
| 299 | - 'PT' => esc_html__( 'Portugal', 'give' ), | |
| 300 | - 'PR' => esc_html__( 'Puerto Rico', 'give' ), | |
| 301 | - 'QA' => esc_html__( 'Qatar', 'give' ), | |
| 302 | - 'RE' => esc_html__( 'Reunion Island', 'give' ), | |
| 303 | - 'RO' => esc_html__( 'Romania', 'give' ), | |
| 304 | - 'RU' => esc_html__( 'Russian Federation', 'give' ), | |
| 305 | - 'RW' => esc_html__( 'Rwanda', 'give' ), | |
| 306 | - 'SH' => esc_html__( 'Saint Helena', 'give' ), | |
| 307 | - 'KN' => esc_html__( 'Saint Kitts and Nevis', 'give' ), | |
| 308 | - 'LC' => esc_html__( 'Saint Lucia', 'give' ), | |
| 309 | - 'PM' => esc_html__( 'Saint Pierre and Miquelon', 'give' ), | |
| 310 | - 'VC' => esc_html__( 'Saint Vincent and the Grenadines', 'give' ), | |
| 311 | - 'SM' => esc_html__( 'San Marino', 'give' ), | |
| 312 | - 'ST' => esc_html__( 'Sao Tome and Principe', 'give' ), | |
| 313 | - 'SA' => esc_html__( 'Saudi Arabia', 'give' ), | |
| 314 | - 'SN' => esc_html__( 'Senegal', 'give' ), | |
| 315 | - 'RS' => esc_html__( 'Serbia', 'give' ), | |
| 316 | - 'SC' => esc_html__( 'Seychelles', 'give' ), | |
| 317 | - 'SL' => esc_html__( 'Sierra Leone', 'give' ), | |
| 318 | - 'SG' => esc_html__( 'Singapore', 'give' ), | |
| 319 | - 'SK' => esc_html__( 'Slovak Republic', 'give' ), | |
| 320 | - 'SI' => esc_html__( 'Slovenia', 'give' ), | |
| 321 | - 'SB' => esc_html__( 'Solomon Islands', 'give' ), | |
| 322 | - 'SO' => esc_html__( 'Somalia', 'give' ), | |
| 323 | - 'ZA' => esc_html__( 'South Africa', 'give' ), | |
| 324 | - 'GS' => esc_html__( 'South Georgia', 'give' ), | |
| 325 | - 'KR' => esc_html__( 'South Korea', 'give' ), | |
| 326 | - 'ES' => esc_html__( 'Spain', 'give' ), | |
| 327 | - 'LK' => esc_html__( 'Sri Lanka', 'give' ), | |
| 328 | - 'SD' => esc_html__( 'Sudan', 'give' ), | |
| 329 | - 'SR' => esc_html__( 'Suriname', 'give' ), | |
| 330 | - 'SJ' => esc_html__( 'Svalbard and Jan Mayen Islands', 'give' ), | |
| 331 | - 'SZ' => esc_html__( 'Swaziland', 'give' ), | |
| 332 | - 'SE' => esc_html__( 'Sweden', 'give' ), | |
| 333 | - 'CH' => esc_html__( 'Switzerland', 'give' ), | |
| 334 | - 'SY' => esc_html__( 'Syrian Arab Republic', 'give' ), | |
| 335 | - 'TW' => esc_html__( 'Taiwan', 'give' ), | |
| 336 | - 'TJ' => esc_html__( 'Tajikistan', 'give' ), | |
| 337 | - 'TZ' => esc_html__( 'Tanzania', 'give' ), | |
| 338 | - 'TG' => esc_html__( 'Togo', 'give' ), | |
| 339 | - 'TK' => esc_html__( 'Tokelau', 'give' ), | |
| 340 | - 'TO' => esc_html__( 'Tonga', 'give' ), | |
| 341 | - 'TH' => esc_html__( 'Thailand', 'give' ), | |
| 342 | - 'TT' => esc_html__( 'Trinidad and Tobago', 'give' ), | |
| 343 | - 'TN' => esc_html__( 'Tunisia', 'give' ), | |
| 344 | - 'TR' => esc_html__( 'Turkey', 'give' ), | |
| 345 | - 'TM' => esc_html__( 'Turkmenistan', 'give' ), | |
| 346 | - 'TC' => esc_html__( 'Turks and Caicos Islands', 'give' ), | |
| 347 | - 'TV' => esc_html__( 'Tuvalu', 'give' ), | |
| 348 | - 'UG' => esc_html__( 'Uganda', 'give' ), | |
| 349 | - 'UA' => esc_html__( 'Ukraine', 'give' ), | |
| 350 | - 'AE' => esc_html__( 'United Arab Emirates', 'give' ), | |
| 351 | - 'UY' => esc_html__( 'Uruguay', 'give' ), | |
| 352 | - 'UM' => esc_html__( 'US Minor Outlying Islands', 'give' ), | |
| 353 | - 'UZ' => esc_html__( 'Uzbekistan', 'give' ), | |
| 354 | - 'VU' => esc_html__( 'Vanuatu', 'give' ), | |
| 355 | - 'VE' => esc_html__( 'Venezuela', 'give' ), | |
| 356 | - 'VN' => esc_html__( 'Vietnam', 'give' ), | |
| 357 | - 'VG' => esc_html__( 'Virgin Islands (British)', 'give' ), | |
| 358 | - 'VI' => esc_html__( 'Virgin Islands (USA)', 'give' ), | |
| 359 | - 'WF' => esc_html__( 'Wallis and Futuna Islands', 'give' ), | |
| 360 | - 'EH' => esc_html__( 'Western Sahara', 'give' ), | |
| 361 | - 'WS' => esc_html__( 'Western Samoa', 'give' ), | |
| 362 | - 'YE' => esc_html__( 'Yemen', 'give' ), | |
| 363 | - 'YU' => esc_html__( 'Yugoslavia', 'give' ), | |
| 364 | - 'ZM' => esc_html__( 'Zambia', 'give' ), | |
| 365 | - 'ZW' => esc_html__( 'Zimbabwe', 'give' ) | |
| 122 | +		'US' => esc_html__('United States', 'give'), | |
| 123 | +		'CA' => esc_html__('Canada', 'give'), | |
| 124 | +		'GB' => esc_html__('United Kingdom', 'give'), | |
| 125 | +		'AF' => esc_html__('Afghanistan', 'give'), | |
| 126 | +		'AL' => esc_html__('Albania', 'give'), | |
| 127 | +		'DZ' => esc_html__('Algeria', 'give'), | |
| 128 | +		'AS' => esc_html__('American Samoa', 'give'), | |
| 129 | +		'AD' => esc_html__('Andorra', 'give'), | |
| 130 | +		'AO' => esc_html__('Angola', 'give'), | |
| 131 | +		'AI' => esc_html__('Anguilla', 'give'), | |
| 132 | +		'AQ' => esc_html__('Antarctica', 'give'), | |
| 133 | +		'AG' => esc_html__('Antigua and Barbuda', 'give'), | |
| 134 | +		'AR' => esc_html__('Argentina', 'give'), | |
| 135 | +		'AM' => esc_html__('Armenia', 'give'), | |
| 136 | +		'AW' => esc_html__('Aruba', 'give'), | |
| 137 | +		'AU' => esc_html__('Australia', 'give'), | |
| 138 | +		'AT' => esc_html__('Austria', 'give'), | |
| 139 | +		'AZ' => esc_html__('Azerbaijan', 'give'), | |
| 140 | +		'BS' => esc_html__('Bahamas', 'give'), | |
| 141 | +		'BH' => esc_html__('Bahrain', 'give'), | |
| 142 | +		'BD' => esc_html__('Bangladesh', 'give'), | |
| 143 | +		'BB' => esc_html__('Barbados', 'give'), | |
| 144 | +		'BY' => esc_html__('Belarus', 'give'), | |
| 145 | +		'BE' => esc_html__('Belgium', 'give'), | |
| 146 | +		'BZ' => esc_html__('Belize', 'give'), | |
| 147 | +		'BJ' => esc_html__('Benin', 'give'), | |
| 148 | +		'BM' => esc_html__('Bermuda', 'give'), | |
| 149 | +		'BT' => esc_html__('Bhutan', 'give'), | |
| 150 | +		'BO' => esc_html__('Bolivia', 'give'), | |
| 151 | +		'BA' => esc_html__('Bosnia and Herzegovina', 'give'), | |
| 152 | +		'BW' => esc_html__('Botswana', 'give'), | |
| 153 | +		'BV' => esc_html__('Bouvet Island', 'give'), | |
| 154 | +		'BR' => esc_html__('Brazil', 'give'), | |
| 155 | +		'IO' => esc_html__('British Indian Ocean Territory', 'give'), | |
| 156 | +		'BN' => esc_html__('Brunei Darrussalam', 'give'), | |
| 157 | +		'BG' => esc_html__('Bulgaria', 'give'), | |
| 158 | +		'BF' => esc_html__('Burkina Faso', 'give'), | |
| 159 | +		'BI' => esc_html__('Burundi', 'give'), | |
| 160 | +		'KH' => esc_html__('Cambodia', 'give'), | |
| 161 | +		'CM' => esc_html__('Cameroon', 'give'), | |
| 162 | +		'CV' => esc_html__('Cape Verde', 'give'), | |
| 163 | +		'KY' => esc_html__('Cayman Islands', 'give'), | |
| 164 | +		'CF' => esc_html__('Central African Republic', 'give'), | |
| 165 | +		'TD' => esc_html__('Chad', 'give'), | |
| 166 | +		'CL' => esc_html__('Chile', 'give'), | |
| 167 | +		'CN' => esc_html__('China', 'give'), | |
| 168 | +		'CX' => esc_html__('Christmas Island', 'give'), | |
| 169 | +		'CC' => esc_html__('Cocos Islands', 'give'), | |
| 170 | +		'CO' => esc_html__('Colombia', 'give'), | |
| 171 | +		'KM' => esc_html__('Comoros', 'give'), | |
| 172 | +		'CD' => esc_html__('Congo, Democratic People\'s Republic', 'give'), | |
| 173 | +		'CG' => esc_html__('Congo, Republic of', 'give'), | |
| 174 | +		'CK' => esc_html__('Cook Islands', 'give'), | |
| 175 | +		'CR' => esc_html__('Costa Rica', 'give'), | |
| 176 | +		'CI' => esc_html__('Cote d\'Ivoire', 'give'), | |
| 177 | +		'HR' => esc_html__('Croatia/Hrvatska', 'give'), | |
| 178 | +		'CU' => esc_html__('Cuba', 'give'), | |
| 179 | +		'CY' => esc_html__('Cyprus Island', 'give'), | |
| 180 | +		'CZ' => esc_html__('Czech Republic', 'give'), | |
| 181 | +		'DK' => esc_html__('Denmark', 'give'), | |
| 182 | +		'DJ' => esc_html__('Djibouti', 'give'), | |
| 183 | +		'DM' => esc_html__('Dominica', 'give'), | |
| 184 | +		'DO' => esc_html__('Dominican Republic', 'give'), | |
| 185 | +		'TP' => esc_html__('East Timor', 'give'), | |
| 186 | +		'EC' => esc_html__('Ecuador', 'give'), | |
| 187 | +		'EG' => esc_html__('Egypt', 'give'), | |
| 188 | +		'GQ' => esc_html__('Equatorial Guinea', 'give'), | |
| 189 | +		'SV' => esc_html__('El Salvador', 'give'), | |
| 190 | +		'ER' => esc_html__('Eritrea', 'give'), | |
| 191 | +		'EE' => esc_html__('Estonia', 'give'), | |
| 192 | +		'ET' => esc_html__('Ethiopia', 'give'), | |
| 193 | +		'FK' => esc_html__('Falkland Islands', 'give'), | |
| 194 | +		'FO' => esc_html__('Faroe Islands', 'give'), | |
| 195 | +		'FJ' => esc_html__('Fiji', 'give'), | |
| 196 | +		'FI' => esc_html__('Finland', 'give'), | |
| 197 | +		'FR' => esc_html__('France', 'give'), | |
| 198 | +		'GF' => esc_html__('French Guiana', 'give'), | |
| 199 | +		'PF' => esc_html__('French Polynesia', 'give'), | |
| 200 | +		'TF' => esc_html__('French Southern Territories', 'give'), | |
| 201 | +		'GA' => esc_html__('Gabon', 'give'), | |
| 202 | +		'GM' => esc_html__('Gambia', 'give'), | |
| 203 | +		'GE' => esc_html__('Georgia', 'give'), | |
| 204 | +		'DE' => esc_html__('Germany', 'give'), | |
| 205 | +		'GR' => esc_html__('Greece', 'give'), | |
| 206 | +		'GH' => esc_html__('Ghana', 'give'), | |
| 207 | +		'GI' => esc_html__('Gibraltar', 'give'), | |
| 208 | +		'GL' => esc_html__('Greenland', 'give'), | |
| 209 | +		'GD' => esc_html__('Grenada', 'give'), | |
| 210 | +		'GP' => esc_html__('Guadeloupe', 'give'), | |
| 211 | +		'GU' => esc_html__('Guam', 'give'), | |
| 212 | +		'GT' => esc_html__('Guatemala', 'give'), | |
| 213 | +		'GG' => esc_html__('Guernsey', 'give'), | |
| 214 | +		'GN' => esc_html__('Guinea', 'give'), | |
| 215 | +		'GW' => esc_html__('Guinea-Bissau', 'give'), | |
| 216 | +		'GY' => esc_html__('Guyana', 'give'), | |
| 217 | +		'HT' => esc_html__('Haiti', 'give'), | |
| 218 | +		'HM' => esc_html__('Heard and McDonald Islands', 'give'), | |
| 219 | +		'VA' => esc_html__('Holy See (City Vatican State)', 'give'), | |
| 220 | +		'HN' => esc_html__('Honduras', 'give'), | |
| 221 | +		'HK' => esc_html__('Hong Kong', 'give'), | |
| 222 | +		'HU' => esc_html__('Hungary', 'give'), | |
| 223 | +		'IS' => esc_html__('Iceland', 'give'), | |
| 224 | +		'IN' => esc_html__('India', 'give'), | |
| 225 | +		'ID' => esc_html__('Indonesia', 'give'), | |
| 226 | +		'IR' => esc_html__('Iran', 'give'), | |
| 227 | +		'IQ' => esc_html__('Iraq', 'give'), | |
| 228 | +		'IE' => esc_html__('Ireland', 'give'), | |
| 229 | +		'IM' => esc_html__('Isle of Man', 'give'), | |
| 230 | +		'IL' => esc_html__('Israel', 'give'), | |
| 231 | +		'IT' => esc_html__('Italy', 'give'), | |
| 232 | +		'JM' => esc_html__('Jamaica', 'give'), | |
| 233 | +		'JP' => esc_html__('Japan', 'give'), | |
| 234 | +		'JE' => esc_html__('Jersey', 'give'), | |
| 235 | +		'JO' => esc_html__('Jordan', 'give'), | |
| 236 | +		'KZ' => esc_html__('Kazakhstan', 'give'), | |
| 237 | +		'KE' => esc_html__('Kenya', 'give'), | |
| 238 | +		'KI' => esc_html__('Kiribati', 'give'), | |
| 239 | +		'KW' => esc_html__('Kuwait', 'give'), | |
| 240 | +		'KG' => esc_html__('Kyrgyzstan', 'give'), | |
| 241 | +		'LA' => esc_html__('Lao People\'s Democratic Republic', 'give'), | |
| 242 | +		'LV' => esc_html__('Latvia', 'give'), | |
| 243 | +		'LB' => esc_html__('Lebanon', 'give'), | |
| 244 | +		'LS' => esc_html__('Lesotho', 'give'), | |
| 245 | +		'LR' => esc_html__('Liberia', 'give'), | |
| 246 | +		'LY' => esc_html__('Libyan Arab Jamahiriya', 'give'), | |
| 247 | +		'LI' => esc_html__('Liechtenstein', 'give'), | |
| 248 | +		'LT' => esc_html__('Lithuania', 'give'), | |
| 249 | +		'LU' => esc_html__('Luxembourg', 'give'), | |
| 250 | +		'MO' => esc_html__('Macau', 'give'), | |
| 251 | +		'MK' => esc_html__('Macedonia', 'give'), | |
| 252 | +		'MG' => esc_html__('Madagascar', 'give'), | |
| 253 | +		'MW' => esc_html__('Malawi', 'give'), | |
| 254 | +		'MY' => esc_html__('Malaysia', 'give'), | |
| 255 | +		'MV' => esc_html__('Maldives', 'give'), | |
| 256 | +		'ML' => esc_html__('Mali', 'give'), | |
| 257 | +		'MT' => esc_html__('Malta', 'give'), | |
| 258 | +		'MH' => esc_html__('Marshall Islands', 'give'), | |
| 259 | +		'MQ' => esc_html__('Martinique', 'give'), | |
| 260 | +		'MR' => esc_html__('Mauritania', 'give'), | |
| 261 | +		'MU' => esc_html__('Mauritius', 'give'), | |
| 262 | +		'YT' => esc_html__('Mayotte', 'give'), | |
| 263 | +		'MX' => esc_html__('Mexico', 'give'), | |
| 264 | +		'FM' => esc_html__('Micronesia', 'give'), | |
| 265 | +		'MD' => esc_html__('Moldova, Republic of', 'give'), | |
| 266 | +		'MC' => esc_html__('Monaco', 'give'), | |
| 267 | +		'MN' => esc_html__('Mongolia', 'give'), | |
| 268 | +		'ME' => esc_html__('Montenegro', 'give'), | |
| 269 | +		'MS' => esc_html__('Montserrat', 'give'), | |
| 270 | +		'MA' => esc_html__('Morocco', 'give'), | |
| 271 | +		'MZ' => esc_html__('Mozambique', 'give'), | |
| 272 | +		'MM' => esc_html__('Myanmar', 'give'), | |
| 273 | +		'NA' => esc_html__('Namibia', 'give'), | |
| 274 | +		'NR' => esc_html__('Nauru', 'give'), | |
| 275 | +		'NP' => esc_html__('Nepal', 'give'), | |
| 276 | +		'NL' => esc_html__('Netherlands', 'give'), | |
| 277 | +		'AN' => esc_html__('Netherlands Antilles', 'give'), | |
| 278 | +		'NC' => esc_html__('New Caledonia', 'give'), | |
| 279 | +		'NZ' => esc_html__('New Zealand', 'give'), | |
| 280 | +		'NI' => esc_html__('Nicaragua', 'give'), | |
| 281 | +		'NE' => esc_html__('Niger', 'give'), | |
| 282 | +		'NG' => esc_html__('Nigeria', 'give'), | |
| 283 | +		'NU' => esc_html__('Niue', 'give'), | |
| 284 | +		'NF' => esc_html__('Norfolk Island', 'give'), | |
| 285 | +		'KP' => esc_html__('North Korea', 'give'), | |
| 286 | +		'MP' => esc_html__('Northern Mariana Islands', 'give'), | |
| 287 | +		'NO' => esc_html__('Norway', 'give'), | |
| 288 | +		'OM' => esc_html__('Oman', 'give'), | |
| 289 | +		'PK' => esc_html__('Pakistan', 'give'), | |
| 290 | +		'PW' => esc_html__('Palau', 'give'), | |
| 291 | +		'PS' => esc_html__('Palestinian Territories', 'give'), | |
| 292 | +		'PA' => esc_html__('Panama', 'give'), | |
| 293 | +		'PG' => esc_html__('Papua New Guinea', 'give'), | |
| 294 | +		'PY' => esc_html__('Paraguay', 'give'), | |
| 295 | +		'PE' => esc_html__('Peru', 'give'), | |
| 296 | +		'PH' => esc_html__('Phillipines', 'give'), | |
| 297 | +		'PN' => esc_html__('Pitcairn Island', 'give'), | |
| 298 | +		'PL' => esc_html__('Poland', 'give'), | |
| 299 | +		'PT' => esc_html__('Portugal', 'give'), | |
| 300 | +		'PR' => esc_html__('Puerto Rico', 'give'), | |
| 301 | +		'QA' => esc_html__('Qatar', 'give'), | |
| 302 | +		'RE' => esc_html__('Reunion Island', 'give'), | |
| 303 | +		'RO' => esc_html__('Romania', 'give'), | |
| 304 | +		'RU' => esc_html__('Russian Federation', 'give'), | |
| 305 | +		'RW' => esc_html__('Rwanda', 'give'), | |
| 306 | +		'SH' => esc_html__('Saint Helena', 'give'), | |
| 307 | +		'KN' => esc_html__('Saint Kitts and Nevis', 'give'), | |
| 308 | +		'LC' => esc_html__('Saint Lucia', 'give'), | |
| 309 | +		'PM' => esc_html__('Saint Pierre and Miquelon', 'give'), | |
| 310 | +		'VC' => esc_html__('Saint Vincent and the Grenadines', 'give'), | |
| 311 | +		'SM' => esc_html__('San Marino', 'give'), | |
| 312 | +		'ST' => esc_html__('Sao Tome and Principe', 'give'), | |
| 313 | +		'SA' => esc_html__('Saudi Arabia', 'give'), | |
| 314 | +		'SN' => esc_html__('Senegal', 'give'), | |
| 315 | +		'RS' => esc_html__('Serbia', 'give'), | |
| 316 | +		'SC' => esc_html__('Seychelles', 'give'), | |
| 317 | +		'SL' => esc_html__('Sierra Leone', 'give'), | |
| 318 | +		'SG' => esc_html__('Singapore', 'give'), | |
| 319 | +		'SK' => esc_html__('Slovak Republic', 'give'), | |
| 320 | +		'SI' => esc_html__('Slovenia', 'give'), | |
| 321 | +		'SB' => esc_html__('Solomon Islands', 'give'), | |
| 322 | +		'SO' => esc_html__('Somalia', 'give'), | |
| 323 | +		'ZA' => esc_html__('South Africa', 'give'), | |
| 324 | +		'GS' => esc_html__('South Georgia', 'give'), | |
| 325 | +		'KR' => esc_html__('South Korea', 'give'), | |
| 326 | +		'ES' => esc_html__('Spain', 'give'), | |
| 327 | +		'LK' => esc_html__('Sri Lanka', 'give'), | |
| 328 | +		'SD' => esc_html__('Sudan', 'give'), | |
| 329 | +		'SR' => esc_html__('Suriname', 'give'), | |
| 330 | +		'SJ' => esc_html__('Svalbard and Jan Mayen Islands', 'give'), | |
| 331 | +		'SZ' => esc_html__('Swaziland', 'give'), | |
| 332 | +		'SE' => esc_html__('Sweden', 'give'), | |
| 333 | +		'CH' => esc_html__('Switzerland', 'give'), | |
| 334 | +		'SY' => esc_html__('Syrian Arab Republic', 'give'), | |
| 335 | +		'TW' => esc_html__('Taiwan', 'give'), | |
| 336 | +		'TJ' => esc_html__('Tajikistan', 'give'), | |
| 337 | +		'TZ' => esc_html__('Tanzania', 'give'), | |
| 338 | +		'TG' => esc_html__('Togo', 'give'), | |
| 339 | +		'TK' => esc_html__('Tokelau', 'give'), | |
| 340 | +		'TO' => esc_html__('Tonga', 'give'), | |
| 341 | +		'TH' => esc_html__('Thailand', 'give'), | |
| 342 | +		'TT' => esc_html__('Trinidad and Tobago', 'give'), | |
| 343 | +		'TN' => esc_html__('Tunisia', 'give'), | |
| 344 | +		'TR' => esc_html__('Turkey', 'give'), | |
| 345 | +		'TM' => esc_html__('Turkmenistan', 'give'), | |
| 346 | +		'TC' => esc_html__('Turks and Caicos Islands', 'give'), | |
| 347 | +		'TV' => esc_html__('Tuvalu', 'give'), | |
| 348 | +		'UG' => esc_html__('Uganda', 'give'), | |
| 349 | +		'UA' => esc_html__('Ukraine', 'give'), | |
| 350 | +		'AE' => esc_html__('United Arab Emirates', 'give'), | |
| 351 | +		'UY' => esc_html__('Uruguay', 'give'), | |
| 352 | +		'UM' => esc_html__('US Minor Outlying Islands', 'give'), | |
| 353 | +		'UZ' => esc_html__('Uzbekistan', 'give'), | |
| 354 | +		'VU' => esc_html__('Vanuatu', 'give'), | |
| 355 | +		'VE' => esc_html__('Venezuela', 'give'), | |
| 356 | +		'VN' => esc_html__('Vietnam', 'give'), | |
| 357 | +		'VG' => esc_html__('Virgin Islands (British)', 'give'), | |
| 358 | +		'VI' => esc_html__('Virgin Islands (USA)', 'give'), | |
| 359 | +		'WF' => esc_html__('Wallis and Futuna Islands', 'give'), | |
| 360 | +		'EH' => esc_html__('Western Sahara', 'give'), | |
| 361 | +		'WS' => esc_html__('Western Samoa', 'give'), | |
| 362 | +		'YE' => esc_html__('Yemen', 'give'), | |
| 363 | +		'YU' => esc_html__('Yugoslavia', 'give'), | |
| 364 | +		'ZM' => esc_html__('Zambia', 'give'), | |
| 365 | +		'ZW' => esc_html__('Zimbabwe', 'give') | |
| 366 | 366 | ); | 
| 367 | 367 | |
| 368 | - return apply_filters( 'give_countries', $countries ); | |
| 368 | +	return apply_filters('give_countries', $countries); | |
| 369 | 369 | } | 
| 370 | 370 | |
| 371 | 371 | /** | 
| @@ -446,7 +446,7 @@ discard block | ||
| 446 | 446 | 'AP' => 'Armed Forces - Pacific' | 
| 447 | 447 | ); | 
| 448 | 448 | |
| 449 | - return apply_filters( 'give_us_states', $states ); | |
| 449 | +	return apply_filters('give_us_states', $states); | |
| 450 | 450 | } | 
| 451 | 451 | |
| 452 | 452 | /** | 
| @@ -459,22 +459,22 @@ discard block | ||
| 459 | 459 |  function give_get_provinces_list() { | 
| 460 | 460 | $provinces = array( | 
| 461 | 461 | '' => '', | 
| 462 | -		'AB' => esc_html__('Alberta', 'give' ), | |
| 463 | -		'BC' => esc_html__('British Columbia', 'give' ), | |
| 464 | -		'MB' => esc_html__('Manitoba', 'give' ), | |
| 465 | -		'NB' => esc_html__('New Brunswick', 'give' ), | |
| 466 | -		'NL' => esc_html__('Newfoundland and Labrador', 'give' ), | |
| 467 | -		'NS' => esc_html__('Nova Scotia', 'give' ), | |
| 468 | -		'NT' => esc_html__('Northwest Territories', 'give' ), | |
| 469 | -		'NU' => esc_html__('Nunavut', 'give' ), | |
| 470 | -		'ON' => esc_html__('Ontario', 'give' ), | |
| 471 | -		'PE' => esc_html__('Prince Edward Island', 'give' ), | |
| 472 | -		'QC' => esc_html__('Quebec', 'give' ), | |
| 473 | -		'SK' => esc_html__('Saskatchewan', 'give' ), | |
| 474 | -		'YT' => esc_html__('Yukon', 'give' ) | |
| 462 | +		'AB' => esc_html__('Alberta', 'give'), | |
| 463 | +		'BC' => esc_html__('British Columbia', 'give'), | |
| 464 | +		'MB' => esc_html__('Manitoba', 'give'), | |
| 465 | +		'NB' => esc_html__('New Brunswick', 'give'), | |
| 466 | +		'NL' => esc_html__('Newfoundland and Labrador', 'give'), | |
| 467 | +		'NS' => esc_html__('Nova Scotia', 'give'), | |
| 468 | +		'NT' => esc_html__('Northwest Territories', 'give'), | |
| 469 | +		'NU' => esc_html__('Nunavut', 'give'), | |
| 470 | +		'ON' => esc_html__('Ontario', 'give'), | |
| 471 | +		'PE' => esc_html__('Prince Edward Island', 'give'), | |
| 472 | +		'QC' => esc_html__('Quebec', 'give'), | |
| 473 | +		'SK' => esc_html__('Saskatchewan', 'give'), | |
| 474 | +		'YT' => esc_html__('Yukon', 'give') | |
| 475 | 475 | ); | 
| 476 | 476 | |
| 477 | - return apply_filters( 'give_canada_provinces', $provinces ); | |
| 477 | +	return apply_filters('give_canada_provinces', $provinces); | |
| 478 | 478 | } | 
| 479 | 479 | |
| 480 | 480 | /** | 
| @@ -496,7 +496,7 @@ discard block | ||
| 496 | 496 | 'WA' => 'Western Australia' | 
| 497 | 497 | ); | 
| 498 | 498 | |
| 499 | - return apply_filters( 'give_australian_states', $states ); | |
| 499 | +	return apply_filters('give_australian_states', $states); | |
| 500 | 500 | } | 
| 501 | 501 | |
| 502 | 502 | /** | 
| @@ -537,7 +537,7 @@ discard block | ||
| 537 | 537 | 'TO' => 'Tocantins' | 
| 538 | 538 | ); | 
| 539 | 539 | |
| 540 | - return apply_filters( 'give_brazil_states', $states ); | |
| 540 | +	return apply_filters('give_brazil_states', $states); | |
| 541 | 541 | } | 
| 542 | 542 | |
| 543 | 543 | /** | 
| @@ -554,7 +554,7 @@ discard block | ||
| 554 | 554 | 'NEW TERRITORIES' => 'New Territories' | 
| 555 | 555 | ); | 
| 556 | 556 | |
| 557 | - return apply_filters( 'give_hong_kong_states', $states ); | |
| 557 | +	return apply_filters('give_hong_kong_states', $states); | |
| 558 | 558 | } | 
| 559 | 559 | |
| 560 | 560 | /** | 
| @@ -588,7 +588,7 @@ discard block | ||
| 588 | 588 | 'ZA' => 'Zala' | 
| 589 | 589 | ); | 
| 590 | 590 | |
| 591 | - return apply_filters( 'give_hungary_states', $states ); | |
| 591 | +	return apply_filters('give_hungary_states', $states); | |
| 592 | 592 | } | 
| 593 | 593 | |
| 594 | 594 | /** | 
| @@ -634,7 +634,7 @@ discard block | ||
| 634 | 634 | 'CN32' => 'Xinjiang / 新疆' | 
| 635 | 635 | ); | 
| 636 | 636 | |
| 637 | - return apply_filters( 'give_chinese_states', $states ); | |
| 637 | +	return apply_filters('give_chinese_states', $states); | |
| 638 | 638 | } | 
| 639 | 639 | |
| 640 | 640 | /** | 
| @@ -663,7 +663,7 @@ discard block | ||
| 663 | 663 | 'WC' => 'West Coast' | 
| 664 | 664 | ); | 
| 665 | 665 | |
| 666 | - return apply_filters( 'give_new_zealand_states', $states ); | |
| 666 | +	return apply_filters('give_new_zealand_states', $states); | |
| 667 | 667 | } | 
| 668 | 668 | |
| 669 | 669 | /** | 
| @@ -711,7 +711,7 @@ discard block | ||
| 711 | 711 | 'PB' => 'Papua Barat' | 
| 712 | 712 | ); | 
| 713 | 713 | |
| 714 | - return apply_filters( 'give_indonesia_states', $states ); | |
| 714 | +	return apply_filters('give_indonesia_states', $states); | |
| 715 | 715 | } | 
| 716 | 716 | |
| 717 | 717 | /** | 
| @@ -761,7 +761,7 @@ discard block | ||
| 761 | 761 | 'PY' => 'Pondicherry (Puducherry)' | 
| 762 | 762 | ); | 
| 763 | 763 | |
| 764 | - return apply_filters( 'give_indian_states', $states ); | |
| 764 | +	return apply_filters('give_indian_states', $states); | |
| 765 | 765 | } | 
| 766 | 766 | |
| 767 | 767 | /** | 
| @@ -791,7 +791,7 @@ discard block | ||
| 791 | 791 | 'PJY' => 'W.P. Putrajaya' | 
| 792 | 792 | ); | 
| 793 | 793 | |
| 794 | - return apply_filters( 'give_malaysian_states', $states ); | |
| 794 | +	return apply_filters('give_malaysian_states', $states); | |
| 795 | 795 | } | 
| 796 | 796 | |
| 797 | 797 | /** | 
| @@ -814,7 +814,7 @@ discard block | ||
| 814 | 814 | 'WC' => 'Western Cape' | 
| 815 | 815 | ); | 
| 816 | 816 | |
| 817 | - return apply_filters( 'give_south_african_states', $states ); | |
| 817 | +	return apply_filters('give_south_african_states', $states); | |
| 818 | 818 | } | 
| 819 | 819 | |
| 820 | 820 | /** | 
| @@ -905,7 +905,7 @@ discard block | ||
| 905 | 905 | 'TH-35' => 'Yasothon (ยโสธร)' | 
| 906 | 906 | ); | 
| 907 | 907 | |
| 908 | - return apply_filters( 'give_thailand_states', $states ); | |
| 908 | +	return apply_filters('give_thailand_states', $states); | |
| 909 | 909 | } | 
| 910 | 910 | |
| 911 | 911 | /** | 
| @@ -917,59 +917,59 @@ discard block | ||
| 917 | 917 |  function give_get_spain_states_list() { | 
| 918 | 918 | $states = array( | 
| 919 | 919 | '' => '', | 
| 920 | - 'C' => esc_html__( 'A Coruña', 'give' ), | |
| 921 | - 'VI' => esc_html__( 'Álava', 'give' ), | |
| 922 | - 'AB' => esc_html__( 'Albacete', 'give' ), | |
| 923 | - 'A' => esc_html__( 'Alicante', 'give' ), | |
| 924 | - 'AL' => esc_html__( 'Almería', 'give' ), | |
| 925 | - 'O' => esc_html__( 'Asturias', 'give' ), | |
| 926 | - 'AV' => esc_html__( 'Ávila', 'give' ), | |
| 927 | - 'BA' => esc_html__( 'Badajoz', 'give' ), | |
| 928 | - 'PM' => esc_html__( 'Baleares', 'give' ), | |
| 929 | - 'B' => esc_html__( 'Barcelona', 'give' ), | |
| 930 | - 'BU' => esc_html__( 'Burgos', 'give' ), | |
| 931 | - 'CC' => esc_html__( 'Cáceres', 'give' ), | |
| 932 | - 'CA' => esc_html__( 'Cádiz', 'give' ), | |
| 933 | - 'S' => esc_html__( 'Cantabria', 'give' ), | |
| 934 | - 'CS' => esc_html__( 'Castellón', 'give' ), | |
| 935 | - 'CE' => esc_html__( 'Ceuta', 'give' ), | |
| 936 | - 'CR' => esc_html__( 'Ciudad Real', 'give' ), | |
| 937 | - 'CO' => esc_html__( 'Córdoba', 'give' ), | |
| 938 | - 'CU' => esc_html__( 'Cuenca', 'give' ), | |
| 939 | - 'GI' => esc_html__( 'Girona', 'give' ), | |
| 940 | - 'GR' => esc_html__( 'Granada', 'give' ), | |
| 941 | - 'GU' => esc_html__( 'Guadalajara', 'give' ), | |
| 942 | - 'SS' => esc_html__( 'Gipuzkoa', 'give' ), | |
| 943 | - 'H' => esc_html__( 'Huelva', 'give' ), | |
| 944 | - 'HU' => esc_html__( 'Huesca', 'give' ), | |
| 945 | - 'J' => esc_html__( 'Jaén', 'give' ), | |
| 946 | - 'LO' => esc_html__( 'La Rioja', 'give' ), | |
| 947 | - 'GC' => esc_html__( 'Las Palmas', 'give' ), | |
| 948 | - 'LE' => esc_html__( 'León', 'give' ), | |
| 949 | - 'L' => esc_html__( 'Lleida', 'give' ), | |
| 950 | - 'LU' => esc_html__( 'Lugo', 'give' ), | |
| 951 | - 'M' => esc_html__( 'Madrid', 'give' ), | |
| 952 | - 'MA' => esc_html__( 'Málaga', 'give' ), | |
| 953 | - 'ML' => esc_html__( 'Melilla', 'give' ), | |
| 954 | - 'MU' => esc_html__( 'Murcia', 'give' ), | |
| 955 | - 'NA' => esc_html__( 'Navarra', 'give' ), | |
| 956 | - 'OR' => esc_html__( 'Ourense', 'give' ), | |
| 957 | - 'P' => esc_html__( 'Palencia', 'give' ), | |
| 958 | - 'PO' => esc_html__( 'Pontevedra', 'give' ), | |
| 959 | - 'SA' => esc_html__( 'Salamanca', 'give' ), | |
| 960 | - 'TF' => esc_html__( 'Santa Cruz de Tenerife', 'give' ), | |
| 961 | - 'SG' => esc_html__( 'Segovia', 'give' ), | |
| 962 | - 'SE' => esc_html__( 'Sevilla', 'give' ), | |
| 963 | - 'SO' => esc_html__( 'Soria', 'give' ), | |
| 964 | - 'T' => esc_html__( 'Tarragona', 'give' ), | |
| 965 | - 'TE' => esc_html__( 'Teruel', 'give' ), | |
| 966 | - 'TO' => esc_html__( 'Toledo', 'give' ), | |
| 967 | - 'V' => esc_html__( 'Valencia', 'give' ), | |
| 968 | - 'VA' => esc_html__( 'Valladolid', 'give' ), | |
| 969 | - 'BI' => esc_html__( 'Bizkaia', 'give' ), | |
| 970 | - 'ZA' => esc_html__( 'Zamora', 'give' ), | |
| 971 | - 'Z' => esc_html__( 'Zaragoza', 'give' ) | |
| 920 | +		'C'  => esc_html__('A Coruña', 'give'), | |
| 921 | +		'VI' => esc_html__('Álava', 'give'), | |
| 922 | +		'AB' => esc_html__('Albacete', 'give'), | |
| 923 | +		'A'  => esc_html__('Alicante', 'give'), | |
| 924 | +		'AL' => esc_html__('Almería', 'give'), | |
| 925 | +		'O'  => esc_html__('Asturias', 'give'), | |
| 926 | +		'AV' => esc_html__('Ávila', 'give'), | |
| 927 | +		'BA' => esc_html__('Badajoz', 'give'), | |
| 928 | +		'PM' => esc_html__('Baleares', 'give'), | |
| 929 | +		'B'  => esc_html__('Barcelona', 'give'), | |
| 930 | +		'BU' => esc_html__('Burgos', 'give'), | |
| 931 | +		'CC' => esc_html__('Cáceres', 'give'), | |
| 932 | +		'CA' => esc_html__('Cádiz', 'give'), | |
| 933 | +		'S'  => esc_html__('Cantabria', 'give'), | |
| 934 | +		'CS' => esc_html__('Castellón', 'give'), | |
| 935 | +		'CE' => esc_html__('Ceuta', 'give'), | |
| 936 | +		'CR' => esc_html__('Ciudad Real', 'give'), | |
| 937 | +		'CO' => esc_html__('Córdoba', 'give'), | |
| 938 | +		'CU' => esc_html__('Cuenca', 'give'), | |
| 939 | +		'GI' => esc_html__('Girona', 'give'), | |
| 940 | +		'GR' => esc_html__('Granada', 'give'), | |
| 941 | +		'GU' => esc_html__('Guadalajara', 'give'), | |
| 942 | +		'SS' => esc_html__('Gipuzkoa', 'give'), | |
| 943 | +		'H'  => esc_html__('Huelva', 'give'), | |
| 944 | +		'HU' => esc_html__('Huesca', 'give'), | |
| 945 | +		'J'  => esc_html__('Jaén', 'give'), | |
| 946 | +		'LO' => esc_html__('La Rioja', 'give'), | |
| 947 | +		'GC' => esc_html__('Las Palmas', 'give'), | |
| 948 | +		'LE' => esc_html__('León', 'give'), | |
| 949 | +		'L'  => esc_html__('Lleida', 'give'), | |
| 950 | +		'LU' => esc_html__('Lugo', 'give'), | |
| 951 | +		'M'  => esc_html__('Madrid', 'give'), | |
| 952 | +		'MA' => esc_html__('Málaga', 'give'), | |
| 953 | +		'ML' => esc_html__('Melilla', 'give'), | |
| 954 | +		'MU' => esc_html__('Murcia', 'give'), | |
| 955 | +		'NA' => esc_html__('Navarra', 'give'), | |
| 956 | +		'OR' => esc_html__('Ourense', 'give'), | |
| 957 | +		'P'  => esc_html__('Palencia', 'give'), | |
| 958 | +		'PO' => esc_html__('Pontevedra', 'give'), | |
| 959 | +		'SA' => esc_html__('Salamanca', 'give'), | |
| 960 | +		'TF' => esc_html__('Santa Cruz de Tenerife', 'give'), | |
| 961 | +		'SG' => esc_html__('Segovia', 'give'), | |
| 962 | +		'SE' => esc_html__('Sevilla', 'give'), | |
| 963 | +		'SO' => esc_html__('Soria', 'give'), | |
| 964 | +		'T'  => esc_html__('Tarragona', 'give'), | |
| 965 | +		'TE' => esc_html__('Teruel', 'give'), | |
| 966 | +		'TO' => esc_html__('Toledo', 'give'), | |
| 967 | +		'V'  => esc_html__('Valencia', 'give'), | |
| 968 | +		'VA' => esc_html__('Valladolid', 'give'), | |
| 969 | +		'BI' => esc_html__('Bizkaia', 'give'), | |
| 970 | +		'ZA' => esc_html__('Zamora', 'give'), | |
| 971 | +		'Z'  => esc_html__('Zaragoza', 'give') | |
| 972 | 972 | ); | 
| 973 | 973 | |
| 974 | - return apply_filters( 'give_spain_states', $states ); | |
| 974 | +	return apply_filters('give_spain_states', $states); | |
| 975 | 975 | } | 
| @@ -10,7 +10,7 @@ discard block | ||
| 10 | 10 | */ | 
| 11 | 11 | |
| 12 | 12 | // Exit if accessed directly. | 
| 13 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 13 | +if ( ! defined('ABSPATH')) { | |
| 14 | 14 | exit; | 
| 15 | 15 | } | 
| 16 | 16 | |
| @@ -23,17 +23,17 @@ discard block | ||
| 23 | 23 | * | 
| 24 | 24 | * @return void | 
| 25 | 25 | */ | 
| 26 | -function give_trigger_donation_receipt( $payment_id ) { | |
| 26 | +function give_trigger_donation_receipt($payment_id) { | |
| 27 | 27 | // Make sure we don't send a receipt while editing a donation. | 
| 28 | -	if ( isset( $_POST['give-action'] ) && 'edit_payment' == $_POST['give-action'] ) { | |
| 28 | +	if (isset($_POST['give-action']) && 'edit_payment' == $_POST['give-action']) { | |
| 29 | 29 | return; | 
| 30 | 30 | } | 
| 31 | 31 | |
| 32 | 32 | // Send email. | 
| 33 | - give_email_donation_receipt( $payment_id ); | |
| 33 | + give_email_donation_receipt($payment_id); | |
| 34 | 34 | } | 
| 35 | 35 | |
| 36 | -add_action( 'give_complete_donation', 'give_trigger_donation_receipt', 999, 1 ); | |
| 36 | +add_action('give_complete_donation', 'give_trigger_donation_receipt', 999, 1); | |
| 37 | 37 | |
| 38 | 38 | /** | 
| 39 | 39 | * Resend the Email Donation Receipt. (This can be done from the Donation History Page) | 
| @@ -44,29 +44,29 @@ discard block | ||
| 44 | 44 | * | 
| 45 | 45 | * @return void | 
| 46 | 46 | */ | 
| 47 | -function give_resend_donation_receipt( $data ) { | |
| 47 | +function give_resend_donation_receipt($data) { | |
| 48 | 48 | |
| 49 | - $purchase_id = absint( $data['purchase_id'] ); | |
| 49 | + $purchase_id = absint($data['purchase_id']); | |
| 50 | 50 | |
| 51 | -	if ( empty( $purchase_id ) ) { | |
| 51 | +	if (empty($purchase_id)) { | |
| 52 | 52 | return; | 
| 53 | 53 | } | 
| 54 | 54 | |
| 55 | -	if ( ! current_user_can( 'edit_give_payments', $purchase_id ) ) { | |
| 56 | - wp_die( esc_html__( 'You do not have permission to edit payments.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) ); | |
| 55 | +	if ( ! current_user_can('edit_give_payments', $purchase_id)) { | |
| 56 | +		wp_die(esc_html__('You do not have permission to edit payments.', 'give'), esc_html__('Error', 'give'), array('response' => 403)); | |
| 57 | 57 | } | 
| 58 | 58 | |
| 59 | - give_email_donation_receipt( $purchase_id, false ); | |
| 59 | + give_email_donation_receipt($purchase_id, false); | |
| 60 | 60 | |
| 61 | - wp_redirect( add_query_arg( array( | |
| 61 | + wp_redirect(add_query_arg(array( | |
| 62 | 62 | 'give-message' => 'email_sent', | 
| 63 | 63 | 'give-action' => false, | 
| 64 | 64 | 'purchase_id' => false | 
| 65 | - ) ) ); | |
| 65 | + ))); | |
| 66 | 66 | exit; | 
| 67 | 67 | } | 
| 68 | 68 | |
| 69 | -add_action( 'give_email_links', 'give_resend_donation_receipt' ); | |
| 69 | +add_action('give_email_links', 'give_resend_donation_receipt'); | |
| 70 | 70 | |
| 71 | 71 | /** | 
| 72 | 72 | * Trigger the sending of a Test Email | 
| @@ -77,8 +77,8 @@ discard block | ||
| 77 | 77 | * | 
| 78 | 78 | * @return void | 
| 79 | 79 | */ | 
| 80 | -function give_send_test_email( $data ) { | |
| 81 | -	if ( ! wp_verify_nonce( $data['_wpnonce'], 'give-test-email' ) ) { | |
| 80 | +function give_send_test_email($data) { | |
| 81 | +	if ( ! wp_verify_nonce($data['_wpnonce'], 'give-test-email')) { | |
| 82 | 82 | return; | 
| 83 | 83 | } | 
| 84 | 84 | |
| @@ -86,8 +86,8 @@ discard block | ||
| 86 | 86 | give_email_test_donation_receipt(); | 
| 87 | 87 | |
| 88 | 88 | // Remove the test email query arg. | 
| 89 | - wp_redirect( remove_query_arg( 'give_action' ) ); | |
| 89 | +	wp_redirect(remove_query_arg('give_action')); | |
| 90 | 90 | exit; | 
| 91 | 91 | } | 
| 92 | 92 | |
| 93 | -add_action( 'give_send_test_email', 'give_send_test_email' ); | |
| 93 | +add_action('give_send_test_email', 'give_send_test_email'); | |
| @@ -10,7 +10,7 @@ discard block | ||
| 10 | 10 | */ | 
| 11 | 11 | |
| 12 | 12 | // Exit if accessed directly. | 
| 13 | -if ( ! defined( 'ABSPATH' ) ) {
 | |
| 13 | +if ( ! defined('ABSPATH')) {
 | |
| 14 | 14 | exit; | 
| 15 | 15 | } | 
| 16 | 16 | |
| @@ -36,29 +36,29 @@ discard block | ||
| 36 | 36 | /** | 
| 37 | 37 | * Templates | 
| 38 | 38 | */ | 
| 39 | - add_filter( 'template_include', array( __CLASS__, 'template_loader' ) ); | |
| 39 | +		add_filter('template_include', array(__CLASS__, 'template_loader'));
 | |
| 40 | 40 | |
| 41 | 41 | /** | 
| 42 | 42 | * Content Wrappers | 
| 43 | 43 | */ | 
| 44 | - add_action( 'give_before_main_content', 'give_output_content_wrapper', 10 ); | |
| 45 | - add_action( 'give_after_main_content', 'give_output_content_wrapper_end', 10 ); | |
| 44 | +		add_action('give_before_main_content', 'give_output_content_wrapper', 10);
 | |
| 45 | +		add_action('give_after_main_content', 'give_output_content_wrapper_end', 10);
 | |
| 46 | 46 | |
| 47 | 47 | /** | 
| 48 | 48 | * Entry Summary Classes | 
| 49 | 49 | */ | 
| 50 | - add_filter( 'give_forms_single_summary_classes', array( $this, 'give_set_single_summary_classes' ) ); | |
| 50 | +		add_filter('give_forms_single_summary_classes', array($this, 'give_set_single_summary_classes'));
 | |
| 51 | 51 | |
| 52 | 52 | /** | 
| 53 | 53 | * Sidebar | 
| 54 | 54 | */ | 
| 55 | - add_action( 'give_before_single_form_summary', array( $this, 'give_output_sidebar_option' ), 1 ); | |
| 55 | +		add_action('give_before_single_form_summary', array($this, 'give_output_sidebar_option'), 1);
 | |
| 56 | 56 | |
| 57 | 57 | /** | 
| 58 | 58 | * Single Forms Summary Box | 
| 59 | 59 | */ | 
| 60 | - add_action( 'give_single_form_summary', 'give_template_single_title', 5 ); | |
| 61 | - add_action( 'give_single_form_summary', 'give_get_donation_form', 10 ); | |
| 60 | +		add_action('give_single_form_summary', 'give_template_single_title', 5);
 | |
| 61 | +		add_action('give_single_form_summary', 'give_get_donation_form', 10);
 | |
| 62 | 62 | |
| 63 | 63 | } | 
| 64 | 64 | |
| @@ -73,10 +73,10 @@ discard block | ||
| 73 | 73 | * | 
| 74 | 74 | * @return string $classes List of space separated class names. | 
| 75 | 75 | */ | 
| 76 | -	public function give_set_single_summary_classes( $classes ) {
 | |
| 76 | +	public function give_set_single_summary_classes($classes) {
 | |
| 77 | 77 | |
| 78 | 78 | //Add full width class when feature image is disabled AND no widgets are present | 
| 79 | -		if ( ! give_is_setting_enabled( give_get_option( 'form_sidebar' ) ) ) {
 | |
| 79 | +		if ( ! give_is_setting_enabled(give_get_option('form_sidebar'))) {
 | |
| 80 | 80 | $classes .= ' give-full-width'; | 
| 81 | 81 | } | 
| 82 | 82 | |
| @@ -97,11 +97,11 @@ discard block | ||
| 97 | 97 |  	public function give_output_sidebar_option() {
 | 
| 98 | 98 | |
| 99 | 99 | //Add full width class when feature image is disabled AND no widgets are present | 
| 100 | -		if ( give_is_setting_enabled( give_get_option( 'form_sidebar' ) ) ) {
 | |
| 101 | - add_action( 'give_before_single_form_summary', 'give_left_sidebar_pre_wrap', 5 ); | |
| 102 | - add_action( 'give_before_single_form_summary', 'give_show_form_images', 10 ); | |
| 103 | - add_action( 'give_before_single_form_summary', 'give_get_forms_sidebar', 20 ); | |
| 104 | - add_action( 'give_before_single_form_summary', 'give_left_sidebar_post_wrap', 30 ); | |
| 100 | +		if (give_is_setting_enabled(give_get_option('form_sidebar'))) {
 | |
| 101 | +			add_action('give_before_single_form_summary', 'give_left_sidebar_pre_wrap', 5);
 | |
| 102 | +			add_action('give_before_single_form_summary', 'give_show_form_images', 10);
 | |
| 103 | +			add_action('give_before_single_form_summary', 'give_get_forms_sidebar', 20);
 | |
| 104 | +			add_action('give_before_single_form_summary', 'give_left_sidebar_post_wrap', 30);
 | |
| 105 | 105 | } | 
| 106 | 106 | |
| 107 | 107 | } | 
| @@ -123,20 +123,20 @@ discard block | ||
| 123 | 123 | * | 
| 124 | 124 | * @return string $template | 
| 125 | 125 | */ | 
| 126 | -	public static function template_loader( $template ) {
 | |
| 127 | - $find = array( 'give.php' ); | |
| 126 | +	public static function template_loader($template) {
 | |
| 127 | +		$find = array('give.php');
 | |
| 128 | 128 | $file = ''; | 
| 129 | 129 | |
| 130 | -		if ( is_single() && get_post_type() == 'give_forms' ) {
 | |
| 130 | +		if (is_single() && get_post_type() == 'give_forms') {
 | |
| 131 | 131 | $file = 'single-give-form.php'; | 
| 132 | 132 | $find[] = $file; | 
| 133 | - $find[] = apply_filters( 'give_template_path', 'give/' ) . $file; | |
| 133 | +			$find[] = apply_filters('give_template_path', 'give/').$file;
 | |
| 134 | 134 | } | 
| 135 | 135 | |
| 136 | -		if ( $file ) {
 | |
| 137 | - $template = locate_template( array_unique( $find ) ); | |
| 138 | -			if ( ! $template ) {
 | |
| 139 | - $template = GIVE_PLUGIN_DIR . '/templates/' . $file; | |
| 136 | +		if ($file) {
 | |
| 137 | + $template = locate_template(array_unique($find)); | |
| 138 | +			if ( ! $template) {
 | |
| 139 | + $template = GIVE_PLUGIN_DIR.'/templates/'.$file; | |
| 140 | 140 | } | 
| 141 | 141 | } | 
| 142 | 142 | |
| @@ -10,7 +10,7 @@ discard block | ||
| 10 | 10 | */ | 
| 11 | 11 | |
| 12 | 12 | // Exit if accessed directly. | 
| 13 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 13 | +if ( ! defined('ABSPATH')) { | |
| 14 | 14 | exit; | 
| 15 | 15 | } | 
| 16 | 16 | |
| @@ -26,11 +26,11 @@ discard block | ||
| 26 | 26 | * | 
| 27 | 27 | * @return void | 
| 28 | 28 | */ | 
| 29 | -function give_email_donation_receipt( $payment_id, $admin_notice = true ) { | |
| 29 | +function give_email_donation_receipt($payment_id, $admin_notice = true) { | |
| 30 | 30 | |
| 31 | - $payment_data = give_get_payment_meta( $payment_id ); | |
| 31 | + $payment_data = give_get_payment_meta($payment_id); | |
| 32 | 32 | |
| 33 | - $from_name = give_get_option( 'from_name', wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ) ); | |
| 33 | +	$from_name = give_get_option('from_name', wp_specialchars_decode(get_bloginfo('name'), ENT_QUOTES)); | |
| 34 | 34 | |
| 35 | 35 | /** | 
| 36 | 36 | * Filters the from name. | 
| @@ -40,9 +40,9 @@ discard block | ||
| 40 | 40 | * | 
| 41 | 41 | * @since 1.0 | 
| 42 | 42 | */ | 
| 43 | - $from_name = apply_filters( 'give_donation_from_name', $from_name, $payment_id, $payment_data ); | |
| 43 | +	$from_name = apply_filters('give_donation_from_name', $from_name, $payment_id, $payment_data); | |
| 44 | 44 | |
| 45 | - $from_email = give_get_option( 'from_email', get_bloginfo( 'admin_email' ) ); | |
| 45 | +	$from_email = give_get_option('from_email', get_bloginfo('admin_email')); | |
| 46 | 46 | |
| 47 | 47 | /** | 
| 48 | 48 | * Filters the from email. | 
| @@ -52,19 +52,19 @@ discard block | ||
| 52 | 52 | * | 
| 53 | 53 | * @since 1.0 | 
| 54 | 54 | */ | 
| 55 | - $from_email = apply_filters( 'give_donation_from_address', $from_email, $payment_id, $payment_data ); | |
| 55 | +	$from_email = apply_filters('give_donation_from_address', $from_email, $payment_id, $payment_data); | |
| 56 | 56 | |
| 57 | - $to_email = give_get_payment_user_email( $payment_id ); | |
| 57 | + $to_email = give_get_payment_user_email($payment_id); | |
| 58 | 58 | |
| 59 | - $subject = give_get_option( 'donation_subject', esc_html__( 'Donation Receipt', 'give' ) ); | |
| 59 | +	$subject = give_get_option('donation_subject', esc_html__('Donation Receipt', 'give')); | |
| 60 | 60 | |
| 61 | 61 | /** | 
| 62 | 62 | * Filters the donation email receipt subject. | 
| 63 | 63 | * | 
| 64 | 64 | * @since 1.0 | 
| 65 | 65 | */ | 
| 66 | - $subject = apply_filters( 'give_donation_subject', wp_strip_all_tags( $subject ), $payment_id ); | |
| 67 | - $subject = give_do_email_tags( $subject, $payment_id ); | |
| 66 | +	$subject = apply_filters('give_donation_subject', wp_strip_all_tags($subject), $payment_id); | |
| 67 | + $subject = give_do_email_tags($subject, $payment_id); | |
| 68 | 68 | |
| 69 | 69 | /** | 
| 70 | 70 | * Filters the donation email receipt attachments. By default, there is no attachment but plugins can hook in to provide one more multiple for the donor. Examples would be a printable ticket or PDF receipt. | 
| @@ -74,14 +74,14 @@ discard block | ||
| 74 | 74 | * | 
| 75 | 75 | * @since 1.0 | 
| 76 | 76 | */ | 
| 77 | - $attachments = apply_filters( 'give_receipt_attachments', array(), $payment_id, $payment_data ); | |
| 78 | - $message = give_do_email_tags( give_get_email_body_content( $payment_id, $payment_data ), $payment_id ); | |
| 77 | +	$attachments = apply_filters('give_receipt_attachments', array(), $payment_id, $payment_data); | |
| 78 | + $message = give_do_email_tags(give_get_email_body_content($payment_id, $payment_data), $payment_id); | |
| 79 | 79 | |
| 80 | 80 | $emails = Give()->emails; | 
| 81 | 81 | |
| 82 | - $emails->__set( 'from_name', $from_name ); | |
| 83 | - $emails->__set( 'from_email', $from_email ); | |
| 84 | - $emails->__set( 'heading', esc_html__( 'Donation Receipt', 'give' ) ); | |
| 82 | +	$emails->__set('from_name', $from_name); | |
| 83 | +	$emails->__set('from_email', $from_email); | |
| 84 | +	$emails->__set('heading', esc_html__('Donation Receipt', 'give')); | |
| 85 | 85 | |
| 86 | 86 | /** | 
| 87 | 87 | * Filters the donation receipt's email headers. | 
| @@ -91,14 +91,14 @@ discard block | ||
| 91 | 91 | * | 
| 92 | 92 | * @since 1.0 | 
| 93 | 93 | */ | 
| 94 | - $headers = apply_filters( 'give_receipt_headers', $emails->get_headers(), $payment_id, $payment_data ); | |
| 95 | - $emails->__set( 'headers', $headers ); | |
| 94 | +	$headers = apply_filters('give_receipt_headers', $emails->get_headers(), $payment_id, $payment_data); | |
| 95 | +	$emails->__set('headers', $headers); | |
| 96 | 96 | |
| 97 | 97 | //Send the donation receipt. | 
| 98 | - $emails->send( $to_email, $subject, $message, $attachments ); | |
| 98 | + $emails->send($to_email, $subject, $message, $attachments); | |
| 99 | 99 | |
| 100 | 100 | //If admin notifications are on, send the admin notice. | 
| 101 | -	if ( $admin_notice && ! give_admin_notices_disabled( $payment_id ) ) { | |
| 101 | +	if ($admin_notice && ! give_admin_notices_disabled($payment_id)) { | |
| 102 | 102 | /** | 
| 103 | 103 | * Fires in the donation email receipt. | 
| 104 | 104 | * | 
| @@ -109,7 +109,7 @@ discard block | ||
| 109 | 109 | * @param int $payment_id Payment id. | 
| 110 | 110 | * @param mixed $payment_data Payment meta data. | 
| 111 | 111 | */ | 
| 112 | - do_action( 'give_admin_donation_email', $payment_id, $payment_data ); | |
| 112 | +		do_action('give_admin_donation_email', $payment_id, $payment_data); | |
| 113 | 113 | } | 
| 114 | 114 | } | 
| 115 | 115 | |
| @@ -122,41 +122,41 @@ discard block | ||
| 122 | 122 | */ | 
| 123 | 123 |  function give_email_test_donation_receipt() { | 
| 124 | 124 | |
| 125 | - $from_name = give_get_option( 'from_name', wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ) ); | |
| 125 | +	$from_name = give_get_option('from_name', wp_specialchars_decode(get_bloginfo('name'), ENT_QUOTES)); | |
| 126 | 126 | |
| 127 | 127 | /** | 
| 128 | 128 | * Filters the from name. | 
| 129 | 129 | * | 
| 130 | 130 | * @since 1.7 | 
| 131 | 131 | */ | 
| 132 | - $from_name = apply_filters( 'give_donation_from_name', $from_name, 0, array() ); | |
| 132 | +	$from_name = apply_filters('give_donation_from_name', $from_name, 0, array()); | |
| 133 | 133 | |
| 134 | - $from_email = give_get_option( 'from_email', get_bloginfo( 'admin_email' ) ); | |
| 134 | +	$from_email = give_get_option('from_email', get_bloginfo('admin_email')); | |
| 135 | 135 | |
| 136 | 136 | /** | 
| 137 | 137 | * Filters the from email. | 
| 138 | 138 | * | 
| 139 | 139 | * @since 1.7 | 
| 140 | 140 | */ | 
| 141 | - $from_email = apply_filters( 'give_donation_from_address', $from_email, 0, array() ); | |
| 141 | +	$from_email = apply_filters('give_donation_from_address', $from_email, 0, array()); | |
| 142 | 142 | |
| 143 | - $subject = give_get_option( 'donation_subject', esc_html__( 'Donation Receipt', 'give' ) ); | |
| 144 | - $subject = apply_filters( 'give_donation_subject', wp_strip_all_tags( $subject ), 0 ); | |
| 145 | - $subject = give_do_email_tags( $subject, 0 ); | |
| 143 | +	$subject = give_get_option('donation_subject', esc_html__('Donation Receipt', 'give')); | |
| 144 | +	$subject = apply_filters('give_donation_subject', wp_strip_all_tags($subject), 0); | |
| 145 | + $subject = give_do_email_tags($subject, 0); | |
| 146 | 146 | |
| 147 | - $attachments = apply_filters( 'give_receipt_attachments', array(), 0, array() ); | |
| 147 | +	$attachments = apply_filters('give_receipt_attachments', array(), 0, array()); | |
| 148 | 148 | |
| 149 | - $message = give_email_preview_template_tags( give_get_email_body_content( 0, array() ) ); | |
| 149 | + $message = give_email_preview_template_tags(give_get_email_body_content(0, array())); | |
| 150 | 150 | |
| 151 | 151 | $emails = Give()->emails; | 
| 152 | - $emails->__set( 'from_name', $from_name ); | |
| 153 | - $emails->__set( 'from_email', $from_email ); | |
| 154 | - $emails->__set( 'heading', esc_html__( 'Donation Receipt', 'give' ) ); | |
| 152 | +	$emails->__set('from_name', $from_name); | |
| 153 | +	$emails->__set('from_email', $from_email); | |
| 154 | +	$emails->__set('heading', esc_html__('Donation Receipt', 'give')); | |
| 155 | 155 | |
| 156 | - $headers = apply_filters( 'give_receipt_headers', $emails->get_headers(), 0, array() ); | |
| 157 | - $emails->__set( 'headers', $headers ); | |
| 156 | +	$headers = apply_filters('give_receipt_headers', $emails->get_headers(), 0, array()); | |
| 157 | +	$emails->__set('headers', $headers); | |
| 158 | 158 | |
| 159 | - $emails->send( give_get_admin_notice_emails(), $subject, $message, $attachments ); | |
| 159 | + $emails->send(give_get_admin_notice_emails(), $subject, $message, $attachments); | |
| 160 | 160 | |
| 161 | 161 | } | 
| 162 | 162 | |
| @@ -170,49 +170,49 @@ discard block | ||
| 170 | 170 | * | 
| 171 | 171 | * @return void | 
| 172 | 172 | */ | 
| 173 | -function give_admin_email_notice( $payment_id = 0, $payment_data = array() ) { | |
| 173 | +function give_admin_email_notice($payment_id = 0, $payment_data = array()) { | |
| 174 | 174 | |
| 175 | - $payment_id = absint( $payment_id ); | |
| 175 | + $payment_id = absint($payment_id); | |
| 176 | 176 | |
| 177 | -	if ( empty( $payment_id ) ) { | |
| 177 | +	if (empty($payment_id)) { | |
| 178 | 178 | return; | 
| 179 | 179 | } | 
| 180 | 180 | |
| 181 | -	if ( ! give_get_payment_by( 'id', $payment_id ) ) { | |
| 181 | +	if ( ! give_get_payment_by('id', $payment_id)) { | |
| 182 | 182 | return; | 
| 183 | 183 | } | 
| 184 | 184 | |
| 185 | - $from_name = give_get_option( 'from_name', wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ) ); | |
| 185 | +	$from_name = give_get_option('from_name', wp_specialchars_decode(get_bloginfo('name'), ENT_QUOTES)); | |
| 186 | 186 | |
| 187 | 187 | /** | 
| 188 | 188 | * Filters the from name. | 
| 189 | 189 | * | 
| 190 | 190 | * @since 1.0 | 
| 191 | 191 | */ | 
| 192 | - $from_name = apply_filters( 'give_donation_from_name', $from_name, $payment_id, $payment_data ); | |
| 192 | +	$from_name = apply_filters('give_donation_from_name', $from_name, $payment_id, $payment_data); | |
| 193 | 193 | |
| 194 | - $from_email = give_get_option( 'from_email', get_bloginfo( 'admin_email' ) ); | |
| 194 | +	$from_email = give_get_option('from_email', get_bloginfo('admin_email')); | |
| 195 | 195 | |
| 196 | 196 | /** | 
| 197 | 197 | * Filters the from email. | 
| 198 | 198 | * | 
| 199 | 199 | * @since 1.0 | 
| 200 | 200 | */ | 
| 201 | - $from_email = apply_filters( 'give_donation_from_address', $from_email, $payment_id, $payment_data ); | |
| 201 | +	$from_email = apply_filters('give_donation_from_address', $from_email, $payment_id, $payment_data); | |
| 202 | 202 | |
| 203 | 203 | /* translators: %s: payment id */ | 
| 204 | - $subject = give_get_option( 'donation_notification_subject', sprintf( esc_html__( 'New Donation - Payment #%s', 'give' ), $payment_id ) ); | |
| 204 | +	$subject = give_get_option('donation_notification_subject', sprintf(esc_html__('New Donation - Payment #%s', 'give'), $payment_id)); | |
| 205 | 205 | |
| 206 | 206 | /** | 
| 207 | 207 | * Filters the donation notification subject. | 
| 208 | 208 | * | 
| 209 | 209 | * @since 1.0 | 
| 210 | 210 | */ | 
| 211 | - $subject = apply_filters( 'give_admin_donation_notification_subject', wp_strip_all_tags( $subject ), $payment_id ); | |
| 212 | - $subject = give_do_email_tags( $subject, $payment_id ); | |
| 211 | +	$subject = apply_filters('give_admin_donation_notification_subject', wp_strip_all_tags($subject), $payment_id); | |
| 212 | + $subject = give_do_email_tags($subject, $payment_id); | |
| 213 | 213 | |
| 214 | - $headers = "From: " . stripslashes_deep( html_entity_decode( $from_name, ENT_COMPAT, 'UTF-8' ) ) . " <$from_email>\r\n"; | |
| 215 | - $headers .= "Reply-To: " . $from_email . "\r\n"; | |
| 214 | + $headers = "From: ".stripslashes_deep(html_entity_decode($from_name, ENT_COMPAT, 'UTF-8'))." <$from_email>\r\n"; | |
| 215 | + $headers .= "Reply-To: ".$from_email."\r\n"; | |
| 216 | 216 | //$headers .= "MIME-Version: 1.0\r\n"; | 
| 217 | 217 | $headers .= "Content-Type: text/html; charset=utf-8\r\n"; | 
| 218 | 218 | |
| @@ -221,28 +221,28 @@ discard block | ||
| 221 | 221 | * | 
| 222 | 222 | * @since 1.0 | 
| 223 | 223 | */ | 
| 224 | - $headers = apply_filters( 'give_admin_donation_notification_headers', $headers, $payment_id, $payment_data ); | |
| 224 | +	$headers = apply_filters('give_admin_donation_notification_headers', $headers, $payment_id, $payment_data); | |
| 225 | 225 | |
| 226 | 226 | /** | 
| 227 | 227 | * Filters the donation notification email attachments. By default, there is no attachment but plugins can hook in to provide one more multiple. | 
| 228 | 228 | * | 
| 229 | 229 | * @since 1.0 | 
| 230 | 230 | */ | 
| 231 | - $attachments = apply_filters( 'give_admin_donation_notification_attachments', array(), $payment_id, $payment_data ); | |
| 231 | +	$attachments = apply_filters('give_admin_donation_notification_attachments', array(), $payment_id, $payment_data); | |
| 232 | 232 | |
| 233 | - $message = give_get_donation_notification_body_content( $payment_id, $payment_data ); | |
| 233 | + $message = give_get_donation_notification_body_content($payment_id, $payment_data); | |
| 234 | 234 | |
| 235 | 235 | $emails = Give()->emails; | 
| 236 | - $emails->__set( 'from_name', $from_name ); | |
| 237 | - $emails->__set( 'from_email', $from_email ); | |
| 238 | - $emails->__set( 'headers', $headers ); | |
| 239 | - $emails->__set( 'heading', esc_html__( 'New Donation!', 'give' ) ); | |
| 236 | +	$emails->__set('from_name', $from_name); | |
| 237 | +	$emails->__set('from_email', $from_email); | |
| 238 | +	$emails->__set('headers', $headers); | |
| 239 | +	$emails->__set('heading', esc_html__('New Donation!', 'give')); | |
| 240 | 240 | |
| 241 | - $emails->send( give_get_admin_notice_emails(), $subject, $message, $attachments ); | |
| 241 | + $emails->send(give_get_admin_notice_emails(), $subject, $message, $attachments); | |
| 242 | 242 | |
| 243 | 243 | } | 
| 244 | 244 | |
| 245 | -add_action( 'give_admin_donation_email', 'give_admin_email_notice', 10, 2 ); | |
| 245 | +add_action('give_admin_donation_email', 'give_admin_email_notice', 10, 2); | |
| 246 | 246 | |
| 247 | 247 | /** | 
| 248 | 248 | * Retrieves the emails for which admin notifications are sent to (these can be changed in the Give Settings). | 
| @@ -252,12 +252,12 @@ discard block | ||
| 252 | 252 | */ | 
| 253 | 253 |  function give_get_admin_notice_emails() { | 
| 254 | 254 | |
| 255 | - $email_option = give_get_option( 'admin_notice_emails' ); | |
| 255 | +	$email_option = give_get_option('admin_notice_emails'); | |
| 256 | 256 | |
| 257 | - $emails = ! empty( $email_option ) && strlen( trim( $email_option ) ) > 0 ? $email_option : get_bloginfo( 'admin_email' ); | |
| 258 | - $emails = array_map( 'trim', explode( "\n", $emails ) ); | |
| 257 | +	$emails = ! empty($email_option) && strlen(trim($email_option)) > 0 ? $email_option : get_bloginfo('admin_email'); | |
| 258 | +	$emails = array_map('trim', explode("\n", $emails)); | |
| 259 | 259 | |
| 260 | - return apply_filters( 'give_admin_notice_emails', $emails ); | |
| 260 | +	return apply_filters('give_admin_notice_emails', $emails); | |
| 261 | 261 | } | 
| 262 | 262 | |
| 263 | 263 | /** | 
| @@ -269,11 +269,11 @@ discard block | ||
| 269 | 269 | * | 
| 270 | 270 | * @return mixed | 
| 271 | 271 | */ | 
| 272 | -function give_admin_notices_disabled( $payment_id = 0 ) { | |
| 272 | +function give_admin_notices_disabled($payment_id = 0) { | |
| 273 | 273 | |
| 274 | 274 | return apply_filters( | 
| 275 | 275 | 'give_admin_notices_disabled', | 
| 276 | - ! give_is_setting_enabled( give_get_option( 'admin_notices' ) ), | |
| 276 | +		! give_is_setting_enabled(give_get_option('admin_notices')), | |
| 277 | 277 | $payment_id | 
| 278 | 278 | ); | 
| 279 | 279 | } | 
| @@ -288,19 +288,19 @@ discard block | ||
| 288 | 288 | */ | 
| 289 | 289 |  function give_get_default_donation_notification_email() { | 
| 290 | 290 | |
| 291 | - $default_email_body = esc_html__( 'Hi there,', 'give' ) . "\n\n"; | |
| 292 | - $default_email_body .= esc_html__( 'This email is to inform you that a new donation has been made on your website:', 'give' ) . ' <a href="' . get_bloginfo( 'url' ) . '" target="_blank">' . get_bloginfo( 'url' ) . '</a>' . ".\n\n"; | |
| 293 | -	$default_email_body .= '<strong>' . esc_html__( 'Donor:', 'give' ) . '</strong> {name}' . "\n"; | |
| 294 | -	$default_email_body .= '<strong>' . esc_html__( 'Donation:', 'give' ) . '</strong> {donation}' . "\n"; | |
| 295 | -	$default_email_body .= '<strong>' . esc_html__( 'Amount:', 'give' ) . '</strong> {amount}' . "\n"; | |
| 296 | -	$default_email_body .= '<strong>' . esc_html__( 'Payment Method:', 'give' ) . '</strong> {payment_method}' . "\n\n"; | |
| 297 | - $default_email_body .= esc_html__( 'Thank you,', 'give' ) . "\n\n"; | |
| 298 | -	$default_email_body .= '{sitename}' . "\n"; | |
| 291 | +	$default_email_body = esc_html__('Hi there,', 'give')."\n\n"; | |
| 292 | +	$default_email_body .= esc_html__('This email is to inform you that a new donation has been made on your website:', 'give').' <a href="'.get_bloginfo('url').'" target="_blank">'.get_bloginfo('url').'</a>'.".\n\n"; | |
| 293 | +	$default_email_body .= '<strong>'.esc_html__('Donor:', 'give').'</strong> {name}'."\n"; | |
| 294 | +	$default_email_body .= '<strong>'.esc_html__('Donation:', 'give').'</strong> {donation}'."\n"; | |
| 295 | +	$default_email_body .= '<strong>'.esc_html__('Amount:', 'give').'</strong> {amount}'."\n"; | |
| 296 | +	$default_email_body .= '<strong>'.esc_html__('Payment Method:', 'give').'</strong> {payment_method}'."\n\n"; | |
| 297 | +	$default_email_body .= esc_html__('Thank you,', 'give')."\n\n"; | |
| 298 | +	$default_email_body .= '{sitename}'."\n"; | |
| 299 | 299 | |
| 300 | - $custom_message = give_get_option( 'donation_notification' ); | |
| 301 | - $message = ! empty( $custom_message ) ? $custom_message : $default_email_body; | |
| 300 | +	$custom_message = give_get_option('donation_notification'); | |
| 301 | + $message = ! empty($custom_message) ? $custom_message : $default_email_body; | |
| 302 | 302 | |
| 303 | - return apply_filters( 'give_default_donation_notification_email', $message ); | |
| 303 | +	return apply_filters('give_default_donation_notification_email', $message); | |
| 304 | 304 | } | 
| 305 | 305 | |
| 306 | 306 | |
| @@ -314,25 +314,25 @@ discard block | ||
| 314 | 314 | */ | 
| 315 | 315 |  function give_get_default_donation_receipt_email() { | 
| 316 | 316 | |
| 317 | -	$default_email_body = esc_html__( 'Dear', 'give' ) . " {name},\n\n"; | |
| 318 | - $default_email_body .= esc_html__( 'Thank you for your donation. Your generosity is appreciated! Here are the details of your donation:', 'give' ) . "\n\n"; | |
| 319 | -	$default_email_body .= '<strong>' . esc_html__( 'Donor:', 'give' ) . '</strong> {fullname}' . "\n"; | |
| 320 | -	$default_email_body .= '<strong>' . esc_html__( 'Donation:', 'give' ) . '</strong> {donation}' . "\n"; | |
| 321 | -	$default_email_body .= '<strong>' . esc_html__( 'Donation Date:', 'give' ) . '</strong> {date}' . "\n"; | |
| 322 | -	$default_email_body .= '<strong>' . esc_html__( 'Amount:', 'give' ) . '</strong> {amount}' . "\n"; | |
| 323 | -	$default_email_body .= '<strong>' . esc_html__( 'Payment Method:', 'give' ) . '</strong> {payment_method}' . "\n"; | |
| 324 | -	$default_email_body .= '<strong>' . esc_html__( 'Payment ID:', 'give' ) . '</strong> {payment_id}' . "\n"; | |
| 325 | -	$default_email_body .= '<strong>' . esc_html__( 'Receipt ID:', 'give' ) . '</strong> {receipt_id}' . "\n\n"; | |
| 326 | -	$default_email_body .= '{receipt_link}' . "\n\n"; | |
| 317 | +	$default_email_body = esc_html__('Dear', 'give')." {name},\n\n"; | |
| 318 | +	$default_email_body .= esc_html__('Thank you for your donation. Your generosity is appreciated! Here are the details of your donation:', 'give')."\n\n"; | |
| 319 | +	$default_email_body .= '<strong>'.esc_html__('Donor:', 'give').'</strong> {fullname}'."\n"; | |
| 320 | +	$default_email_body .= '<strong>'.esc_html__('Donation:', 'give').'</strong> {donation}'."\n"; | |
| 321 | +	$default_email_body .= '<strong>'.esc_html__('Donation Date:', 'give').'</strong> {date}'."\n"; | |
| 322 | +	$default_email_body .= '<strong>'.esc_html__('Amount:', 'give').'</strong> {amount}'."\n"; | |
| 323 | +	$default_email_body .= '<strong>'.esc_html__('Payment Method:', 'give').'</strong> {payment_method}'."\n"; | |
| 324 | +	$default_email_body .= '<strong>'.esc_html__('Payment ID:', 'give').'</strong> {payment_id}'."\n"; | |
| 325 | +	$default_email_body .= '<strong>'.esc_html__('Receipt ID:', 'give').'</strong> {receipt_id}'."\n\n"; | |
| 326 | +	$default_email_body .= '{receipt_link}'."\n\n"; | |
| 327 | 327 | $default_email_body .= "\n\n"; | 
| 328 | - $default_email_body .= esc_html__( 'Sincerely,', 'give' ) . "\n"; | |
| 329 | -	$default_email_body .= '{sitename}' . "\n"; | |
| 328 | +	$default_email_body .= esc_html__('Sincerely,', 'give')."\n"; | |
| 329 | +	$default_email_body .= '{sitename}'."\n"; | |
| 330 | 330 | |
| 331 | - $custom_message = give_get_option( 'donation_receipt' ); | |
| 331 | +	$custom_message = give_get_option('donation_receipt'); | |
| 332 | 332 | |
| 333 | - $message = ! empty( $custom_message ) ? $custom_message : $default_email_body; | |
| 333 | + $message = ! empty($custom_message) ? $custom_message : $default_email_body; | |
| 334 | 334 | |
| 335 | - return apply_filters( 'give_default_donation_receipt_email', $message ); | |
| 335 | +	return apply_filters('give_default_donation_receipt_email', $message); | |
| 336 | 336 | } | 
| 337 | 337 | |
| 338 | 338 | /** | 
| @@ -344,19 +344,19 @@ discard block | ||
| 344 | 344 | * | 
| 345 | 345 | * @return array $email_names | 
| 346 | 346 | */ | 
| 347 | -function give_get_email_names( $user_info ) { | |
| 347 | +function give_get_email_names($user_info) { | |
| 348 | 348 | $email_names = array(); | 
| 349 | - $user_info = maybe_unserialize( $user_info ); | |
| 349 | + $user_info = maybe_unserialize($user_info); | |
| 350 | 350 | |
| 351 | 351 | $email_names['fullname'] = ''; | 
| 352 | -	if ( isset( $user_info['id'] ) && $user_info['id'] > 0 && isset( $user_info['first_name'] ) ) { | |
| 353 | - $user_data = get_userdata( $user_info['id'] ); | |
| 352 | +	if (isset($user_info['id']) && $user_info['id'] > 0 && isset($user_info['first_name'])) { | |
| 353 | + $user_data = get_userdata($user_info['id']); | |
| 354 | 354 | $email_names['name'] = $user_info['first_name']; | 
| 355 | - $email_names['fullname'] = $user_info['first_name'] . ' ' . $user_info['last_name']; | |
| 355 | + $email_names['fullname'] = $user_info['first_name'].' '.$user_info['last_name']; | |
| 356 | 356 | $email_names['username'] = $user_data->user_login; | 
| 357 | -	} elseif ( isset( $user_info['first_name'] ) ) { | |
| 357 | +	} elseif (isset($user_info['first_name'])) { | |
| 358 | 358 | $email_names['name'] = $user_info['first_name']; | 
| 359 | - $email_names['fullname'] = $user_info['first_name'] . ' ' . $user_info['last_name']; | |
| 359 | + $email_names['fullname'] = $user_info['first_name'].' '.$user_info['last_name']; | |
| 360 | 360 | $email_names['username'] = $user_info['first_name']; | 
| 361 | 361 |  	} else { | 
| 362 | 362 | $email_names['name'] = $user_info['email']; | 
| @@ -9,11 +9,11 @@ discard block | ||
| 9 | 9 | * @since 1.8 | 
| 10 | 10 | */ | 
| 11 | 11 | |
| 12 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 12 | +if ( ! defined('ABSPATH')) { | |
| 13 | 13 | exit; // Exit if accessed directly | 
| 14 | 14 | } | 
| 15 | 15 | |
| 16 | -if ( ! class_exists( 'Give_Settings_System_Info' ) ) : | |
| 16 | +if ( ! class_exists('Give_Settings_System_Info')) : | |
| 17 | 17 | |
| 18 | 18 | /** | 
| 19 | 19 | * Give_Settings_System_Info. | 
| @@ -43,15 +43,15 @@ discard block | ||
| 43 | 43 | */ | 
| 44 | 44 |  		public function __construct() { | 
| 45 | 45 | $this->id = 'system-info'; | 
| 46 | - $this->label = esc_html__( 'System Info', 'give' ); | |
| 46 | +			$this->label = esc_html__('System Info', 'give'); | |
| 47 | 47 | |
| 48 | - add_filter( 'give-tools_tabs_array', array( $this, 'add_settings_page' ), 20 ); | |
| 49 | -			add_action( "give-tools_settings_{$this->id}_page", array( $this, 'output' ) ); | |
| 48 | +			add_filter('give-tools_tabs_array', array($this, 'add_settings_page'), 20); | |
| 49 | +			add_action("give-tools_settings_{$this->id}_page", array($this, 'output')); | |
| 50 | 50 | |
| 51 | 51 | // Do not use main form for this tab. | 
| 52 | -			if( give_get_current_setting_tab() === $this->id ) { | |
| 53 | - add_action( "give-tools_open_form", '__return_empty_string' ); | |
| 54 | - add_action( "give-tools_close_form", '__return_empty_string' ); | |
| 52 | +			if (give_get_current_setting_tab() === $this->id) { | |
| 53 | +				add_action("give-tools_open_form", '__return_empty_string'); | |
| 54 | +				add_action("give-tools_close_form", '__return_empty_string'); | |
| 55 | 55 | } | 
| 56 | 56 | } | 
| 57 | 57 | |
| @@ -62,8 +62,8 @@ discard block | ||
| 62 | 62 | * @param array $pages Lst of pages. | 
| 63 | 63 | * @return array | 
| 64 | 64 | */ | 
| 65 | -		public function add_settings_page( $pages ) { | |
| 66 | - $pages[ $this->id ] = $this->label; | |
| 65 | +		public function add_settings_page($pages) { | |
| 66 | + $pages[$this->id] = $this->label; | |
| 67 | 67 | |
| 68 | 68 | return $pages; | 
| 69 | 69 | } | 
| @@ -76,7 +76,7 @@ discard block | ||
| 76 | 76 | */ | 
| 77 | 77 |  		public function output() { | 
| 78 | 78 | $GLOBALS['give_hide_save_button'] = true; | 
| 79 | - include_once( 'views/html-admin-page-system-info.php' ); | |
| 79 | +			include_once('views/html-admin-page-system-info.php'); | |
| 80 | 80 | } | 
| 81 | 81 | } | 
| 82 | 82 | |
| @@ -10,13 +10,13 @@ discard block | ||
| 10 | 10 | */ | 
| 11 | 11 | |
| 12 | 12 | // Exit if accessed directly. | 
| 13 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 13 | +if ( ! defined('ABSPATH')) { | |
| 14 | 14 | exit; | 
| 15 | 15 | } | 
| 16 | 16 | |
| 17 | 17 | // Load WP_List_Table if not loaded | 
| 18 | -if ( ! class_exists( 'WP_List_Table' ) ) { | |
| 19 | - require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php'; | |
| 18 | +if ( ! class_exists('WP_List_Table')) { | |
| 19 | + require_once ABSPATH.'wp-admin/includes/class-wp-list-table.php'; | |
| 20 | 20 | } | 
| 21 | 21 | |
| 22 | 22 | /** | 
| @@ -50,13 +50,13 @@ discard block | ||
| 50 | 50 | global $status, $page; | 
| 51 | 51 | |
| 52 | 52 | // Set parent defaults | 
| 53 | - parent::__construct( array( | |
| 54 | - 'singular' => give_get_forms_label_singular(), // Singular name of the listed records | |
| 55 | - 'plural' => give_get_forms_label_plural(), // Plural name of the listed records | |
| 53 | + parent::__construct(array( | |
| 54 | + 'singular' => give_get_forms_label_singular(), // Singular name of the listed records | |
| 55 | + 'plural' => give_get_forms_label_plural(), // Plural name of the listed records | |
| 56 | 56 | 'ajax' => false // Does this table support ajax? | 
| 57 | - ) ); | |
| 57 | + )); | |
| 58 | 58 | |
| 59 | - add_action( 'give_report_view_actions', array( $this, 'category_filter' ) ); | |
| 59 | +		add_action('give_report_view_actions', array($this, 'category_filter')); | |
| 60 | 60 | $this->query(); | 
| 61 | 61 | |
| 62 | 62 | } | 
| @@ -72,18 +72,18 @@ discard block | ||
| 72 | 72 | * | 
| 73 | 73 | * @return string Column Name | 
| 74 | 74 | */ | 
| 75 | -	public function column_default( $item, $column_name ) { | |
| 76 | -		switch ( $column_name ) { | |
| 75 | +	public function column_default($item, $column_name) { | |
| 76 | +		switch ($column_name) { | |
| 77 | 77 | case 'earnings' : | 
| 78 | - return give_currency_filter( give_format_amount( $item[ $column_name ] ) ); | |
| 78 | + return give_currency_filter(give_format_amount($item[$column_name])); | |
| 79 | 79 | case 'average_sales' : | 
| 80 | - return round( $item[ $column_name ] ); | |
| 80 | + return round($item[$column_name]); | |
| 81 | 81 | case 'average_earnings' : | 
| 82 | - return give_currency_filter( give_format_amount( $item[ $column_name ] ) ); | |
| 82 | + return give_currency_filter(give_format_amount($item[$column_name])); | |
| 83 | 83 | case 'details' : | 
| 84 | - return '<a href="' . admin_url( 'edit.php?post_type=give_forms&page=give-reports&tab=forms&form-id=' . $item['ID'] ) . '">' . esc_html__( 'View Detailed Report', 'give' ) . '</a>'; | |
| 84 | +				return '<a href="'.admin_url('edit.php?post_type=give_forms&page=give-reports&tab=forms&form-id='.$item['ID']).'">'.esc_html__('View Detailed Report', 'give').'</a>'; | |
| 85 | 85 | default: | 
| 86 | - return $item[ $column_name ]; | |
| 86 | + return $item[$column_name]; | |
| 87 | 87 | } | 
| 88 | 88 | } | 
| 89 | 89 | |
| @@ -96,12 +96,12 @@ discard block | ||
| 96 | 96 | */ | 
| 97 | 97 |  	public function get_columns() { | 
| 98 | 98 | $columns = array( | 
| 99 | - 'title' => esc_html__( 'Form', 'give' ), | |
| 100 | - 'sales' => esc_html__( 'Donations', 'give' ), | |
| 101 | - 'earnings' => esc_html__( 'Income', 'give' ), | |
| 102 | - 'average_sales' => esc_html__( 'Monthly Average Donations', 'give' ), | |
| 103 | - 'average_earnings' => esc_html__( 'Monthly Average Income', 'give' ), | |
| 104 | - 'details' => esc_html__( 'Detailed Report', 'give' ) | |
| 99 | +			'title'            => esc_html__('Form', 'give'), | |
| 100 | +			'sales'            => esc_html__('Donations', 'give'), | |
| 101 | +			'earnings'         => esc_html__('Income', 'give'), | |
| 102 | +			'average_sales'    => esc_html__('Monthly Average Donations', 'give'), | |
| 103 | +			'average_earnings' => esc_html__('Monthly Average Income', 'give'), | |
| 104 | +			'details'          => esc_html__('Detailed Report', 'give') | |
| 105 | 105 | ); | 
| 106 | 106 | |
| 107 | 107 | return $columns; | 
| @@ -116,9 +116,9 @@ discard block | ||
| 116 | 116 | */ | 
| 117 | 117 |  	public function get_sortable_columns() { | 
| 118 | 118 | return array( | 
| 119 | - 'title' => array( 'title', true ), | |
| 120 | - 'sales' => array( 'sales', false ), | |
| 121 | - 'earnings' => array( 'earnings', false ), | |
| 119 | +			'title'    => array('title', true), | |
| 120 | +			'sales'    => array('sales', false), | |
| 121 | +			'earnings' => array('earnings', false), | |
| 122 | 122 | ); | 
| 123 | 123 | } | 
| 124 | 124 | |
| @@ -130,7 +130,7 @@ discard block | ||
| 130 | 130 | * @return int Current page number | 
| 131 | 131 | */ | 
| 132 | 132 |  	public function get_paged() { | 
| 133 | - return isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 1; | |
| 133 | + return isset($_GET['paged']) ? absint($_GET['paged']) : 1; | |
| 134 | 134 | } | 
| 135 | 135 | |
| 136 | 136 | |
| @@ -142,7 +142,7 @@ discard block | ||
| 142 | 142 | * @return int Category ID | 
| 143 | 143 | */ | 
| 144 | 144 |  	public function get_category() { | 
| 145 | - return isset( $_GET['category'] ) ? absint( $_GET['category'] ) : 0; | |
| 145 | + return isset($_GET['category']) ? absint($_GET['category']) : 0; | |
| 146 | 146 | } | 
| 147 | 147 | |
| 148 | 148 | |
| @@ -155,8 +155,8 @@ discard block | ||
| 155 | 155 | */ | 
| 156 | 156 |  	public function get_total_forms() { | 
| 157 | 157 | $total = 0; | 
| 158 | - $counts = wp_count_posts( 'give_forms', 'readable' ); | |
| 159 | -		foreach ( $counts as $status => $count ) { | |
| 158 | +		$counts = wp_count_posts('give_forms', 'readable'); | |
| 159 | +		foreach ($counts as $status => $count) { | |
| 160 | 160 | $total += $count; | 
| 161 | 161 | } | 
| 162 | 162 | |
| @@ -170,7 +170,7 @@ discard block | ||
| 170 | 170 | * @since 1.0 | 
| 171 | 171 | * @return void | 
| 172 | 172 | */ | 
| 173 | -	public function bulk_actions( $which = '' ) { | |
| 173 | +	public function bulk_actions($which = '') { | |
| 174 | 174 | |
| 175 | 175 | } | 
| 176 | 176 | |
| @@ -182,27 +182,27 @@ discard block | ||
| 182 | 182 | * | 
| 183 | 183 | * @param string $which | 
| 184 | 184 | */ | 
| 185 | -	protected function display_tablenav( $which ) { | |
| 185 | +	protected function display_tablenav($which) { | |
| 186 | 186 | |
| 187 | -		if ( 'top' === $which ) { | |
| 188 | - wp_nonce_field( 'bulk-' . $this->_args['plural'] ); | |
| 187 | +		if ('top' === $which) { | |
| 188 | +			wp_nonce_field('bulk-'.$this->_args['plural']); | |
| 189 | 189 | } | 
| 190 | 190 | ?> | 
| 191 | - <div class="tablenav give-clearfix <?php echo esc_attr( $which ); ?>"> | |
| 191 | + <div class="tablenav give-clearfix <?php echo esc_attr($which); ?>"> | |
| 192 | 192 | |
| 193 | -			<?php if ( 'top' === $which ) { ?> | |
| 193 | +			<?php if ('top' === $which) { ?> | |
| 194 | 194 | <h3 class="alignleft reports-earnings-title"> | 
| 195 | - <span><?php esc_html_e( 'Donation Forms Report', 'give' ); ?></span> | |
| 195 | +					<span><?php esc_html_e('Donation Forms Report', 'give'); ?></span> | |
| 196 | 196 | </h3> | 
| 197 | 197 | <?php } ?> | 
| 198 | 198 | |
| 199 | 199 | <div class="alignright tablenav-right"> | 
| 200 | 200 | <div class="actions bulkactions"> | 
| 201 | - <?php $this->bulk_actions( $which ); ?> | |
| 201 | + <?php $this->bulk_actions($which); ?> | |
| 202 | 202 | </div> | 
| 203 | 203 | <?php | 
| 204 | - $this->extra_tablenav( $which ); | |
| 205 | - $this->pagination( $which ); | |
| 204 | + $this->extra_tablenav($which); | |
| 205 | + $this->pagination($which); | |
| 206 | 206 | ?> | 
| 207 | 207 | </div> | 
| 208 | 208 | |
| @@ -222,9 +222,9 @@ discard block | ||
| 222 | 222 | */ | 
| 223 | 223 |  	public function category_filter() { | 
| 224 | 224 | |
| 225 | - $categories = get_terms( 'form_category' ); | |
| 226 | -		if ( $categories && ! is_wp_error( $categories ) ) { | |
| 227 | - echo Give()->html->category_dropdown( 'category', $this->get_category() ); | |
| 225 | +		$categories = get_terms('form_category'); | |
| 226 | +		if ($categories && ! is_wp_error($categories)) { | |
| 227 | +			echo Give()->html->category_dropdown('category', $this->get_category()); | |
| 228 | 228 | } | 
| 229 | 229 | } | 
| 230 | 230 | |
| @@ -238,8 +238,8 @@ discard block | ||
| 238 | 238 | */ | 
| 239 | 239 |  	public function query() { | 
| 240 | 240 | |
| 241 | - $orderby = isset( $_GET['orderby'] ) ? $_GET['orderby'] : 'title'; | |
| 242 | - $order = isset( $_GET['order'] ) ? $_GET['order'] : 'DESC'; | |
| 241 | + $orderby = isset($_GET['orderby']) ? $_GET['orderby'] : 'title'; | |
| 242 | + $order = isset($_GET['order']) ? $_GET['order'] : 'DESC'; | |
| 243 | 243 | $category = $this->get_category(); | 
| 244 | 244 | |
| 245 | 245 | $args = array( | 
| @@ -252,7 +252,7 @@ discard block | ||
| 252 | 252 | 'suppress_filters' => true | 
| 253 | 253 | ); | 
| 254 | 254 | |
| 255 | -		if ( ! empty( $category ) ) { | |
| 255 | +		if ( ! empty($category)) { | |
| 256 | 256 | $args['tax_query'] = array( | 
| 257 | 257 | array( | 
| 258 | 258 | 'taxonomy' => 'form_category', | 
| @@ -261,7 +261,7 @@ discard block | ||
| 261 | 261 | ); | 
| 262 | 262 | } | 
| 263 | 263 | |
| 264 | - switch ( $orderby ) : | |
| 264 | + switch ($orderby) : | |
| 265 | 265 | case 'title' : | 
| 266 | 266 | $args['orderby'] = 'title'; | 
| 267 | 267 | break; | 
| @@ -277,9 +277,9 @@ discard block | ||
| 277 | 277 | break; | 
| 278 | 278 | endswitch; | 
| 279 | 279 | |
| 280 | - $args = apply_filters( 'give_form_reports_prepare_items_args', $args, $this ); | |
| 280 | +		$args = apply_filters('give_form_reports_prepare_items_args', $args, $this); | |
| 281 | 281 | |
| 282 | - $this->products = new WP_Query( $args ); | |
| 282 | + $this->products = new WP_Query($args); | |
| 283 | 283 | |
| 284 | 284 | } | 
| 285 | 285 | |
| @@ -295,15 +295,15 @@ discard block | ||
| 295 | 295 | |
| 296 | 296 | $give_forms = $this->products->posts; | 
| 297 | 297 | |
| 298 | -		if ( $give_forms ) { | |
| 299 | -			foreach ( $give_forms as $form ) { | |
| 298 | +		if ($give_forms) { | |
| 299 | +			foreach ($give_forms as $form) { | |
| 300 | 300 | $reports_data[] = array( | 
| 301 | 301 | 'ID' => $form, | 
| 302 | - 'title' => get_the_title( $form ), | |
| 303 | - 'sales' => give_get_form_sales_stats( $form ), | |
| 304 | - 'earnings' => give_get_form_earnings_stats( $form ), | |
| 305 | - 'average_sales' => give_get_average_monthly_form_sales( $form ), | |
| 306 | - 'average_earnings' => give_get_average_monthly_form_earnings( $form ) | |
| 302 | + 'title' => get_the_title($form), | |
| 303 | + 'sales' => give_get_form_sales_stats($form), | |
| 304 | + 'earnings' => give_get_form_earnings_stats($form), | |
| 305 | + 'average_sales' => give_get_average_monthly_form_sales($form), | |
| 306 | + 'average_earnings' => give_get_average_monthly_form_earnings($form) | |
| 307 | 307 | ); | 
| 308 | 308 | } | 
| 309 | 309 | } | 
| @@ -331,7 +331,7 @@ discard block | ||
| 331 | 331 | |
| 332 | 332 | $sortable = $this->get_sortable_columns(); | 
| 333 | 333 | |
| 334 | - $this->_column_headers = array( $columns, $hidden, $sortable ); | |
| 334 | + $this->_column_headers = array($columns, $hidden, $sortable); | |
| 335 | 335 | |
| 336 | 336 | $data = $this->reports_data(); | 
| 337 | 337 | |
| @@ -339,10 +339,10 @@ discard block | ||
| 339 | 339 | |
| 340 | 340 | $this->items = $data; | 
| 341 | 341 | |
| 342 | - $this->set_pagination_args( array( | |
| 342 | + $this->set_pagination_args(array( | |
| 343 | 343 | 'total_items' => $total_items, | 
| 344 | 344 | 'per_page' => $this->per_page, | 
| 345 | - 'total_pages' => ceil( $total_items / $this->per_page ) | |
| 345 | + 'total_pages' => ceil($total_items / $this->per_page) | |
| 346 | 346 | ) | 
| 347 | 347 | ); | 
| 348 | 348 | } | 
| @@ -10,13 +10,13 @@ discard block | ||
| 10 | 10 | */ | 
| 11 | 11 | |
| 12 | 12 | // Exit if accessed directly. | 
| 13 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 13 | +if ( ! defined('ABSPATH')) { | |
| 14 | 14 | exit; | 
| 15 | 15 | } | 
| 16 | 16 | |
| 17 | 17 | // Load WP_List_Table if not loaded | 
| 18 | -if ( ! class_exists( 'WP_List_Table' ) ) { | |
| 19 | - require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php'; | |
| 18 | +if ( ! class_exists('WP_List_Table')) { | |
| 19 | + require_once ABSPATH.'wp-admin/includes/class-wp-list-table.php'; | |
| 20 | 20 | } | 
| 21 | 21 | |
| 22 | 22 | /** | 
| @@ -45,11 +45,11 @@ discard block | ||
| 45 | 45 | global $status, $page; | 
| 46 | 46 | |
| 47 | 47 | // Set parent defaults | 
| 48 | - parent::__construct( array( | |
| 49 | - 'singular' => give_get_forms_label_singular(), // Singular name of the listed records | |
| 50 | - 'plural' => give_get_forms_label_plural(), // Plural name of the listed records | |
| 48 | + parent::__construct(array( | |
| 49 | + 'singular' => give_get_forms_label_singular(), // Singular name of the listed records | |
| 50 | + 'plural' => give_get_forms_label_plural(), // Plural name of the listed records | |
| 51 | 51 | 'ajax' => false // Does this table support ajax? | 
| 52 | - ) ); | |
| 52 | + )); | |
| 53 | 53 | |
| 54 | 54 | } | 
| 55 | 55 | |
| @@ -64,10 +64,10 @@ discard block | ||
| 64 | 64 | * | 
| 65 | 65 | * @return string Column Name | 
| 66 | 66 | */ | 
| 67 | -	public function column_default( $item, $column_name ) { | |
| 68 | -		switch ( $column_name ) { | |
| 67 | +	public function column_default($item, $column_name) { | |
| 68 | +		switch ($column_name) { | |
| 69 | 69 | default: | 
| 70 | - return $item[ $column_name ]; | |
| 70 | + return $item[$column_name]; | |
| 71 | 71 | } | 
| 72 | 72 | } | 
| 73 | 73 | |
| @@ -80,11 +80,11 @@ discard block | ||
| 80 | 80 | */ | 
| 81 | 81 |  	public function get_columns() { | 
| 82 | 82 | $columns = array( | 
| 83 | - 'label' => esc_attr__( 'Gateway', 'give' ), | |
| 84 | - 'complete_sales' => esc_attr__( 'Complete Transactions', 'give' ), | |
| 85 | - 'pending_sales' => esc_attr__( 'Pending / Failed Transactions', 'give' ), | |
| 86 | - 'total_sales' => esc_attr__( 'Total Transactions', 'give' ), | |
| 87 | - 'total_donations' => esc_attr__( 'Total Donated', 'give' ) | |
| 83 | +			'label'           => esc_attr__('Gateway', 'give'), | |
| 84 | +			'complete_sales'  => esc_attr__('Complete Transactions', 'give'), | |
| 85 | +			'pending_sales'   => esc_attr__('Pending / Failed Transactions', 'give'), | |
| 86 | +			'total_sales'     => esc_attr__('Total Transactions', 'give'), | |
| 87 | +			'total_donations' => esc_attr__('Total Donated', 'give') | |
| 88 | 88 | ); | 
| 89 | 89 | |
| 90 | 90 | return $columns; | 
| @@ -99,7 +99,7 @@ discard block | ||
| 99 | 99 | * @return int Current page number | 
| 100 | 100 | */ | 
| 101 | 101 |  	public function get_paged() { | 
| 102 | - return isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 1; | |
| 102 | + return isset($_GET['paged']) ? absint($_GET['paged']) : 1; | |
| 103 | 103 | } | 
| 104 | 104 | |
| 105 | 105 | |
| @@ -110,7 +110,7 @@ discard block | ||
| 110 | 110 | * @since 1.0 | 
| 111 | 111 | * @return void | 
| 112 | 112 | */ | 
| 113 | -	public function bulk_actions( $which = '' ) { | |
| 113 | +	public function bulk_actions($which = '') { | |
| 114 | 114 | |
| 115 | 115 | } | 
| 116 | 116 | |
| @@ -122,27 +122,27 @@ discard block | ||
| 122 | 122 | * | 
| 123 | 123 | * @param string $which | 
| 124 | 124 | */ | 
| 125 | -	protected function display_tablenav( $which ) { | |
| 125 | +	protected function display_tablenav($which) { | |
| 126 | 126 | |
| 127 | -		if ( 'top' === $which ) { | |
| 128 | - wp_nonce_field( 'bulk-' . $this->_args['plural'] ); | |
| 127 | +		if ('top' === $which) { | |
| 128 | +			wp_nonce_field('bulk-'.$this->_args['plural']); | |
| 129 | 129 | } | 
| 130 | 130 | ?> | 
| 131 | - <div class="tablenav gateways-report-tablenav give-clearfix <?php echo esc_attr( $which ); ?>"> | |
| 131 | + <div class="tablenav gateways-report-tablenav give-clearfix <?php echo esc_attr($which); ?>"> | |
| 132 | 132 | |
| 133 | -			<?php if ( 'top' === $which ) { ?> | |
| 133 | +			<?php if ('top' === $which) { ?> | |
| 134 | 134 | <h3 class="alignleft reports-earnings-title"> | 
| 135 | - <span><?php esc_html_e( 'Donation Methods Report', 'give' ); ?></span> | |
| 135 | +					<span><?php esc_html_e('Donation Methods Report', 'give'); ?></span> | |
| 136 | 136 | </h3> | 
| 137 | 137 | <?php } ?> | 
| 138 | 138 | |
| 139 | 139 | <div class="alignright tablenav-right"> | 
| 140 | 140 | <div class="actions bulkactions"> | 
| 141 | - <?php $this->bulk_actions( $which ); ?> | |
| 141 | + <?php $this->bulk_actions($which); ?> | |
| 142 | 142 | </div> | 
| 143 | 143 | <?php | 
| 144 | - $this->extra_tablenav( $which ); | |
| 145 | - $this->pagination( $which ); | |
| 144 | + $this->extra_tablenav($which); | |
| 145 | + $this->pagination($which); | |
| 146 | 146 | ?> | 
| 147 | 147 | </div> | 
| 148 | 148 | |
| @@ -167,18 +167,18 @@ discard block | ||
| 167 | 167 | $gateways = give_get_payment_gateways(); | 
| 168 | 168 | $stats = new Give_Payment_Stats(); | 
| 169 | 169 | |
| 170 | -		foreach ( $gateways as $gateway_id => $gateway ) { | |
| 170 | +		foreach ($gateways as $gateway_id => $gateway) { | |
| 171 | 171 | |
| 172 | - $complete_count = give_count_sales_by_gateway( $gateway_id, 'publish' ); | |
| 173 | - $pending_count = give_count_sales_by_gateway( $gateway_id, array( 'pending', 'failed' ) ); | |
| 172 | + $complete_count = give_count_sales_by_gateway($gateway_id, 'publish'); | |
| 173 | +			$pending_count  = give_count_sales_by_gateway($gateway_id, array('pending', 'failed')); | |
| 174 | 174 | |
| 175 | 175 | $reports_data[] = array( | 
| 176 | 176 | 'ID' => $gateway_id, | 
| 177 | 177 | 'label' => $gateway['admin_label'], | 
| 178 | - 'complete_sales' => give_format_amount( $complete_count, false ), | |
| 179 | - 'pending_sales' => give_format_amount( $pending_count, false ), | |
| 180 | - 'total_sales' => give_format_amount( $complete_count + $pending_count, false ), | |
| 181 | - 'total_donations' => give_currency_filter( give_format_amount( $stats->get_earnings( 0, 0, 0, $gateway_id ) ) ) | |
| 178 | + 'complete_sales' => give_format_amount($complete_count, false), | |
| 179 | + 'pending_sales' => give_format_amount($pending_count, false), | |
| 180 | + 'total_sales' => give_format_amount($complete_count + $pending_count, false), | |
| 181 | + 'total_donations' => give_currency_filter(give_format_amount($stats->get_earnings(0, 0, 0, $gateway_id))) | |
| 182 | 182 | ); | 
| 183 | 183 | } | 
| 184 | 184 | |
| @@ -200,7 +200,7 @@ discard block | ||
| 200 | 200 | $columns = $this->get_columns(); | 
| 201 | 201 | $hidden = array(); // No hidden columns | 
| 202 | 202 | $sortable = $this->get_sortable_columns(); | 
| 203 | - $this->_column_headers = array( $columns, $hidden, $sortable ); | |
| 203 | + $this->_column_headers = array($columns, $hidden, $sortable); | |
| 204 | 204 | $this->items = $this->reports_data(); | 
| 205 | 205 | |
| 206 | 206 | } | 
| @@ -10,7 +10,7 @@ discard block | ||
| 10 | 10 | */ | 
| 11 | 11 | |
| 12 | 12 | // Exit if accessed directly. | 
| 13 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 13 | +if ( ! defined('ABSPATH')) { | |
| 14 | 14 | exit; | 
| 15 | 15 | } | 
| 16 | 16 | |
| @@ -20,7 +20,7 @@ discard block | ||
| 20 | 20 | * @since 1.0 | 
| 21 | 21 | * @return void | 
| 22 | 22 | */ | 
| 23 | -add_action( 'give_manual_cc_form', '__return_false' ); | |
| 23 | +add_action('give_manual_cc_form', '__return_false'); | |
| 24 | 24 | |
| 25 | 25 | /** | 
| 26 | 26 | * Processes the donation data and uses the Manual Payment gateway to record | 
| @@ -32,17 +32,17 @@ discard block | ||
| 32 | 32 | * | 
| 33 | 33 | * @return void | 
| 34 | 34 | */ | 
| 35 | -function give_manual_payment( $purchase_data ) { | |
| 35 | +function give_manual_payment($purchase_data) { | |
| 36 | 36 | |
| 37 | -	if ( ! wp_verify_nonce( $purchase_data['gateway_nonce'], 'give-gateway' ) ) { | |
| 38 | - wp_die( esc_html__( 'Nonce verification failed.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) ); | |
| 37 | +	if ( ! wp_verify_nonce($purchase_data['gateway_nonce'], 'give-gateway')) { | |
| 38 | +		wp_die(esc_html__('Nonce verification failed.', 'give'), esc_html__('Error', 'give'), array('response' => 403)); | |
| 39 | 39 | } | 
| 40 | 40 | |
| 41 | 41 | //Create payment_data array | 
| 42 | 42 | $payment_data = array( | 
| 43 | 43 | 'price' => $purchase_data['price'], | 
| 44 | 44 | 'give_form_title' => $purchase_data['post_data']['give-form-title'], | 
| 45 | - 'give_form_id' => intval( $purchase_data['post_data']['give-form-id'] ), | |
| 45 | + 'give_form_id' => intval($purchase_data['post_data']['give-form-id']), | |
| 46 | 46 | 'give_price_id' => isset($purchase_data['post_data']['give-price-id']) ? $purchase_data['post_data']['give-price-id'] : '', | 
| 47 | 47 | 'date' => $purchase_data['date'], | 
| 48 | 48 | 'user_email' => $purchase_data['user_email'], | 
| @@ -52,24 +52,24 @@ discard block | ||
| 52 | 52 | 'status' => 'pending' | 
| 53 | 53 | ); | 
| 54 | 54 | // Record the pending payment | 
| 55 | - $payment = give_insert_payment( $payment_data ); | |
| 55 | + $payment = give_insert_payment($payment_data); | |
| 56 | 56 | |
| 57 | -	if ( $payment ) { | |
| 58 | - give_update_payment_status( $payment, 'publish' ); | |
| 57 | +	if ($payment) { | |
| 58 | + give_update_payment_status($payment, 'publish'); | |
| 59 | 59 | give_send_to_success_page(); | 
| 60 | 60 |  	} else { | 
| 61 | 61 | give_record_gateway_error( | 
| 62 | - esc_html__( 'Payment Error', 'give' ), | |
| 62 | +			esc_html__('Payment Error', 'give'), | |
| 63 | 63 | sprintf( | 
| 64 | 64 | /* translators: %s: payment data */ | 
| 65 | - esc_html__( 'The payment creation failed while processing a manual (free or test) donation. Payment data: %s', 'give' ), | |
| 66 | - json_encode( $payment_data ) | |
| 65 | +				esc_html__('The payment creation failed while processing a manual (free or test) donation. Payment data: %s', 'give'), | |
| 66 | + json_encode($payment_data) | |
| 67 | 67 | ), | 
| 68 | 68 | $payment | 
| 69 | 69 | ); | 
| 70 | 70 | // If errors are present, send the user back to the donation page so they can be corrected | 
| 71 | - give_send_back_to_checkout( '?payment-mode=' . $purchase_data['post_data']['give-gateway'] ); | |
| 71 | +		give_send_back_to_checkout('?payment-mode='.$purchase_data['post_data']['give-gateway']); | |
| 72 | 72 | } | 
| 73 | 73 | } | 
| 74 | 74 | |
| 75 | -add_action( 'give_gateway_manual', 'give_manual_payment' ); | |
| 75 | +add_action('give_gateway_manual', 'give_manual_payment'); | |