| | 18 | |
| | 19 | ---- |
| | 20 | |
| | 21 | == Testing instructions |
| | 22 | |
| | 23 | How to test the post formats filter without the rest of the Gutenberg changes. |
| | 24 | |
| | 25 | First, please enable post formats on the active theme. Example: |
| | 26 | {{{ |
| | 27 | function twentytwentyfour_post_formats() { |
| | 28 | add_theme_support( 'post-formats', array( 'aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio', 'chat' ) ); |
| | 29 | } |
| | 30 | add_action( 'after_setup_theme', 'twentytwentyfour_post_formats' ); |
| | 31 | }}} |
| | 32 | |
| | 33 | On your WordPress test install, create a few posts with and without formats assigned. |
| | 34 | |
| | 35 | In the Site Editor or block editor, insert a query loop with a format filter. |
| | 36 | In this example, I have used the gallery post format. I have added |
| | 37 | {{{"format":["gallery"]}}} inside {{{query}}}: |
| | 38 | |
| | 39 | {{{ |
| | 40 | <!-- wp:query {"query":{"perPage":10,"pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":true,"format":["gallery"]}} --> |
| | 41 | <div class="wp-block-query"> |
| | 42 | <!-- wp:post-template --> |
| | 43 | <!-- wp:post-title /--> |
| | 44 | <!-- /wp:post-template --> |
| | 45 | </div> |
| | 46 | <!-- /wp:query --> |
| | 47 | }}} |
| | 48 | |
| | 49 | |
| | 50 | In the editor, the query loop should only display posts with the gallery post format. |
| | 51 | |
| | 52 | Next, change the format to standard: |
| | 53 | |
| | 54 | {{{ |
| | 55 | <!-- wp:query {"query":{"perPage":10,"pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":true,"format":["standard"]}} --> |
| | 56 | <div class="wp-block-query"> |
| | 57 | <!-- wp:post-template --> |
| | 58 | <!-- wp:post-title /--> |
| | 59 | <!-- /wp:post-template --> |
| | 60 | </div> |
| | 61 | <!-- /wp:query --> |
| | 62 | }}} |
| | 63 | |
| | 64 | In the editor, the query loop should only display posts that have no post format assigned. |
| | 65 | |
| | 66 | -- |
| | 67 | |
| | 68 | On the front, the query loop does not show any results: I am still figuring out if this is because part of the block changes are missing or if there are problems with {{{build_query_vars_from_query_block}}} in this PR. |
| | 69 | |