{"id":9878063,"date":"2018-01-18T15:40:44","date_gmt":"2018-01-18T15:40:44","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/another-should-have-been-there-feature\/"},"modified":"2018-01-18T15:41:13","modified_gmt":"2018-01-18T15:41:13","slug":"another-should-have-been-there-feature","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/another-should-have-been-there-feature\/","title":{"rendered":"Another should-have-been-there feature"},"content":{"rendered":"<p>A very nice plugin enabling without further ado a functionality that should have been native. <\/p>\n<p>If you&#8217;re actively using the sticky post functionality for CPTs, it might be tricky to use some queries. For example, this will not work<\/p>\n<pre><code>\n$featured_post_args = array(\n  &#039;post_type&#039;           =&gt; &#039;custom_post&#039;,\n  &#039;posts_per_page&#039;      =&gt; 1,\n  &#039;post__in&#039;            =&gt; get_option( &#039;sticky_posts&#039; ),\n  &#039;ignore_sticky_posts&#039; =&gt; 1\n);\n<\/code><\/pre>\n<p>and you need to use something like <\/p>\n<pre><code>\narray_filter(get_option( &#039;sticky_posts&#039; ), function($id) {\n  return get_post_type($id) == &#039;custom_post&#039; &amp;&amp; get_post_status($id) == &#039;publish&#039;;\n});\n<\/code><\/pre>\n<p>But this is a problem of WP itself and not of the plugin.<\/p>\n","protected":false},"template":"","class_list":["post-9878063","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/9878063","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":1,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/9878063\/revisions"}],"predecessor-version":[{"id":9878066,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/9878063\/revisions\/9878066"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=9878063"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}