Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT SQL_CALC_FOUND_ROWS wp_posts.ID
- FROM wp_posts JOIN wp_icl_translations t
- ON wp_posts.ID = t.element_id
- AND t.element_type = CONCAT('post_', wp_posts.post_type)
- WHERE 1=1
- AND wp_posts.post_parent = 0
- AND wp_posts.post_type = '_aletheme_slider_'
- AND (wp_posts.post_status = 'publish'
- OR wp_posts.post_author = 17
- AND wp_posts.post_status = 'private')
- AND ( ( ( t.language_code = 'zh-hans'
- OR ( t.language_code = 'en'
- AND wp_posts.post_type IN ( 'post','page' )
- AND ( ( (
- SELECT COUNT(element_id)
- FROM wp_icl_translations
- WHERE trid = t.trid
- AND language_code = 'zh-hans' ) = 0 )
- OR ( (
- SELECT COUNT(element_id)
- FROM wp_icl_translations t2 JOIN wp_posts p
- ON p.id = t2.element_id
- WHERE t2.trid = t.trid
- AND t2.language_code = 'zh-hans'
- AND ( p.post_status = 'publish'
- OR p.post_type='attachment'
- AND p.post_status = 'inherit' ) ) = 0 ) ) ) )
- AND wp_posts.post_type IN ('post','page','attachment' ) )
- OR wp_posts.post_type NOT IN ('post','page','attachment' ) )
- ORDER BY wp_posts.post_date DESC
- LIMIT 0, 10
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement