Created
May 28, 2017 11:55
-
-
Save robertuniqid/82cfd03853c323b9ed9d4cee726eb6fc to your computer and use it in GitHub Desktop.
EDD Child & Parent License Expiration.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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