@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | 10 | // Exit if accessed directly |
| 11 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 11 | +if ( ! defined('ABSPATH')) { |
|
| 12 | 12 | exit; |
| 13 | 13 | } |
| 14 | 14 | |
@@ -26,12 +26,12 @@ discard block |
||
| 26 | 26 | * |
| 27 | 27 | * @param $_banner_details |
| 28 | 28 | */ |
| 29 | - function __construct( $_banner_details ) { |
|
| 29 | + function __construct($_banner_details) { |
|
| 30 | 30 | |
| 31 | 31 | global $current_user; |
| 32 | 32 | $this->banner_details = $_banner_details; |
| 33 | - $this->test_mode = ( $this->banner_details['testing'] == 'true' ) ? true : false; |
|
| 34 | - $this->nag_meta_key = 'give_addon_activation_ignore_' . sanitize_title( $this->banner_details['name'] ); |
|
| 33 | + $this->test_mode = ($this->banner_details['testing'] == 'true') ? true : false; |
|
| 34 | + $this->nag_meta_key = 'give_addon_activation_ignore_'.sanitize_title($this->banner_details['name']); |
|
| 35 | 35 | |
| 36 | 36 | //Get current user |
| 37 | 37 | $this->user_id = $current_user->ID; |
@@ -50,13 +50,13 @@ discard block |
||
| 50 | 50 | public function init() { |
| 51 | 51 | |
| 52 | 52 | //Testing? |
| 53 | - if ( $this->test_mode ) { |
|
| 54 | - delete_user_meta( $this->user_id, $this->nag_meta_key ); |
|
| 53 | + if ($this->test_mode) { |
|
| 54 | + delete_user_meta($this->user_id, $this->nag_meta_key); |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | //Get the current page to add the notice to |
| 58 | - add_action( 'current_screen', array( $this, 'give_addon_notice_ignore' ) ); |
|
| 59 | - add_action( 'admin_notices', array( $this, 'give_addon_activation_admin_notice' ) ); |
|
| 58 | + add_action('current_screen', array($this, 'give_addon_notice_ignore')); |
|
| 59 | + add_action('admin_notices', array($this, 'give_addon_activation_admin_notice')); |
|
| 60 | 60 | |
| 61 | 61 | |
| 62 | 62 | } |
@@ -71,13 +71,13 @@ discard block |
||
| 71 | 71 | global $pagenow; |
| 72 | 72 | |
| 73 | 73 | //Make sure we're on the plugins page. |
| 74 | - if ( $pagenow !== 'plugins.php' ) { |
|
| 74 | + if ($pagenow !== 'plugins.php') { |
|
| 75 | 75 | return false; |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | // If the user hasn't already dismissed our alert, |
| 79 | 79 | // Output the activation banner |
| 80 | - if ( ! get_user_meta( $this->user_id, $this->nag_meta_key ) ) { ?> |
|
| 80 | + if ( ! get_user_meta($this->user_id, $this->nag_meta_key)) { ?> |
|
| 81 | 81 | |
| 82 | 82 | <!-- * I output inline styles here |
| 83 | 83 | * because there's no reason to keep these |
@@ -157,15 +157,15 @@ discard block |
||
| 157 | 157 | <h3><?php |
| 158 | 158 | printf( |
| 159 | 159 | /* translators: %s: Add-on name */ |
| 160 | - __( "Thank you for installing Give's %s Add-on!", 'give' ), |
|
| 161 | - '<span>' . $this->banner_details['name'] . '</span>' |
|
| 160 | + __("Thank you for installing Give's %s Add-on!", 'give'), |
|
| 161 | + '<span>'.$this->banner_details['name'].'</span>' |
|
| 162 | 162 | ); |
| 163 | 163 | ?></h3> |
| 164 | 164 | |
| 165 | 165 | <a href="<?php |
| 166 | 166 | //The Dismiss Button |
| 167 | - $nag_admin_dismiss_url = 'plugins.php?' . $this->nag_meta_key . '=0'; |
|
| 168 | - echo admin_url( $nag_admin_dismiss_url ); ?>" class="dismiss"><span class="dashicons dashicons-dismiss"></span></a> |
|
| 167 | + $nag_admin_dismiss_url = 'plugins.php?'.$this->nag_meta_key.'=0'; |
|
| 168 | + echo admin_url($nag_admin_dismiss_url); ?>" class="dismiss"><span class="dashicons dashicons-dismiss"></span></a> |
|
| 169 | 169 | |
| 170 | 170 | <!-- * Now we output a few "actions" |
| 171 | 171 | * that the user can take from here --> |
@@ -173,21 +173,21 @@ discard block |
||
| 173 | 173 | <div class="alert-actions"> |
| 174 | 174 | |
| 175 | 175 | <?php //Point them to your settings page |
| 176 | - if ( isset( $this->banner_details['settings_url'] ) ) { ?> |
|
| 176 | + if (isset($this->banner_details['settings_url'])) { ?> |
|
| 177 | 177 | <a href="<?php echo $this->banner_details['settings_url']; ?>"> |
| 178 | - <span class="dashicons dashicons-admin-settings"></span><?php _e( 'Go to Settings', 'give' ); ?> |
|
| 178 | + <span class="dashicons dashicons-admin-settings"></span><?php _e('Go to Settings', 'give'); ?> |
|
| 179 | 179 | </a> |
| 180 | 180 | <?php } ?> |
| 181 | 181 | |
| 182 | 182 | <?php |
| 183 | 183 | // Show them how to configure the Addon |
| 184 | - if ( isset( $this->banner_details['documentation_url'] ) ) { ?> |
|
| 184 | + if (isset($this->banner_details['documentation_url'])) { ?> |
|
| 185 | 185 | <a href="<?php echo $this->banner_details['documentation_url'] ?>" target="_blank"> |
| 186 | 186 | <span class="dashicons dashicons-media-text"></span> |
| 187 | 187 | <?php |
| 188 | 188 | printf( |
| 189 | 189 | /* translators: %s: Add-on name */ |
| 190 | - __( 'Documentation: %s Add-on', 'give' ), |
|
| 190 | + __('Documentation: %s Add-on', 'give'), |
|
| 191 | 191 | $this->banner_details['name'] |
| 192 | 192 | ); |
| 193 | 193 | ?> |
@@ -195,10 +195,10 @@ discard block |
||
| 195 | 195 | <?php } ?> |
| 196 | 196 | <?php |
| 197 | 197 | //Let them signup for plugin updates |
| 198 | - if ( isset( $this->banner_details['support_url'] ) ) { ?> |
|
| 198 | + if (isset($this->banner_details['support_url'])) { ?> |
|
| 199 | 199 | |
| 200 | 200 | <a href="<?php echo $this->banner_details['support_url'] ?>" target="_blank"> |
| 201 | - <span class="dashicons dashicons-sos"></span><?php _e( 'Get Support', 'give' ); ?> |
|
| 201 | + <span class="dashicons dashicons-sos"></span><?php _e('Get Support', 'give'); ?> |
|
| 202 | 202 | </a> |
| 203 | 203 | |
| 204 | 204 | <?php } ?> |
@@ -220,13 +220,13 @@ discard block |
||
| 220 | 220 | /* If user clicks to ignore the notice, add that to their user meta the banner then checks whether this tag exists already or not. |
| 221 | 221 | * See here: http://codex.wordpress.org/Function_Reference/add_user_meta |
| 222 | 222 | */ |
| 223 | - if ( isset( $_GET[ $this->nag_meta_key ] ) && '0' == $_GET[ $this->nag_meta_key ] ) { |
|
| 223 | + if (isset($_GET[$this->nag_meta_key]) && '0' == $_GET[$this->nag_meta_key]) { |
|
| 224 | 224 | |
| 225 | 225 | //Get the global user |
| 226 | 226 | global $current_user; |
| 227 | 227 | $user_id = $current_user->ID; |
| 228 | 228 | |
| 229 | - add_user_meta( $user_id, $this->nag_meta_key, 'true', true ); |
|
| 229 | + add_user_meta($user_id, $this->nag_meta_key, 'true', true); |
|
| 230 | 230 | } |
| 231 | 231 | } |
| 232 | 232 | |
@@ -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', __( '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', __('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,25 +46,25 @@ 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( 'F j, Y' ); ?></h3> |
|
| 49 | + <h3 class="give-dashboard-date-today"><?php echo date('F j, Y'); ?></h3> |
|
| 50 | 50 | |
| 51 | 51 | <p class="give-dashboard-happy-day"><?php |
| 52 | 52 | printf( |
| 53 | 53 | /* translators: %s: day of the week */ |
| 54 | - __( 'Happy %s!', 'give' ), |
|
| 55 | - date( 'l', current_time( 'timestamp' ) ) |
|
| 54 | + __('Happy %s!', 'give'), |
|
| 55 | + date('l', current_time('timestamp')) |
|
| 56 | 56 | ); |
| 57 | 57 | ?></p> |
| 58 | 58 | |
| 59 | - <?php $earnings_today = $stats->get_earnings( 0, 'today', false ); ?> |
|
| 59 | + <?php $earnings_today = $stats->get_earnings(0, 'today', false); ?> |
|
| 60 | 60 | |
| 61 | - <p class="give-dashboard-today-earnings"><?php echo give_currency_filter( give_format_amount( $earnings_today ) ); ?></p> |
|
| 61 | + <p class="give-dashboard-today-earnings"><?php echo give_currency_filter(give_format_amount($earnings_today)); ?></p> |
|
| 62 | 62 | |
| 63 | - <p class="give-orders-today"><?php $donations_today = $stats->get_sales( 0, 'today', false, array( |
|
| 63 | + <p class="give-orders-today"><?php $donations_today = $stats->get_sales(0, 'today', false, array( |
|
| 64 | 64 | 'publish', |
| 65 | 65 | 'revoked' |
| 66 | - ) ); ?><?php echo give_format_amount( $donations_today, false ); ?> |
|
| 67 | - <span><?php echo _x( 'donations today', 'Displays in WP admin dashboard widget after the day\'s total donations', 'give' ); ?></span> |
|
| 66 | + )); ?><?php echo give_format_amount($donations_today, false); ?> |
|
| 67 | + <span><?php echo _x('donations today', 'Displays in WP admin dashboard widget after the day\'s total donations', 'give'); ?></span> |
|
| 68 | 68 | </p> |
| 69 | 69 | |
| 70 | 70 | |
@@ -74,34 +74,34 @@ discard block |
||
| 74 | 74 | <table class="give-table-stats"> |
| 75 | 75 | <thead style="display: none;"> |
| 76 | 76 | <tr> |
| 77 | - <th><?php _e( 'This Week', 'give' ); ?></th> |
|
| 78 | - <th><?php _e( 'This Month', 'give' ); ?></th> |
|
| 79 | - <th><?php _e( 'Past 30 Days', 'give' ); ?></th> |
|
| 77 | + <th><?php _e('This Week', 'give'); ?></th> |
|
| 78 | + <th><?php _e('This Month', 'give'); ?></th> |
|
| 79 | + <th><?php _e('Past 30 Days', 'give'); ?></th> |
|
| 80 | 80 | </tr> |
| 81 | 81 | </thead> |
| 82 | 82 | <tbody> |
| 83 | 83 | <tr id="give-table-stats-tr-1"> |
| 84 | 84 | <td> |
| 85 | - <p class="give-dashboard-stat-total"><?php echo give_currency_filter( give_format_amount( $stats->get_earnings( 0, 'this_week' ) ) ); ?></p> |
|
| 85 | + <p class="give-dashboard-stat-total"><?php echo give_currency_filter(give_format_amount($stats->get_earnings(0, 'this_week'))); ?></p> |
|
| 86 | 86 | |
| 87 | - <p class="give-dashboard-stat-total-label"><?php _e( 'this week', 'give' ); ?></p> |
|
| 87 | + <p class="give-dashboard-stat-total-label"><?php _e('this week', 'give'); ?></p> |
|
| 88 | 88 | </td> |
| 89 | 89 | <td> |
| 90 | - <p class="give-dashboard-stat-total"><?php echo give_currency_filter( give_format_amount( $stats->get_earnings( 0, 'this_month' ) ) ); ?></p> |
|
| 90 | + <p class="give-dashboard-stat-total"><?php echo give_currency_filter(give_format_amount($stats->get_earnings(0, 'this_month'))); ?></p> |
|
| 91 | 91 | |
| 92 | - <p class="give-dashboard-stat-total-label"><?php _e( 'this month', 'give' ); ?></p> |
|
| 92 | + <p class="give-dashboard-stat-total-label"><?php _e('this month', 'give'); ?></p> |
|
| 93 | 93 | </td> |
| 94 | 94 | </tr> |
| 95 | 95 | <tr id="give-table-stats-tr-2"> |
| 96 | 96 | <td> |
| 97 | - <p class="give-dashboard-stat-total"><?php echo give_currency_filter( give_format_amount( $stats->get_earnings( 0, 'last_month' ) ) ) ?></p> |
|
| 97 | + <p class="give-dashboard-stat-total"><?php echo give_currency_filter(give_format_amount($stats->get_earnings(0, 'last_month'))) ?></p> |
|
| 98 | 98 | |
| 99 | - <p class="give-dashboard-stat-total-label"><?php _e( 'last month', 'give' ); ?></p> |
|
| 99 | + <p class="give-dashboard-stat-total-label"><?php _e('last month', 'give'); ?></p> |
|
| 100 | 100 | </td> |
| 101 | 101 | <td> |
| 102 | - <p class="give-dashboard-stat-total"><?php echo give_currency_filter( give_format_amount( $stats->get_earnings( 0, 'this_year', false ) ) ) ?></p> |
|
| 102 | + <p class="give-dashboard-stat-total"><?php echo give_currency_filter(give_format_amount($stats->get_earnings(0, 'this_year', false))) ?></p> |
|
| 103 | 103 | |
| 104 | - <p class="give-dashboard-stat-total-label"><?php _e( 'this year', 'give' ); ?></p> |
|
| 104 | + <p class="give-dashboard-stat-total-label"><?php _e('this year', 'give'); ?></p> |
|
| 105 | 105 | </td> |
| 106 | 106 | </tr> |
| 107 | 107 | </tbody> |
@@ -121,25 +121,25 @@ discard block |
||
| 121 | 121 | * |
| 122 | 122 | * @return array |
| 123 | 123 | */ |
| 124 | -function give_dashboard_at_a_glance_widget( $items ) { |
|
| 125 | - $num_posts = wp_count_posts( 'give_forms' ); |
|
| 124 | +function give_dashboard_at_a_glance_widget($items) { |
|
| 125 | + $num_posts = wp_count_posts('give_forms'); |
|
| 126 | 126 | |
| 127 | - if ( $num_posts && $num_posts->publish ) { |
|
| 127 | + if ($num_posts && $num_posts->publish) { |
|
| 128 | 128 | |
| 129 | 129 | $text = sprintf( |
| 130 | 130 | /* translators: 1: number of posts published 2: forms singular label 3: forms plural label */ |
| 131 | - _n( '%1$s Give %2$s', '%1$s Give %3$s', $num_posts->publish, 'give' ), |
|
| 131 | + _n('%1$s Give %2$s', '%1$s Give %3$s', $num_posts->publish, 'give'), |
|
| 132 | 132 | $num_posts->publish, |
| 133 | 133 | give_get_forms_label_singular(), |
| 134 | 134 | give_get_forms_label_plural() |
| 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() ) ) { |
|
| 140 | - $text = sprintf( '<a class="give-forms-count" href="edit.php?post_type=give_forms">%1$s</a>', $text ); |
|
| 139 | + if (current_user_can('edit_give_forms', get_current_user_id())) { |
|
| 140 | + $text = sprintf('<a class="give-forms-count" href="edit.php?post_type=give_forms">%1$s</a>', $text); |
|
| 141 | 141 | } else { |
| 142 | - $text = sprintf( '<span class="give-forms-count">%1$s</span>', $text ); |
|
| 142 | + $text = sprintf('<span class="give-forms-count">%1$s</span>', $text); |
|
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | $items[] = $text; |
@@ -148,4 +148,4 @@ discard block |
||
| 148 | 148 | return $items; |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | -add_filter( 'dashboard_glance_items', 'give_dashboard_at_a_glance_widget', 1, 1); |
|
| 151 | +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 | |
@@ -22,80 +22,80 @@ discard block |
||
| 22 | 22 | */ |
| 23 | 23 | function give_tools_recount_stats_display() { |
| 24 | 24 | |
| 25 | - if ( ! current_user_can( 'manage_give_settings' ) ) { |
|
| 25 | + if ( ! current_user_can('manage_give_settings')) { |
|
| 26 | 26 | return; |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | - do_action( 'give_tools_recount_stats_before' ); |
|
| 29 | + do_action('give_tools_recount_stats_before'); |
|
| 30 | 30 | ?> |
| 31 | 31 | <div id="poststuff"> |
| 32 | 32 | <div class="postbox"> |
| 33 | 33 | |
| 34 | - <h2 class="hndle ui-sortable-handle"><span><?php _e( 'Recount Stats', 'give' ); ?></span></h2> |
|
| 34 | + <h2 class="hndle ui-sortable-handle"><span><?php _e('Recount Stats', 'give'); ?></span></h2> |
|
| 35 | 35 | |
| 36 | 36 | <div class="inside recount-stats-controls"> |
| 37 | - <p><?php _e( 'Use these tools to recount stats, delete test transactions, or reset stats.', 'give' ); ?></p> |
|
| 37 | + <p><?php _e('Use these tools to recount stats, delete test transactions, or reset stats.', 'give'); ?></p> |
|
| 38 | 38 | <form method="post" id="give-tools-recount-form" class="give-export-form"> |
| 39 | 39 | |
| 40 | - <?php wp_nonce_field( 'give_ajax_export', 'give_ajax_export' ); ?> |
|
| 40 | + <?php wp_nonce_field('give_ajax_export', 'give_ajax_export'); ?> |
|
| 41 | 41 | |
| 42 | 42 | <select name="give-export-class" id="recount-stats-type"> |
| 43 | - <option value="0" selected="selected" disabled="disabled"><?php _e( 'Please select an option', 'give' ); ?></option> |
|
| 44 | - <option data-type="recount-stats" value="Give_Tools_Recount_Income"><?php _e( 'Recalculate Total Donation Income Amount', 'give' ); ?></option> |
|
| 45 | - <option data-type="recount-form" value="Give_Tools_Recount_Form_Stats"><?php _e( 'Recalculate Income Amount and Donation Counts for a Form', 'give' ); ?></option> |
|
| 46 | - <option data-type="recount-all" value="Give_Tools_Recount_All_Stats"><?php _e( 'Recalculate Income Amount and Donation Counts for All Forms', 'give' ); ?></option> |
|
| 47 | - <option data-type="recount-customer-stats" value="Give_Tools_Recount_Customer_Stats"><?php _e( 'Recalculate Donor Statistics', 'give' ); ?></option> |
|
| 48 | - <option data-type="delete-test-transactions" value="Give_Tools_Delete_Test_Transactions"><?php _e( 'Delete Test Transactions', 'give' ); ?></option> |
|
| 49 | - <option data-type="reset-stats" value="Give_Tools_Reset_Stats"><?php _e( 'Delete All Data', 'give' ); ?></option> |
|
| 50 | - <?php do_action( 'give_recount_tool_options' ); ?> |
|
| 43 | + <option value="0" selected="selected" disabled="disabled"><?php _e('Please select an option', 'give'); ?></option> |
|
| 44 | + <option data-type="recount-stats" value="Give_Tools_Recount_Income"><?php _e('Recalculate Total Donation Income Amount', 'give'); ?></option> |
|
| 45 | + <option data-type="recount-form" value="Give_Tools_Recount_Form_Stats"><?php _e('Recalculate Income Amount and Donation Counts for a Form', 'give'); ?></option> |
|
| 46 | + <option data-type="recount-all" value="Give_Tools_Recount_All_Stats"><?php _e('Recalculate Income Amount and Donation Counts for All Forms', 'give'); ?></option> |
|
| 47 | + <option data-type="recount-customer-stats" value="Give_Tools_Recount_Customer_Stats"><?php _e('Recalculate Donor Statistics', 'give'); ?></option> |
|
| 48 | + <option data-type="delete-test-transactions" value="Give_Tools_Delete_Test_Transactions"><?php _e('Delete Test Transactions', 'give'); ?></option> |
|
| 49 | + <option data-type="reset-stats" value="Give_Tools_Reset_Stats"><?php _e('Delete All Data', 'give'); ?></option> |
|
| 50 | + <?php do_action('give_recount_tool_options'); ?> |
|
| 51 | 51 | </select> |
| 52 | 52 | |
| 53 | 53 | <span id="tools-form-dropdown" style="display: none"> |
| 54 | 54 | <?php |
| 55 | 55 | $args = array( |
| 56 | 56 | 'name' => 'form_id', |
| 57 | - 'number' => - 1, |
|
| 57 | + 'number' => -1, |
|
| 58 | 58 | 'chosen' => true, |
| 59 | 59 | ); |
| 60 | - echo Give()->html->forms_dropdown( $args ); |
|
| 60 | + echo Give()->html->forms_dropdown($args); |
|
| 61 | 61 | ?> |
| 62 | 62 | </span> |
| 63 | 63 | |
| 64 | - <input type="submit" id="recount-stats-submit" value="<?php _e( 'Submit', 'give' ); ?>" class="button-secondary"/> |
|
| 64 | + <input type="submit" id="recount-stats-submit" value="<?php _e('Submit', 'give'); ?>" class="button-secondary"/> |
|
| 65 | 65 | |
| 66 | 66 | <br/> |
| 67 | 67 | |
| 68 | 68 | <span class="give-recount-stats-descriptions"> |
| 69 | - <span id="recount-stats"><?php _e( 'Recalculates the overall donation income amount.', 'give' ); ?></span> |
|
| 69 | + <span id="recount-stats"><?php _e('Recalculates the overall donation income amount.', 'give'); ?></span> |
|
| 70 | 70 | <span id="recount-form"><?php |
| 71 | 71 | printf( |
| 72 | 72 | /* translators: %s: form singular label */ |
| 73 | - __( 'Recalculates the donation and income stats for a specific %s.', 'give' ), |
|
| 74 | - give_get_forms_label_singular( true ) |
|
| 73 | + __('Recalculates the donation and income stats for a specific %s.', 'give'), |
|
| 74 | + give_get_forms_label_singular(true) |
|
| 75 | 75 | ); |
| 76 | 76 | ?></span> |
| 77 | 77 | <span id="recount-all"><?php |
| 78 | 78 | printf( |
| 79 | 79 | /* translators: %s: form plural label */ |
| 80 | - __( 'Recalculates the earnings and sales stats for all %s.', 'give' ), |
|
| 81 | - give_get_forms_label_plural( true ) |
|
| 80 | + __('Recalculates the earnings and sales stats for all %s.', 'give'), |
|
| 81 | + give_get_forms_label_plural(true) |
|
| 82 | 82 | ); |
| 83 | 83 | ?></span> |
| 84 | - <span id="recount-customer-stats"><?php _e( 'Recalculates the lifetime value and donation counts for all donors.', 'give' ); ?></span> |
|
| 85 | - <?php do_action( 'give_recount_tool_descriptions' ); ?> |
|
| 86 | - <span id="delete-test-transactions"><?php _e( '<strong>Deletes</strong> all TEST payment records, donors, and related log entries.', 'give' ); ?></span> |
|
| 87 | - <span id="reset-stats"><?php _e( '<strong>Deletes</strong> ALL transaction records, donors, and related log entries regardless of test or live mode.', 'give' ); ?></span> |
|
| 84 | + <span id="recount-customer-stats"><?php _e('Recalculates the lifetime value and donation counts for all donors.', 'give'); ?></span> |
|
| 85 | + <?php do_action('give_recount_tool_descriptions'); ?> |
|
| 86 | + <span id="delete-test-transactions"><?php _e('<strong>Deletes</strong> all TEST payment records, donors, and related log entries.', 'give'); ?></span> |
|
| 87 | + <span id="reset-stats"><?php _e('<strong>Deletes</strong> ALL transaction records, donors, and related log entries regardless of test or live mode.', 'give'); ?></span> |
|
| 88 | 88 | </span> |
| 89 | 89 | |
| 90 | 90 | <span class="spinner"></span> |
| 91 | 91 | |
| 92 | 92 | </form> |
| 93 | - <?php do_action( 'give_tools_recount_forms' ); ?> |
|
| 93 | + <?php do_action('give_tools_recount_forms'); ?> |
|
| 94 | 94 | </div><!-- .inside --> |
| 95 | 95 | </div><!-- .postbox --> |
| 96 | 96 | </div><!-- #poststuff --> |
| 97 | 97 | <?php |
| 98 | - do_action( 'give_tools_recount_stats_after' ); |
|
| 98 | + do_action('give_tools_recount_stats_after'); |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | -add_action( 'give_reports_tab_tools', 'give_tools_recount_stats_display' ); |
|
| 101 | +add_action('give_reports_tab_tools', 'give_tools_recount_stats_display'); |
|
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | 14 | // Exit if accessed directly |
| 15 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 15 | +if ( ! defined('ABSPATH')) { |
|
| 16 | 16 | exit; |
| 17 | 17 | } |
| 18 | 18 | |
@@ -38,16 +38,16 @@ discard block |
||
| 38 | 38 | * @return void |
| 39 | 39 | */ |
| 40 | 40 | public function headers() { |
| 41 | - ignore_user_abort( true ); |
|
| 41 | + ignore_user_abort(true); |
|
| 42 | 42 | |
| 43 | - if ( ! give_is_func_disabled( 'set_time_limit' ) && ! ini_get( 'safe_mode' ) ) { |
|
| 44 | - set_time_limit( 0 ); |
|
| 43 | + if ( ! give_is_func_disabled('set_time_limit') && ! ini_get('safe_mode')) { |
|
| 44 | + set_time_limit(0); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | nocache_headers(); |
| 48 | - header( 'Content-Type: text/csv; charset=utf-8' ); |
|
| 49 | - header( 'Content-Disposition: attachment; filename=' . apply_filters( 'give_earnings_export_filename', 'give-export-' . $this->export_type . '-' . date( 'n' ) . '-' . date( 'Y' ) ) . '.csv' ); |
|
| 50 | - header( "Expires: 0" ); |
|
| 48 | + header('Content-Type: text/csv; charset=utf-8'); |
|
| 49 | + header('Content-Disposition: attachment; filename='.apply_filters('give_earnings_export_filename', 'give-export-'.$this->export_type.'-'.date('n').'-'.date('Y')).'.csv'); |
|
| 50 | + header("Expires: 0"); |
|
| 51 | 51 | |
| 52 | 52 | } |
| 53 | 53 | |
@@ -61,10 +61,10 @@ discard block |
||
| 61 | 61 | public function csv_cols() { |
| 62 | 62 | |
| 63 | 63 | $cols = array( |
| 64 | - 'date' => __( 'Date', 'give' ), |
|
| 65 | - 'donations' => __( 'Donations', 'give' ), |
|
| 64 | + 'date' => __('Date', 'give'), |
|
| 65 | + 'donations' => __('Donations', 'give'), |
|
| 66 | 66 | /* translators: %s: currency */ |
| 67 | - 'earnings' => sprintf( __( 'Income (%s)', 'give' ), html_entity_decode( give_currency_filter( '' ) ) ) |
|
| 67 | + 'earnings' => sprintf(__('Income (%s)', 'give'), html_entity_decode(give_currency_filter(''))) |
|
| 68 | 68 | ); |
| 69 | 69 | |
| 70 | 70 | return $cols; |
@@ -79,28 +79,28 @@ discard block |
||
| 79 | 79 | */ |
| 80 | 80 | public function get_data() { |
| 81 | 81 | |
| 82 | - $start_year = isset( $_POST['start_year'] ) ? absint( $_POST['start_year'] ) : date( 'Y' ); |
|
| 83 | - $end_year = isset( $_POST['end_year'] ) ? absint( $_POST['end_year'] ) : date( 'Y' ); |
|
| 84 | - $start_month = isset( $_POST['start_month'] ) ? absint( $_POST['start_month'] ) : date( 'n' ); |
|
| 85 | - $end_month = isset( $_POST['end_month'] ) ? absint( $_POST['end_month'] ) : date( 'n' ); |
|
| 82 | + $start_year = isset($_POST['start_year']) ? absint($_POST['start_year']) : date('Y'); |
|
| 83 | + $end_year = isset($_POST['end_year']) ? absint($_POST['end_year']) : date('Y'); |
|
| 84 | + $start_month = isset($_POST['start_month']) ? absint($_POST['start_month']) : date('n'); |
|
| 85 | + $end_month = isset($_POST['end_month']) ? absint($_POST['end_month']) : date('n'); |
|
| 86 | 86 | |
| 87 | 87 | $data = array(); |
| 88 | 88 | $year = $start_year; |
| 89 | 89 | $stats = new Give_Payment_Stats; |
| 90 | 90 | |
| 91 | - while ( $year <= $end_year ) { |
|
| 91 | + while ($year <= $end_year) { |
|
| 92 | 92 | |
| 93 | - if ( $year == $start_year && $year == $end_year ) { |
|
| 93 | + if ($year == $start_year && $year == $end_year) { |
|
| 94 | 94 | |
| 95 | 95 | $m1 = $start_month; |
| 96 | 96 | $m2 = $end_month; |
| 97 | 97 | |
| 98 | - } elseif ( $year == $start_year ) { |
|
| 98 | + } elseif ($year == $start_year) { |
|
| 99 | 99 | |
| 100 | 100 | $m1 = $start_month; |
| 101 | 101 | $m2 = 12; |
| 102 | 102 | |
| 103 | - } elseif ( $year == $end_year ) { |
|
| 103 | + } elseif ($year == $end_year) { |
|
| 104 | 104 | |
| 105 | 105 | $m1 = 1; |
| 106 | 106 | $m2 = $end_month; |
@@ -112,28 +112,28 @@ discard block |
||
| 112 | 112 | |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | - while ( $m1 <= $m2 ) { |
|
| 115 | + while ($m1 <= $m2) { |
|
| 116 | 116 | |
| 117 | - $date1 = mktime( 0, 0, 0, $m1, 1, $year ); |
|
| 118 | - $date2 = mktime( 0, 0, 0, $m1, cal_days_in_month( CAL_GREGORIAN, $m1, $year ), $year ); |
|
| 117 | + $date1 = mktime(0, 0, 0, $m1, 1, $year); |
|
| 118 | + $date2 = mktime(0, 0, 0, $m1, cal_days_in_month(CAL_GREGORIAN, $m1, $year), $year); |
|
| 119 | 119 | |
| 120 | 120 | $data[] = array( |
| 121 | - 'date' => date_i18n( 'F Y', $date1 ), |
|
| 122 | - 'donations' => $stats->get_sales( 0, $date1, $date2, array( 'publish', 'revoked' ) ), |
|
| 123 | - 'earnings' => give_format_amount( $stats->get_earnings( 0, $date1, $date2 ) ), |
|
| 121 | + 'date' => date_i18n('F Y', $date1), |
|
| 122 | + 'donations' => $stats->get_sales(0, $date1, $date2, array('publish', 'revoked')), |
|
| 123 | + 'earnings' => give_format_amount($stats->get_earnings(0, $date1, $date2)), |
|
| 124 | 124 | ); |
| 125 | 125 | |
| 126 | - $m1 ++; |
|
| 126 | + $m1++; |
|
| 127 | 127 | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | |
| 131 | - $year ++; |
|
| 131 | + $year++; |
|
| 132 | 132 | |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | - $data = apply_filters( 'give_export_get_data', $data ); |
|
| 136 | - $data = apply_filters( 'give_export_get_data_' . $this->export_type, $data ); |
|
| 135 | + $data = apply_filters('give_export_get_data', $data); |
|
| 136 | + $data = apply_filters('give_export_get_data_'.$this->export_type, $data); |
|
| 137 | 137 | |
| 138 | 138 | return $data; |
| 139 | 139 | } |
@@ -10,11 +10,11 @@ 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 | -add_filter( 'cmb2_meta_boxes', 'give_single_forms_cmb2_metaboxes' ); |
|
| 17 | +add_filter('cmb2_meta_boxes', 'give_single_forms_cmb2_metaboxes');
|
|
| 18 | 18 | |
| 19 | 19 | /** |
| 20 | 20 | * Define the metabox and field configurations. |
@@ -23,23 +23,23 @@ discard block |
||
| 23 | 23 | * |
| 24 | 24 | * @return array |
| 25 | 25 | */ |
| 26 | -function give_single_forms_cmb2_metaboxes( array $meta_boxes ) {
|
|
| 26 | +function give_single_forms_cmb2_metaboxes(array $meta_boxes) {
|
|
| 27 | 27 | |
| 28 | 28 | $post_id = give_get_admin_post_id(); |
| 29 | - $price = give_get_form_price( $post_id ); |
|
| 30 | - $custom_amount_minimum = give_get_form_minimum_price( $post_id ); |
|
| 31 | - $goal = give_get_form_goal( $post_id ); |
|
| 32 | - $variable_pricing = give_has_variable_prices( $post_id ); |
|
| 33 | - $prices = give_get_variable_prices( $post_id ); |
|
| 29 | + $price = give_get_form_price($post_id); |
|
| 30 | + $custom_amount_minimum = give_get_form_minimum_price($post_id); |
|
| 31 | + $goal = give_get_form_goal($post_id); |
|
| 32 | + $variable_pricing = give_has_variable_prices($post_id); |
|
| 33 | + $prices = give_get_variable_prices($post_id); |
|
| 34 | 34 | |
| 35 | 35 | //No empty prices - min. 1.00 for new forms |
| 36 | - if ( empty( $price ) && is_null( $post_id ) ) {
|
|
| 37 | - $price = esc_attr( give_format_amount( '1.00' ) ); |
|
| 36 | + if (empty($price) && is_null($post_id)) {
|
|
| 37 | + $price = esc_attr(give_format_amount('1.00'));
|
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | //Min. $1.00 for new forms |
| 41 | - if ( empty( $custom_amount_minimum ) ) {
|
|
| 42 | - $custom_amount_minimum = esc_attr( give_format_amount( '1.00' ) ); |
|
| 41 | + if (empty($custom_amount_minimum)) {
|
|
| 42 | + $custom_amount_minimum = esc_attr(give_format_amount('1.00'));
|
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | // Start with an underscore to hide fields from custom fields list |
@@ -48,326 +48,326 @@ discard block |
||
| 48 | 48 | /** |
| 49 | 49 | * Repeatable Field Groups |
| 50 | 50 | */ |
| 51 | - $meta_boxes['form_field_options'] = apply_filters( 'give_forms_field_options', array( |
|
| 51 | + $meta_boxes['form_field_options'] = apply_filters('give_forms_field_options', array(
|
|
| 52 | 52 | 'id' => 'form_field_options', |
| 53 | - 'title' => __( 'Donation Options', 'give' ), |
|
| 54 | - 'object_types' => array( 'give_forms' ), |
|
| 53 | + 'title' => __('Donation Options', 'give'),
|
|
| 54 | + 'object_types' => array('give_forms'),
|
|
| 55 | 55 | 'context' => 'normal', |
| 56 | 56 | 'priority' => 'high', //Show above Content WYSIWYG |
| 57 | - 'fields' => apply_filters( 'give_forms_donation_form_metabox_fields', array( |
|
| 57 | + 'fields' => apply_filters('give_forms_donation_form_metabox_fields', array(
|
|
| 58 | 58 | //Donation Option |
| 59 | 59 | array( |
| 60 | - 'name' => __( 'Donation Option', 'give' ), |
|
| 61 | - 'description' => __( 'Would you like this form to have one set donation price or multiple levels (for example, $10, $20, $50)?', 'give' ), |
|
| 62 | - 'id' => $prefix . 'price_option', |
|
| 60 | + 'name' => __('Donation Option', 'give'),
|
|
| 61 | + 'description' => __('Would you like this form to have one set donation price or multiple levels (for example, $10, $20, $50)?', 'give'),
|
|
| 62 | + 'id' => $prefix.'price_option', |
|
| 63 | 63 | 'type' => 'radio_inline', |
| 64 | 64 | 'default' => 'set', |
| 65 | - 'options' => apply_filters( 'give_forms_price_options', array( |
|
| 66 | - 'set' => __( 'Set Donation', 'give' ), |
|
| 67 | - 'multi' => __( 'Multi-level Donation', 'give' ), |
|
| 68 | - ) ), |
|
| 65 | + 'options' => apply_filters('give_forms_price_options', array(
|
|
| 66 | + 'set' => __('Set Donation', 'give'),
|
|
| 67 | + 'multi' => __('Multi-level Donation', 'give'),
|
|
| 68 | + )), |
|
| 69 | 69 | ), |
| 70 | 70 | array( |
| 71 | - 'name' => __( 'Set Donation', 'give' ), |
|
| 72 | - 'description' => __( 'This is the set donation amount for this form. If you have a "Custom Amount Minimum" set, make sure it is less than this amount.', 'give' ), |
|
| 73 | - 'id' => $prefix . 'set_price', |
|
| 71 | + 'name' => __('Set Donation', 'give'),
|
|
| 72 | + 'description' => __('This is the set donation amount for this form. If you have a "Custom Amount Minimum" set, make sure it is less than this amount.', 'give'),
|
|
| 73 | + 'id' => $prefix.'set_price', |
|
| 74 | 74 | 'type' => 'text_small', |
| 75 | 75 | 'row_classes' => 'give-subfield', |
| 76 | - 'before_field' => give_get_option( 'currency_position' ) == 'before' ? '<span class="give-money-symbol give-money-symbol-before">' . give_currency_symbol() . '</span>' : '', |
|
| 77 | - 'after_field' => give_get_option( 'currency_position' ) == 'after' ? '<span class="give-money-symbol give-money-symbol-after">' . give_currency_symbol() . '</span>' : '', |
|
| 76 | + 'before_field' => give_get_option('currency_position') == 'before' ? '<span class="give-money-symbol give-money-symbol-before">'.give_currency_symbol().'</span>' : '',
|
|
| 77 | + 'after_field' => give_get_option('currency_position') == 'after' ? '<span class="give-money-symbol give-money-symbol-after">'.give_currency_symbol().'</span>' : '',
|
|
| 78 | 78 | 'attributes' => array( |
| 79 | - 'placeholder' => give_format_amount( '1.00' ), |
|
| 80 | - 'value' => give_format_amount( $price ), |
|
| 79 | + 'placeholder' => give_format_amount('1.00'),
|
|
| 80 | + 'value' => give_format_amount($price), |
|
| 81 | 81 | 'class' => 'cmb-type-text-small give-money-field', |
| 82 | 82 | ), |
| 83 | 83 | ), |
| 84 | 84 | //Donation levels: Header |
| 85 | 85 | array( |
| 86 | - 'id' => $prefix . 'levels_header', |
|
| 86 | + 'id' => $prefix.'levels_header', |
|
| 87 | 87 | 'type' => 'levels_repeater_header', |
| 88 | 88 | ), |
| 89 | 89 | //Donation Levels: Repeatable CMB2 Group |
| 90 | 90 | array( |
| 91 | - 'id' => $prefix . 'donation_levels', |
|
| 91 | + 'id' => $prefix.'donation_levels', |
|
| 92 | 92 | 'type' => 'group', |
| 93 | 93 | 'row_classes' => 'give-subfield', |
| 94 | 94 | 'options' => array( |
| 95 | - 'add_button' => __( 'Add Level', 'give' ), |
|
| 96 | - 'remove_button' => __( '<span class="dashicons dashicons-no"></span>', 'give' ), |
|
| 95 | + 'add_button' => __('Add Level', 'give'),
|
|
| 96 | + 'remove_button' => __('<span class="dashicons dashicons-no"></span>', 'give'),
|
|
| 97 | 97 | 'sortable' => true, // beta |
| 98 | 98 | ), |
| 99 | 99 | // Fields array works the same, except id's only need to be unique for this group. Prefix is not needed. |
| 100 | - 'fields' => apply_filters( 'give_donation_levels_table_row', array( |
|
| 100 | + 'fields' => apply_filters('give_donation_levels_table_row', array(
|
|
| 101 | 101 | array( |
| 102 | - 'name' => __( 'ID', 'give' ), |
|
| 103 | - 'id' => $prefix . 'id', |
|
| 102 | + 'name' => __('ID', 'give'),
|
|
| 103 | + 'id' => $prefix.'id', |
|
| 104 | 104 | 'type' => 'levels_id', |
| 105 | 105 | ), |
| 106 | 106 | array( |
| 107 | - 'name' => __( 'Amount', 'give' ), |
|
| 108 | - 'id' => $prefix . 'amount', |
|
| 107 | + 'name' => __('Amount', 'give'),
|
|
| 108 | + 'id' => $prefix.'amount', |
|
| 109 | 109 | 'type' => 'text_small', |
| 110 | - 'before_field' => give_get_option( 'currency_position' ) == 'before' ? '<span class="give-money-symbol give-money-symbol-before">' . give_currency_symbol() . '</span>' : '', |
|
| 111 | - 'after_field' => give_get_option( 'currency_position' ) == 'after' ? '<span class="give-money-symbol give-money-symbol-after">' . give_currency_symbol() . '</span>' : '', |
|
| 110 | + 'before_field' => give_get_option('currency_position') == 'before' ? '<span class="give-money-symbol give-money-symbol-before">'.give_currency_symbol().'</span>' : '',
|
|
| 111 | + 'after_field' => give_get_option('currency_position') == 'after' ? '<span class="give-money-symbol give-money-symbol-after">'.give_currency_symbol().'</span>' : '',
|
|
| 112 | 112 | 'attributes' => array( |
| 113 | - 'placeholder' => give_format_amount( '1.00' ), |
|
| 113 | + 'placeholder' => give_format_amount('1.00'),
|
|
| 114 | 114 | 'class' => 'cmb-type-text-small give-money-field', |
| 115 | 115 | ), |
| 116 | 116 | 'before' => 'give_format_admin_multilevel_amount', |
| 117 | 117 | ), |
| 118 | 118 | array( |
| 119 | - 'name' => __( 'Text', 'give' ), |
|
| 120 | - 'id' => $prefix . 'text', |
|
| 119 | + 'name' => __('Text', 'give'),
|
|
| 120 | + 'id' => $prefix.'text', |
|
| 121 | 121 | 'type' => 'text', |
| 122 | 122 | 'attributes' => array( |
| 123 | - 'placeholder' => __( 'Donation Level', 'give' ), |
|
| 123 | + 'placeholder' => __('Donation Level', 'give'),
|
|
| 124 | 124 | 'class' => 'give-multilevel-text-field', |
| 125 | 125 | ), |
| 126 | 126 | ), |
| 127 | 127 | array( |
| 128 | - 'name' => __( 'Default', 'give' ), |
|
| 129 | - 'id' => $prefix . 'default', |
|
| 128 | + 'name' => __('Default', 'give'),
|
|
| 129 | + 'id' => $prefix.'default', |
|
| 130 | 130 | 'type' => 'give_default_radio_inline' |
| 131 | 131 | ), |
| 132 | - ) ), |
|
| 132 | + )), |
|
| 133 | 133 | ), |
| 134 | 134 | //Display Style |
| 135 | 135 | array( |
| 136 | - 'name' => __( 'Display Style', 'give' ), |
|
| 137 | - 'description' => __( 'Set how the donations levels will display on the form.', 'give' ), |
|
| 138 | - 'id' => $prefix . 'display_style', |
|
| 136 | + 'name' => __('Display Style', 'give'),
|
|
| 137 | + 'description' => __('Set how the donations levels will display on the form.', 'give'),
|
|
| 138 | + 'id' => $prefix.'display_style', |
|
| 139 | 139 | 'type' => 'radio_inline', |
| 140 | 140 | 'default' => 'buttons', |
| 141 | 141 | 'options' => array( |
| 142 | - 'buttons' => __( 'Buttons', 'give' ), |
|
| 143 | - 'radios' => __( 'Radios', 'give' ), |
|
| 144 | - 'dropdown' => __( 'Dropdown', 'give' ), |
|
| 142 | + 'buttons' => __('Buttons', 'give'),
|
|
| 143 | + 'radios' => __('Radios', 'give'),
|
|
| 144 | + 'dropdown' => __('Dropdown', 'give'),
|
|
| 145 | 145 | ), |
| 146 | 146 | ), |
| 147 | 147 | //Custom Amount |
| 148 | 148 | array( |
| 149 | - 'name' => __( 'Custom Amount', 'give' ), |
|
| 150 | - 'description' => __( 'Do you want the user to be able to input their own donation amount?', 'give' ), |
|
| 151 | - 'id' => $prefix . 'custom_amount', |
|
| 149 | + 'name' => __('Custom Amount', 'give'),
|
|
| 150 | + 'description' => __('Do you want the user to be able to input their own donation amount?', 'give'),
|
|
| 151 | + 'id' => $prefix.'custom_amount', |
|
| 152 | 152 | 'type' => 'radio_inline', |
| 153 | 153 | 'default' => 'no', |
| 154 | 154 | 'options' => array( |
| 155 | - 'yes' => __( 'Yes', 'give' ), |
|
| 156 | - 'no' => __( 'No', 'give' ), |
|
| 155 | + 'yes' => __('Yes', 'give'),
|
|
| 156 | + 'no' => __('No', 'give'),
|
|
| 157 | 157 | ), |
| 158 | 158 | ), |
| 159 | 159 | array( |
| 160 | - 'name' => __( 'Custom Amount Minimum', 'give' ), |
|
| 161 | - 'description' => __( 'If you would like to set a minimum custom donation amount please enter it here.', 'give' ), |
|
| 162 | - 'id' => $prefix . 'custom_amount_minimum', |
|
| 160 | + 'name' => __('Custom Amount Minimum', 'give'),
|
|
| 161 | + 'description' => __('If you would like to set a minimum custom donation amount please enter it here.', 'give'),
|
|
| 162 | + 'id' => $prefix.'custom_amount_minimum', |
|
| 163 | 163 | 'type' => 'text_small', |
| 164 | 164 | 'row_classes' => 'give-subfield', |
| 165 | - 'before_field' => give_get_option( 'currency_position' ) == 'before' ? '<span class="give-money-symbol give-money-symbol-before">' . give_currency_symbol() . '</span>' : '', |
|
| 166 | - 'after_field' => give_get_option( 'currency_position' ) == 'after' ? '<span class="give-money-symbol give-money-symbol-after">' . give_currency_symbol() . '</span>' : '', |
|
| 165 | + 'before_field' => give_get_option('currency_position') == 'before' ? '<span class="give-money-symbol give-money-symbol-before">'.give_currency_symbol().'</span>' : '',
|
|
| 166 | + 'after_field' => give_get_option('currency_position') == 'after' ? '<span class="give-money-symbol give-money-symbol-after">'.give_currency_symbol().'</span>' : '',
|
|
| 167 | 167 | 'attributes' => array( |
| 168 | - 'placeholder' => give_format_amount( '1.00' ), |
|
| 169 | - 'value' => give_format_amount( $custom_amount_minimum ), |
|
| 168 | + 'placeholder' => give_format_amount('1.00'),
|
|
| 169 | + 'value' => give_format_amount($custom_amount_minimum), |
|
| 170 | 170 | 'class' => 'cmb-type-text-small give-money-field', |
| 171 | 171 | ), |
| 172 | 172 | ), |
| 173 | 173 | array( |
| 174 | - 'name' => __( 'Custom Amount Text', 'give' ), |
|
| 175 | - 'description' => __( 'This text appears as a label below the custom amount field for set donation forms. For multi-level forms the text will appear as it\'s own level (ie button, radio, or select option).', 'give' ), |
|
| 176 | - 'id' => $prefix . 'custom_amount_text', |
|
| 174 | + 'name' => __('Custom Amount Text', 'give'),
|
|
| 175 | + 'description' => __('This text appears as a label below the custom amount field for set donation forms. For multi-level forms the text will appear as it\'s own level (ie button, radio, or select option).', 'give'),
|
|
| 176 | + 'id' => $prefix.'custom_amount_text', |
|
| 177 | 177 | 'type' => 'text', |
| 178 | 178 | 'row_classes' => 'give-subfield', |
| 179 | 179 | 'attributes' => array( |
| 180 | 180 | 'rows' => 3, |
| 181 | - 'placeholder' => __( 'Give a Custom Amount', 'give' ), |
|
| 181 | + 'placeholder' => __('Give a Custom Amount', 'give'),
|
|
| 182 | 182 | ), |
| 183 | 183 | ), |
| 184 | 184 | //Goals |
| 185 | 185 | array( |
| 186 | - 'name' => __( 'Goal', 'give' ), |
|
| 187 | - 'description' => __( 'Do you want to set a donation goal for this form?', 'give' ), |
|
| 188 | - 'id' => $prefix . 'goal_option', |
|
| 186 | + 'name' => __('Goal', 'give'),
|
|
| 187 | + 'description' => __('Do you want to set a donation goal for this form?', 'give'),
|
|
| 188 | + 'id' => $prefix.'goal_option', |
|
| 189 | 189 | 'type' => 'radio_inline', |
| 190 | 190 | 'default' => 'no', |
| 191 | 191 | 'options' => array( |
| 192 | - 'yes' => __( 'Yes', 'give' ), |
|
| 193 | - 'no' => __( 'No', 'give' ), |
|
| 192 | + 'yes' => __('Yes', 'give'),
|
|
| 193 | + 'no' => __('No', 'give'),
|
|
| 194 | 194 | ), |
| 195 | 195 | ), |
| 196 | 196 | array( |
| 197 | - 'name' => __( 'Goal Amount', 'give' ), |
|
| 198 | - 'description' => __( 'This is the monetary goal amount you want to reach for this donation form.', 'give' ), |
|
| 199 | - 'id' => $prefix . 'set_goal', |
|
| 197 | + 'name' => __('Goal Amount', 'give'),
|
|
| 198 | + 'description' => __('This is the monetary goal amount you want to reach for this donation form.', 'give'),
|
|
| 199 | + 'id' => $prefix.'set_goal', |
|
| 200 | 200 | 'type' => 'text_small', |
| 201 | 201 | 'row_classes' => 'give-subfield', |
| 202 | - 'before_field' => give_get_option( 'currency_position' ) == 'before' ? '<span class="give-money-symbol give-money-symbol-before">' . give_currency_symbol() . '</span>' : '', |
|
| 203 | - 'after_field' => give_get_option( 'currency_position' ) == 'after' ? '<span class="give-money-symbol give-money-symbol-after">' . give_currency_symbol() . '</span>' : '', |
|
| 202 | + 'before_field' => give_get_option('currency_position') == 'before' ? '<span class="give-money-symbol give-money-symbol-before">'.give_currency_symbol().'</span>' : '',
|
|
| 203 | + 'after_field' => give_get_option('currency_position') == 'after' ? '<span class="give-money-symbol give-money-symbol-after">'.give_currency_symbol().'</span>' : '',
|
|
| 204 | 204 | 'attributes' => array( |
| 205 | - 'placeholder' => give_format_amount( '0.00' ), |
|
| 206 | - 'value' => isset( $goal ) ? esc_attr( give_format_amount( $goal ) ) : '', |
|
| 205 | + 'placeholder' => give_format_amount('0.00'),
|
|
| 206 | + 'value' => isset($goal) ? esc_attr(give_format_amount($goal)) : '', |
|
| 207 | 207 | 'class' => 'cmb-type-text-small give-money-field', |
| 208 | 208 | ), |
| 209 | 209 | ), |
| 210 | 210 | |
| 211 | 211 | array( |
| 212 | - 'name' => __( 'Goal Format', 'give' ), |
|
| 213 | - 'description' => __( 'Would you like to display the total amount raised based on your monetary goal or a percentage? For instance, "$500 of $1,000 raised" or "50% funded".', 'give' ), |
|
| 214 | - 'id' => $prefix . 'goal_format', |
|
| 212 | + 'name' => __('Goal Format', 'give'),
|
|
| 213 | + 'description' => __('Would you like to display the total amount raised based on your monetary goal or a percentage? For instance, "$500 of $1,000 raised" or "50% funded".', 'give'),
|
|
| 214 | + 'id' => $prefix.'goal_format', |
|
| 215 | 215 | 'type' => 'radio_inline', |
| 216 | 216 | 'default' => 'amount', |
| 217 | 217 | 'row_classes' => 'give-subfield', |
| 218 | 218 | 'options' => array( |
| 219 | - 'amount' => __( 'Amount ', 'give' ), |
|
| 220 | - 'percentage' => __( 'Percentage', 'give' ), |
|
| 219 | + 'amount' => __('Amount ', 'give'),
|
|
| 220 | + 'percentage' => __('Percentage', 'give'),
|
|
| 221 | 221 | ), |
| 222 | 222 | ), |
| 223 | 223 | array( |
| 224 | - 'name' => __( 'Goal Progress Bar Color', 'give' ), |
|
| 225 | - 'id' => $prefix . 'goal_color', |
|
| 224 | + 'name' => __('Goal Progress Bar Color', 'give'),
|
|
| 225 | + 'id' => $prefix.'goal_color', |
|
| 226 | 226 | 'type' => 'colorpicker', |
| 227 | 227 | 'row_classes' => 'give-subfield', |
| 228 | 228 | 'default' => '#2bc253', |
| 229 | 229 | ), |
| 230 | 230 | |
| 231 | 231 | array( |
| 232 | - 'name' => __( 'Close Form when Goal Achieved', 'give' ), |
|
| 233 | - 'desc' => __( 'Would you like to close the donation forms and stop accepting donations once this goal has been met?', 'give' ), |
|
| 234 | - 'id' => $prefix . 'close_form_when_goal_achieved', |
|
| 232 | + 'name' => __('Close Form when Goal Achieved', 'give'),
|
|
| 233 | + 'desc' => __('Would you like to close the donation forms and stop accepting donations once this goal has been met?', 'give'),
|
|
| 234 | + 'id' => $prefix.'close_form_when_goal_achieved', |
|
| 235 | 235 | 'type' => 'radio_inline', |
| 236 | 236 | 'row_classes' => 'give-subfield', |
| 237 | 237 | 'options' => array( |
| 238 | - 'yes' => __( 'Yes', 'give' ), |
|
| 239 | - 'no' => __( 'No', 'give' ), |
|
| 238 | + 'yes' => __('Yes', 'give'),
|
|
| 239 | + 'no' => __('No', 'give'),
|
|
| 240 | 240 | ), |
| 241 | 241 | 'default' => 'no', |
| 242 | 242 | ), |
| 243 | 243 | array( |
| 244 | - 'name' => __( 'Goal Achieved Message', 'give' ), |
|
| 245 | - 'desc' => __( 'Would you like to display a custom message when the goal is closed? If none is provided the default message will be displayed', 'give' ), |
|
| 246 | - 'id' => $prefix . 'form_goal_achieved_message', |
|
| 244 | + 'name' => __('Goal Achieved Message', 'give'),
|
|
| 245 | + 'desc' => __('Would you like to display a custom message when the goal is closed? If none is provided the default message will be displayed', 'give'),
|
|
| 246 | + 'id' => $prefix.'form_goal_achieved_message', |
|
| 247 | 247 | 'type' => 'textarea', |
| 248 | 248 | 'row_classes' => 'give-subfield', |
| 249 | 249 | 'attributes' => array( |
| 250 | - 'placeholder' => __( 'Thank you to all our donors, we have met our fundraising goal.', 'give' ), |
|
| 250 | + 'placeholder' => __('Thank you to all our donors, we have met our fundraising goal.', 'give'),
|
|
| 251 | 251 | ), |
| 252 | 252 | ) |
| 253 | 253 | ) |
| 254 | 254 | ) |
| 255 | - ) ); |
|
| 255 | + )); |
|
| 256 | 256 | |
| 257 | 257 | |
| 258 | 258 | /** |
| 259 | 259 | * Content Field |
| 260 | 260 | */ |
| 261 | - $meta_boxes['form_content_options'] = apply_filters( 'give_forms_content_options', array( |
|
| 261 | + $meta_boxes['form_content_options'] = apply_filters('give_forms_content_options', array(
|
|
| 262 | 262 | 'id' => 'form_content_options', |
| 263 | - 'title' => __( 'Form Content', 'give' ), |
|
| 264 | - 'object_types' => array( 'give_forms' ), |
|
| 263 | + 'title' => __('Form Content', 'give'),
|
|
| 264 | + 'object_types' => array('give_forms'),
|
|
| 265 | 265 | 'context' => 'normal', |
| 266 | 266 | 'priority' => 'high', //Show above Content WYSIWYG |
| 267 | - 'fields' => apply_filters( 'give_forms_content_options_metabox_fields', array( |
|
| 267 | + 'fields' => apply_filters('give_forms_content_options_metabox_fields', array(
|
|
| 268 | 268 | //Donation Option |
| 269 | 269 | array( |
| 270 | - 'name' => __( 'Display Content', 'give' ), |
|
| 271 | - 'description' => __( 'Do you want to display content? If you select "Yes" a WYSIWYG editor will appear which you will be able to enter content to display above or below the form.', 'give' ), |
|
| 272 | - 'id' => $prefix . 'content_option', |
|
| 270 | + 'name' => __('Display Content', 'give'),
|
|
| 271 | + 'description' => __('Do you want to display content? If you select "Yes" a WYSIWYG editor will appear which you will be able to enter content to display above or below the form.', 'give'),
|
|
| 272 | + 'id' => $prefix.'content_option', |
|
| 273 | 273 | 'type' => 'select', |
| 274 | - 'options' => apply_filters( 'give_forms_content_options_select', array( |
|
| 275 | - 'none' => __( 'No content', 'give' ), |
|
| 276 | - 'give_pre_form' => __( 'Yes, display content ABOVE the form fields', 'give' ), |
|
| 277 | - 'give_post_form' => __( 'Yes, display content BELOW the form fields', 'give' ), |
|
| 274 | + 'options' => apply_filters('give_forms_content_options_select', array(
|
|
| 275 | + 'none' => __('No content', 'give'),
|
|
| 276 | + 'give_pre_form' => __('Yes, display content ABOVE the form fields', 'give'),
|
|
| 277 | + 'give_post_form' => __('Yes, display content BELOW the form fields', 'give'),
|
|
| 278 | 278 | ) |
| 279 | 279 | ), |
| 280 | 280 | 'default' => 'none', |
| 281 | 281 | ), |
| 282 | 282 | array( |
| 283 | - 'name' => __( 'Content', 'give' ), |
|
| 284 | - 'description' => __( 'This content will display on the single give form page.', 'give' ), |
|
| 285 | - 'id' => $prefix . 'form_content', |
|
| 283 | + 'name' => __('Content', 'give'),
|
|
| 284 | + 'description' => __('This content will display on the single give form page.', 'give'),
|
|
| 285 | + 'id' => $prefix.'form_content', |
|
| 286 | 286 | 'row_classes' => 'give-subfield', |
| 287 | 287 | 'type' => 'wysiwyg' |
| 288 | 288 | ), |
| 289 | 289 | ) |
| 290 | 290 | ) |
| 291 | - ) ); |
|
| 291 | + )); |
|
| 292 | 292 | |
| 293 | 293 | |
| 294 | 294 | /** |
| 295 | 295 | * Display Options |
| 296 | 296 | */ |
| 297 | - $meta_boxes['form_display_options'] = apply_filters( 'give_form_display_options', array( |
|
| 297 | + $meta_boxes['form_display_options'] = apply_filters('give_form_display_options', array(
|
|
| 298 | 298 | 'id' => 'form_display_options', |
| 299 | - 'title' => __( 'Form Display Options', 'give' ), |
|
| 300 | - 'object_types' => array( 'give_forms' ), |
|
| 299 | + 'title' => __('Form Display Options', 'give'),
|
|
| 300 | + 'object_types' => array('give_forms'),
|
|
| 301 | 301 | 'context' => 'normal', // 'normal', 'advanced', or 'side' |
| 302 | 302 | 'priority' => 'high', //Show above Content WYSIWYG |
| 303 | 303 | 'show_names' => true, // Show field names on the left |
| 304 | - 'fields' => apply_filters( 'give_forms_display_options_metabox_fields', array( |
|
| 304 | + 'fields' => apply_filters('give_forms_display_options_metabox_fields', array(
|
|
| 305 | 305 | array( |
| 306 | - 'name' => __( 'Payment Fields', 'give' ), |
|
| 307 | - 'desc' => __( 'How would you like to display payment information for this form? The "Show on Page" option will display the entire form when the page loads. "Reveal Upon Click" places a button below the donation fields and upon click slides into view the rest of the fields. "Modal Window Upon Click" is a similar option, rather than sliding into view the fields they will open in a shadow box or "modal" window.', 'give' ), |
|
| 308 | - 'id' => $prefix . 'payment_display', |
|
| 306 | + 'name' => __('Payment Fields', 'give'),
|
|
| 307 | + 'desc' => __('How would you like to display payment information for this form? The "Show on Page" option will display the entire form when the page loads. "Reveal Upon Click" places a button below the donation fields and upon click slides into view the rest of the fields. "Modal Window Upon Click" is a similar option, rather than sliding into view the fields they will open in a shadow box or "modal" window.', 'give'),
|
|
| 308 | + 'id' => $prefix.'payment_display', |
|
| 309 | 309 | 'type' => 'select', |
| 310 | 310 | 'options' => array( |
| 311 | - 'onpage' => __( 'Show on Page', 'give' ), |
|
| 312 | - 'reveal' => __( 'Reveal Upon Click', 'give' ), |
|
| 313 | - 'modal' => __( 'Modal Window Upon Click', 'give' ), |
|
| 311 | + 'onpage' => __('Show on Page', 'give'),
|
|
| 312 | + 'reveal' => __('Reveal Upon Click', 'give'),
|
|
| 313 | + 'modal' => __('Modal Window Upon Click', 'give'),
|
|
| 314 | 314 | ), |
| 315 | 315 | 'default' => 'onpage', |
| 316 | 316 | ), |
| 317 | 317 | array( |
| 318 | - 'id' => $prefix . 'reveal_label', |
|
| 319 | - 'name' => __( 'Reveal / Modal Open Text', 'give' ), |
|
| 320 | - 'desc' => __( 'The button label for completing the donation.', 'give' ), |
|
| 318 | + 'id' => $prefix.'reveal_label', |
|
| 319 | + 'name' => __('Reveal / Modal Open Text', 'give'),
|
|
| 320 | + 'desc' => __('The button label for completing the donation.', 'give'),
|
|
| 321 | 321 | 'type' => 'text_small', |
| 322 | 322 | 'row_classes' => 'give-subfield', |
| 323 | 323 | 'attributes' => array( |
| 324 | - 'placeholder' => __( 'Donate Now', 'give' ), |
|
| 324 | + 'placeholder' => __('Donate Now', 'give'),
|
|
| 325 | 325 | ), |
| 326 | 326 | ), |
| 327 | 327 | array( |
| 328 | - 'id' => $prefix . 'checkout_label', |
|
| 329 | - 'name' => __( 'Complete Donation Text', 'give' ), |
|
| 330 | - 'desc' => __( 'The button label for completing a donation.', 'give' ), |
|
| 328 | + 'id' => $prefix.'checkout_label', |
|
| 329 | + 'name' => __('Complete Donation Text', 'give'),
|
|
| 330 | + 'desc' => __('The button label for completing a donation.', 'give'),
|
|
| 331 | 331 | 'type' => 'text_small', |
| 332 | 332 | 'attributes' => array( |
| 333 | - 'placeholder' => __( 'Donate Now', 'give' ), |
|
| 333 | + 'placeholder' => __('Donate Now', 'give'),
|
|
| 334 | 334 | ), |
| 335 | 335 | ), |
| 336 | 336 | array( |
| 337 | - 'name' => __( 'Default Gateway', 'give' ), |
|
| 338 | - 'desc' => __( 'By default, the gateway for this form will inherit the global default gateway (set under Give > Settings > Payment Gateways). This option allows you to customize the default gateway for this form only.', 'give' ), |
|
| 339 | - 'id' => $prefix . 'default_gateway', |
|
| 337 | + 'name' => __('Default Gateway', 'give'),
|
|
| 338 | + 'desc' => __('By default, the gateway for this form will inherit the global default gateway (set under Give > Settings > Payment Gateways). This option allows you to customize the default gateway for this form only.', 'give'),
|
|
| 339 | + 'id' => $prefix.'default_gateway', |
|
| 340 | 340 | 'type' => 'default_gateway' |
| 341 | 341 | ), |
| 342 | 342 | array( |
| 343 | - 'name' => __( 'Disable Guest Donations', 'give' ), |
|
| 344 | - 'desc' => __( 'Do you want to require users be logged-in to make donations?', 'give' ), |
|
| 345 | - 'id' => $prefix . 'logged_in_only', |
|
| 343 | + 'name' => __('Disable Guest Donations', 'give'),
|
|
| 344 | + 'desc' => __('Do you want to require users be logged-in to make donations?', 'give'),
|
|
| 345 | + 'id' => $prefix.'logged_in_only', |
|
| 346 | 346 | 'type' => 'checkbox' |
| 347 | 347 | ), |
| 348 | 348 | array( |
| 349 | - 'name' => __( 'Register / Login Form', 'give' ), |
|
| 350 | - 'desc' => __( 'Display the registration and login forms in the payment section for non-logged-in users.', 'give' ), |
|
| 351 | - 'id' => $prefix . 'show_register_form', |
|
| 349 | + 'name' => __('Register / Login Form', 'give'),
|
|
| 350 | + 'desc' => __('Display the registration and login forms in the payment section for non-logged-in users.', 'give'),
|
|
| 351 | + 'id' => $prefix.'show_register_form', |
|
| 352 | 352 | 'type' => 'select', |
| 353 | 353 | 'options' => array( |
| 354 | - 'both' => __( 'Registration and Login Forms', 'give' ), |
|
| 355 | - 'registration' => __( 'Registration Form Only', 'give' ), |
|
| 356 | - 'login' => __( 'Login Form Only', 'give' ), |
|
| 357 | - 'none' => __( 'None', 'give' ), |
|
| 354 | + 'both' => __('Registration and Login Forms', 'give'),
|
|
| 355 | + 'registration' => __('Registration Form Only', 'give'),
|
|
| 356 | + 'login' => __('Login Form Only', 'give'),
|
|
| 357 | + 'none' => __('None', 'give'),
|
|
| 358 | 358 | ), |
| 359 | 359 | 'default' => 'none', |
| 360 | 360 | ), |
| 361 | 361 | array( |
| 362 | - 'name' => __( 'Floating Labels', 'give' ), |
|
| 362 | + 'name' => __('Floating Labels', 'give'),
|
|
| 363 | 363 | /* translators: %s: forms http://bradfrost.com/blog/post/float-label-pattern/ */ |
| 364 | - 'desc' => sprintf( __( 'Select the <a href="%s" target="_blank">floating labels</a> setting for this Give form.<br>Be aware that if you have the "Disable CSS" option enabled, you will need to style the floating labels yourself.', 'give' ), esc_url( "http://bradfrost.com/blog/post/float-label-pattern/" ) ), |
|
| 365 | - 'id' => $prefix . 'form_floating_labels', |
|
| 364 | + 'desc' => sprintf(__('Select the <a href="%s" target="_blank">floating labels</a> setting for this Give form.<br>Be aware that if you have the "Disable CSS" option enabled, you will need to style the floating labels yourself.', 'give'), esc_url("http://bradfrost.com/blog/post/float-label-pattern/")),
|
|
| 365 | + 'id' => $prefix.'form_floating_labels', |
|
| 366 | 366 | 'type' => 'select', |
| 367 | 367 | 'options' => array( |
| 368 | - '' => __( 'Use the global setting', 'give' ), |
|
| 369 | - 'enabled' => __( 'Enabled', 'give' ), |
|
| 370 | - 'disabled' => __( 'Disabled', 'give' ), |
|
| 368 | + '' => __('Use the global setting', 'give'),
|
|
| 369 | + 'enabled' => __('Enabled', 'give'),
|
|
| 370 | + 'disabled' => __('Disabled', 'give'),
|
|
| 371 | 371 | ), |
| 372 | 372 | 'default' => 'none', |
| 373 | 373 | ) |
@@ -379,47 +379,47 @@ discard block |
||
| 379 | 379 | /** |
| 380 | 380 | * Terms & Conditions |
| 381 | 381 | */ |
| 382 | - $meta_boxes['form_terms_options'] = apply_filters( 'give_forms_terms_options', array( |
|
| 382 | + $meta_boxes['form_terms_options'] = apply_filters('give_forms_terms_options', array(
|
|
| 383 | 383 | 'id' => 'form_terms_options', |
| 384 | - 'title' => __( 'Terms and Conditions', 'give' ), |
|
| 385 | - 'object_types' => array( 'give_forms' ), |
|
| 384 | + 'title' => __('Terms and Conditions', 'give'),
|
|
| 385 | + 'object_types' => array('give_forms'),
|
|
| 386 | 386 | 'context' => 'normal', |
| 387 | 387 | 'priority' => 'high', //Show above Content WYSIWYG |
| 388 | - 'fields' => apply_filters( 'give_forms_terms_options_metabox_fields', array( |
|
| 388 | + 'fields' => apply_filters('give_forms_terms_options_metabox_fields', array(
|
|
| 389 | 389 | //Donation Option |
| 390 | 390 | array( |
| 391 | - 'name' => __( 'Terms and Conditions', 'give' ), |
|
| 392 | - 'description' => __( 'Do you want to require the user to agree to terms and conditions prior to being able to complete their donation?', 'give' ), |
|
| 393 | - 'id' => $prefix . 'terms_option', |
|
| 391 | + 'name' => __('Terms and Conditions', 'give'),
|
|
| 392 | + 'description' => __('Do you want to require the user to agree to terms and conditions prior to being able to complete their donation?', 'give'),
|
|
| 393 | + 'id' => $prefix.'terms_option', |
|
| 394 | 394 | 'type' => 'select', |
| 395 | - 'options' => apply_filters( 'give_forms_content_options_select', array( |
|
| 396 | - 'none' => __( 'No', 'give' ), |
|
| 397 | - 'yes' => __( 'Yes', 'give' ), |
|
| 395 | + 'options' => apply_filters('give_forms_content_options_select', array(
|
|
| 396 | + 'none' => __('No', 'give'),
|
|
| 397 | + 'yes' => __('Yes', 'give'),
|
|
| 398 | 398 | ) |
| 399 | 399 | ), |
| 400 | 400 | 'default' => 'none', |
| 401 | 401 | ), |
| 402 | 402 | array( |
| 403 | - 'id' => $prefix . 'agree_label', |
|
| 404 | - 'name' => __( 'Agree to Terms Label', 'give' ), |
|
| 405 | - 'desc' => __( 'The label shown next to the agree to terms check box. Add your own to customize or leave blank to use the default text placeholder.', 'give' ), |
|
| 403 | + 'id' => $prefix.'agree_label', |
|
| 404 | + 'name' => __('Agree to Terms Label', 'give'),
|
|
| 405 | + 'desc' => __('The label shown next to the agree to terms check box. Add your own to customize or leave blank to use the default text placeholder.', 'give'),
|
|
| 406 | 406 | 'type' => 'text', |
| 407 | 407 | 'row_classes' => 'give-subfield', |
| 408 | 408 | 'size' => 'regular', |
| 409 | 409 | 'attributes' => array( |
| 410 | - 'placeholder' => __( 'Agree to Terms?', 'give' ), |
|
| 410 | + 'placeholder' => __('Agree to Terms?', 'give'),
|
|
| 411 | 411 | ), |
| 412 | 412 | ), |
| 413 | 413 | array( |
| 414 | - 'id' => $prefix . 'agree_text', |
|
| 414 | + 'id' => $prefix.'agree_text', |
|
| 415 | 415 | 'row_classes' => 'give-subfield', |
| 416 | - 'name' => __( 'Agreement Text', 'give' ), |
|
| 417 | - 'desc' => __( 'This is the actual text which the user will have to agree to in order to make a donation.', 'give' ), |
|
| 416 | + 'name' => __('Agreement Text', 'give'),
|
|
| 417 | + 'desc' => __('This is the actual text which the user will have to agree to in order to make a donation.', 'give'),
|
|
| 418 | 418 | 'type' => 'wysiwyg' |
| 419 | 419 | ), |
| 420 | 420 | ) |
| 421 | 421 | ) |
| 422 | - ) ); |
|
| 422 | + )); |
|
| 423 | 423 | |
| 424 | 424 | return $meta_boxes; |
| 425 | 425 | |
@@ -433,11 +433,11 @@ discard block |
||
| 433 | 433 | |
| 434 | 434 | <div class="table-container"> |
| 435 | 435 | <div class="table-row"> |
| 436 | - <div class="table-cell col-amount"><?php _e( 'Amount', 'give' ); ?></div> |
|
| 437 | - <div class="table-cell col-text"><?php _e( 'Text', 'give' ); ?></div> |
|
| 438 | - <div class="table-cell col-default"><?php _e( 'Default', 'give' ); ?></div> |
|
| 439 | - <?php do_action( 'give_donation_levels_table_head' ); ?> |
|
| 440 | - <div class="table-cell col-sort"><?php _e( 'Sort', 'give' ); ?></div> |
|
| 436 | + <div class="table-cell col-amount"><?php _e('Amount', 'give'); ?></div>
|
|
| 437 | + <div class="table-cell col-text"><?php _e('Text', 'give'); ?></div>
|
|
| 438 | + <div class="table-cell col-default"><?php _e('Default', 'give'); ?></div>
|
|
| 439 | + <?php do_action('give_donation_levels_table_head'); ?>
|
|
| 440 | + <div class="table-cell col-sort"><?php _e('Sort', 'give'); ?></div>
|
|
| 441 | 441 | |
| 442 | 442 | </div> |
| 443 | 443 | </div> |
@@ -445,7 +445,7 @@ discard block |
||
| 445 | 445 | <?php |
| 446 | 446 | } |
| 447 | 447 | |
| 448 | -add_action( 'cmb2_render_levels_repeater_header', 'give_cmb_render_levels_repeater_header', 10 ); |
|
| 448 | +add_action('cmb2_render_levels_repeater_header', 'give_cmb_render_levels_repeater_header', 10);
|
|
| 449 | 449 | |
| 450 | 450 | |
| 451 | 451 | /** |
@@ -462,25 +462,25 @@ discard block |
||
| 462 | 462 | * @param $object_type |
| 463 | 463 | * @param $field_type_object |
| 464 | 464 | */ |
| 465 | -function give_cmb_render_levels_id( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
|
|
| 465 | +function give_cmb_render_levels_id($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
|
|
| 466 | 466 | |
| 467 | - $escaped_value = ( isset( $escaped_value['level_id'] ) ? $escaped_value['level_id'] : '' ); |
|
| 467 | + $escaped_value = (isset($escaped_value['level_id']) ? $escaped_value['level_id'] : ''); |
|
| 468 | 468 | |
| 469 | 469 | $field_options_array = array( |
| 470 | 470 | 'class' => 'give-hidden give-level-id-input', |
| 471 | - 'name' => $field_type_object->_name( '[level_id]' ), |
|
| 472 | - 'id' => $field_type_object->_id( '_level_id' ), |
|
| 471 | + 'name' => $field_type_object->_name('[level_id]'),
|
|
| 472 | + 'id' => $field_type_object->_id('_level_id'),
|
|
| 473 | 473 | 'value' => $escaped_value, |
| 474 | 474 | 'type' => 'number', |
| 475 | 475 | 'desc' => '', |
| 476 | 476 | ); |
| 477 | 477 | |
| 478 | - echo '<p class="give-level-id">' . $escaped_value . '</p>'; |
|
| 479 | - echo $field_type_object->input( $field_options_array ); |
|
| 478 | + echo '<p class="give-level-id">'.$escaped_value.'</p>'; |
|
| 479 | + echo $field_type_object->input($field_options_array); |
|
| 480 | 480 | |
| 481 | 481 | } |
| 482 | 482 | |
| 483 | -add_action( 'cmb2_render_levels_id', 'give_cmb_render_levels_id', 10, 5 ); |
|
| 483 | +add_action('cmb2_render_levels_id', 'give_cmb_render_levels_id', 10, 5);
|
|
| 484 | 484 | |
| 485 | 485 | |
| 486 | 486 | /** |
@@ -492,13 +492,13 @@ discard block |
||
| 492 | 492 | * @param $object_type |
| 493 | 493 | * @param $field_type_object |
| 494 | 494 | */ |
| 495 | -function give_cmb_give_default_radio_inline( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
|
|
| 496 | - echo '<input type="radio" class="cmb2-option donation-level-radio" name="' . $field_object->args['_name'] . '" id="' . $field_object->args['id'] . '" value="default" ' . checked( 'default', $escaped_value, false ) . '>'; |
|
| 497 | - echo '<label for="' . $field_object->args['id'] . '">Default</label>'; |
|
| 495 | +function give_cmb_give_default_radio_inline($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
|
|
| 496 | + echo '<input type="radio" class="cmb2-option donation-level-radio" name="'.$field_object->args['_name'].'" id="'.$field_object->args['id'].'" value="default" '.checked('default', $escaped_value, false).'>';
|
|
| 497 | + echo '<label for="'.$field_object->args['id'].'">Default</label>'; |
|
| 498 | 498 | |
| 499 | 499 | } |
| 500 | 500 | |
| 501 | -add_action( 'cmb2_render_give_default_radio_inline', 'give_cmb_give_default_radio_inline', 10, 5 ); |
|
| 501 | +add_action('cmb2_render_give_default_radio_inline', 'give_cmb_give_default_radio_inline', 10, 5);
|
|
| 502 | 502 | |
| 503 | 503 | |
| 504 | 504 | /** |
@@ -508,20 +508,20 @@ discard block |
||
| 508 | 508 | */ |
| 509 | 509 | function give_add_shortcode_to_publish_metabox() {
|
| 510 | 510 | |
| 511 | - if ( 'give_forms' !== get_post_type() ) {
|
|
| 511 | + if ('give_forms' !== get_post_type()) {
|
|
| 512 | 512 | return false; |
| 513 | 513 | } |
| 514 | 514 | |
| 515 | 515 | global $post; |
| 516 | 516 | |
| 517 | 517 | //Only enqueue scripts for CPT on post type screen |
| 518 | - if ( 'give_forms' === $post->post_type ) {
|
|
| 518 | + if ('give_forms' === $post->post_type) {
|
|
| 519 | 519 | //Shortcode column with select all input |
| 520 | - $shortcode = htmlentities( '[give_form id="' . $post->ID . '"]' ); |
|
| 521 | - echo '<div class="shortcode-wrap box-sizing"><label>' . __( 'Give Form Shortcode:', 'give' ) . '</label><input onClick="this.setSelectionRange(0, this.value.length)" type="text" class="shortcode-input" readonly value="' . $shortcode . '"></div>'; |
|
| 520 | + $shortcode = htmlentities('[give_form id="'.$post->ID.'"]');
|
|
| 521 | + echo '<div class="shortcode-wrap box-sizing"><label>'.__('Give Form Shortcode:', 'give').'</label><input onClick="this.setSelectionRange(0, this.value.length)" type="text" class="shortcode-input" readonly value="'.$shortcode.'"></div>';
|
|
| 522 | 522 | |
| 523 | 523 | } |
| 524 | 524 | |
| 525 | 525 | } |
| 526 | 526 | |
| 527 | -add_action( 'post_submitbox_misc_actions', 'give_add_shortcode_to_publish_metabox' ); |
|
| 527 | +add_action('post_submitbox_misc_actions', 'give_add_shortcode_to_publish_metabox');
|
|