@@ -328,34 +328,34 @@ discard block |
||
| 328 | 328 | } |
| 329 | 329 | |
| 330 | 330 | /** |
| 331 | - * Get the fields for a specific context |
|
| 332 | - * |
|
| 333 | - * @since 1.19.2 |
|
| 334 | - * |
|
| 331 | + * Get the fields for a specific context |
|
| 332 | + * |
|
| 333 | + * @since 1.19.2 |
|
| 334 | + * |
|
| 335 | 335 | * @param string $context [Optional] "directory", "single", or "edit" |
| 336 | 336 | * |
| 337 | 337 | * @return array Array of GravityView field layout configurations |
| 338 | 338 | */ |
| 339 | 339 | public function getContextFields( $context = '' ) { |
| 340 | 340 | |
| 341 | - if( '' === $context ) { |
|
| 342 | - $context = $this->getContext(); |
|
| 343 | - } |
|
| 341 | + if( '' === $context ) { |
|
| 342 | + $context = $this->getContext(); |
|
| 343 | + } |
|
| 344 | 344 | |
| 345 | 345 | $fields = $this->getFields(); |
| 346 | 346 | |
| 347 | - foreach ( (array) $fields as $key => $context_fields ) { |
|
| 347 | + foreach ( (array) $fields as $key => $context_fields ) { |
|
| 348 | 348 | |
| 349 | - // Formatted as `{context}_{template id}-{zone name}`, so we want just the $context to match against |
|
| 350 | - $matches = explode( '_', $key ); |
|
| 349 | + // Formatted as `{context}_{template id}-{zone name}`, so we want just the $context to match against |
|
| 350 | + $matches = explode( '_', $key ); |
|
| 351 | 351 | |
| 352 | - if( isset( $matches[0] ) && $matches[0] === $context ) { |
|
| 353 | - return $context_fields; |
|
| 354 | - } |
|
| 355 | - } |
|
| 352 | + if( isset( $matches[0] ) && $matches[0] === $context ) { |
|
| 353 | + return $context_fields; |
|
| 354 | + } |
|
| 355 | + } |
|
| 356 | 356 | |
| 357 | 357 | return array(); |
| 358 | - } |
|
| 358 | + } |
|
| 359 | 359 | |
| 360 | 360 | /** |
| 361 | 361 | * @param array $fields |
@@ -448,10 +448,10 @@ discard block |
||
| 448 | 448 | */ |
| 449 | 449 | public function getPaging() { |
| 450 | 450 | |
| 451 | - $default_params = array( |
|
| 452 | - 'offset' => 0, |
|
| 453 | - 'page_size' => 20, |
|
| 454 | - ); |
|
| 451 | + $default_params = array( |
|
| 452 | + 'offset' => 0, |
|
| 453 | + 'page_size' => 20, |
|
| 454 | + ); |
|
| 455 | 455 | |
| 456 | 456 | return wp_parse_args( $this->paging, $default_params ); |
| 457 | 457 | } |
@@ -508,10 +508,10 @@ discard block |
||
| 508 | 508 | public function getSorting() { |
| 509 | 509 | |
| 510 | 510 | $defaults_params = array( |
| 511 | - 'sort_field' => 'date_created', |
|
| 512 | - 'sort_direction' => 'ASC', |
|
| 513 | - 'is_numeric' => false, |
|
| 514 | - ); |
|
| 511 | + 'sort_field' => 'date_created', |
|
| 512 | + 'sort_direction' => 'ASC', |
|
| 513 | + 'is_numeric' => false, |
|
| 514 | + ); |
|
| 515 | 515 | |
| 516 | 516 | return wp_parse_args( $this->sorting, $defaults_params ); |
| 517 | 517 | } |
@@ -837,7 +837,7 @@ discard block |
||
| 837 | 837 | */ |
| 838 | 838 | public function render_widget_hooks( $view_id_or_context ) { |
| 839 | 839 | |
| 840 | - /** |
|
| 840 | + /** |
|
| 841 | 841 | * @deprecated Numeric argument is deprecated. Pass a \GV\Template_Context instead. |
| 842 | 842 | */ |
| 843 | 843 | if ( is_numeric( $view_id_or_context ) ) { |