Conditions | 3 |
Paths | 3 |
Total Lines | 16 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | private function enqueue_all_posts() { |
||
18 | global $wpdb; |
||
19 | |||
20 | // I hope this is never bigger than RAM... |
||
21 | $post_ids = $wpdb->get_col( "SELECT id FROM $wpdb->posts"); |
||
22 | |||
23 | // Request posts in groups of N for efficiency |
||
24 | $chunked_post_ids = array_chunk( $post_ids, self::$array_chunk_size ); |
||
25 | |||
26 | foreach ( $chunked_post_ids as $chunk ) { |
||
27 | $posts = get_posts( array( 'post__in' => $chunk, 'post_status' => 'any' ) ); |
||
28 | foreach ( $posts as $post ) { |
||
29 | do_action( 'jp_full_sync_post', $post ); |
||
30 | } |
||
31 | } |
||
32 | } |
||
33 | |||
34 | } |
The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using
the property is implicitly global.
To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.