コード例 #1
0
ファイル: uninstall.php プロジェクト: rustyeddy/sandbox
function webman_remove_all_sites()
{
    $loop = webman_get_site_loop();
    if ($loop == null) {
        $html .= "Rats something smells fishy, we could not the the Sites loop";
        return $html;
    }
    webman_logit(__FUNCTION__ . ": removing all webman_site posts");
    // Loop through all the sites and print them as a list.
    while ($loop->have_posts()) {
        $post = $loop->the_post();
        webman_logit('    removing post id: ' . $post->ID);
        wp_delete_post($post->ID);
    }
}
コード例 #2
0
ファイル: sites.php プロジェクト: rustyeddy/sandbox
function webman_sites($atts, $content = null)
{
    $loop = webman_get_site_loop();
    if ($loop == null) {
        $html .= "You don't currently have any sites!";
        return $html;
    }
    // Loop through all the sites and print them as a list.
    $html .= '<ul>';
    while ($loop->have_posts()) {
        $loop->the_post();
        $plink = get_post_permalink();
        $title = get_the_title();
        $html .= "<li /><a href='" . $plink . "'>" . $title . '</a>';
    }
    $html .= '</ul>';
    // Cleanup after ourselves
    wp_reset_query();
    wp_reset_postdata();
    // Give 'em what they want!
    return $html;
}