| @@ 326-337 (lines=12) @@ | ||
| 323 | return (int) ceil( $count / self::ARRAY_CHUNK_SIZE ); |
|
| 324 | } |
|
| 325 | ||
| 326 | private function get_where_sql( $config ) { |
|
| 327 | global $wpdb; |
|
| 328 | ||
| 329 | $query = "meta_key = '{$wpdb->prefix}capabilities'"; |
|
| 330 | ||
| 331 | // config is a list of user IDs to sync |
|
| 332 | if ( is_array( $config ) ) { |
|
| 333 | $query .= ' AND user_id IN (' . implode( ',', array_map( 'intval', $config ) ) . ')'; |
|
| 334 | } |
|
| 335 | ||
| 336 | return $query; |
|
| 337 | } |
|
| 338 | ||
| 339 | function get_full_sync_actions() { |
|
| 340 | return array( 'jetpack_full_sync_users' ); |
|
| @@ 81-90 (lines=10) @@ | ||
| 78 | return (int) ceil( $count / self::ARRAY_CHUNK_SIZE ); |
|
| 79 | } |
|
| 80 | ||
| 81 | private function get_where_sql( $config ) { |
|
| 82 | $where_sql = Jetpack_Sync_Settings::get_blacklisted_post_types_sql(); |
|
| 83 | // config is a list of post IDs to sync |
|
| 84 | if ( is_array( $config ) ) { |
|
| 85 | $where_sql .= ' AND ID IN (' . implode( ',', array_map( 'intval', $config ) ) . ')'; |
|
| 86 | } |
|
| 87 | return $where_sql; |
|
| 88 | } |
|
| 89 | ||
| 90 | public function init_before_send() { |
|
| 91 | add_filter( 'jetpack_sync_before_send_jetpack_post_saved', array( $this, 'expand_jetpack_post_saved' ) ); |
|
| 92 | add_filter( 'jetpack_sync_before_send_jetpack_post_published', array( $this, 'expand_jetpack_post_saved' ) ); |
|
| 93 | ||