Conditions | 4 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
55 | private static function handle_maybe_custom_posts_page( $query ) { |
||
56 | |||
57 | if ($custom_posts_page = get_option('page_for_posts')) { |
||
58 | |||
59 | if ( isset($query->query['p']) && $query->query['p'] == $custom_posts_page ) { |
||
60 | |||
61 | return new WP_Query(array('post_type' => 'post')); |
||
62 | |||
63 | } |
||
64 | |||
65 | } |
||
66 | |||
67 | return $query; |
||
68 | |||
69 | } |
||
70 | |||
71 | } |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.