Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 4 | ||
Bugs | 1 | Features | 1 |
1 | <?php |
||
22 | public static function find_query( $args = false ) { |
||
23 | $default_args = array(); |
||
24 | |||
25 | if ( ! $args ) { |
||
26 | return self::get_current_query(); |
||
27 | } |
||
28 | |||
29 | if ( is_array( $args ) ) { |
||
30 | return new \WP_Query( array_merge( $default_args, $args ) ); |
||
31 | } |
||
32 | |||
33 | return new \WP_Query( $default_args ); |
||
34 | } |
||
35 | |||
69 |
Instead of relying on
global
state, we recommend one of these alternatives:1. Pass all data via parameters
2. Create a class that maintains your state