Skip to content

Instantly share code, notes, and snippets.

@tjtate
Created May 9, 2014 18:10
Show Gist options
  • Save tjtate/c2f5ef0ff181d42f8ddb to your computer and use it in GitHub Desktop.
Save tjtate/c2f5ef0ff181d42f8ddb to your computer and use it in GitHub Desktop.
<?php
global $wpdb;
//get all articles
$articlecount = $wpdb->get_results( 'SELECT COUNT(ID) AS total_posts FROM wp_posts WHERE post_status = "publish"' );
$articlecount = $articlecount[0]->total_posts;
$sql_limit = 200;
//$increment_limit = 1;
$increment_limit = ceil($articlecount / $sql_limit);
for ($i=1; $i <= $increment_limit; $i++) {
$starting_point = $i * $sql_limit;
$articles = $this->get_articles($starting_point);
$response = $this->send_to_profiles( $articles, 'articles/articledata' );
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment