wordpress

  • wp_get_environment_type, in core at last

    WordPress had no concept of an environment, so every site invented one — and the versions differed enough that a shared plugin could not rely on any of…

  • A REST permission_callback is not optional

    The argument was technically optional for years, and omitting it means no authorisation at all — which is how an endpoint meant for the admin ends up readable…

  • Lazy loading arrived in the browser

    One attribute replaces an IntersectionObserver and a library — and applying it to everything makes the Largest Contentful Paint worse rather than better.

  • get_posts is WP_Query with four different defaults

    The two are usually described as interchangeable and they are not: get_posts sets four arguments differently, and three of them change behaviour. suppress_filters is the one that produces…

  • posts_per_page = -1 is an incident waiting

    It means unlimited, and it is fine on a development site with forty posts. The site it eventually runs on has forty thousand. fields => ‘ids’ changes the…

  • wp cron event list, and the hook nobody knew about

    WordPress’s scheduler is a table of events run opportunistically on page loads, and a site with a ten-year plugin history has entries pointing at functions that no longer…

  • wp_cache_add_global_groups, or multisite prefixes it

    On a multisite network the object cache prefixes keys with the blog id unless the group is declared global, so data cached on one site is invisible to…

  • register_rest_field with a schema a client can discover

    Adding a computed field by filtering the prepared response works and leaves the field undocumented, so nothing but your own client knows it exists. The schema entry puts…

  • templateLock, and how much freedom to give an editor

    A block template defines the starting structure, and the lock setting decides whether an editor can change it — which is a product decision presented as a configuration…

  • A drop-in is not a plugin, and object-cache.php is one

    A drop-in is a file with a fixed name in wp-content that WordPress loads if it exists, and it cannot be activated, deactivated or updated by anything. object-cache.php…