Skip to content

Instantly share code, notes, and snippets.

@remcotolsma
Created February 8, 2019 10:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save remcotolsma/8e0c31e82e0816e9883ebb1d8a7f94cf to your computer and use it in GitHub Desktop.
Save remcotolsma/8e0c31e82e0816e9883ebb1d8a7f94cf to your computer and use it in GitHub Desktop.
Tommy Booking Support WordPress posts accommodation ID's.
SELECT
wp_posts.ID,
wp_posts.post_title,
wp_postmeta.meta_value
FROM
wp_posts
LEFT JOIN
wp_postmeta
ON (
wp_posts.ID = wp_postmeta.post_id
AND
wp_postmeta.meta_key = '_tbs_accommodation_id'
)
WHERE
wp_posts.post_type = 'camping'
AND
wp_posts.post_status = 'publish'
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment