Urgent.News

What's breaking now, across thousands of outlets.

Tech

Enqueue Hooks: Four Hooks, Four Different Zones — and How Not to Mix Them Up

On the surface, these five hooks all do the same thing — load CSS/JS. But four of them sound almost identical while each one runs in a different zone of the site. Mix them up, and block styles leak onto the front end where nobody asked for them, or the Gutenberg editor is left with no styling at all. Which zone each hook covers Hook Front end Admin Block editor wp_enqueue_scripts ✅ — —…

Enqueue Hooks are a set of five functions that all serve the same purpose: loading CSS and JavaScript. However, each hook operates in a different area of the site, and mixing them up can lead to styling issues or even a broken Gutenberg editor. The hooks are as follows:

1. wp_enqueue_scripts: This hook is the standard hook for loading styles and scripts that are visible on the front end of a site. An example of how to use it is shown in the source material.

2. admin_enqueue_scripts: This is a separate hook that only runs inside wp-admin. It should be used for styling and scripting that only appears within the admin area. The source material provides a good example of how to use this hook effectively, avoiding the performance issue caused by loading CSS/JS on every wp-admin screen.

3. enqueue_block_editor_assets: This hook is for styles and JavaScript files that are specific to the block editor. These should never load on the front end, and mixing them up with other hooks can lead to problems.

4. enqueue_block_assets: This is a single hook that fires both in the editor and the front end. It is the correct place for CSS when a block needs to look the same in both areas. A good example of usage is provided in the source material.

The most common mistake when using enqueue hooks is to use enqueue_block_assets instead of enqueue_block_editor_assets (or vice versa), which can result in styles showing up in the wrong place or failing to appear where they should.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

One core, two hosts

First published on openspec-ui.dev . OpenSpec Workbench ships in two forms: a VS Code extension and a standalone web application that runs on your machine.

  • OpenSpec Workbench has Visual Studio Code extension and standalone web app versions
  • Core handles execution, OpenSpec and Git integration, security, persistence
  • Thin adapters allow shared core to run on different hosts

Keeping score honestly: zero improved, four made worse

Development covered 5 Aug 2026 to 7 Aug 2026 (commit dates). This stretch was mostly me auditing my own work, six rounds of it, on the tooling that edits the tie-in novel and the tooling that plays…

  • Zero chapters improved during the tooling audit
  • Four chapters damaged by the editing pipeline
  • Found and then un-found safety conditions in the system

Lean and how it relate to IT

Lean is a way of thinking: deliver value to the customer with less waste, by improving the system on purpose. That matters to us because software work is the same way: we turn an idea into a running…

More from Thursday 24 September →