superpowers-sage:wp-hooks-lifecycle

Register WordPress actions and filters at correct Sage/Acorn lifecycle stages.

13|Updated Mar 19, 2026
One-click install
npx skills add https://github.com/hekivo/superpowers-sage --skill superpowers-sage-wp-hooks-lifecycle-hekivo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: superpowers-sage:wp-hooks-lifecycle
Source: https://github.com/hekivo/superpowers-sage/tree/main/skills/wp-hooks-lifecycle
Command: npx skills add https://github.com/hekivo/superpowers-sage --skill superpowers-sage-wp-hooks-lifecycle-hekivo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill solves the problem of WordPress hooks firing at the wrong time, with the wrong priority, or producing incorrect results because actions/filters and lifecycle placement are misunderstood in Sage/Acorn projects.

Core Features & Use Cases

  • Choose the correct hook type and callback contract: distinguishes actions (side effects, no return required) from filters (data transformation, must return the filtered value) and maps them to add_action vs add_filter.
  • Place hooks in the right Sage/Acorn location: guides registrations primarily into boot() methods in ServiceProviders (and clarifies why register() is for container bindings only), plus lifecycle timing choices like after_setup_theme, init, wp_loaded, wp_enqueue_scripts, and content filters like the_content.
  • Prevent common production failures: covers priority/accepted_args mismatches, removal issues, autosave/revision duplication for save_post, and Tailwind v4 filter conflicts (e.g., disabling wptexturize via run_wptexturize).

Quick Start

Ask your AI assistant to help you register your the_content filter and an init action in the correct Acorn ServiceProvider boot() method with the right priority and accepted argument count, then troubleshoot why the hook order is not matching expectations.

Frequently Asked Questions about superpowers-sage:wp-hooks-lifecycle

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I register WordPress hooks correctly in a Sage theme using Acorn ServiceProviders?

Register WordPress hooks in Sage by placing add_action and add_filter calls inside the boot() method of your Acorn ServiceProvider, ensuring correct lifecycle timing and priority for deterministic execution.

Why does my WordPress filter return null and break the_content output?

WordPress filters require returning the filtered value, unlike actions which handle side effects; omitting the return statement in add_filter callbacks causes data loss and breaks content rendering modifications.

What is the difference between register() and boot() in Acorn ServiceProviders for WordPress hooks?

The register() method is exclusively for container bindings, while the boot() method is the correct lifecycle stage to register WordPress actions and filters so they execute at the proper theme initialization timing.

How do I fix Tailwind v4 wptexturize conflicts in Sage?

Resolve Tailwind v4 wptexturize conflicts by disabling the run_wptexturize filter, preventing unwanted text transformation that breaks Tailwind class markup and content rendering in Sage.

How to stop WordPress save_post hook from firing multiple times during autosave?

Prevent save_post hook duplication by checking wp_is_post_autosave and wp_is_post_revision within your callback, ensuring your custom post type registration or metadata updates only run on actual content saves.

When should I use init vs wp_loaded for WordPress hook registration?

Use init for registering custom post types and taxonomies requiring early lifecycle access, while wp_loaded is for hooks needing all core and plugin code fully loaded before execution.