Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Returns the post object for an organizer who should be identified
- * by slug.
- *
- * If the organizer cannot be found (bool) false will be returned.
- *
- * @param $slug
- * @return bool|object
- */
- function get_organizer_by_slug($slug) {
- $query = new WP_Query("name=$slug&post_type=".TribeEvents::ORGANIZER_POST_TYPE);
- // Successful query? Return the first object if so (we anyway expect the slug to be unique)
- if ($query->have_posts()) {
- $query->the_post();
- $post = $query->post;
- wp_reset_query();
- return $post;
- }
- else return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment