@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | * - Checks PHP version numbers |
208 | 208 | * - Sets self::$is_compatible[__CLASS__] to boolean value |
209 | 209 | * |
210 | - * @return boolean Is the extension supported? |
|
210 | + * @return boolean|null Is the extension supported? |
|
211 | 211 | */ |
212 | 212 | protected function is_extension_supported() { |
213 | 213 | |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | /** |
330 | 330 | * Add a notice to be displayed in the admin. |
331 | 331 | * |
332 | - * @param array $notice Array with `class` and `message` keys. The message is not escaped. |
|
332 | + * @param string $notice Array with `class` and `message` keys. The message is not escaped. |
|
333 | 333 | * |
334 | 334 | * @return void |
335 | 335 | */ |
@@ -291,7 +291,7 @@ |
||
291 | 291 | public function settings() { |
292 | 292 | |
293 | 293 | // If doing ajax, get outta here |
294 | - if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX && 'update-plugin' !== Utils::_POST('action') ) ) { |
|
294 | + if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX && 'update-plugin' !== Utils::_POST('action') ) ) { |
|
295 | 295 | return; |
296 | 296 | } |
297 | 297 |
@@ -305,13 +305,13 @@ |
||
305 | 305 | $this->_remote_update_url, |
306 | 306 | $this->_path, |
307 | 307 | array( |
308 | - 'version' => $this->_version, // current version number |
|
309 | - 'license' => \GV\Utils::get( $license, 'license_key', $license['license'] ), |
|
310 | - 'item_id' => $this->_item_id, // The ID of the download on _remote_update_url |
|
311 | - 'item_name' => $this->_title, // name of this plugin |
|
312 | - 'author' => strip_tags( $this->_author ) // author of this plugin |
|
313 | - ) |
|
314 | - ); |
|
308 | + 'version' => $this->_version, // current version number |
|
309 | + 'license' => \GV\Utils::get( $license, 'license_key', $license['license'] ), |
|
310 | + 'item_id' => $this->_item_id, // The ID of the download on _remote_update_url |
|
311 | + 'item_name' => $this->_title, // name of this plugin |
|
312 | + 'author' => strip_tags( $this->_author ) // author of this plugin |
|
313 | + ) |
|
314 | + ); |
|
315 | 315 | } |
316 | 316 | |
317 | 317 | /** |
@@ -180,13 +180,13 @@ discard block |
||
180 | 180 | $tab = wp_parse_args( $tab_settings, $tab_defaults ); |
181 | 181 | |
182 | 182 | // Force the screen to be GravityView |
183 | - $tab['screen'] = 'gravityview'; |
|
183 | + $tab[ 'screen' ] = 'gravityview'; |
|
184 | 184 | |
185 | 185 | if ( class_exists( 'GravityView_Metabox_Tab' ) ) { |
186 | - $metabox = new \GravityView_Metabox_Tab( $tab['id'], $tab['title'], $tab['file'], $tab['icon-class'], $tab['callback'], $tab['callback_args'] ); |
|
186 | + $metabox = new \GravityView_Metabox_Tab( $tab[ 'id' ], $tab[ 'title' ], $tab[ 'file' ], $tab[ 'icon-class' ], $tab[ 'callback' ], $tab[ 'callback_args' ] ); |
|
187 | 187 | \GravityView_Metabox_Tabs::add( $metabox ); |
188 | 188 | } else { |
189 | - add_meta_box( 'gravityview_' . $tab['id'], $tab['title'], $tab['callback'], $tab['screen'], $tab['context'], $tab['priority'] ); |
|
189 | + add_meta_box( 'gravityview_' . $tab[ 'id' ], $tab[ 'title' ], $tab[ 'callback' ], $tab[ 'screen' ], $tab[ 'context' ], $tab[ 'priority' ] ); |
|
190 | 190 | } |
191 | 191 | } |
192 | 192 | |
@@ -211,14 +211,14 @@ discard block |
||
211 | 211 | */ |
212 | 212 | protected function is_extension_supported() { |
213 | 213 | |
214 | - self::$is_compatible = is_array( self::$is_compatible ) ? self::$is_compatible : array( get_called_class() => (bool) self::$is_compatible ); |
|
214 | + self::$is_compatible = is_array( self::$is_compatible ) ? self::$is_compatible : array( get_called_class() => (bool)self::$is_compatible ); |
|
215 | 215 | |
216 | 216 | if ( ! function_exists( 'gravityview' ) ) { |
217 | 217 | $message = sprintf( __( 'Could not activate the %s Extension; GravityView is not active.', 'gravityview' ), esc_html( $this->_title ) ); |
218 | - } else if ( false === version_compare( Plugin::$version, $this->_min_gravityview_version , ">=" ) ) { |
|
219 | - $message = sprintf( __( 'The %s Extension requires GravityView Version %s or newer.', 'gravityview' ), esc_html( $this->_title ), '<tt>'.$this->_min_gravityview_version.'</tt>' ); |
|
220 | - } else if ( isset( $this->_min_php_version ) && false === version_compare( phpversion(), $this->_min_php_version , ">=" ) ) { |
|
221 | - $message = sprintf( __( 'The %s Extension requires PHP Version %s or newer. Please ask your host to upgrade your server\'s PHP.', 'gravityview' ), esc_html( $this->_title ), '<tt>'.$this->_min_php_version.'</tt>' ); |
|
218 | + } else if ( false === version_compare( Plugin::$version, $this->_min_gravityview_version, ">=" ) ) { |
|
219 | + $message = sprintf( __( 'The %s Extension requires GravityView Version %s or newer.', 'gravityview' ), esc_html( $this->_title ), '<tt>' . $this->_min_gravityview_version . '</tt>' ); |
|
220 | + } else if ( isset( $this->_min_php_version ) && false === version_compare( phpversion(), $this->_min_php_version, ">=" ) ) { |
|
221 | + $message = sprintf( __( 'The %s Extension requires PHP Version %s or newer. Please ask your host to upgrade your server\'s PHP.', 'gravityview' ), esc_html( $this->_title ), '<tt>' . $this->_min_php_version . '</tt>' ); |
|
222 | 222 | } else if ( ! empty( $this->_max_gravityview_version ) && false === version_compare( $this->_max_gravityview_version, Plugin::$version, ">" ) ) { |
223 | 223 | $message = sprintf( __( 'The %s Extension is not compatible with this version of GravityView. Please update the Extension to the latest version.', 'gravityview' ), esc_html( $this->_title ) ); |
224 | 224 | } else { |
@@ -258,12 +258,12 @@ discard block |
||
258 | 258 | |
259 | 259 | $locale = get_locale(); |
260 | 260 | |
261 | - if ( function_exists('get_user_locale') && is_admin() ) { |
|
261 | + if ( function_exists( 'get_user_locale' ) && is_admin() ) { |
|
262 | 262 | $locale = get_user_locale(); |
263 | 263 | } |
264 | 264 | |
265 | 265 | // Traditional WordPress plugin locale filter |
266 | - $locale = apply_filters( 'plugin_locale', $locale, $this->_text_domain ); |
|
266 | + $locale = apply_filters( 'plugin_locale', $locale, $this->_text_domain ); |
|
267 | 267 | |
268 | 268 | $mofile = sprintf( '%1$s-%2$s.mo', $this->_text_domain, $locale ); |
269 | 269 | |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | public function settings() { |
292 | 292 | |
293 | 293 | // If doing ajax, get outta here |
294 | - if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX && 'update-plugin' !== Utils::_POST('action') ) ) { |
|
294 | + if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX && 'update-plugin' !== Utils::_POST( 'action' ) ) ) { |
|
295 | 295 | return; |
296 | 296 | } |
297 | 297 | |
@@ -306,9 +306,9 @@ discard block |
||
306 | 306 | $this->_path, |
307 | 307 | array( |
308 | 308 | 'version' => $this->_version, // current version number |
309 | - 'license' => \GV\Utils::get( $license, 'license_key', $license['license'] ), |
|
309 | + 'license' => \GV\Utils::get( $license, 'license_key', $license[ 'license' ] ), |
|
310 | 310 | 'item_id' => $this->_item_id, // The ID of the download on _remote_update_url |
311 | - 'item_name' => $this->_title, // name of this plugin |
|
311 | + 'item_name' => $this->_title, // name of this plugin |
|
312 | 312 | 'author' => strip_tags( $this->_author ) // author of this plugin |
313 | 313 | ) |
314 | 314 | ); |
@@ -337,16 +337,16 @@ discard block |
||
337 | 337 | */ |
338 | 338 | public static function add_notice( $notice = array() ) { |
339 | 339 | |
340 | - if ( is_array( $notice ) && empty( $notice['message'] ) ) { |
|
340 | + if ( is_array( $notice ) && empty( $notice[ 'message' ] ) ) { |
|
341 | 341 | gravityview()->log->error( 'Notice not set', array( 'data' => $notice ) ); |
342 | 342 | return; |
343 | 343 | } else if ( is_string( $notice ) ) { |
344 | 344 | $notice = array( 'message' => $notice ); |
345 | 345 | } |
346 | 346 | |
347 | - $notice['class'] = empty( $notice['class'] ) ? 'error' : $notice['class']; |
|
347 | + $notice[ 'class' ] = empty( $notice[ 'class' ] ) ? 'error' : $notice[ 'class' ]; |
|
348 | 348 | |
349 | - self::$admin_notices []= $notice; |
|
349 | + self::$admin_notices [ ] = $notice; |
|
350 | 350 | } |
351 | 351 | |
352 | 352 | /** |
@@ -360,8 +360,8 @@ discard block |
||
360 | 360 | } |
361 | 361 | |
362 | 362 | foreach ( self::$admin_notices as $key => $notice ) { |
363 | - echo '<div id="message" class="'. esc_attr( $notice['class'] ).'">'; |
|
364 | - echo wpautop( $notice['message'] ); |
|
363 | + echo '<div id="message" class="' . esc_attr( $notice[ 'class' ] ) . '">'; |
|
364 | + echo wpautop( $notice[ 'message' ] ); |
|
365 | 365 | echo '<div class="clear"></div>'; |
366 | 366 | echo '</div>'; |
367 | 367 | } |
@@ -54,7 +54,7 @@ |
||
54 | 54 | * @param \GV\GF_Form $form The Gravity Form form. |
55 | 55 | * @param int $field_id The Gravity Form field ID for the $form. |
56 | 56 | * |
57 | - * @return \GV\Field|null The requested field or null if not found. |
|
57 | + * @return null|GF_Field The requested field or null if not found. |
|
58 | 58 | */ |
59 | 59 | public static function by_id( $form, $field_id ) { |
60 | 60 |
@@ -27,17 +27,17 @@ discard block |
||
27 | 27 | * @return \GV\GF_Field|null The field implementation or null on error. |
28 | 28 | */ |
29 | 29 | public static function from_configuration( $configuration ) { |
30 | - if ( empty( $configuration['id'] ) || ! is_numeric( $configuration['id'] ) ) { |
|
30 | + if ( empty( $configuration[ 'id' ] ) || ! is_numeric( $configuration[ 'id' ] ) ) { |
|
31 | 31 | gravityview()->log->error( 'Invalid configuration[id] supplied.' ); |
32 | 32 | return null; |
33 | 33 | } |
34 | 34 | |
35 | - if ( empty( $configuration['form_id'] ) || ! $form = \GV\GF_Form::by_id( $configuration['form_id'] ) ) { |
|
35 | + if ( empty( $configuration[ 'form_id' ] ) || ! $form = \GV\GF_Form::by_id( $configuration[ 'form_id' ] ) ) { |
|
36 | 36 | gravityview()->log->error( 'Invalid configuration[form_id] supplied.' ); |
37 | 37 | return null; |
38 | 38 | } |
39 | 39 | |
40 | - $field = self::by_id( $form, $configuration['id'] ); |
|
40 | + $field = self::by_id( $form, $configuration[ 'id' ] ); |
|
41 | 41 | |
42 | 42 | if ( ! $field ) { |
43 | 43 | gravityview()->log->error( 'Invalid configuration[id] supplied.' ); |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | |
112 | 112 | /** This is a complex Gravity Forms input. */ |
113 | 113 | if ( $input = \GFFormsModel::get_input( $this->field, $this->ID ) ) { |
114 | - $label = ! empty( $input['customLabel'] ) ? $input['customLabel'] : $input['label']; |
|
114 | + $label = ! empty( $input[ 'customLabel' ] ) ? $input[ 'customLabel' ] : $input[ 'label' ]; |
|
115 | 115 | } else { |
116 | 116 | /** This is a field with one label. */ |
117 | 117 | $label = $this->field->get_field_label( true, $this->label ); |
@@ -132,10 +132,8 @@ |
||
132 | 132 | /** |
133 | 133 | * Get a \GV\Field by Form and Field ID for this data source. |
134 | 134 | * |
135 | - * @param \GV\GF_Form $form The Gravity Form form ID. |
|
136 | - * @param int $field_id The Gravity Form field ID for the $form_id. |
|
137 | 135 | * |
138 | - * @return \GV\Field|null The requested field or null if not found. |
|
136 | + * @return null|GF_Field The requested field or null if not found. |
|
139 | 137 | */ |
140 | 138 | public static function get_field( /** varargs */ ) { |
141 | 139 | $args = func_get_args(); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | $self = new self(); |
56 | 56 | $self->form = $form; |
57 | 57 | |
58 | - $self->ID = intval( $self->form['id'] ); |
|
58 | + $self->ID = intval( $self->form[ 'id' ] ); |
|
59 | 59 | |
60 | 60 | return $self; |
61 | 61 | } |
@@ -70,13 +70,13 @@ discard block |
||
70 | 70 | * @return \GV\GF_Form|null An instance of this form or null if not found. |
71 | 71 | */ |
72 | 72 | public static function from_form( $form ) { |
73 | - if ( empty( $form['id'] ) ) { |
|
73 | + if ( empty( $form[ 'id' ] ) ) { |
|
74 | 74 | return null; |
75 | 75 | } |
76 | 76 | |
77 | 77 | $self = new self(); |
78 | 78 | $self->form = $form; |
79 | - $self->ID = $self->form['id']; |
|
79 | + $self->ID = $self->form[ 'id' ]; |
|
80 | 80 | |
81 | 81 | return $self; |
82 | 82 | } |
@@ -119,11 +119,11 @@ discard block |
||
119 | 119 | |
120 | 120 | /** The offset and limit */ |
121 | 121 | if ( ! empty( $offset->limit ) ) { |
122 | - $paging['page_size'] = $offset->limit; |
|
122 | + $paging[ 'page_size' ] = $offset->limit; |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | if ( ! empty( $offset->offset ) ) { |
126 | - $paging['offset'] = $offset->offset; |
|
126 | + $paging[ 'offset' ] = $offset->offset; |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | foreach ( \GFAPI::get_entries( $form->ID, $search_criteria, $sorting, $paging ) as $entry ) { |
@@ -180,8 +180,8 @@ discard block |
||
180 | 180 | */ |
181 | 181 | public function get_fields() { |
182 | 182 | $fields = array(); |
183 | - foreach ( $this['fields'] as $field ) { |
|
184 | - foreach ( empty( $field['inputs'] ) ? array( $field['id'] ) : wp_list_pluck( $field['inputs'], 'id' ) as $id ) { |
|
183 | + foreach ( $this[ 'fields' ] as $field ) { |
|
184 | + foreach ( empty( $field[ 'inputs' ] ) ? array( $field[ 'id' ] ) : wp_list_pluck( $field[ 'inputs' ], 'id' ) as $id ) { |
|
185 | 185 | if ( is_numeric( $id ) ) { |
186 | 186 | $fields[ $id ] = self::get_field( $this, $id ); |
187 | 187 | } else { |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | * @return bool Whether the offset exists or not. |
219 | 219 | */ |
220 | 220 | public function offsetExists( $offset ) { |
221 | - return isset( $this->form[$offset] ); |
|
221 | + return isset( $this->form[ $offset ] ); |
|
222 | 222 | } |
223 | 223 | |
224 | 224 | /** |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | * @return mixed The value of the requested form data. |
234 | 234 | */ |
235 | 235 | public function offsetGet( $offset ) { |
236 | - return $this->form[$offset]; |
|
236 | + return $this->form[ $offset ]; |
|
237 | 237 | } |
238 | 238 | |
239 | 239 | /** |
@@ -64,7 +64,7 @@ |
||
64 | 64 | * Set an setting. |
65 | 65 | * |
66 | 66 | * @param mixed $key The key in this setting to retrieve. |
67 | - * @param mixed $default A default in case the key is not set. |
|
67 | + * @param false|null $default A default in case the key is not set. |
|
68 | 68 | * |
69 | 69 | * @api |
70 | 70 | * @since 2.0 |
@@ -22,7 +22,7 @@ |
||
22 | 22 | * |
23 | 23 | * @param \GV\Field $field The field to be ouput. |
24 | 24 | * |
25 | - * @return string|false The field output or false if "hide_empty" is set. |
|
25 | + * @return null|string The field output or false if "hide_empty" is set. |
|
26 | 26 | */ |
27 | 27 | public function the_field( \GV\Field $field ) { |
28 | 28 | $renderer = new Field_Renderer(); |
@@ -63,7 +63,6 @@ |
||
63 | 63 | * Initializer. |
64 | 64 | * |
65 | 65 | * @param \GV\View $view The View connected to this template. |
66 | - * @param \GV\Entry_Collection $entries A collection of entries for this view. |
|
67 | 66 | * @param \GV\Request $request The request context. |
68 | 67 | */ |
69 | 68 | public function __construct( Entry $entry, View $view, Request $request ) { |
@@ -113,18 +113,18 @@ |
||
113 | 113 | global $post; |
114 | 114 | |
115 | 115 | if ( ! $this->request->is_view() && $post ) { |
116 | - $specifics []= sprintf( '%spost-%d-view-%d-entry-%d-%s.php', $slug_dir, $post->ID, $this->view->ID, $this->entry->ID, $slug_name ); |
|
117 | - $specifics []= sprintf( '%spost-%d-entry-%d-%s.php', $slug_dir, $post->ID, $this->entry->ID, $slug_name ); |
|
118 | - $specifics []= sprintf( '%spost-%d-view-%d-%s.php', $slug_dir, $post->ID, $this->view->ID, $slug_name ); |
|
119 | - $specifics []= sprintf( '%spost-%d-%s.php', $slug_dir, $post->ID, $slug_name ); |
|
116 | + $specifics [ ] = sprintf( '%spost-%d-view-%d-entry-%d-%s.php', $slug_dir, $post->ID, $this->view->ID, $this->entry->ID, $slug_name ); |
|
117 | + $specifics [ ] = sprintf( '%spost-%d-entry-%d-%s.php', $slug_dir, $post->ID, $this->entry->ID, $slug_name ); |
|
118 | + $specifics [ ] = sprintf( '%spost-%d-view-%d-%s.php', $slug_dir, $post->ID, $this->view->ID, $slug_name ); |
|
119 | + $specifics [ ] = sprintf( '%spost-%d-%s.php', $slug_dir, $post->ID, $slug_name ); |
|
120 | 120 | } |
121 | 121 | |
122 | - $specifics []= sprintf( '%sview-%d-entry-%d-%s.php', $slug_dir, $this->view->ID, $this->entry->ID, $slug_name ); |
|
123 | - $specifics []= sprintf( '%sform-%d-entry-%d-%s.php', $slug_dir, $this->view->form->ID, $this->entry->ID, $slug_name ); |
|
124 | - $specifics []= sprintf( '%sview-%d-%s.php', $slug_dir, $this->view->ID, $slug_name ); |
|
125 | - $specifics []= sprintf( '%sform-%d-%s.php', $slug_dir, $this->view->form->ID, $slug_name ); |
|
122 | + $specifics [ ] = sprintf( '%sview-%d-entry-%d-%s.php', $slug_dir, $this->view->ID, $this->entry->ID, $slug_name ); |
|
123 | + $specifics [ ] = sprintf( '%sform-%d-entry-%d-%s.php', $slug_dir, $this->view->form->ID, $this->entry->ID, $slug_name ); |
|
124 | + $specifics [ ] = sprintf( '%sview-%d-%s.php', $slug_dir, $this->view->ID, $slug_name ); |
|
125 | + $specifics [ ] = sprintf( '%sform-%d-%s.php', $slug_dir, $this->view->form->ID, $slug_name ); |
|
126 | 126 | |
127 | - $specifics []= sprintf( '%sentry-%d-%s.php', $slug_dir, $this->entry->ID, $slug_name ); |
|
127 | + $specifics [ ] = sprintf( '%sentry-%d-%s.php', $slug_dir, $this->entry->ID, $slug_name ); |
|
128 | 128 | |
129 | 129 | return array_merge( $specifics, $templates ); |
130 | 130 | } |
@@ -51,7 +51,7 @@ |
||
51 | 51 | * @param \GV\Field $field The Field. |
52 | 52 | * @param \GV\Request $request The request. |
53 | 53 | * |
54 | - * @return void |
|
54 | + * @return string|null |
|
55 | 55 | */ |
56 | 56 | public function __construct( \GV\View $view, \GV\Entry $entry = null, \GV\Field $field = null, \GV\Request $request = null ) { |
57 | 57 | add_filter( $this->filter_prefix . '_get_template_part', array( $this, 'add_id_specific_templates' ), 10, 3 ); |
@@ -98,15 +98,15 @@ discard block |
||
98 | 98 | $additional = array(); |
99 | 99 | |
100 | 100 | // form-19-table-body.php |
101 | - $additional[] = sprintf( 'form-%d-%s-%s.php', $this->view->form ? $this->view->form->ID : 0, $slug, $name ); |
|
101 | + $additional[ ] = sprintf( 'form-%d-%s-%s.php', $this->view->form ? $this->view->form->ID : 0, $slug, $name ); |
|
102 | 102 | |
103 | 103 | // view-3-table-body.php |
104 | - $additional[] = sprintf( 'view-%d-%s-%s.php', $this->view->ID, $slug, $name ); |
|
104 | + $additional[ ] = sprintf( 'view-%d-%s-%s.php', $this->view->ID, $slug, $name ); |
|
105 | 105 | |
106 | 106 | global $post; |
107 | 107 | if ( $post ) { |
108 | 108 | // page-19-table-body.php |
109 | - $additional[] = sprintf( 'page-%d-%s-%s.php', $post->ID, $slug, $name ); |
|
109 | + $additional[ ] = sprintf( 'page-%d-%s-%s.php', $post->ID, $slug, $name ); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | // Combine with existing table-body.php and table.php |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | ob_start(); |
131 | 131 | |
132 | 132 | $request = new Mock_Request(); |
133 | - $request->returns['is_view'] = $this->view; |
|
133 | + $request->returns[ 'is_view' ] = $this->view; |
|
134 | 134 | |
135 | 135 | /** |
136 | 136 | * You got one shot. One opportunity. To render all the widgets you have ever wanted. |
@@ -144,17 +144,17 @@ discard block |
||
144 | 144 | foreach ( array( 'gravityview_before', 'gravityview_after' ) as $hook ) { |
145 | 145 | /** WordPress 4.6 and lower compatibility, when WP_Hook classes were still absent. */ |
146 | 146 | if ( is_array( $wp_filter[ $hook ] ) ) { |
147 | - if ( ! empty( $wp_filter[ $hook ][10] ) ) { |
|
148 | - foreach ( $wp_filter[ $hook ][10] as $function_key => $callback ) { |
|
147 | + if ( ! empty( $wp_filter[ $hook ][ 10 ] ) ) { |
|
148 | + foreach ( $wp_filter[ $hook ][ 10 ] as $function_key => $callback ) { |
|
149 | 149 | if ( strpos( $function_key, 'render_widget_hooks' ) ) { |
150 | - unset( $wp_filter[ $hook ][10][ $function_key ] ); |
|
150 | + unset( $wp_filter[ $hook ][ 10 ][ $function_key ] ); |
|
151 | 151 | } |
152 | 152 | } |
153 | 153 | } |
154 | 154 | } else { |
155 | - foreach ( $wp_filter[ $hook ]->callbacks[10] as $function_key => $callback ) { |
|
155 | + foreach ( $wp_filter[ $hook ]->callbacks[ 10 ] as $function_key => $callback ) { |
|
156 | 156 | if ( strpos( $function_key, 'render_widget_hooks' ) ) { |
157 | - unset( $wp_filter[ $hook ]->callbacks[10][ $function_key ] ); |
|
157 | + unset( $wp_filter[ $hook ]->callbacks[ 10 ][ $function_key ] ); |
|
158 | 158 | } |
159 | 159 | } |
160 | 160 | } |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | */ |
166 | 166 | if ( $this->entry ) { |
167 | 167 | |
168 | - $request->returns['is_entry'] = $this->entry; |
|
168 | + $request->returns[ 'is_entry' ] = $this->entry; |
|
169 | 169 | |
170 | 170 | global $post; |
171 | 171 | |
@@ -209,8 +209,8 @@ discard block |
||
209 | 209 | 'fields' => $this->view->fields->by_visible(), |
210 | 210 | 'in_the_loop' => true, |
211 | 211 | ), empty( $parameters ) ? array() : array( |
212 | - 'paging' => $parameters['paging'], |
|
213 | - 'sorting' => $parameters['sorting'], |
|
212 | + 'paging' => $parameters[ 'paging' ], |
|
213 | + 'sorting' => $parameters[ 'sorting' ], |
|
214 | 214 | ), $post ? array( |
215 | 215 | 'post' => $post, |
216 | 216 | ) : array() ) ); |
@@ -151,7 +151,7 @@ |
||
151 | 151 | * Output a field cell. |
152 | 152 | * |
153 | 153 | * @param \GV\Field $field The field to be ouput. |
154 | - * @param \GV\Field $entry The entry this field is for. |
|
154 | + * @param Entry $entry The entry this field is for. |
|
155 | 155 | * |
156 | 156 | * @return void |
157 | 157 | */ |
@@ -77,22 +77,22 @@ |
||
77 | 77 | 'dir' => 'asc', |
78 | 78 | ); |
79 | 79 | |
80 | - if ( ! empty( $sorting['key'] ) && (string) $sort_field_id === (string) $sorting['key'] ) { |
|
80 | + if ( ! empty( $sorting[ 'key' ] ) && (string)$sort_field_id === (string)$sorting[ 'key' ] ) { |
|
81 | 81 | //toggle sorting direction. |
82 | - if ( 'asc' === $sorting['direction'] ) { |
|
83 | - $sort_args['dir'] = 'desc'; |
|
82 | + if ( 'asc' === $sorting[ 'direction' ] ) { |
|
83 | + $sort_args[ 'dir' ] = 'desc'; |
|
84 | 84 | $class .= ' gv-icon-sort-desc'; |
85 | 85 | } else { |
86 | - $sort_args['dir'] = 'asc'; |
|
86 | + $sort_args[ 'dir' ] = 'asc'; |
|
87 | 87 | $class .= ' gv-icon-sort-asc'; |
88 | 88 | } |
89 | 89 | } else { |
90 | 90 | $class .= ' gv-icon-caret-up-down'; |
91 | 91 | } |
92 | 92 | |
93 | - $url = add_query_arg( $sort_args, remove_query_arg( array('pagenum') ) ); |
|
93 | + $url = add_query_arg( $sort_args, remove_query_arg( array( 'pagenum' ) ) ); |
|
94 | 94 | |
95 | - return '<a href="'. esc_url_raw( $url ) .'" class="'. $class .'" ></a> '. $column_label; |
|
95 | + return '<a href="' . esc_url_raw( $url ) . '" class="' . $class . '" ></a> ' . $column_label; |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | /** |
@@ -19,8 +19,8 @@ discard block |
||
19 | 19 | |
20 | 20 | |
21 | 21 | /** |
22 | - * Constructor. Add filters to modify output. |
|
23 | - * |
|
22 | + * Constructor. Add filters to modify output. |
|
23 | + * |
|
24 | 24 | * @since 2.0.4 |
25 | 25 | * |
26 | 26 | * @param View $view |
@@ -29,19 +29,19 @@ discard block |
||
29 | 29 | */ |
30 | 30 | public function __construct( View $view, Entry_Collection $entries, Request $request ) { |
31 | 31 | |
32 | - add_filter( 'gravityview/template/field/label', array( __CLASS__, 'add_columns_sort_links' ), 100, 2 ); |
|
32 | + add_filter( 'gravityview/template/field/label', array( __CLASS__, 'add_columns_sort_links' ), 100, 2 ); |
|
33 | 33 | |
34 | 34 | parent::__construct( $view, $entries, $request ); |
35 | 35 | } |
36 | 36 | |
37 | 37 | /** |
38 | - * Add sorting links to HTML columns that support sorting |
|
39 | - * |
|
40 | - * @since 2.0.4 |
|
41 | - * @since 2.0.5 Made static |
|
42 | - * |
|
43 | - * @static |
|
44 | - * |
|
38 | + * Add sorting links to HTML columns that support sorting |
|
39 | + * |
|
40 | + * @since 2.0.4 |
|
41 | + * @since 2.0.5 Made static |
|
42 | + * |
|
43 | + * @static |
|
44 | + * |
|
45 | 45 | * @param string $column_label Label for the table column |
46 | 46 | * @param \GV\Template_Context $context |
47 | 47 | * |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | $sort_columns = $context->view->settings->get( 'sort_columns' ); |
53 | 53 | |
54 | 54 | if ( empty( $sort_columns ) ) { |
55 | - return $column_label; |
|
55 | + return $column_label; |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | if ( ! \GravityView_frontend::getInstance()->is_field_sortable( $context->field->ID, $context->view->form->form ) ) { |
@@ -113,10 +113,10 @@ discard block |
||
113 | 113 | } |
114 | 114 | |
115 | 115 | /** |
116 | - * Returns the label for a column, with support for all deprecated filters |
|
117 | - * |
|
118 | - * @since 2.1 |
|
119 | - * |
|
116 | + * Returns the label for a column, with support for all deprecated filters |
|
117 | + * |
|
118 | + * @since 2.1 |
|
119 | + * |
|
120 | 120 | * @param \GV\Field $field |
121 | 121 | * @param \GV\Template_Context $context |
122 | 122 | */ |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | $column_label = apply_filters( 'gravityview/template/field/label', $column_label, $context ); |
140 | 140 | |
141 | 141 | return $column_label; |
142 | - } |
|
142 | + } |
|
143 | 143 | |
144 | 144 | /** |
145 | 145 | * Output the entry row. |
@@ -208,15 +208,15 @@ discard block |
||
208 | 208 | */ |
209 | 209 | do_action( 'gravityview/template/table/cells/before', $context ); |
210 | 210 | |
211 | - /** |
|
212 | - * @action `gravityview_table_cells_before` Inside the `tr` while rendering each entry in the loop. Can be used to insert additional table cells. |
|
213 | - * @since 1.0.7 |
|
211 | + /** |
|
212 | + * @action `gravityview_table_cells_before` Inside the `tr` while rendering each entry in the loop. Can be used to insert additional table cells. |
|
213 | + * @since 1.0.7 |
|
214 | 214 | * @param \GravityView_View $this Current GravityView_View object |
215 | 215 | * @deprecated Use `gravityview/template/table/cells/before` |
216 | - */ |
|
217 | - do_action( 'gravityview_table_cells_before', \GravityView_View::getInstance() ); |
|
216 | + */ |
|
217 | + do_action( 'gravityview_table_cells_before', \GravityView_View::getInstance() ); |
|
218 | 218 | |
219 | - foreach ( $fields->all() as $field ) { |
|
219 | + foreach ( $fields->all() as $field ) { |
|
220 | 220 | $this->the_field( $field, $entry ); |
221 | 221 | } |
222 | 222 | |
@@ -227,13 +227,13 @@ discard block |
||
227 | 227 | */ |
228 | 228 | do_action( 'gravityview/template/table/cells/after', $context ); |
229 | 229 | |
230 | - /** |
|
231 | - * @action `gravityview_table_cells_after` Inside the `tr` while rendering each entry in the loop. Can be used to insert additional table cells. |
|
232 | - * @since 1.0.7 |
|
230 | + /** |
|
231 | + * @action `gravityview_table_cells_after` Inside the `tr` while rendering each entry in the loop. Can be used to insert additional table cells. |
|
232 | + * @since 1.0.7 |
|
233 | 233 | * @param \GravityView_View $this Current GravityView_View object |
234 | 234 | * @deprecated Use `gravityview/template/table/cells/after` |
235 | - */ |
|
236 | - do_action( 'gravityview_table_cells_after', \GravityView_View::getInstance() ); |
|
235 | + */ |
|
236 | + do_action( 'gravityview_table_cells_after', \GravityView_View::getInstance() ); |
|
237 | 237 | |
238 | 238 | ?> |
239 | 239 | </tr> |
@@ -271,9 +271,9 @@ discard block |
||
271 | 271 | 'value' => $value, |
272 | 272 | 'hide_empty' => false, |
273 | 273 | 'zone_id' => 'directory_table-columns', |
274 | - 'label' => self::get_field_column_label( $field, $context ), |
|
274 | + 'label' => self::get_field_column_label( $field, $context ), |
|
275 | 275 | 'markup' => '<td id="{{ field_id }}" class="{{ class }}" data-label="{{label_value:data-label}}">{{ value }}</td>', |
276 | - 'form' => $form, |
|
276 | + 'form' => $form, |
|
277 | 277 | ); |
278 | 278 | |
279 | 279 | /** Output. */ |
@@ -298,11 +298,11 @@ discard block |
||
298 | 298 | do_action( 'gravityview/template/table/body/before', $context ); |
299 | 299 | |
300 | 300 | /** |
301 | - * @action `gravityview_table_body_before` Inside the `tbody`, before any rows are rendered. Can be used to insert additional rows. |
|
302 | - * @deprecated Use `gravityview/template/table/body/before` |
|
303 | - * @since 1.0.7 |
|
304 | - * @param \GravityView_View $gravityview_view Current GravityView_View object. |
|
305 | - */ |
|
301 | + * @action `gravityview_table_body_before` Inside the `tbody`, before any rows are rendered. Can be used to insert additional rows. |
|
302 | + * @deprecated Use `gravityview/template/table/body/before` |
|
303 | + * @since 1.0.7 |
|
304 | + * @param \GravityView_View $gravityview_view Current GravityView_View object. |
|
305 | + */ |
|
306 | 306 | do_action( 'gravityview_table_body_before', \GravityView_View::getInstance() /** ugh! */ ); |
307 | 307 | } |
308 | 308 | |
@@ -324,11 +324,11 @@ discard block |
||
324 | 324 | do_action( 'gravityview/template/table/body/after', $context ); |
325 | 325 | |
326 | 326 | /** |
327 | - * @action `gravityview_table_body_after` Inside the `tbody`, after any rows are rendered. Can be used to insert additional rows. |
|
328 | - * @deprecated Use `gravityview/template/table/body/after` |
|
329 | - * @since 1.0.7 |
|
330 | - * @param \GravityView_View $gravityview_view Current GravityView_View object. |
|
331 | - */ |
|
327 | + * @action `gravityview_table_body_after` Inside the `tbody`, after any rows are rendered. Can be used to insert additional rows. |
|
328 | + * @deprecated Use `gravityview/template/table/body/after` |
|
329 | + * @since 1.0.7 |
|
330 | + * @param \GravityView_View $gravityview_view Current GravityView_View object. |
|
331 | + */ |
|
332 | 332 | do_action( 'gravityview_table_body_after', \GravityView_View::getInstance() /** ugh! */ ); |
333 | 333 | } |
334 | 334 |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | * |
317 | 317 | * @param array $widget_args The Widget shortcode args. |
318 | 318 | * @param string $content The content. |
319 | - * @param string|\GV\Template_Context $context The context, if available. |
|
319 | + * @param string $context The context, if available. |
|
320 | 320 | * |
321 | 321 | * @return void |
322 | 322 | */ |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | * @internal |
376 | 376 | * @since 2.0 |
377 | 377 | * |
378 | - * @return \GV\Widget|null The widget implementation from configuration or none. |
|
378 | + * @return Widget The widget implementation from configuration or none. |
|
379 | 379 | */ |
380 | 380 | public static function from_configuration( $configuration ) { |
381 | 381 | $registered_widgets = self::registered(); |
@@ -163,14 +163,14 @@ |
||
163 | 163 | return $settings; |
164 | 164 | } |
165 | 165 | |
166 | - /** |
|
166 | + /** |
|
167 | 167 | * Get the Widget ID. |
168 | 168 | * |
169 | - * @return string The Widget ID. |
|
170 | - */ |
|
171 | - public function get_widget_id() { |
|
172 | - return $this->widget_id; |
|
173 | - } |
|
169 | + * @return string The Widget ID. |
|
170 | + */ |
|
171 | + public function get_widget_id() { |
|
172 | + return $this->widget_id; |
|
173 | + } |
|
174 | 174 | |
175 | 175 | /** |
176 | 176 | * Get the widget settings |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | $enable_custom_class = apply_filters( 'gravityview/widget/enable_custom_class', false, $this ); |
152 | 152 | |
153 | 153 | if ( $enable_custom_class ) { |
154 | - $settings['custom_class'] = array( |
|
154 | + $settings[ 'custom_class' ] = array( |
|
155 | 155 | 'type' => 'text', |
156 | 156 | 'label' => __( 'Custom CSS Class:', 'gravityview' ), |
157 | 157 | 'desc' => __( 'This class will be added to the widget container', 'gravityview' ), |
@@ -203,8 +203,8 @@ discard block |
||
203 | 203 | */ |
204 | 204 | public static function get_default_widget_areas() { |
205 | 205 | $default_areas = array( |
206 | - array( '1-1' => array( array( 'areaid' => 'top', 'title' => __( 'Top', 'gravityview' ) , 'subtitle' => '' ) ) ), |
|
207 | - array( '1-2' => array( array( 'areaid' => 'left', 'title' => __( 'Left', 'gravityview' ) , 'subtitle' => '' ) ), '2-2' => array( array( 'areaid' => 'right', 'title' => __( 'Right', 'gravityview' ) , 'subtitle' => '' ) ) ), |
|
206 | + array( '1-1' => array( array( 'areaid' => 'top', 'title' => __( 'Top', 'gravityview' ), 'subtitle' => '' ) ) ), |
|
207 | + array( '1-2' => array( array( 'areaid' => 'left', 'title' => __( 'Left', 'gravityview' ), 'subtitle' => '' ) ), '2-2' => array( array( 'areaid' => 'right', 'title' => __( 'Right', 'gravityview' ), 'subtitle' => '' ) ) ), |
|
208 | 208 | ); |
209 | 209 | |
210 | 210 | /** |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | } |
235 | 235 | |
236 | 236 | $widgets[ $this->get_widget_id() ] = array( |
237 | - 'label' => $this->widget_label , |
|
237 | + 'label' => $this->widget_label, |
|
238 | 238 | 'description' => $this->widget_description, |
239 | 239 | 'subtitle' => $this->widget_subtitle, |
240 | 240 | 'class' => get_called_class(), |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | */ |
256 | 256 | public function assign_widget_options( $options = array(), $template = '', $widget = '' ) { |
257 | 257 | if ( $this->get_widget_id() === $widget ) { |
258 | - if( $settings = $this->get_settings() ) { |
|
258 | + if ( $settings = $this->get_settings() ) { |
|
259 | 259 | $options = array_merge( $options, $settings ); |
260 | 260 | } |
261 | 261 | } |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | return; |
307 | 307 | } |
308 | 308 | |
309 | - add_shortcode( $this->shortcode_name, array( $this, 'render_shortcode') ); |
|
309 | + add_shortcode( $this->shortcode_name, array( $this, 'render_shortcode' ) ); |
|
310 | 310 | } |
311 | 311 | |
312 | 312 | /** |