Last active
December 15, 2015 08:19
-
-
Save typeofweb/5229490 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 SUBSTR( | |
CONCAT( | |
REPLACE( | |
REPLACE( | |
REPLACE( | |
REPLACE(wpo.option_value,'%year%',date_format(wpp.post_date,'%Y')) | |
,'%monthnum%',date_format(wpp.post_date,'%m')) | |
,'%day%',date_format(wpp.post_date,'%d')) | |
,'%postname%',wpp.post_name ) | |
) | |
, 2) as permalink FROM wp_posts wpp INNER JOIN wp_options wpo on wpo.option_name='permalink_structure' WHERE wpp.post_type = 'post' AND wpp.post_status = 'publish' ORDER BY wpp.post_date DESC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment