@@ -67,10 +67,10 @@ discard block |
||
67 | 67 | // Make sure the keys are all set |
68 | 68 | $note = wp_parse_args( $note, $default_note ); |
69 | 69 | |
70 | - GFFormsModel::add_note( intval( $note['lead_id'] ), intval( $note['user_id'] ), esc_attr( $note['user_name'] ), $note['note'], esc_attr( $note['note_type'] ) ); |
|
70 | + GFFormsModel::add_note( intval( $note[ 'lead_id' ] ), intval( $note[ 'user_id' ] ), esc_attr( $note[ 'user_name' ] ), $note[ 'note' ], esc_attr( $note[ 'note_type' ] ) ); |
|
71 | 71 | |
72 | 72 | // If last_error is empty string, there was no error. |
73 | - if( empty( $wpdb->last_error ) ) { |
|
73 | + if ( empty( $wpdb->last_error ) ) { |
|
74 | 74 | $return = $wpdb->insert_id; |
75 | 75 | } else { |
76 | 76 | $return = new WP_Error( 'gravityview-add-note', $wpdb->last_error ); |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | */ |
97 | 97 | public static function delete_notes( $note_ids = array() ) { |
98 | 98 | |
99 | - if( !is_array( $note_ids ) ) { |
|
99 | + if ( ! is_array( $note_ids ) ) { |
|
100 | 100 | |
101 | 101 | do_action( 'gravityview_log_error', __METHOD__ . ' - Note IDs not an array. Not processing delete request.', $note_ids ); |
102 | 102 | |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | ) |
152 | 152 | ); |
153 | 153 | |
154 | - return $results ? $results[0] : false; |
|
154 | + return $results ? $results[ 0 ] : false; |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | /** |
@@ -164,8 +164,8 @@ discard block |
||
164 | 164 | */ |
165 | 165 | public static function filter_avatar( $avatar = '', $note ) { |
166 | 166 | |
167 | - if( 'gravityview' === $note->note_type && -1 === (int)$note->user_id ) { |
|
168 | - $avatar = sprintf( '<img src="%s" width="48" height="48" alt="GravityView" class="avatar avatar-48 gravityview-avatar" />', esc_url_raw( plugins_url( 'assets/images/floaty-avatar.png', GRAVITYVIEW_FILE ) ) ); |
|
167 | + if ( 'gravityview' === $note->note_type && -1 === (int)$note->user_id ) { |
|
168 | + $avatar = sprintf( '<img src="%s" width="48" height="48" alt="GravityView" class="avatar avatar-48 gravityview-avatar" />', esc_url_raw( plugins_url( 'assets/images/floaty-avatar.png', GRAVITYVIEW_FILE ) ) ); |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | return $avatar; |
@@ -21,10 +21,10 @@ |
||
21 | 21 | {email_fields} |
22 | 22 | |
23 | 23 | <div class="gv-note-content-container"> |
24 | - <label for="gv-note-content-{entry_slug}" class="screen-reader-text"><?php echo GravityView_Field_Notes::strings('content-label'); ?></label> |
|
24 | + <label for="gv-note-content-{entry_slug}" class="screen-reader-text"><?php echo GravityView_Field_Notes::strings( 'content-label' ); ?></label> |
|
25 | 25 | <textarea name="gv-note-content" id="gv-note-content-{entry_slug}"></textarea> |
26 | 26 | </div> |
27 | 27 | |
28 | - <button type="submit" class="button gv-add-note-submit"><?php echo GravityView_Field_Notes::strings('add-note'); ?></button> |
|
28 | + <button type="submit" class="button gv-add-note-submit"><?php echo GravityView_Field_Notes::strings( 'add-note' ); ?></button> |
|
29 | 29 | </div> |
30 | 30 | </form> |
31 | 31 | \ No newline at end of file |
@@ -21,7 +21,7 @@ |
||
21 | 21 | * @return string |
22 | 22 | */ |
23 | 23 | function get_field_desc() { |
24 | - return !empty( $this->field['desc'] ) ? $this->field['desc'] : ''; |
|
24 | + return ! empty( $this->field[ 'desc' ] ) ? $this->field[ 'desc' ] : ''; |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | } |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | } |
23 | 23 | |
24 | 24 | function render_input( $override_input = null ) { |
25 | - if( isset( $override_input ) ) { |
|
25 | + if ( isset( $override_input ) ) { |
|
26 | 26 | echo $override_input; |
27 | 27 | return; |
28 | 28 | } |
@@ -30,18 +30,18 @@ discard block |
||
30 | 30 | ?> |
31 | 31 | <ul class="gv-setting-list"> |
32 | 32 | <?php |
33 | - foreach( $this->field['options'] as $value => $label ) { ?> |
|
34 | - <li <?php if( isset( $label['requires'] ) ) { printf( 'class="gv-sub-setting" data-requires="%s"', $label['requires'] ); } ?>> |
|
33 | + foreach ( $this->field[ 'options' ] as $value => $label ) { ?> |
|
34 | + <li <?php if ( isset( $label[ 'requires' ] ) ) { printf( 'class="gv-sub-setting" data-requires="%s"', $label[ 'requires' ] ); } ?>> |
|
35 | 35 | <label> |
36 | 36 | <input name="<?php printf( '%s[%s]', esc_attr( $this->name ), esc_attr( $value ) ); ?>" type="hidden" |
37 | 37 | value="0"/> |
38 | 38 | <input name="<?php printf( '%s[%s]', esc_attr( $this->name ), esc_attr( $value ) ); ?>" |
39 | 39 | id="<?php echo $this->get_field_id(); ?>" type="checkbox" |
40 | 40 | value="1" <?php checked( ! empty( $this->value[ $value ] ) ); ?> /> |
41 | - <?php echo esc_html( $label['label'] ); ?> |
|
41 | + <?php echo esc_html( $label[ 'label' ] ); ?> |
|
42 | 42 | </label> |
43 | - <?php if( ! empty( $label['desc'] ) ) { |
|
44 | - printf( '<span class="howto">%s</span>', $label['desc'] ); |
|
43 | + <?php if ( ! empty( $label[ 'desc' ] ) ) { |
|
44 | + printf( '<span class="howto">%s</span>', $label[ 'desc' ] ); |
|
45 | 45 | } |
46 | 46 | ?> |
47 | 47 | </li> |
@@ -9,9 +9,9 @@ discard block |
||
9 | 9 | $gravityview_view = GravityView_View::getInstance(); |
10 | 10 | |
11 | 11 | $visibility_settings = $gravityview_view->getCurrentFieldSetting( 'notes' ); |
12 | -$show_notes_logged_out = ( ! empty( $visibility_settings['view'] ) && ! empty( $visibility_settings['view_loggedout'] ) ); |
|
12 | +$show_notes_logged_out = ( ! empty( $visibility_settings[ 'view' ] ) && ! empty( $visibility_settings[ 'view_loggedout' ] ) ); |
|
13 | 13 | |
14 | -if( ! GVCommon::has_cap( array( 'gravityview_view_entry_notes', 'gravityview_add_entry_notes', 'gravityview_delete_entry_notes' ) ) && ! $show_notes_logged_out ) { |
|
14 | +if ( ! GVCommon::has_cap( array( 'gravityview_view_entry_notes', 'gravityview_add_entry_notes', 'gravityview_delete_entry_notes' ) ) && ! $show_notes_logged_out ) { |
|
15 | 15 | return; |
16 | 16 | } |
17 | 17 | |
@@ -25,20 +25,20 @@ discard block |
||
25 | 25 | do_action( 'gravityview/field/notes/scripts' ); |
26 | 26 | |
27 | 27 | $entry = $gravityview_view->getCurrentEntry(); |
28 | -$notes = GravityView_Entry_Notes::get_notes( $entry['id'] ); |
|
28 | +$notes = GravityView_Entry_Notes::get_notes( $entry[ 'id' ] ); |
|
29 | 29 | $strings = GravityView_Field_Notes::strings(); |
30 | -$entry_slug = GravityView_API::get_entry_slug( $entry['id'], $entry ); |
|
30 | +$entry_slug = GravityView_API::get_entry_slug( $entry[ 'id' ], $entry ); |
|
31 | 31 | |
32 | -$show_add = ! empty( $visibility_settings['add'] ); |
|
33 | -$show_delete = ( ! empty( $visibility_settings['delete'] ) && GVCommon::has_cap( 'gravityview_delete_entry_notes' ) ); |
|
34 | -$show_notes = $show_notes_logged_out || ( ! empty( $visibility_settings['view'] ) && GVCommon::has_cap( 'gravityview_view_entry_notes' ) ); |
|
32 | +$show_add = ! empty( $visibility_settings[ 'add' ] ); |
|
33 | +$show_delete = ( ! empty( $visibility_settings[ 'delete' ] ) && GVCommon::has_cap( 'gravityview_delete_entry_notes' ) ); |
|
34 | +$show_notes = $show_notes_logged_out || ( ! empty( $visibility_settings[ 'view' ] ) && GVCommon::has_cap( 'gravityview_view_entry_notes' ) ); |
|
35 | 35 | |
36 | 36 | $container_class = ( sizeof( $notes ) > 0 ? 'gv-has-notes' : 'gv-no-notes' ); |
37 | 37 | $container_class .= $show_notes ? ' gv-show-notes' : ' gv-hide-notes'; |
38 | 38 | ?> |
39 | 39 | <div class="gv-notes <?php echo $container_class; ?>"> |
40 | 40 | <?php |
41 | - if( $show_notes ) { |
|
41 | + if ( $show_notes ) { |
|
42 | 42 | ?> |
43 | 43 | <form method="post" class="gv-notes-list"> |
44 | 44 | <?php if ( $show_delete ) { wp_nonce_field( 'gv_delete_notes_' . $entry_slug, 'gv_delete_notes' ); } ?> |
@@ -46,21 +46,21 @@ discard block |
||
46 | 46 | <input type="hidden" name="action" value="gv_delete_notes" /> |
47 | 47 | <input type="hidden" name="entry-slug" value="<?php echo esc_attr( $entry_slug ); ?>" /> |
48 | 48 | <table> |
49 | - <caption><?php echo $strings['caption']; ?></caption> |
|
49 | + <caption><?php echo $strings[ 'caption' ]; ?></caption> |
|
50 | 50 | <?php |
51 | 51 | if ( $show_delete ) { |
52 | 52 | ?> |
53 | 53 | <thead> |
54 | 54 | <tr> |
55 | 55 | <th colspan="2"> |
56 | - <label><input type="checkbox" value="" class="gv-notes-toggle" title="<?php echo $strings['toggle-notes']; ?>"><span class="screen-reader-text"><?php echo $strings['toggle-notes']; ?></span></label> |
|
57 | - <button type="submit" class="button button-small gv-notes-delete"><?php echo $strings['delete']; ?></button> |
|
56 | + <label><input type="checkbox" value="" class="gv-notes-toggle" title="<?php echo $strings[ 'toggle-notes' ]; ?>"><span class="screen-reader-text"><?php echo $strings[ 'toggle-notes' ]; ?></span></label> |
|
57 | + <button type="submit" class="button button-small gv-notes-delete"><?php echo $strings[ 'delete' ]; ?></button> |
|
58 | 58 | </th> |
59 | 59 | </tr> |
60 | 60 | </thead> |
61 | 61 | <?php } ?> |
62 | 62 | <tbody> |
63 | - <tr class="gv-notes-no-notes"><td colspan="2"><?php echo $strings['no-notes']; ?></td></tr> |
|
63 | + <tr class="gv-notes-no-notes"><td colspan="2"><?php echo $strings[ 'no-notes' ]; ?></td></tr> |
|
64 | 64 | <?php |
65 | 65 | foreach ( $notes as $note ) { |
66 | 66 | echo GravityView_Field_Notes::display_note( $note, $show_delete ); |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | <?php |
74 | 74 | } // End if can view notes |
75 | 75 | |
76 | - if( $show_add ) { |
|
76 | + if ( $show_add ) { |
|
77 | 77 | echo do_shortcode( '[gv_note_add]' ); |
78 | 78 | } |
79 | 79 | ?> |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | $signature_fields = GFAPI::get_fields_by_type( $form, 'signature' ); |
54 | 54 | |
55 | 55 | foreach ( $signature_fields as $field ) { |
56 | - unset( $_POST["input_{$field->id}"] ); |
|
56 | + unset( $_POST[ "input_{$field->id}" ] ); |
|
57 | 57 | } |
58 | 58 | } |
59 | 59 | |
@@ -72,19 +72,19 @@ discard block |
||
72 | 72 | */ |
73 | 73 | function edit_entry_field_input( $field_content = '', $field, $value = '', $lead_id = 0, $form_id = 0 ) { |
74 | 74 | |
75 | - $context = function_exists('gravityview_get_context') ? gravityview_get_context() : ''; |
|
75 | + $context = function_exists( 'gravityview_get_context' ) ? gravityview_get_context() : ''; |
|
76 | 76 | |
77 | - if( 'signature' !== $field->type || 'edit' !== $context ) { |
|
77 | + if ( 'signature' !== $field->type || 'edit' !== $context ) { |
|
78 | 78 | return $field_content; |
79 | 79 | } |
80 | 80 | |
81 | 81 | // We need to fetch a fresh version of the entry, since the saved entry hasn't refreshed in GV yet. |
82 | 82 | $entry = GravityView_View::getInstance()->getCurrentEntry(); |
83 | - $entry = GFAPI::get_entry( $entry['id'] ); |
|
83 | + $entry = GFAPI::get_entry( $entry[ 'id' ] ); |
|
84 | 84 | $entry_value = rgar( $entry, $field->id ); |
85 | 85 | |
86 | - $_POST["input_{$field->id}"] = $entry_value; // Used when Edit Entry form *is* submitted |
|
87 | - $_POST["input_{$form_id}_{$field->id}_signature_filename"] = $entry_value; // Used when Edit Entry form *is not* submitted |
|
86 | + $_POST[ "input_{$field->id}" ] = $entry_value; // Used when Edit Entry form *is* submitted |
|
87 | + $_POST[ "input_{$form_id}_{$field->id}_signature_filename" ] = $entry_value; // Used when Edit Entry form *is not* submitted |
|
88 | 88 | |
89 | 89 | return ''; // Return empty string to force using $_POST values instead |
90 | 90 | } |
@@ -50,7 +50,7 @@ |
||
50 | 50 | */ |
51 | 51 | public function if_gravityview_return_true( $has_content = false ) { |
52 | 52 | |
53 | - if( ! class_exists( 'GravityView_frontend' ) ) { |
|
53 | + if ( ! class_exists( 'GravityView_frontend' ) ) { |
|
54 | 54 | return $has_content; |
55 | 55 | } |
56 | 56 |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | $gv_modifiers = array( |
54 | 54 | 'maxwords:(\d+)' => 'modifier_maxwords', /** @see modifier_maxwords */ |
55 | 55 | 'wpautop' => 'modifier_wpautop', /** @see modifier_wpautop */ |
56 | - 'timestamp' => 'modifier_timestamp', /** @see modifier_timestamp */ |
|
56 | + 'timestamp' => 'modifier_timestamp', /** @see modifier_timestamp */ |
|
57 | 57 | ); |
58 | 58 | |
59 | 59 | $return = $value; |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | |
254 | 254 | $atts = array( |
255 | 255 | 'format' => self::get_format_from_modifiers( $exploded, false ), |
256 | - 'human' => in_array( 'human', $exploded ), // {date_created:human} |
|
256 | + 'human' => in_array( 'human', $exploded ), // {date_created:human} |
|
257 | 257 | 'diff' => in_array( 'diff', $exploded ), // {date_created:diff} |
258 | 258 | 'raw' => in_array( 'raw', $exploded ), // {date_created:raw} |
259 | 259 | 'timestamp' => in_array( 'timestamp', $exploded ), // {date_created:timestamp} |
@@ -216,7 +216,7 @@ |
||
216 | 216 | * @param bool $url_encode Whether to URL-encode output |
217 | 217 | * @param bool $esc_html Whether to apply `esc_html()` to output |
218 | 218 | * |
219 | - * @return mixed |
|
219 | + * @return string |
|
220 | 220 | */ |
221 | 221 | public static function replace_gv_merge_tags( $text, $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) { |
222 | 222 |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | public static function process_modifiers( $value, $merge_tag, $modifier, $field, $raw_value ) { |
46 | 46 | |
47 | 47 | // No modifier was set or the raw value was empty |
48 | - if( 'all_fields' === $merge_tag || '' === $modifier || ! is_string( $raw_value ) || '' === $raw_value ) { |
|
48 | + if ( 'all_fields' === $merge_tag || '' === $modifier || ! is_string( $raw_value ) || '' === $raw_value ) { |
|
49 | 49 | return $value; |
50 | 50 | } |
51 | 51 | |
@@ -61,9 +61,9 @@ discard block |
||
61 | 61 | foreach ( $gv_modifiers as $gv_modifier => $method ) { |
62 | 62 | |
63 | 63 | // Only match the regex if it's the first modifer; this allows us to enforce our own modifier structure |
64 | - preg_match( '/^' . $gv_modifier .'/ism', $modifier, $matches ); |
|
64 | + preg_match( '/^' . $gv_modifier . '/ism', $modifier, $matches ); |
|
65 | 65 | |
66 | - if( ! empty( $matches ) ) { |
|
66 | + if ( ! empty( $matches ) ) { |
|
67 | 67 | // The called method is passed the raw value and the full matches array |
68 | 68 | $return = self::$method( $raw_value, $matches ); |
69 | 69 | break; |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | */ |
88 | 88 | private static function modifier_timestamp( $raw_value, $matches ) { |
89 | 89 | |
90 | - if( empty( $matches[0] ) ) { |
|
90 | + if ( empty( $matches[ 0 ] ) ) { |
|
91 | 91 | return $raw_value; |
92 | 92 | } |
93 | 93 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | */ |
112 | 112 | private static function modifier_wpautop( $raw_value, $matches ) { |
113 | 113 | |
114 | - if( empty( $matches[0] ) || ! function_exists( 'wpautop' ) ) { |
|
114 | + if ( empty( $matches[ 0 ] ) || ! function_exists( 'wpautop' ) ) { |
|
115 | 115 | return $raw_value; |
116 | 116 | } |
117 | 117 | |
@@ -135,11 +135,11 @@ discard block |
||
135 | 135 | */ |
136 | 136 | private static function modifier_maxwords( $raw_value, $matches ) { |
137 | 137 | |
138 | - if( ! is_string( $raw_value ) || empty( $matches[1] ) || ! function_exists( 'wp_trim_words' ) ) { |
|
138 | + if ( ! is_string( $raw_value ) || empty( $matches[ 1 ] ) || ! function_exists( 'wp_trim_words' ) ) { |
|
139 | 139 | return $raw_value; |
140 | 140 | } |
141 | 141 | |
142 | - $max = intval( $matches[1] ); |
|
142 | + $max = intval( $matches[ 1 ] ); |
|
143 | 143 | |
144 | 144 | $more_placeholder = '[GVMORE]'; |
145 | 145 | |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | * @param bool $esc_html Pass return value through `esc_html()` |
172 | 172 | * @return string Text with variables maybe replaced |
173 | 173 | */ |
174 | - public static function replace_variables($text, $form = array(), $entry = array(), $url_encode = false, $esc_html = true ) { |
|
174 | + public static function replace_variables( $text, $form = array(), $entry = array(), $url_encode = false, $esc_html = true ) { |
|
175 | 175 | |
176 | 176 | /** |
177 | 177 | * @filter `gravityview_do_replace_variables` Turn off merge tag variable replacements.\n |
@@ -196,9 +196,9 @@ discard block |
||
196 | 196 | * @internal Fixed $form['title'] in Gravity Forms |
197 | 197 | * @see https://github.com/gravityforms/gravityforms/pull/27/files |
198 | 198 | */ |
199 | - $form['title'] = isset( $form['title'] ) ? $form['title'] : ''; |
|
200 | - $form['id'] = isset( $form['id'] ) ? $form['id'] : ''; |
|
201 | - $form['fields'] = isset( $form['fields'] ) ? $form['fields'] : array(); |
|
199 | + $form[ 'title' ] = isset( $form[ 'title' ] ) ? $form[ 'title' ] : ''; |
|
200 | + $form[ 'id' ] = isset( $form[ 'id' ] ) ? $form[ 'id' ] : ''; |
|
201 | + $form[ 'fields' ] = isset( $form[ 'fields' ] ) ? $form[ 'fields' ] : array(); |
|
202 | 202 | |
203 | 203 | return GFCommon::replace_variables( $text, $form, $entry, $url_encode, $esc_html ); |
204 | 204 | } |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | */ |
221 | 221 | public static function replace_gv_merge_tags( $text, $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) { |
222 | 222 | |
223 | - if( '' === $text ) { |
|
223 | + if ( '' === $text ) { |
|
224 | 224 | return $text; |
225 | 225 | } |
226 | 226 | |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | * @see GFCommon::replace_variables_prepopulate() |
231 | 231 | * @todo Remove eventually: Gravity Forms fixed this issue in 1.9.14 |
232 | 232 | */ |
233 | - if( false === $form ) { |
|
233 | + if ( false === $form ) { |
|
234 | 234 | return $text; |
235 | 235 | } |
236 | 236 | |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | 'diff' => in_array( 'diff', $exploded ), // {date_created:diff} |
265 | 265 | 'raw' => in_array( 'raw', $exploded ), // {date_created:raw} |
266 | 266 | 'timestamp' => in_array( 'timestamp', $exploded ), // {date_created:timestamp} |
267 | - 'time' => in_array( 'time', $exploded ), // {date_created:time} |
|
267 | + 'time' => in_array( 'time', $exploded ), // {date_created:time} |
|
268 | 268 | ); |
269 | 269 | |
270 | 270 | $formatted_date = GVCommon::format_date( $date_created, $atts ); |
@@ -341,8 +341,8 @@ discard block |
||
341 | 341 | return $original_text; |
342 | 342 | } |
343 | 343 | |
344 | - foreach ( (array) $matches as $match ) { |
|
345 | - $full_tag = $match[0]; |
|
344 | + foreach ( (array)$matches as $match ) { |
|
345 | + $full_tag = $match[ 0 ]; |
|
346 | 346 | $modifier = rgar( $match, 2, 'permalink' ); |
347 | 347 | |
348 | 348 | $replacement = false; |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | $replacement = esc_html( $replacement ); |
361 | 361 | } |
362 | 362 | |
363 | - if( $url_encode ) { |
|
363 | + if ( $url_encode ) { |
|
364 | 364 | $replacement = urlencode( $replacement ); |
365 | 365 | } |
366 | 366 | |
@@ -400,14 +400,14 @@ discard block |
||
400 | 400 | preg_match_all( "/{get:(.*?)}/ism", $text, $matches, PREG_SET_ORDER ); |
401 | 401 | |
402 | 402 | // If there are no matches OR the Entry `created_by` isn't set or is 0 (no user) |
403 | - if( empty( $matches ) ) { |
|
403 | + if ( empty( $matches ) ) { |
|
404 | 404 | return $text; |
405 | 405 | } |
406 | 406 | |
407 | 407 | foreach ( $matches as $match ) { |
408 | 408 | |
409 | - $full_tag = $match[0]; |
|
410 | - $property = $match[1]; |
|
409 | + $full_tag = $match[ 0 ]; |
|
410 | + $property = $match[ 1 ]; |
|
411 | 411 | |
412 | 412 | $value = stripslashes_deep( rgget( $property ) ); |
413 | 413 | |
@@ -431,7 +431,7 @@ discard block |
||
431 | 431 | * @since 1.15 |
432 | 432 | * @param bool $esc_html Whether to esc_html() the value. Default: `true` |
433 | 433 | */ |
434 | - $esc_html = apply_filters('gravityview/merge_tags/get/esc_html/' . $property, true ); |
|
434 | + $esc_html = apply_filters( 'gravityview/merge_tags/get/esc_html/' . $property, true ); |
|
435 | 435 | |
436 | 436 | $value = $esc_html ? esc_html( $value ) : $value; |
437 | 437 | |
@@ -442,7 +442,7 @@ discard block |
||
442 | 442 | * @param[in] array $form Gravity Forms form array |
443 | 443 | * @param[in] array $entry Entry array |
444 | 444 | */ |
445 | - $value = apply_filters('gravityview/merge_tags/get/value/' . $property, $value, $text, $form, $entry ); |
|
445 | + $value = apply_filters( 'gravityview/merge_tags/get/value/' . $property, $value, $text, $form, $entry ); |
|
446 | 446 | |
447 | 447 | $text = str_replace( $full_tag, $value, $text ); |
448 | 448 | } |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | */ |
19 | 19 | public function __construct() { |
20 | 20 | |
21 | - if( ! is_admin() ) { return; } |
|
21 | + if ( ! is_admin() ) { return; } |
|
22 | 22 | |
23 | 23 | $this->add_hooks(); |
24 | 24 | } |
@@ -32,13 +32,13 @@ discard block |
||
32 | 32 | */ |
33 | 33 | private function add_hooks() { |
34 | 34 | //Hooks for no-conflict functionality |
35 | - add_action( 'wp_print_scripts', array( $this, 'no_conflict_scripts' ), 1000); |
|
36 | - add_action( 'admin_print_footer_scripts', array( $this, 'no_conflict_scripts' ), 9); |
|
35 | + add_action( 'wp_print_scripts', array( $this, 'no_conflict_scripts' ), 1000 ); |
|
36 | + add_action( 'admin_print_footer_scripts', array( $this, 'no_conflict_scripts' ), 9 ); |
|
37 | 37 | |
38 | - add_action( 'wp_print_styles', array( $this, 'no_conflict_styles' ), 1000); |
|
39 | - add_action( 'admin_print_styles', array( $this, 'no_conflict_styles' ), 11); |
|
40 | - add_action( 'admin_print_footer_scripts', array( $this, 'no_conflict_styles' ), 1); |
|
41 | - add_action( 'admin_footer', array( $this, 'no_conflict_styles' ), 1); |
|
38 | + add_action( 'wp_print_styles', array( $this, 'no_conflict_styles' ), 1000 ); |
|
39 | + add_action( 'admin_print_styles', array( $this, 'no_conflict_styles' ), 11 ); |
|
40 | + add_action( 'admin_print_footer_scripts', array( $this, 'no_conflict_styles' ), 1 ); |
|
41 | + add_action( 'admin_footer', array( $this, 'no_conflict_styles' ), 1 ); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -51,13 +51,13 @@ discard block |
||
51 | 51 | function no_conflict_scripts() { |
52 | 52 | global $wp_scripts; |
53 | 53 | |
54 | - if( ! gravityview_is_admin_page() ) { |
|
54 | + if ( ! gravityview_is_admin_page() ) { |
|
55 | 55 | return; |
56 | 56 | } |
57 | 57 | |
58 | - $no_conflict_mode = GravityView_Settings::getSetting('no-conflict-mode'); |
|
58 | + $no_conflict_mode = GravityView_Settings::getSetting( 'no-conflict-mode' ); |
|
59 | 59 | |
60 | - if( empty( $no_conflict_mode ) ) { |
|
60 | + if ( empty( $no_conflict_mode ) ) { |
|
61 | 61 | return; |
62 | 62 | } |
63 | 63 | |
@@ -110,24 +110,24 @@ discard block |
||
110 | 110 | function no_conflict_styles() { |
111 | 111 | global $wp_styles; |
112 | 112 | |
113 | - if( ! gravityview_is_admin_page() ) { |
|
113 | + if ( ! gravityview_is_admin_page() ) { |
|
114 | 114 | return; |
115 | 115 | } |
116 | 116 | |
117 | 117 | // Dequeue other jQuery styles even if no-conflict is off. |
118 | 118 | // Terrible-looking tabs help no one. |
119 | - if( !empty( $wp_styles->registered ) ) { |
|
120 | - foreach ($wp_styles->registered as $key => $style) { |
|
121 | - if( preg_match( '/^(?:wp\-)?jquery/ism', $key ) ) { |
|
119 | + if ( ! empty( $wp_styles->registered ) ) { |
|
120 | + foreach ( $wp_styles->registered as $key => $style ) { |
|
121 | + if ( preg_match( '/^(?:wp\-)?jquery/ism', $key ) ) { |
|
122 | 122 | wp_dequeue_style( $key ); |
123 | 123 | } |
124 | 124 | } |
125 | 125 | } |
126 | 126 | |
127 | - $no_conflict_mode = GravityView_Settings::getSetting('no-conflict-mode'); |
|
127 | + $no_conflict_mode = GravityView_Settings::getSetting( 'no-conflict-mode' ); |
|
128 | 128 | |
129 | 129 | // If no conflict is off, jQuery will suffice. |
130 | - if( empty( $no_conflict_mode ) ) { |
|
130 | + if ( empty( $no_conflict_mode ) ) { |
|
131 | 131 | return; |
132 | 132 | } |
133 | 133 | |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | /** |
155 | 155 | * @action `gravityview_remove_conflicts_after` Runs after no-conflict styles are removed. You can re-add styles here. |
156 | 156 | */ |
157 | - do_action('gravityview_remove_conflicts_after'); |
|
157 | + do_action( 'gravityview_remove_conflicts_after' ); |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | /** |
@@ -178,9 +178,9 @@ discard block |
||
178 | 178 | |
179 | 179 | //reset queue |
180 | 180 | $queue = array(); |
181 | - foreach( $wp_objects->queue as $object ) { |
|
182 | - if( in_array( $object, $required_objects ) || preg_match('/gravityview|gf_|gravityforms/ism', $object ) ) { |
|
183 | - $queue[] = $object; |
|
181 | + foreach ( $wp_objects->queue as $object ) { |
|
182 | + if ( in_array( $object, $required_objects ) || preg_match( '/gravityview|gf_|gravityforms/ism', $object ) ) { |
|
183 | + $queue[ ] = $object; |
|
184 | 184 | } |
185 | 185 | } |
186 | 186 | $wp_objects->queue = $queue; |
@@ -189,8 +189,8 @@ discard block |
||
189 | 189 | |
190 | 190 | //unregistering scripts |
191 | 191 | $registered = array(); |
192 | - foreach( $wp_objects->registered as $handle => $script_registration ){ |
|
193 | - if( in_array( $handle, $required_objects ) ){ |
|
192 | + foreach ( $wp_objects->registered as $handle => $script_registration ) { |
|
193 | + if ( in_array( $handle, $required_objects ) ) { |
|
194 | 194 | $registered[ $handle ] = $script_registration; |
195 | 195 | } |
196 | 196 | } |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | * @param array $registered [description] |
206 | 206 | * @param array $scripts [description] |
207 | 207 | */ |
208 | - private function add_script_dependencies($registered, $scripts) { |
|
208 | + private function add_script_dependencies( $registered, $scripts ) { |
|
209 | 209 | |
210 | 210 | //gets all dependent scripts linked to the $scripts array passed |
211 | 211 | do { |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | $deps = isset( $registered[ $script ] ) && is_array( $registered[ $script ]->deps ) ? $registered[ $script ]->deps : array(); |
215 | 215 | foreach ( $deps as $dep ) { |
216 | 216 | if ( ! in_array( $dep, $scripts ) && ! in_array( $dep, $dependents ) ) { |
217 | - $dependents[] = $dep; |
|
217 | + $dependents[ ] = $dep; |
|
218 | 218 | } |
219 | 219 | } |
220 | 220 | } |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | |
117 | 117 | // Dequeue other jQuery styles even if no-conflict is off. |
118 | 118 | // Terrible-looking tabs help no one. |
119 | - if( !empty( $wp_styles->registered ) ) { |
|
119 | + if( !empty( $wp_styles->registered ) ) { |
|
120 | 120 | foreach ($wp_styles->registered as $key => $style) { |
121 | 121 | if( preg_match( '/^(?:wp\-)?jquery/ism', $key ) ) { |
122 | 122 | wp_dequeue_style( $key ); |
@@ -189,8 +189,8 @@ discard block |
||
189 | 189 | |
190 | 190 | //unregistering scripts |
191 | 191 | $registered = array(); |
192 | - foreach( $wp_objects->registered as $handle => $script_registration ){ |
|
193 | - if( in_array( $handle, $required_objects ) ){ |
|
192 | + foreach( $wp_objects->registered as $handle => $script_registration ) { |
|
193 | + if( in_array( $handle, $required_objects ) ) { |
|
194 | 194 | $registered[ $handle ] = $script_registration; |
195 | 195 | } |
196 | 196 | } |