Uncategorized

  • the_content filter order decides who wins

    Everything that touches post output hangs off the same filter — autoembeds, wpautop, shortcode expansion, and every plugin. Priority decides the order, and getting it wrong is why…

  • iterator_to_array closes the generator gap

    A function returning a generator cannot be passed to anything expecting an array — count(), array_map(), json_encode() all fail or produce nonsense. iterator_to_array() is the escape hatch, and…

  • let and const have a temporal dead zone

    var declarations are hoisted and initialised to undefined, so reading one before its line is legal and quietly wrong. let and const are hoisted too — the common…

  • WooCommerce checkout field order is a filter, not a template edit

    Reordering the checkout form by copying form-billing.php into the theme works and then quietly rots: every WooCommerce release that touches that template leaves your copy behind, and the…

  • rsync –dry-run before anything with –delete

    –delete removes files at the destination that are not at the source, which is what makes rsync a deployment tool rather than a copy. It is also one…

  • logrotate copytruncate loses lines; create does not

    The default rotation renames the file and creates a new one — but a process holding the old file descriptor keeps writing to the renamed file, so the…

  • nginx try_files order is the whole routing decision

    try_files takes each argument in turn and serves the first that exists, falling through to the last unconditionally. Every front-controller configuration is one line of it, and the…

  • Composer scripts are a task runner you already have

    Projects accumulate a README section listing the commands nobody remembers: the linter with its config path, the test suite with its flags, the cache clear that has to…

  • Interface segregation shows up as a mock with six stubs

    The principle is abstract until you write the test. If exercising one method means stubbing five others that the code under test never calls, the interface is doing…

  • array_column flattens a result set in one call

    Pulling one field out of a result set is a foreach that everyone writes and nobody enjoys. array_column() does it in one call, and its second use —…