| Conditions | 2 |
| Paths | 2 |
| Total Lines | 24 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | public static function process( $post_type, $offset, $query, $callback ) { |
||
| 13 | |||
| 14 | $posts_per_page = 10; |
||
| 15 | |||
| 16 | $args = array_merge( |
||
| 17 | self::get_args( $post_type, $query ), |
||
| 18 | array( |
||
| 19 | 'offset' => $offset, |
||
| 20 | 'posts_per_page' => $posts_per_page, |
||
| 21 | ) |
||
| 22 | ); |
||
| 23 | |||
| 24 | $post_ids = get_posts( $args ); |
||
| 25 | |||
| 26 | foreach ( $post_ids as $post_id ) { |
||
| 27 | call_user_func( $callback, $post_id ); |
||
| 28 | } |
||
| 29 | |||
| 30 | return array( |
||
| 31 | 'current' => $offset, |
||
| 32 | 'next' => $offset + $posts_per_page, |
||
| 33 | 'count' => self::count( $post_type, $query ), |
||
| 34 | ); |
||
| 35 | } |
||
| 36 | |||
| 66 | } |