[wp-trac] [WordPress Trac] #62014: Editor: Add a 'format' parameter to query to enable filtering post formats in the Query Loop block

WordPress Trac noreply at wordpress.org
Thu Sep 19 00:41:35 UTC 2024


#62014: Editor: Add a 'format' parameter to query to enable filtering post formats
in the Query Loop block
-------------------------------------------------+-------------------------
 Reporter:  poena                                |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  6.7
Component:  Editor                               |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-testing-info needs-    |     Focuses:
  testing needs-unit-tests                       |
-------------------------------------------------+-------------------------

Comment (by peterwilsoncc):

 When building the query in blocks.php, I think it will need a nested query
 based on the above.

 {{{#!php
 <?php

 'tax_query' => array(
   'relation' = 'AND',
   array(
     // Taxonomy query from block args tags, cateagory and tax_query
   ),
   array(
     relation = 'OR',
     array(
       'taxonomy' => 'post_format',
       'slug' => ( 'link', 'gallery' ),
     ),
     array(
       'taxonomy' => 'post_format',
       'operator' => 'NOT EXISTS', // Standard post type
     )
   ),
 );


 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/62014#comment:13>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list