@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | * @since 1.3.0 |
12 | 12 | */ |
13 | 13 | |
14 | -defined( 'ABSPATH' ) or exit; |
|
14 | +defined('ABSPATH') or exit; |
|
15 | 15 | |
16 | 16 | final class Give_Shortcode_Button { |
17 | 17 | |
@@ -27,16 +27,16 @@ discard block |
||
27 | 27 | */ |
28 | 28 | public function __construct() { |
29 | 29 | |
30 | - if ( is_admin() ) { |
|
31 | - add_filter( 'mce_external_plugins', array( $this, 'mce_external_plugins' ), 15 ); |
|
30 | + if (is_admin()) { |
|
31 | + add_filter('mce_external_plugins', array($this, 'mce_external_plugins'), 15); |
|
32 | 32 | |
33 | - add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_assets' ) ); |
|
34 | - add_action( 'admin_enqueue_scripts', array( $this, 'admin_localize_scripts' ), 13 ); |
|
35 | - add_action( 'media_buttons', array( $this, 'shortcode_button' ) ); |
|
33 | + add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_assets')); |
|
34 | + add_action('admin_enqueue_scripts', array($this, 'admin_localize_scripts'), 13); |
|
35 | + add_action('media_buttons', array($this, 'shortcode_button')); |
|
36 | 36 | } |
37 | 37 | |
38 | - add_action( "wp_ajax_give_shortcode", array( $this, 'shortcode_ajax' ) ); |
|
39 | - add_action( "wp_ajax_nopriv_give_shortcode", array( $this, 'shortcode_ajax' ) ); |
|
38 | + add_action("wp_ajax_give_shortcode", array($this, 'shortcode_ajax')); |
|
39 | + add_action("wp_ajax_nopriv_give_shortcode", array($this, 'shortcode_ajax')); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | /** |
@@ -48,13 +48,13 @@ discard block |
||
48 | 48 | * |
49 | 49 | * @since 1.0 |
50 | 50 | */ |
51 | - public function mce_external_plugins( $plugin_array ) { |
|
51 | + public function mce_external_plugins($plugin_array) { |
|
52 | 52 | |
53 | - if ( current_user_can( 'edit_posts' ) && current_user_can( 'edit_pages' ) ) { |
|
53 | + if (current_user_can('edit_posts') && current_user_can('edit_pages')) { |
|
54 | 54 | |
55 | - $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; |
|
55 | + $suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min'; |
|
56 | 56 | |
57 | - $plugin_array['give_shortcode'] = GIVE_PLUGIN_URL . 'assets/js/admin/tinymce/mce-plugin' . $suffix . '.js'; |
|
57 | + $plugin_array['give_shortcode'] = GIVE_PLUGIN_URL.'assets/js/admin/tinymce/mce-plugin'.$suffix.'.js'; |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | return $plugin_array; |
@@ -69,12 +69,12 @@ discard block |
||
69 | 69 | */ |
70 | 70 | public function admin_enqueue_assets() { |
71 | 71 | |
72 | - $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; |
|
72 | + $suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min'; |
|
73 | 73 | |
74 | 74 | wp_enqueue_script( |
75 | 75 | 'give_shortcode', |
76 | - GIVE_PLUGIN_URL . 'assets/js/admin/admin-shortcodes' . $suffix . '.js', |
|
77 | - array( 'jquery' ), |
|
76 | + GIVE_PLUGIN_URL.'assets/js/admin/admin-shortcodes'.$suffix.'.js', |
|
77 | + array('jquery'), |
|
78 | 78 | GIVE_VERSION, |
79 | 79 | true |
80 | 80 | ); |
@@ -89,17 +89,17 @@ discard block |
||
89 | 89 | */ |
90 | 90 | public function admin_localize_scripts() { |
91 | 91 | |
92 | - if ( ! empty( self::$shortcodes ) ) { |
|
92 | + if ( ! empty(self::$shortcodes)) { |
|
93 | 93 | |
94 | 94 | $variables = array(); |
95 | 95 | |
96 | - foreach ( self::$shortcodes as $shortcode => $values ) { |
|
97 | - if ( ! empty( $values['required'] ) ) { |
|
98 | - $variables[ $shortcode ] = $values['required']; |
|
96 | + foreach (self::$shortcodes as $shortcode => $values) { |
|
97 | + if ( ! empty($values['required'])) { |
|
98 | + $variables[$shortcode] = $values['required']; |
|
99 | 99 | } |
100 | 100 | } |
101 | 101 | |
102 | - wp_localize_script( 'give_shortcode', 'scShortcodes', $variables ); |
|
102 | + wp_localize_script('give_shortcode', 'scShortcodes', $variables); |
|
103 | 103 | } |
104 | 104 | } |
105 | 105 | |
@@ -114,24 +114,24 @@ discard block |
||
114 | 114 | |
115 | 115 | global $pagenow, $wp_version; |
116 | 116 | |
117 | - $shortcode_button_pages = array( 'post.php', 'page.php', 'post-new.php', 'post-edit.php' ); |
|
117 | + $shortcode_button_pages = array('post.php', 'page.php', 'post-new.php', 'post-edit.php'); |
|
118 | 118 | // Only run in admin post/page creation and edit screens |
119 | - if ( in_array( $pagenow, $shortcode_button_pages ) |
|
120 | - && apply_filters( 'give_shortcode_button_condition', true ) |
|
121 | - && ! empty( self::$shortcodes ) |
|
119 | + if (in_array($pagenow, $shortcode_button_pages) |
|
120 | + && apply_filters('give_shortcode_button_condition', true) |
|
121 | + && ! empty(self::$shortcodes) |
|
122 | 122 | ) { |
123 | 123 | |
124 | 124 | $shortcodes = array(); |
125 | 125 | |
126 | - foreach ( self::$shortcodes as $shortcode => $values ) { |
|
126 | + foreach (self::$shortcodes as $shortcode => $values) { |
|
127 | 127 | /** |
128 | 128 | * Filters the condition for including the current shortcode |
129 | 129 | * |
130 | 130 | * @since 1.0 |
131 | 131 | */ |
132 | - if ( apply_filters( sanitize_title( $shortcode ) . '_condition', true ) ) { |
|
132 | + if (apply_filters(sanitize_title($shortcode).'_condition', true)) { |
|
133 | 133 | |
134 | - $shortcodes[ $shortcode ] = sprintf( |
|
134 | + $shortcodes[$shortcode] = sprintf( |
|
135 | 135 | '<div class="sc-shortcode mce-menu-item give-shortcode-item-%1$s" data-shortcode="%s">%s</div>', |
136 | 136 | $shortcode, |
137 | 137 | $values['label'], |
@@ -140,37 +140,37 @@ discard block |
||
140 | 140 | } |
141 | 141 | } |
142 | 142 | |
143 | - if ( ! empty( $shortcodes ) ) { |
|
143 | + if ( ! empty($shortcodes)) { |
|
144 | 144 | |
145 | 145 | // check current WP version |
146 | - $img = ( version_compare( $wp_version, '3.5', '<' ) ) |
|
147 | - ? '<img src="' . GIVE_PLUGIN_URL . 'assets/images/give-media.png" />' |
|
148 | - : '<span class="wp-media-buttons-icon" id="give-media-button" style="background-image: url(' . give_svg_icons( 'give_grey' ) . ');"></span>'; |
|
146 | + $img = (version_compare($wp_version, '3.5', '<')) |
|
147 | + ? '<img src="'.GIVE_PLUGIN_URL.'assets/images/give-media.png" />' |
|
148 | + : '<span class="wp-media-buttons-icon" id="give-media-button" style="background-image: url('.give_svg_icons('give_grey').');"></span>'; |
|
149 | 149 | |
150 | - reset( $shortcodes ); |
|
150 | + reset($shortcodes); |
|
151 | 151 | |
152 | - if ( count( $shortcodes ) == 1 ) { |
|
152 | + if (count($shortcodes) == 1) { |
|
153 | 153 | |
154 | - $shortcode = key( $shortcodes ); |
|
154 | + $shortcode = key($shortcodes); |
|
155 | 155 | |
156 | 156 | printf( |
157 | 157 | '<button class="button sc-shortcode" data-shortcode="%s">%s</button>', |
158 | 158 | $shortcode, |
159 | - sprintf( '%s %s %s', |
|
159 | + sprintf('%s %s %s', |
|
160 | 160 | $img, |
161 | - __( 'Insert', 'give' ), |
|
162 | - self::$shortcodes[ $shortcode ]['label'] |
|
161 | + __('Insert', 'give'), |
|
162 | + self::$shortcodes[$shortcode]['label'] |
|
163 | 163 | ) |
164 | 164 | ); |
165 | 165 | } else { |
166 | 166 | printf( |
167 | - '<div class="sc-wrap">' . |
|
168 | - '<button class="button sc-button">%s %s</button>' . |
|
169 | - '<div class="sc-menu mce-menu">%s</div>' . |
|
167 | + '<div class="sc-wrap">'. |
|
168 | + '<button class="button sc-button">%s %s</button>'. |
|
169 | + '<div class="sc-menu mce-menu">%s</div>'. |
|
170 | 170 | '</div>', |
171 | 171 | $img, |
172 | - __( 'Give Shortcodes', 'give' ), |
|
173 | - implode( '', array_values( $shortcodes ) ) |
|
172 | + __('Give Shortcodes', 'give'), |
|
173 | + implode('', array_values($shortcodes)) |
|
174 | 174 | ); |
175 | 175 | } |
176 | 176 | } |
@@ -186,15 +186,15 @@ discard block |
||
186 | 186 | */ |
187 | 187 | public function shortcode_ajax() { |
188 | 188 | |
189 | - $shortcode = isset( $_POST['shortcode'] ) ? $_POST['shortcode'] : false; |
|
189 | + $shortcode = isset($_POST['shortcode']) ? $_POST['shortcode'] : false; |
|
190 | 190 | $response = false; |
191 | 191 | |
192 | - if ( $shortcode && array_key_exists( $shortcode, self::$shortcodes ) ) { |
|
192 | + if ($shortcode && array_key_exists($shortcode, self::$shortcodes)) { |
|
193 | 193 | |
194 | - $data = self::$shortcodes[ $shortcode ]; |
|
194 | + $data = self::$shortcodes[$shortcode]; |
|
195 | 195 | |
196 | - if ( ! empty( $data['errors'] ) ) { |
|
197 | - $data['btn_okay'] = array( __( 'Okay', 'give' ) ); |
|
196 | + if ( ! empty($data['errors'])) { |
|
197 | + $data['btn_okay'] = array(__('Okay', 'give')); |
|
198 | 198 | } |
199 | 199 | |
200 | 200 | $response = array( |
@@ -206,10 +206,10 @@ discard block |
||
206 | 206 | ); |
207 | 207 | } else { |
208 | 208 | // todo: handle error |
209 | - error_log( print_r( 'AJAX error!', 1 ) ); |
|
209 | + error_log(print_r('AJAX error!', 1)); |
|
210 | 210 | } |
211 | 211 | |
212 | - wp_send_json( $response ); |
|
212 | + wp_send_json($response); |
|
213 | 213 | } |
214 | 214 | } |
215 | 215 |
@@ -117,8 +117,8 @@ |
||
117 | 117 | $shortcode_button_pages = array( 'post.php', 'page.php', 'post-new.php', 'post-edit.php' ); |
118 | 118 | // Only run in admin post/page creation and edit screens |
119 | 119 | if ( in_array( $pagenow, $shortcode_button_pages ) |
120 | - && apply_filters( 'give_shortcode_button_condition', true ) |
|
121 | - && ! empty( self::$shortcodes ) |
|
120 | + && apply_filters( 'give_shortcode_button_condition', true ) |
|
121 | + && ! empty( self::$shortcodes ) |
|
122 | 122 | ) { |
123 | 123 | |
124 | 124 | $shortcodes = array(); |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * @since 1.3.0 |
10 | 10 | */ |
11 | 11 | |
12 | -defined( 'ABSPATH' ) or exit; |
|
12 | +defined('ABSPATH') or exit; |
|
13 | 13 | |
14 | 14 | class Give_Shortcode_Donation_History extends Give_Shortcode_Generator { |
15 | 15 | |
@@ -18,9 +18,9 @@ discard block |
||
18 | 18 | */ |
19 | 19 | public function __construct() { |
20 | 20 | |
21 | - $this->shortcode['label'] = __( 'Donation History', 'give' ); |
|
21 | + $this->shortcode['label'] = __('Donation History', 'give'); |
|
22 | 22 | |
23 | - parent::__construct( 'donation_history' ); |
|
23 | + parent::__construct('donation_history'); |
|
24 | 24 | } |
25 | 25 | } |
26 | 26 |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * @since 1.3.0 |
10 | 10 | */ |
11 | 11 | |
12 | -defined( 'ABSPATH' ) or exit; |
|
12 | +defined('ABSPATH') or exit; |
|
13 | 13 | |
14 | 14 | class Give_Shortcode_Donation_Form extends Give_Shortcode_Generator { |
15 | 15 | |
@@ -18,10 +18,10 @@ discard block |
||
18 | 18 | */ |
19 | 19 | public function __construct() { |
20 | 20 | |
21 | - $this->shortcode['title'] = __( 'Donation Form', 'give' ); |
|
22 | - $this->shortcode['label'] = __( 'Donation Form', 'give' ); |
|
21 | + $this->shortcode['title'] = __('Donation Form', 'give'); |
|
22 | + $this->shortcode['label'] = __('Donation Form', 'give'); |
|
23 | 23 | |
24 | - parent::__construct( 'give_form' ); |
|
24 | + parent::__construct('give_form'); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | /** |
@@ -31,8 +31,8 @@ discard block |
||
31 | 31 | */ |
32 | 32 | public function define_fields() { |
33 | 33 | |
34 | - $create_form_link = sprintf( __( '%sClick here%s to create a new Donation Form.', 'give' ), |
|
35 | - '<a href="' . admin_url( 'post-new.php?post_type=give_forms' ) . '">', |
|
34 | + $create_form_link = sprintf(__('%sClick here%s to create a new Donation Form.', 'give'), |
|
35 | + '<a href="'.admin_url('post-new.php?post_type=give_forms').'">', |
|
36 | 36 | '</a>' |
37 | 37 | ); |
38 | 38 | |
@@ -43,68 +43,68 @@ discard block |
||
43 | 43 | 'post_type' => 'give_forms', |
44 | 44 | ), |
45 | 45 | 'name' => 'id', |
46 | - 'tooltip' => __( 'Select a Donation Form', 'give' ), |
|
47 | - 'placeholder' => sprintf( '– %s –', __( 'Select a Form', 'give' ) ), |
|
46 | + 'tooltip' => __('Select a Donation Form', 'give'), |
|
47 | + 'placeholder' => sprintf('– %s –', __('Select a Form', 'give')), |
|
48 | 48 | 'required' => array( |
49 | - 'alert' => __( 'You must first select a Form!', 'give' ), |
|
50 | - 'error' => sprintf( '<p class="strong">%s</p><p class="no-margin">%s</p>', __( 'No donation forms were found!', 'give' ), $create_form_link ), |
|
49 | + 'alert' => __('You must first select a Form!', 'give'), |
|
50 | + 'error' => sprintf('<p class="strong">%s</p><p class="no-margin">%s</p>', __('No donation forms were found!', 'give'), $create_form_link), |
|
51 | 51 | ), |
52 | 52 | ), |
53 | 53 | array( |
54 | 54 | 'type' => 'container', |
55 | - 'html' => sprintf( '<p class="strong margin-top">%s</p>', __( 'Optional form settings', 'give' ) ), |
|
55 | + 'html' => sprintf('<p class="strong margin-top">%s</p>', __('Optional form settings', 'give')), |
|
56 | 56 | ), |
57 | 57 | array( |
58 | 58 | 'type' => 'listbox', |
59 | 59 | 'name' => 'show_title', |
60 | - 'label' => __( 'Show Title:', 'give' ), |
|
61 | - 'tooltip' => __( 'Do you want to display the form title?', 'give' ), |
|
60 | + 'label' => __('Show Title:', 'give'), |
|
61 | + 'tooltip' => __('Do you want to display the form title?', 'give'), |
|
62 | 62 | 'options' => array( |
63 | - 'true' => __( 'Show', 'give' ), |
|
64 | - 'false' => __( 'Hide', 'give' ), |
|
63 | + 'true' => __('Show', 'give'), |
|
64 | + 'false' => __('Hide', 'give'), |
|
65 | 65 | ), |
66 | 66 | ), |
67 | 67 | array( |
68 | 68 | 'type' => 'listbox', |
69 | 69 | 'name' => 'show_goal', |
70 | - 'label' => __( 'Show Goal:', 'give' ), |
|
71 | - 'tooltip' => __( 'Do you want to display the donation goal?', 'give' ), |
|
70 | + 'label' => __('Show Goal:', 'give'), |
|
71 | + 'tooltip' => __('Do you want to display the donation goal?', 'give'), |
|
72 | 72 | 'options' => array( |
73 | - 'true' => __( 'Show', 'give' ), |
|
74 | - 'false' => __( 'Hide', 'give' ), |
|
73 | + 'true' => __('Show', 'give'), |
|
74 | + 'false' => __('Hide', 'give'), |
|
75 | 75 | ), |
76 | 76 | ), |
77 | 77 | array( |
78 | 78 | 'type' => 'listbox', |
79 | 79 | 'name' => 'show_content', |
80 | 80 | 'minWidth' => 240, |
81 | - 'label' => __( 'Display Content:', 'give' ), |
|
82 | - 'tooltip' => __( 'Do you want to display the form content?', 'give' ), |
|
81 | + 'label' => __('Display Content:', 'give'), |
|
82 | + 'tooltip' => __('Do you want to display the form content?', 'give'), |
|
83 | 83 | 'options' => array( |
84 | - 'none' => __( 'No Content', 'give' ), |
|
85 | - 'above' => __( 'Display above the form fields', 'give' ), |
|
86 | - 'below' => __( 'Display below the form fields', 'give' ), |
|
84 | + 'none' => __('No Content', 'give'), |
|
85 | + 'above' => __('Display above the form fields', 'give'), |
|
86 | + 'below' => __('Display below the form fields', 'give'), |
|
87 | 87 | ), |
88 | 88 | ), |
89 | 89 | array( |
90 | 90 | 'type' => 'listbox', |
91 | 91 | 'name' => 'display_style', |
92 | - 'label' => __( 'Payment Fields:', 'give' ), |
|
93 | - 'tooltip' => __( 'How would you like to display payment information?', 'give' ), |
|
92 | + 'label' => __('Payment Fields:', 'give'), |
|
93 | + 'tooltip' => __('How would you like to display payment information?', 'give'), |
|
94 | 94 | 'options' => array( |
95 | - 'onpage' => __( 'Show on Page', 'give' ), |
|
96 | - 'reveal' => __( 'Reveal Upon Click', 'give' ), |
|
97 | - 'modal' => __( 'Modal Window Upon Click', 'give' ), |
|
95 | + 'onpage' => __('Show on Page', 'give'), |
|
96 | + 'reveal' => __('Reveal Upon Click', 'give'), |
|
97 | + 'modal' => __('Modal Window Upon Click', 'give'), |
|
98 | 98 | ), |
99 | 99 | ), |
100 | 100 | array( |
101 | 101 | 'type' => 'listbox', |
102 | 102 | 'name' => 'float_labels', |
103 | - 'label' => __( 'Floating Labels:', 'give' ), |
|
104 | - 'tooltip' => __( 'Override the default floating labels setting for this form?', 'give' ), |
|
103 | + 'label' => __('Floating Labels:', 'give'), |
|
104 | + 'tooltip' => __('Override the default floating labels setting for this form?', 'give'), |
|
105 | 105 | 'options' => array( |
106 | - 'enabled' => __( 'Enabled', 'give' ), |
|
107 | - 'disabled' => __( 'Disabled', 'give' ), |
|
106 | + 'enabled' => __('Enabled', 'give'), |
|
107 | + 'disabled' => __('Disabled', 'give'), |
|
108 | 108 | ), |
109 | 109 | ), |
110 | 110 | ); |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * The [give_form] Shortcode Generator class |
|
4 | - * |
|
5 | - * @package Give |
|
6 | - * @subpackage Admin |
|
7 | - * @copyright Copyright (c) 2015, WordImpress |
|
8 | - * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
|
9 | - * @since 1.3.0 |
|
10 | - */ |
|
3 | + * The [give_form] Shortcode Generator class |
|
4 | + * |
|
5 | + * @package Give |
|
6 | + * @subpackage Admin |
|
7 | + * @copyright Copyright (c) 2015, WordImpress |
|
8 | + * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
|
9 | + * @since 1.3.0 |
|
10 | + */ |
|
11 | 11 | |
12 | 12 | defined( 'ABSPATH' ) or exit; |
13 | 13 |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * @since 1.3.0 |
10 | 10 | */ |
11 | 11 | |
12 | -defined( 'ABSPATH' ) or exit; |
|
12 | +defined('ABSPATH') or exit; |
|
13 | 13 | |
14 | 14 | class Give_Shortcode_Donation_Form_Goal extends Give_Shortcode_Generator { |
15 | 15 | |
@@ -18,10 +18,10 @@ discard block |
||
18 | 18 | */ |
19 | 19 | public function __construct() { |
20 | 20 | |
21 | - $this->shortcode['title'] = __( 'Donation Form Goal', 'give' ); |
|
22 | - $this->shortcode['label'] = __( 'Donation Form Goal', 'give' ); |
|
21 | + $this->shortcode['title'] = __('Donation Form Goal', 'give'); |
|
22 | + $this->shortcode['label'] = __('Donation Form Goal', 'give'); |
|
23 | 23 | |
24 | - parent::__construct( 'give_goal' ); |
|
24 | + parent::__construct('give_goal'); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | /** |
@@ -31,8 +31,8 @@ discard block |
||
31 | 31 | */ |
32 | 32 | public function define_fields() { |
33 | 33 | |
34 | - $create_form_link = sprintf( __( '%sClick here%s to create a new Donation Form.', 'give' ), |
|
35 | - '<a href="' . admin_url( 'post-new.php?post_type=give_forms' ) . '">', |
|
34 | + $create_form_link = sprintf(__('%sClick here%s to create a new Donation Form.', 'give'), |
|
35 | + '<a href="'.admin_url('post-new.php?post_type=give_forms').'">', |
|
36 | 36 | '</a>' |
37 | 37 | ); |
38 | 38 | |
@@ -43,35 +43,35 @@ discard block |
||
43 | 43 | 'post_type' => 'give_forms', |
44 | 44 | ), |
45 | 45 | 'name' => 'id', |
46 | - 'tooltip' => __( 'Select a Donation Form', 'give' ), |
|
47 | - 'placeholder' => sprintf( '– %s –', __( 'Select a Form', 'give' ) ), |
|
46 | + 'tooltip' => __('Select a Donation Form', 'give'), |
|
47 | + 'placeholder' => sprintf('– %s –', __('Select a Form', 'give')), |
|
48 | 48 | 'required' => array( |
49 | - 'alert' => __( 'You must first select a Form!', 'give' ), |
|
50 | - 'error' => sprintf( '<p class="strong">%s</p><p class="no-margin">%s</p>', __( 'No donation forms were found!', 'give' ), $create_form_link ), |
|
49 | + 'alert' => __('You must first select a Form!', 'give'), |
|
50 | + 'error' => sprintf('<p class="strong">%s</p><p class="no-margin">%s</p>', __('No donation forms were found!', 'give'), $create_form_link), |
|
51 | 51 | ), |
52 | 52 | ), |
53 | 53 | array( |
54 | 54 | 'type' => 'container', |
55 | - 'html' => sprintf( '<p class="strong margin-top">%s</p>', __( 'Optional settings', 'give' ) ), |
|
55 | + 'html' => sprintf('<p class="strong margin-top">%s</p>', __('Optional settings', 'give')), |
|
56 | 56 | ), |
57 | 57 | array( |
58 | 58 | 'type' => 'listbox', |
59 | 59 | 'name' => 'show_text', |
60 | - 'label' => __( 'Show Text:', 'give' ), |
|
61 | - 'tooltip' => __( 'This text displays the amount of income raised compared to the goal.', 'give' ), |
|
60 | + 'label' => __('Show Text:', 'give'), |
|
61 | + 'tooltip' => __('This text displays the amount of income raised compared to the goal.', 'give'), |
|
62 | 62 | 'options' => array( |
63 | - 'true' => __( 'Show', 'give' ), |
|
64 | - 'false' => __( 'Hide', 'give' ), |
|
63 | + 'true' => __('Show', 'give'), |
|
64 | + 'false' => __('Hide', 'give'), |
|
65 | 65 | ), |
66 | 66 | ), |
67 | 67 | array( |
68 | 68 | 'type' => 'listbox', |
69 | 69 | 'name' => 'show_bar', |
70 | - 'label' => __( 'Show Progress Bar:', 'give' ), |
|
71 | - 'tooltip' => __( 'Do you want to display the goal\'s progress bar?', 'give' ), |
|
70 | + 'label' => __('Show Progress Bar:', 'give'), |
|
71 | + 'tooltip' => __('Do you want to display the goal\'s progress bar?', 'give'), |
|
72 | 72 | 'options' => array( |
73 | - 'true' => __( 'Show', 'give' ), |
|
74 | - 'false' => __( 'Hide', 'give' ), |
|
73 | + 'true' => __('Show', 'give'), |
|
74 | + 'false' => __('Hide', 'give'), |
|
75 | 75 | ), |
76 | 76 | ), |
77 | 77 | ); |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * @since 1.3.0 |
10 | 10 | */ |
11 | 11 | |
12 | -defined( 'ABSPATH' ) or exit; |
|
12 | +defined('ABSPATH') or exit; |
|
13 | 13 | |
14 | 14 | class Give_Shortcode_Login extends Give_Shortcode_Generator { |
15 | 15 | |
@@ -18,10 +18,10 @@ discard block |
||
18 | 18 | */ |
19 | 19 | public function __construct() { |
20 | 20 | |
21 | - $this->shortcode['title'] = __( 'Login', 'give' ); |
|
22 | - $this->shortcode['label'] = __( 'Login', 'give' ); |
|
21 | + $this->shortcode['title'] = __('Login', 'give'); |
|
22 | + $this->shortcode['label'] = __('Login', 'give'); |
|
23 | 23 | |
24 | - parent::__construct( 'give_login' ); |
|
24 | + parent::__construct('give_login'); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | /** |
@@ -34,13 +34,13 @@ discard block |
||
34 | 34 | return array( |
35 | 35 | array( |
36 | 36 | 'type' => 'container', |
37 | - 'html' => sprintf( '<p class="no-margin">%s</p>', __( 'Redirect URL (optional):', 'give' ) ), |
|
37 | + 'html' => sprintf('<p class="no-margin">%s</p>', __('Redirect URL (optional):', 'give')), |
|
38 | 38 | ), |
39 | 39 | array( |
40 | 40 | 'type' => 'textbox', |
41 | 41 | 'name' => 'redirect', |
42 | 42 | 'minWidth' => 320, |
43 | - 'tooltip' => __( 'Enter an URL here to redirect to after login.', 'give' ), |
|
43 | + 'tooltip' => __('Enter an URL here to redirect to after login.', 'give'), |
|
44 | 44 | ), |
45 | 45 | ); |
46 | 46 | } |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * @since 1.3.0 |
10 | 10 | */ |
11 | 11 | |
12 | -defined( 'ABSPATH' ) or exit; |
|
12 | +defined('ABSPATH') or exit; |
|
13 | 13 | |
14 | 14 | class Give_Shortcode_Profile_Editor extends Give_Shortcode_Generator { |
15 | 15 | |
@@ -18,9 +18,9 @@ discard block |
||
18 | 18 | */ |
19 | 19 | public function __construct() { |
20 | 20 | |
21 | - $this->shortcode['label'] = __( 'Profile Editor', 'give' ); |
|
21 | + $this->shortcode['label'] = __('Profile Editor', 'give'); |
|
22 | 22 | |
23 | - parent::__construct( 'give_profile_editor' ); |
|
23 | + parent::__construct('give_profile_editor'); |
|
24 | 24 | } |
25 | 25 | } |
26 | 26 |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * @since 1.3.0 |
10 | 10 | */ |
11 | 11 | |
12 | -defined( 'ABSPATH' ) or exit; |
|
12 | +defined('ABSPATH') or exit; |
|
13 | 13 | |
14 | 14 | class Give_Shortcode_Donation_Receipt extends Give_Shortcode_Generator { |
15 | 15 | |
@@ -18,10 +18,10 @@ discard block |
||
18 | 18 | */ |
19 | 19 | public function __construct() { |
20 | 20 | |
21 | - $this->shortcode['title'] = __( 'Donation Receipt', 'give' ); |
|
22 | - $this->shortcode['label'] = __( 'Donation Receipt', 'give' ); |
|
21 | + $this->shortcode['title'] = __('Donation Receipt', 'give'); |
|
22 | + $this->shortcode['label'] = __('Donation Receipt', 'give'); |
|
23 | 23 | |
24 | - parent::__construct( 'give_receipt' ); |
|
24 | + parent::__construct('give_receipt'); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | /** |
@@ -34,51 +34,51 @@ discard block |
||
34 | 34 | return array( |
35 | 35 | array( |
36 | 36 | 'type' => 'container', |
37 | - 'html' => sprintf( '<p class="strong">%s</p>', __( 'Optional settings', 'give' ) ), |
|
37 | + 'html' => sprintf('<p class="strong">%s</p>', __('Optional settings', 'give')), |
|
38 | 38 | ), |
39 | 39 | array( |
40 | 40 | 'type' => 'listbox', |
41 | 41 | 'name' => 'price', |
42 | - 'label' => __( 'Show Price:', 'give' ), |
|
42 | + 'label' => __('Show Price:', 'give'), |
|
43 | 43 | 'options' => array( |
44 | - 'true' => __( 'Show', 'give' ), |
|
45 | - 'false' => __( 'Hide', 'give' ), |
|
44 | + 'true' => __('Show', 'give'), |
|
45 | + 'false' => __('Hide', 'give'), |
|
46 | 46 | ), |
47 | 47 | ), |
48 | 48 | array( |
49 | 49 | 'type' => 'listbox', |
50 | 50 | 'name' => 'date', |
51 | - 'label' => __( 'Show Date:', 'give' ), |
|
51 | + 'label' => __('Show Date:', 'give'), |
|
52 | 52 | 'options' => array( |
53 | - 'true' => __( 'Show', 'give' ), |
|
54 | - 'false' => __( 'Hide', 'give' ), |
|
53 | + 'true' => __('Show', 'give'), |
|
54 | + 'false' => __('Hide', 'give'), |
|
55 | 55 | ), |
56 | 56 | ), |
57 | 57 | array( |
58 | 58 | 'type' => 'listbox', |
59 | 59 | 'name' => 'payment_key', |
60 | - 'label' => __( 'Show Payment Key:', 'give' ), |
|
60 | + 'label' => __('Show Payment Key:', 'give'), |
|
61 | 61 | 'options' => array( |
62 | - 'true' => __( 'Show', 'give' ), |
|
63 | - 'false' => __( 'Hide', 'give' ), |
|
62 | + 'true' => __('Show', 'give'), |
|
63 | + 'false' => __('Hide', 'give'), |
|
64 | 64 | ), |
65 | 65 | ), |
66 | 66 | array( |
67 | 67 | 'type' => 'listbox', |
68 | 68 | 'name' => 'payment_method', |
69 | - 'label' => __( 'Show Payment Method:', 'give' ), |
|
69 | + 'label' => __('Show Payment Method:', 'give'), |
|
70 | 70 | 'options' => array( |
71 | - 'true' => __( 'Show', 'give' ), |
|
72 | - 'false' => __( 'Hide', 'give' ), |
|
71 | + 'true' => __('Show', 'give'), |
|
72 | + 'false' => __('Hide', 'give'), |
|
73 | 73 | ), |
74 | 74 | ), |
75 | 75 | array( |
76 | 76 | 'type' => 'listbox', |
77 | 77 | 'name' => 'payment_id', |
78 | - 'label' => __( 'Show Payment ID:', 'give' ), |
|
78 | + 'label' => __('Show Payment ID:', 'give'), |
|
79 | 79 | 'options' => array( |
80 | - 'true' => __( 'Show', 'give' ), |
|
81 | - 'false' => __( 'Hide', 'give' ), |
|
80 | + 'true' => __('Show', 'give'), |
|
81 | + 'false' => __('Hide', 'give'), |
|
82 | 82 | ), |
83 | 83 | ), |
84 | 84 | ); |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * The [give_receipt] Shortcode Generator class |
|
4 | - * |
|
5 | - * @package Give |
|
6 | - * @subpackage Admin |
|
7 | - * @copyright Copyright (c) 2015, WordImpress |
|
8 | - * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
|
9 | - * @since 1.3.0 |
|
10 | - */ |
|
3 | + * The [give_receipt] Shortcode Generator class |
|
4 | + * |
|
5 | + * @package Give |
|
6 | + * @subpackage Admin |
|
7 | + * @copyright Copyright (c) 2015, WordImpress |
|
8 | + * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
|
9 | + * @since 1.3.0 |
|
10 | + */ |
|
11 | 11 | |
12 | 12 | defined( 'ABSPATH' ) or exit; |
13 | 13 |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * @since 1.3.0 |
10 | 10 | */ |
11 | 11 | |
12 | -defined( 'ABSPATH' ) or exit; |
|
12 | +defined('ABSPATH') or exit; |
|
13 | 13 | |
14 | 14 | class Give_Shortcode_Register extends Give_Shortcode_Generator { |
15 | 15 | |
@@ -18,10 +18,10 @@ discard block |
||
18 | 18 | */ |
19 | 19 | public function __construct() { |
20 | 20 | |
21 | - $this->shortcode['title'] = __( 'Register', 'give' ); |
|
22 | - $this->shortcode['label'] = __( 'Register', 'give' ); |
|
21 | + $this->shortcode['title'] = __('Register', 'give'); |
|
22 | + $this->shortcode['label'] = __('Register', 'give'); |
|
23 | 23 | |
24 | - parent::__construct( 'give_register' ); |
|
24 | + parent::__construct('give_register'); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | /** |
@@ -34,13 +34,13 @@ discard block |
||
34 | 34 | return array( |
35 | 35 | array( |
36 | 36 | 'type' => 'container', |
37 | - 'html' => sprintf( '<p class="no-margin">%s</p>', __( 'Redirect URL (optional):', 'give' ) ), |
|
37 | + 'html' => sprintf('<p class="no-margin">%s</p>', __('Redirect URL (optional):', 'give')), |
|
38 | 38 | ), |
39 | 39 | array( |
40 | 40 | 'type' => 'textbox', |
41 | 41 | 'name' => 'redirect', |
42 | 42 | 'minWidth' => 320, |
43 | - 'tooltip' => __( 'Enter an URL here to redirect to after registering.', 'give' ), |
|
43 | + 'tooltip' => __('Enter an URL here to redirect to after registering.', 'give'), |
|
44 | 44 | ), |
45 | 45 | ); |
46 | 46 | } |
@@ -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_upgrades_screen() { |
24 | - $action = isset( $_GET['give-upgrade'] ) ? sanitize_text_field( $_GET['give-upgrade'] ) : ''; |
|
25 | - $step = isset( $_GET['step'] ) ? absint( $_GET['step'] ) : 1; |
|
26 | - $total = isset( $_GET['total'] ) ? absint( $_GET['total'] ) : false; |
|
27 | - $custom = isset( $_GET['custom'] ) ? absint( $_GET['custom'] ) : 0; |
|
28 | - $number = isset( $_GET['number'] ) ? absint( $_GET['number'] ) : 100; |
|
29 | - $steps = round( ( $total / $number ), 0 ); |
|
24 | + $action = isset($_GET['give-upgrade']) ? sanitize_text_field($_GET['give-upgrade']) : ''; |
|
25 | + $step = isset($_GET['step']) ? absint($_GET['step']) : 1; |
|
26 | + $total = isset($_GET['total']) ? absint($_GET['total']) : false; |
|
27 | + $custom = isset($_GET['custom']) ? absint($_GET['custom']) : 0; |
|
28 | + $number = isset($_GET['number']) ? absint($_GET['number']) : 100; |
|
29 | + $steps = round(($total / $number), 0); |
|
30 | 30 | |
31 | 31 | $doing_upgrade_args = array( |
32 | 32 | 'page' => 'give-upgrades', |
@@ -36,25 +36,25 @@ discard block |
||
36 | 36 | 'custom' => $custom, |
37 | 37 | 'steps' => $steps |
38 | 38 | ); |
39 | - update_option( 'give_doing_upgrade', $doing_upgrade_args ); |
|
40 | - if ( $step > $steps ) { |
|
39 | + update_option('give_doing_upgrade', $doing_upgrade_args); |
|
40 | + if ($step > $steps) { |
|
41 | 41 | // Prevent a weird case where the estimate was off. Usually only a couple. |
42 | 42 | $steps = $step; |
43 | 43 | } |
44 | 44 | ?> |
45 | 45 | <div class="wrap"> |
46 | - <h2><?php _e( 'Give - Upgrades', 'give' ); ?></h2> |
|
46 | + <h2><?php _e('Give - Upgrades', 'give'); ?></h2> |
|
47 | 47 | |
48 | - <?php if ( ! empty( $action ) ) : ?> |
|
48 | + <?php if ( ! empty($action)) : ?> |
|
49 | 49 | |
50 | 50 | <div id="give-upgrade-status"> |
51 | - <p style="font-size: 20px;max-width: 900px;"><?php _e( 'The upgrade process has started, please be patient and do not close this window or navigate away from this page. This could take several minutes depending on the upgrade and the size of your website. You will be automatically redirected when the upgrade is finished.', 'give' ); ?> |
|
52 | - <img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/spinner.gif'; ?>" id="give-upgrade-loader" style=" position: relative; top: 3px; left: 6px;" /> |
|
51 | + <p style="font-size: 20px;max-width: 900px;"><?php _e('The upgrade process has started, please be patient and do not close this window or navigate away from this page. This could take several minutes depending on the upgrade and the size of your website. You will be automatically redirected when the upgrade is finished.', 'give'); ?> |
|
52 | + <img src="<?php echo GIVE_PLUGIN_URL.'/assets/images/spinner.gif'; ?>" id="give-upgrade-loader" style=" position: relative; top: 3px; left: 6px;" /> |
|
53 | 53 | </p> |
54 | 54 | |
55 | - <?php if ( ! empty( $total ) ) : ?> |
|
55 | + <?php if ( ! empty($total)) : ?> |
|
56 | 56 | <p> |
57 | - <strong><?php printf( __( 'Step %d of approximately %d running', 'give' ), $step, $steps ); ?></strong> |
|
57 | + <strong><?php printf(__('Step %d of approximately %d running', 'give'), $step, $steps); ?></strong> |
|
58 | 58 | </p> |
59 | 59 | <?php endif; ?> |
60 | 60 | </div> |
@@ -68,8 +68,8 @@ discard block |
||
68 | 68 | |
69 | 69 | <div id="give-upgrade-status"> |
70 | 70 | <p style="font-size: 20px;max-width: 900px;"> |
71 | - <?php _e( 'The upgrade process has started, please be patient and do not close this window or navigate away from this page. This could take several minutes depending on the upgrade and the size of your website. You will be automatically redirected when the upgrade is finished.', 'give' ); ?> |
|
72 | - <img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/spinner.gif'; ?>" id="give-upgrade-loader" style=" position: relative; top: 3px; left: 6px;" /> |
|
71 | + <?php _e('The upgrade process has started, please be patient and do not close this window or navigate away from this page. This could take several minutes depending on the upgrade and the size of your website. You will be automatically redirected when the upgrade is finished.', 'give'); ?> |
|
72 | + <img src="<?php echo GIVE_PLUGIN_URL.'/assets/images/spinner.gif'; ?>" id="give-upgrade-loader" style=" position: relative; top: 3px; left: 6px;" /> |
|
73 | 73 | </p> |
74 | 74 | </div> |
75 | 75 | <script type="text/javascript"> |
@@ -64,11 +64,14 @@ |
||
64 | 64 | }, 250 ); |
65 | 65 | </script> |
66 | 66 | |
67 | - <?php else : ?> |
|
67 | + <?php else { |
|
68 | + : ?> |
|
68 | 69 | |
69 | 70 | <div id="give-upgrade-status"> |
70 | 71 | <p style="font-size: 20px;max-width: 900px;"> |
71 | - <?php _e( 'The upgrade process has started, please be patient and do not close this window or navigate away from this page. This could take several minutes depending on the upgrade and the size of your website. You will be automatically redirected when the upgrade is finished.', 'give' ); ?> |
|
72 | + <?php _e( 'The upgrade process has started, please be patient and do not close this window or navigate away from this page. This could take several minutes depending on the upgrade and the size of your website. You will be automatically redirected when the upgrade is finished.', 'give' ); |
|
73 | +} |
|
74 | +?> |
|
72 | 75 | <img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/spinner.gif'; ?>" id="give-upgrade-loader" style=" position: relative; top: 3px; left: 6px;" /> |
73 | 76 | </p> |
74 | 77 | </div> |