wp-plugin-hooks

Design and document custom WordPress action and filter hooks with stable APIs.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/vikingokft/wp-agent-skills --skill wp-plugin-hooks-vikingokft
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: wp-plugin-hooks
Source: https://github.com/vikingokft/wp-agent-skills/tree/main/plugin-scaffold/wp-plugin-hooks
Command: npx skills add https://github.com/vikingokft/wp-agent-skills --skill wp-plugin-hooks-vikingokft

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents breaking third-party integrations by guiding you to design, document, version, and deprecate custom WordPress action and filter hooks as a stable public API contract.

Core Features & Use Cases

  • Action vs filter semantics: choose the correct hook type based on whether listeners should react with side effects or transform returned values.
  • Naming and discoverability: enforce a plugin-prefixed naming scheme and add mandatory docblocks with Fires/Filters, @since, typed @param, and (for filters) correct @return semantics.
  • Evolution without breakage: maintain backward compatibility by keeping parameter order/count and types stable, and deprecate using apply_filters_deprecated/do_action_deprecated instead of silent removal.
  • Correct dynamic forwarding: use *_ref_array variants when forwarding unknown-length argument lists and respect how these functions pass args internally.

Quick Start

Ask the AI to review a proposed patch that introduces or changes a custom do_action/apply_filters hook and return a backwards-compatibility plan with docblock updates and any required deprecation wiring.

Frequently Asked Questions about wp-plugin-hooks

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

FAQPage Schema
How do I deprecate a custom WordPress filter hook without breaking third-party plugins?▼

To deprecate a custom WordPress filter hook safely, use apply_filters_deprecated instead of removing it. This maintains backward compatibility by notifying developers while preserving the third-party listener execution flow during plugin updates.

What is the correct way to document WordPress action and filter hooks in DocBlocks?▼

Document WordPress action and filter hooks using Fires or Filters tags, precise @since versions, and typed @param tags. For filters, you must also include correct @return semantics to define the expected transformed value type.

When do I need to use ref_array variants for WordPress plugin hooks?▼

Use ref_array variants when forwarding unknown-length argument lists through WordPress plugin hooks. This respects how these functions pass args internally and maintains strict parameter contract stability for dynamic forwarding.

Does adding new parameters to an existing apply_filters hook break the API contract?▼

Adding new parameters to an existing apply_filters hook can break the API contract if it changes parameter order or count. Maintain backward compatibility by keeping existing parameter order, count, and types strictly stable across versions.

How do I choose between using an action or a filter for my WordPress plugin extension surface?▼

Choose a WordPress action hook when third-party listeners should react with side effects, and choose a filter hook when listeners need to transform and return values. This separates side effects from data modification cleanly.

What are the limitations of relying on do_action_deprecated for evolving plugin hooks?▼

The limitation of do_action_deprecated is that it only warns of removal; it still requires strict parameter contract stability beforehand. You must enforce plugin-prefixed naming and maintain typed @param tags to prevent silent integration failures.