Skip to content

Instantly share code, notes, and snippets.

@robertuniqid
Created May 28, 2017 11:55
Show Gist options
  • Save robertuniqid/82cfd03853c323b9ed9d4cee726eb6fc to your computer and use it in GitHub Desktop.
Save robertuniqid/82cfd03853c323b9ed9d4cee726eb6fc to your computer and use it in GitHub Desktop.
EDD Child & Parent License Expiration.
SELECT p.ID as license_id,
c_exp.meta_value as child_expiration,
p_exp.meta_value as parent_expiration
FROM `wp_posts` p
LEFT JOIN `wp_postmeta` c_exp ON c_exp.post_id = p.ID AND c_exp.meta_key = "_edd_sl_expiration"
LEFT JOIN `wp_postmeta` p_exp ON p_exp.post_id = p.post_parent AND p_exp.meta_key = "_edd_sl_expiration"
WHERE p.`post_type` = 'edd_license'
AND p.post_parent != 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment