コード例 #1
0
function fbcsf_runfbcs()
{
    global $wpdb;
    $posts = $wpdb->prefix . 'posts';
    $postsID = $wpdb->get_results(" SELECT ID FROM  {$posts}  WHERE post_type =  'post' ");
    foreach ($postsID as $post_ID) {
        $post_ID = $post_ID->ID;
        fbcsf_syncCommentCounts($post_ID);
        fbcsf_impComments($post_ID);
    }
    die;
}
コード例 #2
0
function fbcsf_runfbcs()
{
    global $wpdb;
    $posts = $wpdb->prefix . 'posts';
    $postsID = $wpdb->get_results(" SELECT ID FROM  {$posts} WHERE post_type =  'post' ", ARRAY_N);
    $postcount = count($postsID);
    $start = $_POST['data'];
    $stop = $start + 3;
    if ($stop < $postcount) {
        for ($i = $start; $i <= $stop; $i++) {
            fbcsf_syncCommentCounts($postsID[$i][ID]);
            fbcsf_impComments($postsID[$i][ID]);
        }
    }
    echo $stop;
    wp_die();
}