@@ -181,9 +181,9 @@ discard block |
||
181 | 181 | * @return FunctionWrapper|mixed |
182 | 182 | */ |
183 | 183 | public static function function_wrapper( $function_name, $defaults = array(), $return_output_buffer = false ) { |
184 | - Helper::warn( 'function_wrapper is deprecated and will be removed in 1.4. Use {{ function( \'function_to_call\' ) }} instead or use FunctionWrapper directly. For more information refer to https://timber.github.io/docs/guides/functions/' ); |
|
184 | + Helper::warn('function_wrapper is deprecated and will be removed in 1.4. Use {{ function( \'function_to_call\' ) }} instead or use FunctionWrapper directly. For more information refer to https://timber.github.io/docs/guides/functions/'); |
|
185 | 185 | |
186 | - return new FunctionWrapper( $function_name, $defaults, $return_output_buffer ); |
|
186 | + return new FunctionWrapper($function_name, $defaults, $return_output_buffer); |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | /** |
@@ -434,12 +434,12 @@ discard block |
||
434 | 434 | * @return array |
435 | 435 | */ |
436 | 436 | public static function filter_array( $list, $arrow, $operator = 'AND' ) { |
437 | - if ( ! is_callable( $arrow ) ) { |
|
438 | - self::warn( 'This filter is using Twig\'s filter by default. If you want to use wp_list_filter use {{ my_array|wp_list_filter }}.' ); |
|
439 | - return self::wp_list_filter( $list, $arrow, $operator ); |
|
437 | + if ( !is_callable($arrow) ) { |
|
438 | + self::warn('This filter is using Twig\'s filter by default. If you want to use wp_list_filter use {{ my_array|wp_list_filter }}.'); |
|
439 | + return self::wp_list_filter($list, $arrow, $operator); |
|
440 | 440 | } |
441 | 441 | |
442 | - return array_filter( $list, $arrow, \ARRAY_FILTER_USE_BOTH ); |
|
442 | + return array_filter($list, $arrow, \ARRAY_FILTER_USE_BOTH); |
|
443 | 443 | } |
444 | 444 | |
445 | 445 | /** |
@@ -454,16 +454,16 @@ discard block |
||
454 | 454 | * @return array |
455 | 455 | */ |
456 | 456 | public static function wp_list_filter( $list, $args, $operator = 'AND' ) { |
457 | - if ( ! is_array( $args ) ) { |
|
458 | - $args = array( 'slug' => $args ); |
|
457 | + if ( !is_array($args) ) { |
|
458 | + $args = array('slug' => $args); |
|
459 | 459 | } |
460 | 460 | |
461 | - if ( ! is_array( $list ) && ! is_a( $list, 'Traversable' ) ) { |
|
461 | + if ( !is_array($list) && !is_a($list, 'Traversable') ) { |
|
462 | 462 | return array(); |
463 | 463 | } |
464 | 464 | |
465 | - $util = new \WP_List_Util( $list ); |
|
466 | - return $util->filter( $args, $operator ); |
|
465 | + $util = new \WP_List_Util($list); |
|
466 | + return $util->filter($args, $operator); |
|
467 | 467 | } |
468 | 468 | |
469 | 469 | /* Links, Forms, Etc. Utilities |