Function Reference: gdlist_get_all_listed_posts

Summary

This function has not been documented yet.

Source File

gdlist_get_all_listed_posts() is located in geodir_list_manager/geodir_list_manager.php [Line: 482]

Source Code

function gdlist_get_all_listed_posts($post_id = null) {
    if ($post_id) {
        $post = get_post($post_id);
    } else {
        global $post;
    }
    $listed_posts = array();
    $all_postypes = geodir_get_posttypes();
    foreach ($all_postypes as $pt) {
        $connected = new WP_Query( array(
            'connected_type' => $pt.'_to_gd_list',
            'connected_items' => $post,
            'nopaging' => true
        ) );
        while ( $connected->have_posts() ) : $connected->the_post();
            $listed_posts[get_the_ID()] = get_the_title();
        endwhile;
        wp_reset_postdata(); // set $post back to original post
    }
    return $listed_posts;
}