Advertisement
Guest User

Untitled

a guest
Sep 19th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. SELECT SQL_CALC_FOUND_ROWS wp_posts.ID
  2. FROM wp_posts JOIN wp_icl_translations t
  3. ON wp_posts.ID = t.element_id
  4. AND t.element_type = CONCAT('post_', wp_posts.post_type)
  5. WHERE 1=1
  6. AND wp_posts.post_parent = 0
  7. AND wp_posts.post_type = '_aletheme_slider_'
  8. AND (wp_posts.post_status = 'publish'
  9. OR wp_posts.post_author = 17
  10. AND wp_posts.post_status = 'private')
  11. AND ( ( ( t.language_code = 'zh-hans'
  12. OR ( t.language_code = 'en'
  13. AND wp_posts.post_type IN ( 'post','page' )
  14. AND ( ( (
  15. SELECT COUNT(element_id)
  16. FROM wp_icl_translations
  17. WHERE trid = t.trid
  18. AND language_code = 'zh-hans' ) = 0 )
  19. OR ( (
  20. SELECT COUNT(element_id)
  21. FROM wp_icl_translations t2 JOIN wp_posts p
  22. ON p.id = t2.element_id
  23. WHERE t2.trid = t.trid
  24. AND t2.language_code = 'zh-hans'
  25. AND ( p.post_status = 'publish'
  26. OR p.post_type='attachment'
  27. AND p.post_status = 'inherit' ) ) = 0 ) ) ) )
  28. AND wp_posts.post_type IN ('post','page','attachment' ) )
  29. OR wp_posts.post_type NOT IN ('post','page','attachment' ) )
  30. ORDER BY wp_posts.post_date DESC
  31. LIMIT 0, 10
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement