@@ -52,13 +52,13 @@ discard block |
||
52 | 52 | * |
53 | 53 | * @return array Blocklist, with "total" added. If not edit context, original field blocklist. Otherwise, blocklist including total. |
54 | 54 | */ |
55 | - public function add_to_blocklist( $blocklist = array(), $context = NULL ){ |
|
55 | + public function add_to_blocklist( $blocklist = array(), $context = NULL ) { |
|
56 | 56 | |
57 | - if( empty( $context ) || $context !== 'edit' ) { |
|
57 | + if ( empty( $context ) || $context !== 'edit' ) { |
|
58 | 58 | return $blocklist; |
59 | 59 | } |
60 | 60 | |
61 | - $blocklist[] = 'total'; |
|
61 | + $blocklist[ ] = 'total'; |
|
62 | 62 | |
63 | 63 | return $blocklist; |
64 | 64 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | */ |
77 | 77 | function edit_entry_recalculate_totals( $form = array(), $entry_id = 0, $Edit_Entry_Render = null ) { |
78 | 78 | |
79 | - $original_form = GFAPI::get_form( $form['id'] ); |
|
79 | + $original_form = GFAPI::get_form( $form[ 'id' ] ); |
|
80 | 80 | |
81 | 81 | $total_fields = GFCommon::get_fields_by_type( $original_form, 'total' ); |
82 | 82 | |
@@ -87,12 +87,12 @@ discard block |
||
87 | 87 | |
88 | 88 | /** @type GF_Field_Total $total_field */ |
89 | 89 | foreach ( $total_fields as $total_field ) { |
90 | - $entry["{$total_field->id}"] = GFCommon::get_order_total( $original_form, $entry ); |
|
90 | + $entry[ "{$total_field->id}" ] = GFCommon::get_order_total( $original_form, $entry ); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | $return_entry = GFAPI::update_entry( $entry ); |
94 | 94 | |
95 | - if( is_wp_error( $return_entry ) ) { |
|
95 | + if ( is_wp_error( $return_entry ) ) { |
|
96 | 96 | gravityview()->log->error( 'Updating the entry total fields failed', array( 'data' => $return_entry ) ); |
97 | 97 | } else { |
98 | 98 | gravityview()->log->debug( 'Updating the entry total fields succeeded' ); |
@@ -49,8 +49,8 @@ |
||
49 | 49 | public function blocklist_field_types( $field_types = array(), $context = '' ) { |
50 | 50 | |
51 | 51 | // Allow Calculation field in Edit Entry |
52 | - if( 'edit' !== $context ) { |
|
53 | - $field_types[] = $this->name; |
|
52 | + if ( 'edit' !== $context ) { |
|
53 | + $field_types[ ] = $this->name; |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | return $field_types; |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | */ |
54 | 54 | $hide_coupon_fields = apply_filters( 'gravityview/edit_entry/hide-coupon-fields', $has_transaction_data ); |
55 | 55 | |
56 | - return (bool) $hide_coupon_fields; |
|
56 | + return (bool)$hide_coupon_fields; |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | public function edit_entry_field_blocklist( $blocklist = array(), $entry = array() ) { |
79 | 79 | |
80 | 80 | if ( $this->should_hide_coupon_fields( $entry ) ) { |
81 | - $blocklist[] = 'coupon'; |
|
81 | + $blocklist[ ] = 'coupon'; |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | return $blocklist; |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | // No coupons match the codes provided |
117 | 117 | $discounts = gf_coupons()->get_coupons_by_codes( $coupon_codes, $form ); |
118 | 118 | |
119 | - if( ! $discounts ) { |
|
119 | + if ( ! $discounts ) { |
|
120 | 120 | return $value; |
121 | 121 | } |
122 | 122 | |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | * @see GF_Field_Coupon::get_field_input |
126 | 126 | */ |
127 | 127 | $_POST = ! isset( $_POST ) ? array() : $_POST; |
128 | - $_POST[ 'gf_coupons_' . $form['id'] ] = json_encode( (array) $discounts ); |
|
128 | + $_POST[ 'gf_coupons_' . $form[ 'id' ] ] = json_encode( (array)$discounts ); |
|
129 | 129 | $_POST[ 'input_' . $field->id ] = implode( ',', $coupon_codes ); |
130 | 130 | |
131 | 131 | return $value; |
@@ -79,11 +79,11 @@ discard block |
||
79 | 79 | } |
80 | 80 | |
81 | 81 | $sidebars_widgets = wp_get_sidebars_widgets(); |
82 | - if ( empty( $sidebars_widgets[ $matches[1] ] ) ) { |
|
82 | + if ( empty( $sidebars_widgets[ $matches[ 1 ] ] ) ) { |
|
83 | 83 | return $shortcodes; |
84 | 84 | } |
85 | 85 | |
86 | - foreach ( $sidebars_widgets[ $matches[1] ] as $widgets ) { |
|
86 | + foreach ( $sidebars_widgets[ $matches[ 1 ] ] as $widgets ) { |
|
87 | 87 | if ( |
88 | 88 | /** |
89 | 89 | * Blocklisted widgets. |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | strpos( $widgets, 'gv_recent_entries' ) === 0 |
93 | 93 | ) { |
94 | 94 | |
95 | - $shortcodes []= 'et_pb_sidebar'; |
|
95 | + $shortcodes [ ] = 'et_pb_sidebar'; |
|
96 | 96 | break; |
97 | 97 | } |
98 | 98 | } |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | /** |
85 | 85 | * @see RGFormsModel::update_lead_property() Trigger when any entry property changes |
86 | 86 | */ |
87 | - foreach( $this->lead_db_columns as $column ) { |
|
87 | + foreach ( $this->lead_db_columns as $column ) { |
|
88 | 88 | add_action( 'gform_update_' . $column, array( $this, 'entry_status_changed' ), 10, 3 ); |
89 | 89 | } |
90 | 90 | |
@@ -115,9 +115,9 @@ discard block |
||
115 | 115 | return; |
116 | 116 | } |
117 | 117 | |
118 | - gravityview()->log->debug( 'adding form {form_id} to blocklist because entry #{lead_id} was deleted', array( 'form_id' => $entry['form_id'], 'entry_id' => $lead_id, 'data' => array( 'value' => $property_value, 'previous' => $previous_value ) ) ); |
|
118 | + gravityview()->log->debug( 'adding form {form_id} to blocklist because entry #{lead_id} was deleted', array( 'form_id' => $entry[ 'form_id' ], 'entry_id' => $lead_id, 'data' => array( 'value' => $property_value, 'previous' => $previous_value ) ) ); |
|
119 | 119 | |
120 | - $this->blocklist_add( $entry['form_id'] ); |
|
120 | + $this->blocklist_add( $entry[ 'form_id' ] ); |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | /** |
@@ -130,9 +130,9 @@ discard block |
||
130 | 130 | */ |
131 | 131 | public function entry_updated( $form, $lead_id ) { |
132 | 132 | |
133 | - gravityview()->log->debug(' adding form {form_id} to blocklist because entry #{entry_id} was updated', array( 'form_id' => $form['id'], 'entry_id' => $lead_id ) ); |
|
133 | + gravityview()->log->debug( ' adding form {form_id} to blocklist because entry #{entry_id} was updated', array( 'form_id' => $form[ 'id' ], 'entry_id' => $lead_id ) ); |
|
134 | 134 | |
135 | - $this->blocklist_add( $form['id'] ); |
|
135 | + $this->blocklist_add( $form[ 'id' ] ); |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | /** |
@@ -147,9 +147,9 @@ discard block |
||
147 | 147 | */ |
148 | 148 | public function entry_created( $entry, $form ) { |
149 | 149 | |
150 | - gravityview()->log->debug( 'adding form {form_id} to blocklist because entry #{entry_id} was created', array( 'form_id' => $form['id'], 'entry_id' => $entry['id'] ) ); |
|
150 | + gravityview()->log->debug( 'adding form {form_id} to blocklist because entry #{entry_id} was created', array( 'form_id' => $form[ 'id' ], 'entry_id' => $entry[ 'id' ] ) ); |
|
151 | 151 | |
152 | - $this->blocklist_add( $form['id'] ); |
|
152 | + $this->blocklist_add( $form[ 'id' ] ); |
|
153 | 153 | } |
154 | 154 | |
155 | 155 | /** |
@@ -165,9 +165,9 @@ discard block |
||
165 | 165 | return; |
166 | 166 | } |
167 | 167 | |
168 | - gravityview()->log->debug( 'adding form {form_id} to blocklist because entry #{entry_id} was added', array( 'form_id' => $form['id'], 'entry_id' => $entry['id'] ) ); |
|
168 | + gravityview()->log->debug( 'adding form {form_id} to blocklist because entry #{entry_id} was added', array( 'form_id' => $form[ 'id' ], 'entry_id' => $entry[ 'id' ] ) ); |
|
169 | 169 | |
170 | - $this->blocklist_add( $form['id'] ); |
|
170 | + $this->blocklist_add( $form[ 'id' ] ); |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | /** |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | // Normally just one form, but supports multiple forms |
187 | 187 | // |
188 | 188 | // Array of IDs 12, 5, 14 would result in `f:12-f:5-f:14` |
189 | - $forms = 'f:' . implode( '-f:', (array) $form_ids ); |
|
189 | + $forms = 'f:' . implode( '-f:', (array)$form_ids ); |
|
190 | 190 | |
191 | 191 | // Prefix for transient keys |
192 | 192 | // Now the prefix would be: `gv-cache-f:12-f:5-f:14-` |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | $form_ids = is_array( $form_ids ) ? $form_ids : array( $form_ids ); |
237 | 237 | |
238 | 238 | // Add the passed form IDs |
239 | - $blocklist = array_merge( (array) $blocklist, $form_ids ); |
|
239 | + $blocklist = array_merge( (array)$blocklist, $form_ids ); |
|
240 | 240 | |
241 | 241 | // Don't duplicate |
242 | 242 | $blocklist = array_unique( $blocklist ); |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | |
280 | 280 | $blocklist = get_option( self::BLOCKLIST_OPTION_NAME, array() ); |
281 | 281 | |
282 | - $updated_list = array_diff( $blocklist, (array) $form_ids ); |
|
282 | + $updated_list = array_diff( $blocklist, (array)$form_ids ); |
|
283 | 283 | |
284 | 284 | gravityview()->log->debug( 'Removing form IDs from cache blocklist', array( 'data' => array( |
285 | 285 | '$form_ids' => $form_ids, |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | return false; |
338 | 338 | } |
339 | 339 | |
340 | - foreach ( (array) $form_ids as $form_id ) { |
|
340 | + foreach ( (array)$form_ids as $form_id ) { |
|
341 | 341 | |
342 | 342 | if ( in_array( $form_id, $blocklist ) ) { |
343 | 343 | |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | * @filter `gravityview_cache_time_{$filter_name}` Modify the cache time for a type of cache |
412 | 412 | * @param int $time_in_seconds Default: `DAY_IN_SECONDS` |
413 | 413 | */ |
414 | - $cache_time = (int) apply_filters( 'gravityview_cache_time_' . $filter_name, DAY_IN_SECONDS ); |
|
414 | + $cache_time = (int)apply_filters( 'gravityview_cache_time_' . $filter_name, DAY_IN_SECONDS ); |
|
415 | 415 | |
416 | 416 | gravityview()->log->debug( 'Setting cache with transient key {key} for {cache_time} seconds', array( 'key' => $this->key, 'cache_time' => $cache_time ) ); |
417 | 417 | |
@@ -447,7 +447,7 @@ discard block |
||
447 | 447 | return; |
448 | 448 | } |
449 | 449 | |
450 | - foreach ( (array) $form_ids as $form_id ) { |
|
450 | + foreach ( (array)$form_ids as $form_id ) { |
|
451 | 451 | |
452 | 452 | $key = '_transient_gv-cache-'; |
453 | 453 | |
@@ -558,7 +558,7 @@ discard block |
||
558 | 558 | public function use_cache() { |
559 | 559 | |
560 | 560 | // Exit early if debugging (unless running PHPUnit) |
561 | - if ( defined( 'WP_DEBUG' ) && WP_DEBUG && ! ( defined('DOING_GRAVITYVIEW_TESTS' ) && DOING_GRAVITYVIEW_TESTS ) ) { |
|
561 | + if ( defined( 'WP_DEBUG' ) && WP_DEBUG && ! ( defined( 'DOING_GRAVITYVIEW_TESTS' ) && DOING_GRAVITYVIEW_TESTS ) ) { |
|
562 | 562 | return apply_filters( 'gravityview_use_cache', false, $this ); |
563 | 563 | } |
564 | 564 | |
@@ -566,7 +566,7 @@ discard block |
||
566 | 566 | |
567 | 567 | if ( GVCommon::has_cap( 'edit_gravityviews' ) ) { |
568 | 568 | |
569 | - if ( isset( $_GET['cache'] ) || isset( $_GET['nocache'] ) ) { |
|
569 | + if ( isset( $_GET[ 'cache' ] ) || isset( $_GET[ 'nocache' ] ) ) { |
|
570 | 570 | |
571 | 571 | gravityview()->log->debug( 'Not using cache: ?cache or ?nocache is in the URL' ); |
572 | 572 | |
@@ -593,7 +593,7 @@ discard block |
||
593 | 593 | */ |
594 | 594 | $use_cache = apply_filters( 'gravityview_use_cache', $use_cache, $this ); |
595 | 595 | |
596 | - return (boolean) $use_cache; |
|
596 | + return (boolean)$use_cache; |
|
597 | 597 | } |
598 | 598 | |
599 | 599 | } |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | */ |
57 | 57 | public function add_default_field( $entry_default_fields, $form = array(), $zone = '' ) { |
58 | 58 | |
59 | - $entry_default_fields['custom'] = array( |
|
59 | + $entry_default_fields[ 'custom' ] = array( |
|
60 | 60 | 'label' => $this->label, |
61 | 61 | 'type' => $this->name, |
62 | 62 | 'desc' => $this->description, |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | |
70 | 70 | public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) { |
71 | 71 | |
72 | - unset ( $field_options['search_filter'], $field_options['show_as_link'], $field_options['new_window'] ); |
|
72 | + unset ( $field_options[ 'search_filter' ], $field_options[ 'show_as_link' ], $field_options[ 'new_window' ] ); |
|
73 | 73 | |
74 | 74 | $new_fields = array( |
75 | 75 | 'content' => array( |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | ); |
113 | 113 | |
114 | 114 | if ( 'edit' === $context ) { |
115 | - unset( $field_options['custom_label'], $field_options['show_label'], $field_options['allow_edit_cap'], $new_fields['wpautop'], $new_fields['oembed'] ); |
|
115 | + unset( $field_options[ 'custom_label' ], $field_options[ 'show_label' ], $field_options[ 'allow_edit_cap' ], $new_fields[ 'wpautop' ], $new_fields[ 'oembed' ] ); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | return $new_fields + $field_options; |
@@ -146,9 +146,9 @@ discard block |
||
146 | 146 | |
147 | 147 | // Loop through the configured Edit Entry fields and add Custom Content fields if there are any |
148 | 148 | // TODO: Make this available to other custom GV field types |
149 | - foreach ( (array) $edit_fields as $edit_field ) { |
|
149 | + foreach ( (array)$edit_fields as $edit_field ) { |
|
150 | 150 | |
151 | - if( 'custom' === \GV\Utils::get( $edit_field, 'id') ) { |
|
151 | + if ( 'custom' === \GV\Utils::get( $edit_field, 'id' ) ) { |
|
152 | 152 | |
153 | 153 | $field_data = array( |
154 | 154 | 'label' => \GV\Utils::get( $edit_field, 'custom_label' ), |
@@ -162,13 +162,13 @@ discard block |
||
162 | 162 | $field_data[ $key ] = GravityView_Merge_Tags::replace_variables( $field_datum, $form, $entry_data, false, false ); |
163 | 163 | } |
164 | 164 | |
165 | - $field_data['cssClass'] = \GV\Utils::get( $edit_field, 'custom_class' ); |
|
165 | + $field_data[ 'cssClass' ] = \GV\Utils::get( $edit_field, 'custom_class' ); |
|
166 | 166 | |
167 | - $new_fields[] = new GF_Field_HTML( $field_data ); |
|
167 | + $new_fields[ ] = new GF_Field_HTML( $field_data ); |
|
168 | 168 | |
169 | 169 | } else { |
170 | - if( isset( $fields[ $i ] ) ) { |
|
171 | - $new_fields[] = $fields[ $i ]; |
|
170 | + if ( isset( $fields[ $i ] ) ) { |
|
171 | + $new_fields[ ] = $fields[ $i ]; |
|
172 | 172 | } |
173 | 173 | $i++; |
174 | 174 | } |
@@ -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 = null, $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 = \GV\Utils::get( $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 | } |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | array( |
84 | 84 | 'ajaxurl' => admin_url( 'admin-ajax.php' ), |
85 | 85 | 'action' => 'entry_creator_get_users', |
86 | - 'gf25' => (bool) gravityview()->plugin->is_GF_25(), |
|
86 | + 'gf25' => (bool)gravityview()->plugin->is_GF_25(), |
|
87 | 87 | 'language' => array( |
88 | 88 | 'search_placeholder' => esc_html__( 'Search by ID, login, email, or name.', 'gravityview' ), |
89 | 89 | ), |
@@ -107,11 +107,11 @@ discard block |
||
107 | 107 | ) |
108 | 108 | ); |
109 | 109 | |
110 | - if ( ! wp_verify_nonce( $post_var['gv_nonce'], 'gv_entry_creator' ) ) { |
|
110 | + if ( ! wp_verify_nonce( $post_var[ 'gv_nonce' ], 'gv_entry_creator' ) ) { |
|
111 | 111 | die(); |
112 | 112 | } |
113 | 113 | |
114 | - $search_string = $post_var['q']; |
|
114 | + $search_string = $post_var[ 'q' ]; |
|
115 | 115 | |
116 | 116 | if ( is_numeric( $search_string ) ) { |
117 | 117 | $user_args = array( |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | } |
159 | 159 | |
160 | 160 | // Update the entry. The `false` prevents checking Akismet; `true` disables the user updated hook from firing |
161 | - $result = RGFormsModel::update_entry_property( (int) $entry['id'], 'created_by', (int) $user_id, false, true ); |
|
161 | + $result = RGFormsModel::update_entry_property( (int)$entry[ 'id' ], 'created_by', (int)$user_id, false, true ); |
|
162 | 162 | |
163 | 163 | if ( false === $result ) { |
164 | 164 | $status = __( 'Error', 'gravityview' ); |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | return; |
181 | 181 | } |
182 | 182 | |
183 | - GravityView_Entry_Notes::add_note( $entry['id'], - 1, 'GravityView', $note, 'gravityview' ); |
|
183 | + GravityView_Entry_Notes::add_note( $entry[ 'id' ], - 1, 'GravityView', $note, 'gravityview' ); |
|
184 | 184 | |
185 | 185 | } |
186 | 186 | |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | } |
216 | 216 | |
217 | 217 | // If screen mode isn't set, then we're in the wrong place. |
218 | - if ( empty( $_REQUEST['screen_mode'] ) ) { |
|
218 | + if ( empty( $_REQUEST[ 'screen_mode' ] ) ) { |
|
219 | 219 | return; |
220 | 220 | } |
221 | 221 | |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | |
242 | 242 | // If $_GET['screen_mode'] is set to edit, set $_POST value |
243 | 243 | if ( \GV\Utils::_GET( 'screen_mode' ) === 'edit' ) { |
244 | - $_POST["screen_mode"] = 'edit'; |
|
244 | + $_POST[ "screen_mode" ] = 'edit'; |
|
245 | 245 | } |
246 | 246 | |
247 | 247 | } |
@@ -283,16 +283,14 @@ discard block |
||
283 | 283 | $originally_created_by_user_data = get_userdata( $originally_created_by ); |
284 | 284 | |
285 | 285 | $original_name = ! empty( $originally_created_by_user_data ) ? |
286 | - sprintf( $user_format, $originally_created_by_user_data->display_name, $originally_created_by_user_data->ID ) : |
|
287 | - esc_attr_x( 'Deleted User', 'To show that the entry was created by a no longer existing user.', 'gravityview' ); |
|
286 | + sprintf( $user_format, $originally_created_by_user_data->display_name, $originally_created_by_user_data->ID ) : esc_attr_x( 'Deleted User', 'To show that the entry was created by a no longer existing user.', 'gravityview' ); |
|
288 | 287 | } |
289 | 288 | |
290 | 289 | if ( ! empty( $created_by ) ) { |
291 | 290 | $created_by_user_data = get_userdata( $created_by ); |
292 | 291 | |
293 | 292 | $created_by_name = ! empty( $created_by_user_data ) ? |
294 | - sprintf( $user_format, $created_by_user_data->display_name, $created_by_user_data->ID ) : |
|
295 | - esc_attr_x( 'Deleted User', 'To show that the entry was created by a no longer existing user.', 'gravityview' ); |
|
293 | + sprintf( $user_format, $created_by_user_data->display_name, $created_by_user_data->ID ) : esc_attr_x( 'Deleted User', 'To show that the entry was created by a no longer existing user.', 'gravityview' ); |
|
296 | 294 | } |
297 | 295 | |
298 | 296 | GravityView_Entry_Notes::add_note( $entry_id, $current_user->ID, $user_data->display_name, sprintf( __( 'Changed entry creator from %s to %s', 'gravityview' ), $original_name, $created_by_name ), 'note' ); |
@@ -322,7 +320,7 @@ discard block |
||
322 | 320 | $entry_creator_user_id = \GV\Utils::get( $entry, 'created_by' ); |
323 | 321 | |
324 | 322 | $entry_creator_user = GVCommon::get_users( 'change_entry_creator', array( 'include' => $entry_creator_user_id ) ); |
325 | - $entry_creator_user = isset( $entry_creator_user[0] ) ? $entry_creator_user[0] : array(); |
|
323 | + $entry_creator_user = isset( $entry_creator_user[ 0 ] ) ? $entry_creator_user[ 0 ] : array(); |
|
326 | 324 | |
327 | 325 | $output .= '<option value="0" ' . selected( true, empty( $entry_creator_user_id ), false ) . '> — ' . esc_attr_x( 'No User', 'No user assigned to the entry', 'gravityview' ) . ' — </option>'; |
328 | 326 | |
@@ -341,18 +339,18 @@ discard block |
||
341 | 339 | } |
342 | 340 | |
343 | 341 | $user_count = count_users(); |
344 | - $user_count = $user_count['total_users']; |
|
342 | + $user_count = $user_count[ 'total_users' ]; |
|
345 | 343 | $users_displayed = self::DEFAULT_NUMBER_OF_USERS + ( ! empty( $entry_creator_user ) ? 1 : 0 ); |
346 | 344 | if ( $user_count > $users_displayed ) { |
347 | 345 | $remaining_users = $user_count - $users_displayed; |
348 | - $user_users = _n( esc_html__('user', 'gravityview' ), esc_html__('users', 'gravityview' ), $remaining_users ); |
|
346 | + $user_users = _n( esc_html__( 'user', 'gravityview' ), esc_html__( 'users', 'gravityview' ), $remaining_users ); |
|
349 | 347 | $message = esc_html_x( 'Use the input above to search the remaining %d %s.', '%d is replaced with user count %s is replaced with "user" or "users"', 'gravityview' ); |
350 | 348 | $message = sprintf( $message, $remaining_users, $user_users ); |
351 | - $output .= '<option value="_user_count" disabled="disabled">' . esc_html( $message ) . '</option>'; |
|
349 | + $output .= '<option value="_user_count" disabled="disabled">' . esc_html( $message ) . '</option>'; |
|
352 | 350 | } |
353 | 351 | |
354 | 352 | $output .= '</select>'; |
355 | - $output .= '<input name="originally_created_by" value="' . esc_attr( $entry['created_by'] ) . '" type="hidden" />'; |
|
353 | + $output .= '<input name="originally_created_by" value="' . esc_attr( $entry[ 'created_by' ] ) . '" type="hidden" />'; |
|
356 | 354 | $output .= wp_nonce_field( 'gv_entry_creator', 'gv_entry_creator_nonce', false, false ); |
357 | 355 | |
358 | 356 | echo $output; |
@@ -366,8 +364,8 @@ discard block |
||
366 | 364 | * @return array |
367 | 365 | */ |
368 | 366 | function register_gform_noconflict( $assets ) { |
369 | - $assets[] = 'gravityview_selectwoo'; |
|
370 | - $assets[] = 'gravityview_entry_creator'; |
|
367 | + $assets[ ] = 'gravityview_selectwoo'; |
|
368 | + $assets[ ] = 'gravityview_entry_creator'; |
|
371 | 369 | |
372 | 370 | return $assets; |
373 | 371 | } |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | |
27 | 27 | $this->label = esc_attr__( 'Approve Entries', 'gravityview' ); |
28 | 28 | |
29 | - $this->description = esc_attr__( 'Approve and reject entries from the View.', 'gravityview' ); |
|
29 | + $this->description = esc_attr__( 'Approve and reject entries from the View.', 'gravityview' ); |
|
30 | 30 | |
31 | 31 | $this->add_hooks(); |
32 | 32 | |
@@ -48,11 +48,11 @@ discard block |
||
48 | 48 | */ |
49 | 49 | public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) { |
50 | 50 | |
51 | - unset( $field_options['only_loggedin'] ); |
|
51 | + unset( $field_options[ 'only_loggedin' ] ); |
|
52 | 52 | |
53 | - unset( $field_options['new_window'] ); |
|
53 | + unset( $field_options[ 'new_window' ] ); |
|
54 | 54 | |
55 | - unset( $field_options['show_as_link'] ); |
|
55 | + unset( $field_options[ 'show_as_link' ] ); |
|
56 | 56 | |
57 | 57 | return $field_options; |
58 | 58 | } |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | |
76 | 76 | add_action( 'gravityview/field/approval/load_scripts', array( $this, 'enqueue_and_localize_script' ) ); |
77 | 77 | |
78 | - add_action( 'gravityview_datatables_scripts_styles', array( $this, 'enqueue_and_localize_script' ) ); |
|
78 | + add_action( 'gravityview_datatables_scripts_styles', array( $this, 'enqueue_and_localize_script' ) ); |
|
79 | 79 | |
80 | 80 | add_filter( 'gravityview_get_entries', array( $this, 'modify_search_parameters' ), 1000 ); |
81 | 81 | |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | public function maybe_prevent_field_render( $html, $args ) { |
98 | 98 | |
99 | 99 | // If the field is `entry_approval` type but the user doesn't have the moderate entries cap, don't render. |
100 | - if( $this->name === \GV\Utils::get( $args['field'], 'id' ) && ! GVCommon::has_cap('gravityview_moderate_entries') ) { |
|
100 | + if ( $this->name === \GV\Utils::get( $args[ 'field' ], 'id' ) && ! GVCommon::has_cap( 'gravityview_moderate_entries' ) ) { |
|
101 | 101 | return ''; |
102 | 102 | } |
103 | 103 | |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | public function modify_search_parameters( $parameters ) { |
128 | 128 | |
129 | 129 | if ( $this->name === \GV\Utils::get( $parameters, 'sorting/key' ) ) { |
130 | - $parameters['sorting']['key'] = 'is_approved'; |
|
130 | + $parameters[ 'sorting' ][ 'key' ] = 'is_approved'; |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | return $parameters; |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | |
149 | 149 | $script_debug = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; |
150 | 150 | |
151 | - wp_register_script( 'gravityview-field-approval', GRAVITYVIEW_URL . 'assets/js/field-approval'.$script_debug.'.js', array( 'jquery' ), GravityView_Plugin::version, true ); |
|
151 | + wp_register_script( 'gravityview-field-approval', GRAVITYVIEW_URL . 'assets/js/field-approval' . $script_debug . '.js', array( 'jquery' ), GravityView_Plugin::version, true ); |
|
152 | 152 | |
153 | 153 | wp_register_script( 'gravityview-field-approval-popper', GRAVITYVIEW_URL . 'assets/lib/tippy/popper.min.js', array(), GravityView_Plugin::version, true ); |
154 | 154 | wp_register_script( 'gravityview-field-approval-tippy', GRAVITYVIEW_URL . 'assets/lib/tippy/tippy.min.js', array(), GravityView_Plugin::version, true ); |
@@ -156,14 +156,14 @@ discard block |
||
156 | 156 | |
157 | 157 | $style_path = GRAVITYVIEW_DIR . 'templates/css/field-approval.css'; |
158 | 158 | |
159 | - if( class_exists( 'GravityView_View' ) ) { |
|
159 | + if ( class_exists( 'GravityView_View' ) ) { |
|
160 | 160 | /** |
161 | 161 | * Override CSS file by placing in your theme's /gravityview/css/ sub-directory. |
162 | 162 | */ |
163 | 163 | $style_path = GravityView_View::getInstance()->locate_template( 'css/field-approval.css', false ); |
164 | 164 | } |
165 | 165 | |
166 | - $style_url = plugins_url( 'css/field-approval.css', trailingslashit( dirname( $style_path ) ) ); |
|
166 | + $style_url = plugins_url( 'css/field-approval.css', trailingslashit( dirname( $style_path ) ) ); |
|
167 | 167 | |
168 | 168 | /** |
169 | 169 | * @filter `gravityview/field/approval/css_url` URL to the Approval field CSS file. |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | */ |
173 | 173 | $style_url = apply_filters( 'gravityview/field/approval/css_url', $style_url ); |
174 | 174 | |
175 | - if( ! empty( $style_url ) ) { |
|
175 | + if ( ! empty( $style_url ) ) { |
|
176 | 176 | wp_register_style( 'gravityview-field-approval', $style_url, array( 'dashicons' ), GravityView_Plugin::version, 'screen' ); |
177 | 177 | } |
178 | 178 | |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | public function enqueue_and_localize_script() { |
188 | 188 | |
189 | 189 | // The script is already registered and enqueued |
190 | - if( wp_script_is( 'gravityview-field-approval', 'enqueued' ) ) { |
|
190 | + if ( wp_script_is( 'gravityview-field-approval', 'enqueued' ) ) { |
|
191 | 191 | return; |
192 | 192 | } |
193 | 193 | |
@@ -200,11 +200,11 @@ discard block |
||
200 | 200 | |
201 | 201 | wp_localize_script( 'gravityview-field-approval', 'gvApproval', array( |
202 | 202 | 'ajaxurl' => admin_url( 'admin-ajax.php' ), |
203 | - 'nonce' => wp_create_nonce('gravityview_entry_approval'), |
|
203 | + 'nonce' => wp_create_nonce( 'gravityview_entry_approval' ), |
|
204 | 204 | 'status' => GravityView_Entry_Approval_Status::get_all(), |
205 | 205 | 'status_popover_template' => GravityView_Entry_Approval::get_popover_template(), |
206 | 206 | 'status_popover_placement' => GravityView_Entry_Approval::get_popover_placement(), |
207 | - )); |
|
207 | + ) ); |
|
208 | 208 | |
209 | 209 | } |
210 | 210 | |
@@ -221,8 +221,8 @@ discard block |
||
221 | 221 | */ |
222 | 222 | public function filter_gravityview_entry_default_field( $entry_default_fields, $form, $context ) { |
223 | 223 | |
224 | - if ( ! isset( $entry_default_fields["{$this->name}"] ) && 'edit' !== $context ) { |
|
225 | - $entry_default_fields["{$this->name}"] = array( |
|
224 | + if ( ! isset( $entry_default_fields[ "{$this->name}" ] ) && 'edit' !== $context ) { |
|
225 | + $entry_default_fields[ "{$this->name}" ] = array( |
|
226 | 226 | 'label' => $this->label, |
227 | 227 | 'desc' => $this->description, |
228 | 228 | 'type' => $this->name, |