これは、 WordPressに実装されているMySQLに関する非常に具体的な質問です。
特定の「タグ」を持ち、特定の「カテゴリ」(両方とも複数)に属する投稿を表示(選択)するプラグインを開発しようとしています
カテゴリとタグの保存方法が原因で不可能だと言われました。
wp_posts
投稿のリストが含まれ、各投稿には「ID」がありますwp_terms
用語のリスト(カテゴリとタグの両方)が含まれています。各用語にはTERM_IDがありますwp_term_taxonomy
TERM_IDを含む用語のリストがあり、それらのそれぞれ(カテゴリまたはタグのいずれか)の分類法の定義がありますwp_term_relationships
用語と投稿の間に関連付けがあります
テーブルを結合して、カテゴリ「Category1」にも属するタグ「Nuclear」と「Deals」を持つすべての投稿を取得するにはどうすればよいですか?