我在页面上有过滤器插件。我通过快捷码预设和查询字符串参数得到生成的SQL查询。
因此,我想获取SQL查询,而不受查询字符串get params的影响。
例如我有一个页面url,其中有一个过滤器。
1 example
https://example。com/快照/
所以如果我有这样的url。WP\\U查询生成此SQL查询
SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) WHERE 1=1 AND ( wp_term_relationships.term_taxonomy_id IN (38) AND wp_posts.ID NOT IN (
SELECT object_id
FROM wp_term_relationships
WHERE term_taxonomy_id IN (341)
)
) AND wp_posts.post_type = \'product\' AND ((wp_posts.post_status =
\'publish\')) GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 16
2 example
如果我有这样的url页面
https://example。com/snapbacks/?pa\\U品牌=nike
我有这个sql查询
SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) LEFT JOIN wp_term_relationships AS tt1 ON (wp_posts.ID = tt1.object_id) WHERE 1=1 AND ( wp_term_relationships.term_taxonomy_id IN (46) AND tt1.term_taxonomy_id IN (38) AND wp_posts.ID NOT IN (
SELECT object_id
FROM wp_term_relationships
WHERE term_taxonomy_id IN (341)
)) AND wp_posts.post_type = \'product\' AND ((wp_posts.post_status = \'publish\')) GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 16
所以我有几个问题。
如何获取https://example页面上第一个示例中显示的sql查询。com/snapbacks/?pa\\U brand=nike where?添加了“pa\\U brand=nike”部分