Skip to content

Conversation

@dd32
Copy link
Owner

@dd32 dd32 commented Mar 1, 2024

PR'ing this against my own repo intentionally for a self-reminder. This is probably going to go stale very quickly, but that's OK.

This was a trial-run at removing some of the template-parts and using block templates instead instead of pattern hacking.

Things I ran into:

  • wp:query works, but I ran into shortcomings around the blocks available via it.
  • When using wp:post-template you can set the className on the <ul> but you can't set the class on the <li> (which is what the post_class is). This lead to a str_replace on the block render HTML to add plugin-card to the plugin-cards, later fixed by using a different CSS selector instead.. Unable to add a class to query block list item WordPress/gutenberg#41441
  • When using wp:post-template you can't define a "top level" block, so the "plugin-card" block is actually only the contents of the node that it would be rendered as, ie. it's all of the contents inside the <li>....</li> not including the li tags.
  • A bunch of template tags I wanted aren't present.
    • I made a wporg/missing-template-tag eval block for this, and I quite like it as a hacky fixer.
    • <!-- wp:wporg/missing-template-tag {"function":"the_archive_description","args":["<div class='taxonomy-description'>", "</div>"]} /-->
    • <!-- wp:wporg/missing-template-tag {"function":"the_posts_pagination"} /-->
  • Blocks are rendered before wp_head fires, so there's some customization on archive titles that doesn't apply to the block rendered header.
    • This is probably OK for us, as we'd probably want to use our own search archive template header/title and probably the same for the archive.
    • As a proof of concept, I tried to convert it to a variation of the query-title block which was laughable. See 9260f8f

@dd32 dd32 force-pushed the plugins/2024-theme-try-to-remove-patterns branch from 0c3ce20 to f1a0127 Compare March 1, 2024 06:15
@dd32 dd32 force-pushed the plugins/2024-theme-try-to-remove-patterns branch from f1a0127 to a287730 Compare March 1, 2024 06:18
dd32 added a commit that referenced this pull request Apr 9, 2025
…`, `monthnum` and `day` fields.

This includes:
 - `E_WARNING: Array to string conversion in wp-includes/post.php:6072`
 - `Uncaught TypeError: urldecode(): Argument #1 ($string) must be of type string, array given in wp-includes/post.php:6083`

See https://core.trac.wordpress.org/ticket/62828


git-svn-id: https://meta.svn.wordpress.org/sites/trunk@14416 74240141-8908-4e6f-9713-ba540dce6ec7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants