@@ -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 | |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | * @param array $aux_data Additional data to be used to replace merge tags {@see https://www.gravityhelp.com/documentation/article/gform_merge_tag_data/} |
| 176 | 176 | * @return string Text with variables maybe replaced |
| 177 | 177 | */ |
| 178 | - public static function replace_variables($text, $form = array(), $entry = array(), $url_encode = false, $esc_html = true, $nl2br = true, $format = 'html', $aux_data = array() ) { |
|
| 178 | + public static function replace_variables( $text, $form = array(), $entry = array(), $url_encode = false, $esc_html = true, $nl2br = true, $format = 'html', $aux_data = array() ) { |
|
| 179 | 179 | |
| 180 | 180 | /** |
| 181 | 181 | * @filter `gravityview_do_replace_variables` Turn off merge tag variable replacements.\n |
@@ -200,9 +200,9 @@ discard block |
||
| 200 | 200 | * @internal Fixed $form['title'] in Gravity Forms |
| 201 | 201 | * @see https://github.com/gravityforms/gravityforms/pull/27/files |
| 202 | 202 | */ |
| 203 | - $form['title'] = isset( $form['title'] ) ? $form['title'] : ''; |
|
| 204 | - $form['id'] = isset( $form['id'] ) ? $form['id'] : ''; |
|
| 205 | - $form['fields'] = isset( $form['fields'] ) ? $form['fields'] : array(); |
|
| 203 | + $form[ 'title' ] = isset( $form[ 'title' ] ) ? $form[ 'title' ] : ''; |
|
| 204 | + $form[ 'id' ] = isset( $form[ 'id' ] ) ? $form[ 'id' ] : ''; |
|
| 205 | + $form[ 'fields' ] = isset( $form[ 'fields' ] ) ? $form[ 'fields' ] : array(); |
|
| 206 | 206 | |
| 207 | 207 | return GFCommon::replace_variables( $text, $form, $entry, $url_encode, $esc_html, $nl2br, $format, $aux_data ); |
| 208 | 208 | } |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | */ |
| 225 | 225 | public static function replace_gv_merge_tags( $text, $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) { |
| 226 | 226 | |
| 227 | - if( '' === $text ) { |
|
| 227 | + if ( '' === $text ) { |
|
| 228 | 228 | return $text; |
| 229 | 229 | } |
| 230 | 230 | |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | * @see GFCommon::replace_variables_prepopulate() |
| 235 | 235 | * @todo Remove eventually: Gravity Forms fixed this issue in 1.9.14 |
| 236 | 236 | */ |
| 237 | - if( false === $form ) { |
|
| 237 | + if ( false === $form ) { |
|
| 238 | 238 | return $text; |
| 239 | 239 | } |
| 240 | 240 | |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | 'diff' => in_array( 'diff', $exploded ), // {date_created:diff} |
| 269 | 269 | 'raw' => in_array( 'raw', $exploded ), // {date_created:raw} |
| 270 | 270 | 'timestamp' => in_array( 'timestamp', $exploded ), // {date_created:timestamp} |
| 271 | - 'time' => in_array( 'time', $exploded ), // {date_created:time} |
|
| 271 | + 'time' => in_array( 'time', $exploded ), // {date_created:time} |
|
| 272 | 272 | ); |
| 273 | 273 | |
| 274 | 274 | $formatted_date = GVCommon::format_date( $date_created, $atts ); |
@@ -345,8 +345,8 @@ discard block |
||
| 345 | 345 | return $original_text; |
| 346 | 346 | } |
| 347 | 347 | |
| 348 | - foreach ( (array) $matches as $match ) { |
|
| 349 | - $full_tag = $match[0]; |
|
| 348 | + foreach ( (array)$matches as $match ) { |
|
| 349 | + $full_tag = $match[ 0 ]; |
|
| 350 | 350 | $modifier = rgar( $match, 2, 'permalink' ); |
| 351 | 351 | |
| 352 | 352 | $replacement = false; |
@@ -364,7 +364,7 @@ discard block |
||
| 364 | 364 | $replacement = esc_html( $replacement ); |
| 365 | 365 | } |
| 366 | 366 | |
| 367 | - if( $url_encode ) { |
|
| 367 | + if ( $url_encode ) { |
|
| 368 | 368 | $replacement = urlencode( $replacement ); |
| 369 | 369 | } |
| 370 | 370 | |
@@ -404,14 +404,14 @@ discard block |
||
| 404 | 404 | preg_match_all( "/{get:(.*?)}/ism", $text, $matches, PREG_SET_ORDER ); |
| 405 | 405 | |
| 406 | 406 | // If there are no matches OR the Entry `created_by` isn't set or is 0 (no user) |
| 407 | - if( empty( $matches ) ) { |
|
| 407 | + if ( empty( $matches ) ) { |
|
| 408 | 408 | return $text; |
| 409 | 409 | } |
| 410 | 410 | |
| 411 | 411 | foreach ( $matches as $match ) { |
| 412 | 412 | |
| 413 | - $full_tag = $match[0]; |
|
| 414 | - $property = $match[1]; |
|
| 413 | + $full_tag = $match[ 0 ]; |
|
| 414 | + $property = $match[ 1 ]; |
|
| 415 | 415 | |
| 416 | 416 | $value = stripslashes_deep( rgget( $property ) ); |
| 417 | 417 | |
@@ -435,7 +435,7 @@ discard block |
||
| 435 | 435 | * @since 1.15 |
| 436 | 436 | * @param bool $esc_html Whether to esc_html() the value. Default: `true` |
| 437 | 437 | */ |
| 438 | - $esc_html = apply_filters('gravityview/merge_tags/get/esc_html/' . $property, true ); |
|
| 438 | + $esc_html = apply_filters( 'gravityview/merge_tags/get/esc_html/' . $property, true ); |
|
| 439 | 439 | |
| 440 | 440 | $value = $esc_html ? esc_html( $value ) : $value; |
| 441 | 441 | |
@@ -446,7 +446,7 @@ discard block |
||
| 446 | 446 | * @param[in] array $form Gravity Forms form array |
| 447 | 447 | * @param[in] array $entry Entry array |
| 448 | 448 | */ |
| 449 | - $value = apply_filters('gravityview/merge_tags/get/value/' . $property, $value, $text, $form, $entry ); |
|
| 449 | + $value = apply_filters( 'gravityview/merge_tags/get/value/' . $property, $value, $text, $form, $entry ); |
|
| 450 | 450 | |
| 451 | 451 | $text = str_replace( $full_tag, $value, $text ); |
| 452 | 452 | } |
@@ -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 | } |
@@ -19,12 +19,12 @@ |
||
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | function render_input( $override_input = null ) { |
| 22 | - if( isset( $override_input ) ) { |
|
| 22 | + if ( isset( $override_input ) ) { |
|
| 23 | 23 | echo $override_input; |
| 24 | 24 | return; |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | - foreach( $this->field['options'] as $value => $label ) : ?> |
|
| 27 | + foreach ( $this->field[ 'options' ] as $value => $label ) : ?> |
|
| 28 | 28 | <label class="<?php echo $this->get_label_class(); ?>"> |
| 29 | 29 | <input name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>-<?php echo esc_attr( $value ); ?>" type="radio" value="<?php echo esc_attr( $value ); ?>" <?php checked( $value, $this->value, true ); ?> /> <?php echo esc_html( $label ); ?> |
| 30 | 30 | </label> |