@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | |
23 | 23 | $this->label = esc_attr__( 'Approve Entries', 'gravityview' ); |
24 | 24 | |
25 | - $this->description = esc_attr__( 'Approve and reject entries from the View.', 'gravityview' ); |
|
25 | + $this->description = esc_attr__( 'Approve and reject entries from the View.', 'gravityview' ); |
|
26 | 26 | |
27 | 27 | $this->add_hooks(); |
28 | 28 | |
@@ -44,11 +44,11 @@ discard block |
||
44 | 44 | */ |
45 | 45 | function field_options( $field_options, $template_id = '', $field_id = '', $context = '', $input_type = '' ) { |
46 | 46 | |
47 | - unset( $field_options['only_loggedin'] ); |
|
47 | + unset( $field_options[ 'only_loggedin' ] ); |
|
48 | 48 | |
49 | - unset( $field_options['new_window'] ); |
|
49 | + unset( $field_options[ 'new_window' ] ); |
|
50 | 50 | |
51 | - unset( $field_options['show_as_link'] ); |
|
51 | + unset( $field_options[ 'show_as_link' ] ); |
|
52 | 52 | |
53 | 53 | return $field_options; |
54 | 54 | } |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | |
69 | 69 | add_action( 'gravityview/field/approval/load_scripts', array( $this, 'enqueue_and_localize_script' ) ); |
70 | 70 | |
71 | - add_action( 'gravityview_datatables_scripts_styles', array( $this, 'enqueue_and_localize_script' ) ); |
|
71 | + add_action( 'gravityview_datatables_scripts_styles', array( $this, 'enqueue_and_localize_script' ) ); |
|
72 | 72 | |
73 | 73 | add_filter( 'gravityview_get_entries', array( $this, 'modify_search_parameters' ), 1000 ); |
74 | 74 | |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | public function maybe_prevent_field_render( $html, $args ) { |
89 | 89 | |
90 | 90 | // If the field is `entry_approval` type but the user doesn't have the moderate entries cap, don't render. |
91 | - if( $this->name === rgar( $args['field'], 'id' ) && ! GVCommon::has_cap('gravityview_moderate_entries') ) { |
|
91 | + if ( $this->name === rgar( $args[ 'field' ], 'id' ) && ! GVCommon::has_cap( 'gravityview_moderate_entries' ) ) { |
|
92 | 92 | return ''; |
93 | 93 | } |
94 | 94 | |
@@ -104,8 +104,8 @@ discard block |
||
104 | 104 | */ |
105 | 105 | public function modify_search_parameters( $parameters ) { |
106 | 106 | |
107 | - if( $this->name === rgars( $parameters, 'sorting/key' ) ) { |
|
108 | - $parameters['sorting']['key'] = 'is_approved'; |
|
107 | + if ( $this->name === rgars( $parameters, 'sorting/key' ) ) { |
|
108 | + $parameters[ 'sorting' ][ 'key' ] = 'is_approved'; |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | return $parameters; |
@@ -121,18 +121,18 @@ discard block |
||
121 | 121 | function register_scripts_and_styles() { |
122 | 122 | $script_debug = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; |
123 | 123 | |
124 | - wp_register_script( 'gravityview-field-approval', GRAVITYVIEW_URL . 'assets/js/field-approval'.$script_debug.'.js', array( 'jquery' ), GravityView_Plugin::version, true ); |
|
124 | + wp_register_script( 'gravityview-field-approval', GRAVITYVIEW_URL . 'assets/js/field-approval' . $script_debug . '.js', array( 'jquery' ), GravityView_Plugin::version, true ); |
|
125 | 125 | |
126 | 126 | $style_path = GRAVITYVIEW_DIR . 'templates/css/field-approval.css'; |
127 | 127 | |
128 | - if( class_exists( 'GravityView_View' ) ) { |
|
128 | + if ( class_exists( 'GravityView_View' ) ) { |
|
129 | 129 | /** |
130 | 130 | * Override CSS file by placing in your theme's /gravityview/css/ sub-directory. |
131 | 131 | */ |
132 | 132 | $style_path = GravityView_View::getInstance()->locate_template( 'css/field-approval.css', false ); |
133 | 133 | } |
134 | 134 | |
135 | - $style_url = plugins_url( 'css/field-approval.css', trailingslashit( dirname( $style_path ) ) ); |
|
135 | + $style_url = plugins_url( 'css/field-approval.css', trailingslashit( dirname( $style_path ) ) ); |
|
136 | 136 | |
137 | 137 | /** |
138 | 138 | * @filter `gravityview/field/approval/css_url` URL to the Approval field CSS file. |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | */ |
142 | 142 | $style_url = apply_filters( 'gravityview/field/approval/css_url', $style_url ); |
143 | 143 | |
144 | - if( ! empty( $style_url ) ) { |
|
144 | + if ( ! empty( $style_url ) ) { |
|
145 | 145 | wp_register_style( 'gravityview-field-approval', $style_url, array( 'dashicons' ), GravityView_Plugin::version, 'screen' ); |
146 | 146 | } |
147 | 147 | |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | public function enqueue_and_localize_script() { |
157 | 157 | |
158 | 158 | // The script is already registered and enqueued |
159 | - if( wp_script_is( 'gravityview-field-approval', 'enqueued' ) ) { |
|
159 | + if ( wp_script_is( 'gravityview-field-approval', 'enqueued' ) ) { |
|
160 | 160 | return; |
161 | 161 | } |
162 | 162 | |
@@ -166,9 +166,9 @@ discard block |
||
166 | 166 | |
167 | 167 | wp_localize_script( 'gravityview-field-approval', 'gvApproval', array( |
168 | 168 | 'ajaxurl' => admin_url( 'admin-ajax.php' ), |
169 | - 'nonce' => wp_create_nonce('gravityview_entry_approval'), |
|
169 | + 'nonce' => wp_create_nonce( 'gravityview_entry_approval' ), |
|
170 | 170 | 'status' => GravityView_Entry_Approval_Status::get_all(), |
171 | - )); |
|
171 | + ) ); |
|
172 | 172 | |
173 | 173 | } |
174 | 174 | |
@@ -185,8 +185,8 @@ discard block |
||
185 | 185 | */ |
186 | 186 | public function filter_gravityview_entry_default_field( $entry_default_fields, $form, $context ) { |
187 | 187 | |
188 | - if ( ! isset( $entry_default_fields["{$this->name}"] ) && 'edit' !== $context ) { |
|
189 | - $entry_default_fields["{$this->name}"] = array( |
|
188 | + if ( ! isset( $entry_default_fields[ "{$this->name}" ] ) && 'edit' !== $context ) { |
|
189 | + $entry_default_fields[ "{$this->name}" ] = array( |
|
190 | 190 | 'label' => $this->label, |
191 | 191 | 'desc' => $this->description, |
192 | 192 | 'type' => $this->name, |
@@ -58,8 +58,8 @@ discard block |
||
58 | 58 | |
59 | 59 | if ( 'address' === rgar( $search_field, 'type' ) ) { |
60 | 60 | |
61 | - $field_id = intval( floor( $search_field['key'] ) ); |
|
62 | - $input_id = gravityview_get_input_id_from_id( $search_field['key'] ); |
|
61 | + $field_id = intval( floor( $search_field[ 'key' ] ) ); |
|
62 | + $input_id = gravityview_get_input_id_from_id( $search_field[ 'key' ] ); |
|
63 | 63 | $form = GravityView_View::getInstance()->getForm(); |
64 | 64 | |
65 | 65 | /** @var GF_Field_Address $address_field */ |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | $choices = array(); |
69 | 69 | |
70 | 70 | $method_name = 'get_choices_' . self::get_input_type_from_input_id( $input_id ); |
71 | - if( method_exists( $this, $method_name ) ) { |
|
71 | + if ( method_exists( $this, $method_name ) ) { |
|
72 | 72 | /** |
73 | 73 | * @uses GravityView_Field_Address::get_choices_country() |
74 | 74 | * @uses GravityView_Field_Address::get_choices_state() |
@@ -76,12 +76,12 @@ discard block |
||
76 | 76 | $choices = $this->{$method_name}( $address_field ); |
77 | 77 | } |
78 | 78 | |
79 | - if( ! empty( $choices ) ) { |
|
80 | - $search_field['choices'] = $choices; |
|
81 | - $search_field['type'] = rgar( $search_field, 'input'); |
|
79 | + if ( ! empty( $choices ) ) { |
|
80 | + $search_field[ 'choices' ] = $choices; |
|
81 | + $search_field[ 'type' ] = rgar( $search_field, 'input' ); |
|
82 | 82 | } else { |
83 | - $search_field['type'] = 'text'; |
|
84 | - $search_field['input'] = 'input_text'; |
|
83 | + $search_field[ 'type' ] = 'text'; |
|
84 | + $search_field[ 'input' ] = 'input_text'; |
|
85 | 85 | } |
86 | 86 | } |
87 | 87 | } |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | $country_choices = array(); |
108 | 108 | |
109 | 109 | foreach ( $countries as $key => $country ) { |
110 | - $country_choices[] = array( |
|
110 | + $country_choices[ ] = array( |
|
111 | 111 | 'value' => $country, |
112 | 112 | 'text' => $country, |
113 | 113 | ); |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | */ |
132 | 132 | private function get_choices_state( $address_field ) { |
133 | 133 | |
134 | - $address_type = empty( $address_field->addressType ) ? $address_field->get_default_address_type( $form['id'] ) : $address_field->addressType; |
|
134 | + $address_type = empty( $address_field->addressType ) ? $address_field->get_default_address_type( $form[ 'id' ] ) : $address_field->addressType; |
|
135 | 135 | |
136 | 136 | $state_choices = array(); |
137 | 137 | |
@@ -143,12 +143,12 @@ discard block |
||
143 | 143 | $states = GFCommon::get_canadian_provinces(); |
144 | 144 | break; |
145 | 145 | default: |
146 | - $states = empty( $address_types[ $address_type ]['states'] ) ? array() : $address_types[ $address_type ]['states']; |
|
146 | + $states = empty( $address_types[ $address_type ][ 'states' ] ) ? array() : $address_types[ $address_type ][ 'states' ]; |
|
147 | 147 | break; |
148 | 148 | } |
149 | 149 | |
150 | 150 | foreach ( $states as $key => $state ) { |
151 | - $state_choices[] = array( |
|
151 | + $state_choices[ ] = array( |
|
152 | 152 | 'value' => $state, |
153 | 153 | 'text' => $state, |
154 | 154 | ); |
@@ -171,13 +171,13 @@ discard block |
||
171 | 171 | // Use the same inputs as the "text" input type allows |
172 | 172 | $text_inputs = rgar( $input_types, 'text' ); |
173 | 173 | |
174 | - $input_types['street'] = $text_inputs; |
|
175 | - $input_types['street2'] = $text_inputs; |
|
176 | - $input_types['city'] = $text_inputs; |
|
174 | + $input_types[ 'street' ] = $text_inputs; |
|
175 | + $input_types[ 'street2' ] = $text_inputs; |
|
176 | + $input_types[ 'city' ] = $text_inputs; |
|
177 | 177 | |
178 | - $input_types['state'] = array( 'select', 'radio', 'link' ) + $text_inputs; |
|
179 | - $input_types['zip'] = array( 'input_text' ); |
|
180 | - $input_types['country'] = array( 'select', 'radio', 'link' ) + $text_inputs; |
|
178 | + $input_types[ 'state' ] = array( 'select', 'radio', 'link' ) + $text_inputs; |
|
179 | + $input_types[ 'zip' ] = array( 'input_text' ); |
|
180 | + $input_types[ 'country' ] = array( 'select', 'radio', 'link' ) + $text_inputs; |
|
181 | 181 | |
182 | 182 | return $input_types; |
183 | 183 | } |
@@ -198,10 +198,10 @@ discard block |
||
198 | 198 | // Is this search field for an input (eg: 4.2) or the whole address field (eg: 4)? |
199 | 199 | $input_id = gravityview_get_input_id_from_id( $field_id ); |
200 | 200 | |
201 | - if( 'address' === $field_type && $input_id ) { |
|
201 | + if ( 'address' === $field_type && $input_id ) { |
|
202 | 202 | |
203 | 203 | // If the input ID matches an expected address input, set to that. Otherwise, keep existing input type. |
204 | - if( $address_field_name = self::get_input_type_from_input_id( $input_id ) ) { |
|
204 | + if ( $address_field_name = self::get_input_type_from_input_id( $input_id ) ) { |
|
205 | 205 | $input_type = $address_field_name; |
206 | 206 | } |
207 | 207 | } |
@@ -250,20 +250,20 @@ discard block |
||
250 | 250 | function field_options( $field_options, $template_id = '', $field_id = '', $context = '', $input_type = '' ) { |
251 | 251 | |
252 | 252 | // If this is NOT the full address field, return default options. |
253 | - if( floor( $field_id ) !== floatval( $field_id ) ) { |
|
253 | + if ( floor( $field_id ) !== floatval( $field_id ) ) { |
|
254 | 254 | return $field_options; |
255 | 255 | } |
256 | 256 | |
257 | - if( 'edit' === $context ) { |
|
257 | + if ( 'edit' === $context ) { |
|
258 | 258 | return $field_options; |
259 | 259 | } |
260 | 260 | |
261 | 261 | $add_options = array(); |
262 | 262 | |
263 | - $add_options['show_map_link'] = array( |
|
263 | + $add_options[ 'show_map_link' ] = array( |
|
264 | 264 | 'type' => 'checkbox', |
265 | 265 | 'label' => __( 'Show Map Link:', 'gravityview' ), |
266 | - 'desc' => __('Display a "Map It" link below the address', 'gravityview'), |
|
266 | + 'desc' => __( 'Display a "Map It" link below the address', 'gravityview' ), |
|
267 | 267 | 'value' => true, |
268 | 268 | 'merge_tags' => false, |
269 | 269 | ); |
@@ -14,7 +14,7 @@ |
||
14 | 14 | |
15 | 15 | var $is_numeric = true; |
16 | 16 | |
17 | - var $search_operators = array( 'is', 'isnot', 'starts_with', 'ends_with' ); |
|
17 | + var $search_operators = array( 'is', 'isnot', 'starts_with', 'ends_with' ); |
|
18 | 18 | |
19 | 19 | var $group = 'pricing'; |
20 | 20 |
@@ -45,9 +45,9 @@ discard block |
||
45 | 45 | $field_options = parent::field_options( $field_options, $template_id, $field_id, $context, $input_type ); |
46 | 46 | |
47 | 47 | // It's not the parent field; it's an input |
48 | - if( floor( $field_id ) !== floatval( $field_id ) ) { |
|
48 | + if ( floor( $field_id ) !== floatval( $field_id ) ) { |
|
49 | 49 | |
50 | - if( $this->is_choice_value_enabled() ) { |
|
50 | + if ( $this->is_choice_value_enabled() ) { |
|
51 | 51 | |
52 | 52 | $desc = esc_html__( 'This input has a label and a value. What should be displayed?', 'gravityview' ); |
53 | 53 | $default = 'value'; |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | ); |
66 | 66 | } |
67 | 67 | |
68 | - $field_options['choice_display'] = array( |
|
68 | + $field_options[ 'choice_display' ] = array( |
|
69 | 69 | 'type' => 'radio', |
70 | 70 | 'class' => 'vertical', |
71 | 71 | 'label' => __( 'What should be displayed:', 'gravityview' ), |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | */ |
50 | 50 | function clear_product_info_cache( $form = array(), $entry_id = 0, $Edit_Entry_Render = null ) { |
51 | 51 | |
52 | - if( $this->should_hide_product_fields( $Edit_Entry_Render->entry ) ) { |
|
52 | + if ( $this->should_hide_product_fields( $Edit_Entry_Render->entry ) ) { |
|
53 | 53 | return; |
54 | 54 | } |
55 | 55 | |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | * @see GVCommon::entry_has_transaction_data() |
102 | 102 | * @param boolean $hide_product_fields Whether to hide product fields in the editor. Uses $entry data to determine. |
103 | 103 | */ |
104 | - $hide_product_fields = (bool) apply_filters( 'gravityview/edit_entry/hide-product-fields', $has_transaction_data ); |
|
104 | + $hide_product_fields = (bool)apply_filters( 'gravityview/edit_entry/hide-product-fields', $has_transaction_data ); |
|
105 | 105 | |
106 | 106 | return $hide_product_fields; |
107 | 107 | } |
@@ -245,7 +245,7 @@ |
||
245 | 245 | * @param bool $url_encode Whether to URL-encode output |
246 | 246 | * @param bool $esc_html Whether to apply `esc_html()` to output |
247 | 247 | * |
248 | - * @return mixed |
|
248 | + * @return string |
|
249 | 249 | */ |
250 | 250 | public function replace_merge_tag( $matches = array(), $text = '', $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) { |
251 | 251 |
@@ -134,17 +134,17 @@ discard block |
||
134 | 134 | |
135 | 135 | add_filter( 'gravityview/sortable/field_blacklist', array( $this, '_filter_sortable_fields' ), 1 ); |
136 | 136 | |
137 | - if( $this->entry_meta_key ) { |
|
137 | + if ( $this->entry_meta_key ) { |
|
138 | 138 | add_filter( 'gform_entry_meta', array( $this, 'add_entry_meta' ) ); |
139 | 139 | add_filter( 'gravityview/common/sortable_fields', array( $this, 'add_sortable_field' ), 10, 2 ); |
140 | 140 | } |
141 | 141 | |
142 | - if( $this->_custom_merge_tag ) { |
|
142 | + if ( $this->_custom_merge_tag ) { |
|
143 | 143 | add_filter( 'gform_custom_merge_tags', array( $this, '_filter_gform_custom_merge_tags' ), 10, 4 ); |
144 | 144 | add_filter( 'gform_replace_merge_tags', array( $this, '_filter_gform_replace_merge_tags' ), 10, 7 ); |
145 | 145 | } |
146 | 146 | |
147 | - if( 'meta' === $this->group || '' !== $this->default_search_label ) { |
|
147 | + if ( 'meta' === $this->group || '' !== $this->default_search_label ) { |
|
148 | 148 | add_filter( 'gravityview_search_field_label', array( $this, 'set_default_search_label' ), 10, 3 ); |
149 | 149 | } |
150 | 150 | |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | * Auto-assign label from Gravity Forms label, if exists |
153 | 153 | * @since 1.20 |
154 | 154 | */ |
155 | - if( empty( $this->label ) && ! empty( $this->_gf_field_class_name ) && class_exists( $this->_gf_field_class_name ) ) { |
|
155 | + if ( empty( $this->label ) && ! empty( $this->_gf_field_class_name ) && class_exists( $this->_gf_field_class_name ) ) { |
|
156 | 156 | $this->label = ucfirst( GF_Fields::get( $this->name )->get_form_editor_field_title() ); |
157 | 157 | } |
158 | 158 | |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | 'type' => $this->name |
176 | 176 | ); |
177 | 177 | |
178 | - $fields["{$this->entry_meta_key}"] = $added_field; |
|
178 | + $fields[ "{$this->entry_meta_key}" ] = $added_field; |
|
179 | 179 | |
180 | 180 | return $fields; |
181 | 181 | } |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | */ |
196 | 196 | function set_default_search_label( $label = '', $gf_field = null, $field = array() ) { |
197 | 197 | |
198 | - if( $this->name === $field['field'] && '' === $label ) { |
|
198 | + if ( $this->name === $field[ 'field' ] && '' === $label ) { |
|
199 | 199 | $label = esc_html( $this->default_search_label ); |
200 | 200 | } |
201 | 201 | |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | * |
217 | 217 | * @return string Original text if {_custom_merge_tag} isn't found. Otherwise, replaced text. |
218 | 218 | */ |
219 | - public function _filter_gform_replace_merge_tags( $text, $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) { |
|
219 | + public function _filter_gform_replace_merge_tags( $text, $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) { |
|
220 | 220 | |
221 | 221 | // Is there is field merge tag? Strip whitespace off the ned, too. |
222 | 222 | preg_match_all( '/{' . preg_quote( $this->_custom_merge_tag ) . ':?(.*?)(?:\s)?}/ism', $text, $matches, PREG_SET_ORDER ); |
@@ -247,19 +247,19 @@ discard block |
||
247 | 247 | */ |
248 | 248 | public function replace_merge_tag( $matches = array(), $text = '', $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) { |
249 | 249 | |
250 | - foreach( $matches as $match ) { |
|
250 | + foreach ( $matches as $match ) { |
|
251 | 251 | |
252 | - $full_tag = $match[0]; |
|
252 | + $full_tag = $match[ 0 ]; |
|
253 | 253 | |
254 | 254 | // Strip the Merge Tags |
255 | - $tag = str_replace( array( '{', '}'), '', $full_tag ); |
|
255 | + $tag = str_replace( array( '{', '}' ), '', $full_tag ); |
|
256 | 256 | |
257 | 257 | // Replace the value from the entry, if exists |
258 | - if( isset( $entry[ $tag ] ) ) { |
|
258 | + if ( isset( $entry[ $tag ] ) ) { |
|
259 | 259 | |
260 | 260 | $value = $entry[ $tag ]; |
261 | 261 | |
262 | - if( is_callable( array( $this, 'get_content') ) ) { |
|
262 | + if ( is_callable( array( $this, 'get_content' ) ) ) { |
|
263 | 263 | $value = $this->get_content( $value ); |
264 | 264 | } |
265 | 265 | |
@@ -332,8 +332,8 @@ discard block |
||
332 | 332 | */ |
333 | 333 | public function _filter_sortable_fields( $not_sortable ) { |
334 | 334 | |
335 | - if( ! $this->is_sortable ) { |
|
336 | - $not_sortable[] = $this->name; |
|
335 | + if ( ! $this->is_sortable ) { |
|
336 | + $not_sortable[ ] = $this->name; |
|
337 | 337 | } |
338 | 338 | |
339 | 339 | return $not_sortable; |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | */ |
351 | 351 | function add_entry_meta( $entry_meta ) { |
352 | 352 | |
353 | - if( ! isset( $entry_meta["{$this->entry_meta_key}"] ) ) { |
|
353 | + if ( ! isset( $entry_meta[ "{$this->entry_meta_key}" ] ) ) { |
|
354 | 354 | |
355 | 355 | $added_meta = array( |
356 | 356 | 'label' => $this->label, |
@@ -359,13 +359,13 @@ discard block |
||
359 | 359 | ); |
360 | 360 | |
361 | 361 | if ( $this->entry_meta_update_callback && is_callable( $this->entry_meta_update_callback ) ) { |
362 | - $added_meta['update_entry_meta_callback'] = $this->entry_meta_update_callback; |
|
362 | + $added_meta[ 'update_entry_meta_callback' ] = $this->entry_meta_update_callback; |
|
363 | 363 | } |
364 | 364 | |
365 | - $entry_meta["{$this->entry_meta_key}"] = $added_meta; |
|
365 | + $entry_meta[ "{$this->entry_meta_key}" ] = $added_meta; |
|
366 | 366 | |
367 | 367 | } else { |
368 | - do_action( 'gravityview_log_error', __METHOD__ . ' Entry meta already set: ' . $this->entry_meta_key, $entry_meta["{$this->entry_meta_key}"] ); |
|
368 | + do_action( 'gravityview_log_error', __METHOD__ . ' Entry meta already set: ' . $this->entry_meta_key, $entry_meta[ "{$this->entry_meta_key}" ] ); |
|
369 | 369 | } |
370 | 370 | |
371 | 371 | return $entry_meta; |
@@ -394,7 +394,7 @@ discard block |
||
394 | 394 | 'date_display' => array( |
395 | 395 | 'type' => 'text', |
396 | 396 | 'label' => __( 'Override Date Format', 'gravityview' ), |
397 | - 'desc' => sprintf( __( 'Define how the date is displayed (using %sthe PHP date format%s)', 'gravityview'), '<a href="https://codex.wordpress.org/Formatting_Date_and_Time">', '</a>' ), |
|
397 | + 'desc' => sprintf( __( 'Define how the date is displayed (using %sthe PHP date format%s)', 'gravityview' ), '<a href="https://codex.wordpress.org/Formatting_Date_and_Time">', '</a>' ), |
|
398 | 398 | /** |
399 | 399 | * @filter `gravityview_date_format` Override the date format with a [PHP date format](https://codex.wordpress.org/Formatting_Date_and_Time) |
400 | 400 | * @param[in,out] null|string $date_format Date Format (default: null) |
@@ -419,7 +419,7 @@ discard block |
||
419 | 419 | |
420 | 420 | $options = $this->field_support_options(); |
421 | 421 | |
422 | - if( isset( $options[ $key ] ) ) { |
|
422 | + if ( isset( $options[ $key ] ) ) { |
|
423 | 423 | $field_options[ $key ] = $options[ $key ]; |
424 | 424 | } |
425 | 425 | |
@@ -483,11 +483,11 @@ discard block |
||
483 | 483 | $connected_form = rgpost( 'form_id' ); |
484 | 484 | |
485 | 485 | // Otherwise, get the Form ID from the Post page |
486 | - if( empty( $connected_form ) ) { |
|
486 | + if ( empty( $connected_form ) ) { |
|
487 | 487 | $connected_form = gravityview_get_form_id( get_the_ID() ); |
488 | 488 | } |
489 | 489 | |
490 | - if( empty( $connected_form ) ) { |
|
490 | + if ( empty( $connected_form ) ) { |
|
491 | 491 | do_action( 'gravityview_log_error', sprintf( '%s: Form not found for form ID "%s"', __METHOD__, $connected_form ) ); |
492 | 492 | return false; |
493 | 493 | } |
@@ -23,16 +23,16 @@ discard block |
||
23 | 23 | |
24 | 24 | function field_options( $field_options, $template_id, $field_id, $context, $input_type ) { |
25 | 25 | |
26 | - unset ( $field_options['search_filter'] ); |
|
26 | + unset ( $field_options[ 'search_filter' ] ); |
|
27 | 27 | |
28 | - if( 'edit' === $context ) { |
|
28 | + if ( 'edit' === $context ) { |
|
29 | 29 | return $field_options; |
30 | 30 | } |
31 | 31 | |
32 | - $this->add_field_support('link_to_post', $field_options ); |
|
32 | + $this->add_field_support( 'link_to_post', $field_options ); |
|
33 | 33 | |
34 | 34 | // @since 1.5.4 |
35 | - $this->add_field_support('dynamic_data', $field_options ); |
|
35 | + $this->add_field_support( 'dynamic_data', $field_options ); |
|
36 | 36 | |
37 | 37 | return $field_options; |
38 | 38 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $url = $title = $caption = $description = ''; |
60 | 60 | |
61 | 61 | // If there's a |:| match, process. Otherwise, empty array! |
62 | - if( preg_match( '/\|\:\|/', $value ) ) { |
|
62 | + if ( preg_match( '/\|\:\|/', $value ) ) { |
|
63 | 63 | list( $url, $title, $caption, $description ) = array_pad( explode( '|:|', $value ), 4, false ); |
64 | 64 | } |
65 | 65 | |
@@ -88,8 +88,8 @@ discard block |
||
88 | 88 | */ |
89 | 89 | public function get_field_input( $form, $value = '', $entry = null, GF_Field_Post_Image $field ) { |
90 | 90 | |
91 | - $id = (int) $field->id; |
|
92 | - $form_id = $form['id']; |
|
91 | + $id = (int)$field->id; |
|
92 | + $form_id = $form[ 'id' ]; |
|
93 | 93 | $input_name = "input_{$id}"; |
94 | 94 | $field_id = sprintf( 'input_%d_%d', $form_id, $id ); |
95 | 95 | $img_name = null; |
@@ -97,16 +97,16 @@ discard block |
||
97 | 97 | // Convert |:| to associative array |
98 | 98 | $img_array = self::explode_value( $value ); |
99 | 99 | |
100 | - if( ! empty( $img_array['url'] ) ) { |
|
100 | + if ( ! empty( $img_array[ 'url' ] ) ) { |
|
101 | 101 | |
102 | - $img_name = basename( $img_array['url'] ); |
|
102 | + $img_name = basename( $img_array[ 'url' ] ); |
|
103 | 103 | |
104 | 104 | /** |
105 | 105 | * Set the $uploaded_files value so that the .ginput_preview renders, and the file upload is hidden |
106 | 106 | * @see GF_Field_Post_Image::get_field_input See the `<span class='ginput_preview'>` code |
107 | 107 | * @see GFFormsModel::get_temp_filename See the `rgget( $input_name, self::$uploaded_files[ $form_id ] );` code |
108 | 108 | */ |
109 | - if( empty( GFFormsModel::$uploaded_files[ $form_id ][ $input_name ] ) ) { |
|
109 | + if ( empty( GFFormsModel::$uploaded_files[ $form_id ][ $input_name ] ) ) { |
|
110 | 110 | GFFormsModel::$uploaded_files[ $form_id ][ $input_name ] = $img_name; |
111 | 111 | } |
112 | 112 | } |
@@ -135,8 +135,8 @@ discard block |
||
135 | 135 | * @hack |
136 | 136 | */ |
137 | 137 | if ( null !== $img_name ) { |
138 | - $current_file = sprintf( "<input name='%s' id='%s' type='hidden' value='%s' />", $input_name, $field_id, esc_url_raw( $img_array['url'] ) ); |
|
139 | - $gf_post_image_field_output = str_replace('<span class=\'ginput_preview\'>', '<span class=\'ginput_preview\'>'.$current_file, $gf_post_image_field_output ); |
|
138 | + $current_file = sprintf( "<input name='%s' id='%s' type='hidden' value='%s' />", $input_name, $field_id, esc_url_raw( $img_array[ 'url' ] ) ); |
|
139 | + $gf_post_image_field_output = str_replace( '<span class=\'ginput_preview\'>', '<span class=\'ginput_preview\'>' . $current_file, $gf_post_image_field_output ); |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | return $gf_post_image_field_output; |
@@ -13,7 +13,7 @@ |
||
13 | 13 | * @see GFCommon::get_field_filter_settings Gravity Forms suggests checkboxes should just be "contains" |
14 | 14 | * @var array |
15 | 15 | */ |
16 | - var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains'); |
|
16 | + var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains' ); |
|
17 | 17 | |
18 | 18 | var $is_searchable = true; |
19 | 19 |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | var $is_searchable = true; |
13 | 13 | |
14 | - var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains'); |
|
14 | + var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains' ); |
|
15 | 15 | |
16 | 16 | var $_gf_field_class_name = 'GF_Field_Radio'; |
17 | 17 | |
@@ -40,8 +40,8 @@ discard block |
||
40 | 40 | // Set the $_field_id var |
41 | 41 | $field_options = parent::field_options( $field_options, $template_id, $field_id, $context, $input_type ); |
42 | 42 | |
43 | - if( $this->is_choice_value_enabled() ) { |
|
44 | - $field_options['choice_display'] = array( |
|
43 | + if ( $this->is_choice_value_enabled() ) { |
|
44 | + $field_options[ 'choice_display' ] = array( |
|
45 | 45 | 'type' => 'radio', |
46 | 46 | 'value' => 'value', |
47 | 47 | 'label' => __( 'What should be displayed:', 'gravityview' ), |