wordpress

  • templates/ and parts/ replace the template hierarchy

    5.9 on 25 January makes a theme a directory of HTML files, and the PHP template hierarchy stops being how a page is chosen. The naming still follows…

  • A hybrid theme keeps PHP templates and gains theme.json

    A classic theme can add theme.json without becoming a block theme, which is the migration path for an existing site. The flip is abrupt: creating templates/index.html makes WordPress…

  • A block template is an HTML file with block comments

    The file contains block markup, which is HTML with comments that carry the block name and its attributes, and nothing else. A self-closing block comment is a dynamic…

  • The site editor writes templates to the database

    A template edited in the site editor becomes a wp_template post, and from that moment the file on disk is ignored for that template. This is the single…

  • posts_per_page => -1 is a promise you cannot keep

    An unbounded query works on the development database with four hundred rows and takes the site down at forty thousand. fields => ‘ids’ is the other half and…

  • A block style variation instead of a whole block

    A block that differs from a core block only in appearance is a style variation, which is a class name and a stylesheet rule. The variation adds an…

  • Block deprecations exist because save() is a contract

    A static block’s save output is stored in the post, and changing it invalidates every existing instance unless the old shape is still declared. Without the deprecation the…

  • An InnerBlocks template with allowedBlocks

    A container block can specify what it starts with and what may be added, which is the difference between a layout and a suggestion. allowedBlocks restricts the inserter…

  • wp_options autoload, ranked by size

    The total autoloaded payload is a single number that predicts a large fraction of baseline request time, and almost nobody knows theirs. Tracking the figure over time is…

  • An autoloaded option that holds a cache

    Every autoloaded option is fetched on every request, and a plugin storing a cache in one turns a cache into a fixed cost. The total autoloaded size is…