Advertisement
Guest User

WP Query

a guest
Nov 20th, 2019
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 1.98 KB | None | 0 0
  1. SELECT DISTINCT SQL_CALC_FOUND_ROWS wpql_posts.*
  2. FROM   wpql_posts
  3.        INNER JOIN wpql_postmeta
  4.                ON ( wpql_posts.id = wpql_postmeta.post_id )
  5.        INNER JOIN wpql_postmeta AS a
  6.                ON ( a.post_id = wpql_posts.id )
  7.        INNER JOIN wpql_postmeta AS b
  8.                ON ( ( b.meta_id = a.meta_id + @@auto_increment_increment )
  9.                     AND ( b.post_id = wpql_posts.id ) )
  10.        INNER JOIN wpql_posts AS c
  11.                ON ( ( c.post_type = 'acf-field' )
  12.                     AND ( ( c.post_content LIKE '%:"text"%' )
  13.                            OR ( c.post_content LIKE '%:"textarea"%' )
  14.                            OR ( c.post_content LIKE '%:"number"%' )
  15.                            OR ( c.post_content LIKE '%:"email"%' )
  16.                            OR ( c.post_content LIKE '%:"url"%' )
  17.                            OR ( c.post_content LIKE '%:"file"%' )
  18.                            OR ( c.post_content LIKE '%:"wysiwyg"%' )
  19.                            OR ( c.post_content LIKE '%:"select"%' )
  20.                            OR ( c.post_content LIKE '%:"checkbox"%' )
  21.                            OR ( c.post_content LIKE '%:"radio"%' ) ) )
  22.        LEFT JOIN wpql_posts AS d
  23.               ON ( d.id = a.meta_value )
  24. WHERE  1 = 1
  25.        AND ( ( ( c.post_name = b.meta_value )
  26.                AND ( a.meta_value LIKE '%Zubarev%' ) )
  27.               OR ( ( wpql_posts.post_title LIKE '%Zubarev%' )
  28.                     OR ( wpql_posts.post_content LIKE '%Zubarev%' )
  29.                     OR ( wpql_posts.post_excerpt LIKE '%Zubarev%' ) )
  30.               OR ( d.post_title LIKE '%Zubarev%' ) )
  31.        AND ( wpql_postmeta.meta_key = 'date' )
  32.        AND wpql_posts.post_type = 'research_paper'
  33.        AND ( wpql_posts.post_status = 'publish'
  34.               OR wpql_posts.post_status = 'acf-disabled'
  35.               OR wpql_posts.post_status = 'private' )
  36. GROUP  BY wpql_posts.id
  37. ORDER  BY wpql_postmeta.meta_value + 0 DESC
  38. LIMIT  0, 8
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement