Created
July 14, 2012 15:26
-
-
Save Spoygg/3111827 to your computer and use it in GitHub Desktop.
Merge publication prevods to single page prevod
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
<?php | |
// First fetch all prevods | |
// Mysql call | |
$sql = " | |
SELECT ID, post_title, post_content, post_parent, post_name | |
FROM wp_rscom_posts | |
WHERE post_parent | |
IN ( | |
SELECT ID | |
FROM wp_rscom_posts | |
WHERE post_parent | |
IN ( | |
SELECT ID | |
FROM `wp_rscom_posts` | |
WHERE post_parent = 0 | |
AND post_type = 'prevod' | |
AND post_status = 'publish' | |
) | |
AND post_type = 'prevod' | |
AND post_status = 'publish' | |
AND post_title NOT LIKE '%blog%' | |
) | |
AND post_type = 'prevod' | |
AND post_status = 'publish' | |
order by post_parent, ID" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment