{"id":14613289,"date":"2021-06-30T20:06:35","date_gmt":"2021-06-30T20:06:35","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/how-to-count-user-unlocked-posts\/"},"modified":"2021-06-30T20:06:35","modified_gmt":"2021-06-30T20:06:35","slug":"how-to-count-user-unlocked-posts","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/how-to-count-user-unlocked-posts\/","title":{"rendered":"How to count user unlocked posts?"},"content":{"rendered":"<p>Hi!<br \/>\nHow to count user unlocked posts in a specific custom taxonomy term?<\/p>\n<p>I know how to get count of all post in a specific custom taxonomy term:<\/p>\n<pre><code>$args = array(\n    &#039;post_type&#039; =&gt; &#039;books&#039;,\n    &#039;tax_query&#039; =&gt; array(\n        array (\n            &#039;taxonomy&#039; =&gt; &#039;books_cat&#039;,\n            &#039;field&#039; =&gt; &#039;slug&#039;,\n            &#039;terms&#039; =&gt; &#039;adventure&#039;,\n        )\n    ),\n);\n\n$the_query = new WP_Query( $args );\n$the_query-&gt;found_posts;<\/code><\/pre>\n<p>But how to count only unlocked posts by the user in that taxonomy term?<\/p>\n","protected":false},"template":"","class_list":["post-14613289","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/14613289","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/14613289\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=14613289"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}