Skip to content

secondsky/claude-skills / plugins/wordpress-plugin-core/skills/wordpress-plugin-core

wordpress-plugin-core

Flagged

WordPress plugin development with hooks, security, REST API, custom post types. Use for plugin creation, $wpdb queries, Settings API, or encountering SQL injection, XSS, CSRF, nonce errors.

FileKindSize
SKILL.mdskill md17.9 KB
assets/example-template.txtmarkdown416 B
examples/github-updater.phpscript15.3 KB
references/advanced-topics.mdmarkdown16.6 KB
references/common-hooks.mdmarkdown2.7 KB
references/common-patterns.mdmarkdown13.1 KB
references/error-catalog.mdmarkdown16.3 KB
references/example-reference.mdmarkdown760 B
references/github-auto-updates.mdmarkdown30.3 KB
references/plugin-architectures.mdmarkdown21.0 KB
references/security-checklist.mdmarkdown11.7 KB
scripts/example-script.shexecutablescript302 B
scripts/scaffold-plugin.shexecutablescript9.0 KB
templates/examples/ajax-handler.phpscript8.0 KB
templates/examples/custom-post-type.phpscript9.5 KB
templates/examples/meta-box.phpscript6.3 KB
templates/examples/rest-endpoint.phpscript8.7 KB
templates/examples/settings-page.phpscript7.9 KB
templates/plugin-oop/README.mdmarkdown7.4 KB
templates/plugin-oop/my-oop-plugin.phpscript12.5 KB
templates/plugin-oop/uninstall.phpscript929 B
templates/plugin-oop/views/admin-settings.phpscript2.1 KB
templates/plugin-psr4/README.mdmarkdown9.7 KB
templates/plugin-psr4/composer.jsonconfig706 B
templates/plugin-psr4/my-psr4-plugin.phpscript1.7 KB
templates/plugin-psr4/src/API/BookEndpoints.phpscript5.3 KB
templates/plugin-psr4/src/Admin/Settings.phpscript5.1 KB
templates/plugin-psr4/src/Frontend/Assets.phpscript2.0 KB
templates/plugin-psr4/src/Plugin.phpscript2.4 KB
templates/plugin-psr4/src/PostTypes/Book.phpscript4.9 KB
templates/plugin-psr4/src/Taxonomies/Genre.phpscript1.9 KB
templates/plugin-psr4/uninstall.phpscript929 B
templates/plugin-simple/README.mdmarkdown4.6 KB
templates/plugin-simple/my-simple-plugin.phpscript7.4 KB
templates/plugin-simple/uninstall.phpscript1.3 KB

references/common-hooks.md

View on GitHub
# Common WordPress Hooks Reference

Quick reference for the most commonly used WordPress hooks in plugin development.

---

## Action Hooks

### Plugin Lifecycle

| Hook | When It Fires | Use For |
|------|--------------|---------|
| `plugins_loaded` | After all plugins loaded | Init plugin functionality |
| `init` | WordPress initialization | Register post types, taxonomies |
| `admin_init` | Admin initialization | Register settings |
| `wp_loaded` | WordPress fully loaded | Late initialization |

### Admin Hooks

| Hook | When It Fires | Use For |
|------|--------------|---------|
| `admin_menu` | Admin menu creation | Add admin pages |
| `admin_enqueue_scripts` | Admin assets loading | Enqueue admin CSS/JS |
| `admin_notices` | Admin notices display | Show admin messages |
| `save_post` | After post saved | Save custom data |
| `add_meta_boxes` | Meta boxes registration | Add meta boxes |

### Frontend Hooks

| Hook | When It Fires | Use For |
|------|--------------|---------|
| `wp_enqueue_scripts` | Frontend assets loading | Enqueue CSS/JS |
| `wp_head` | In `<head>` section | Add meta tags, styles |
| `wp_footer` | Before `</body>` | Add scripts, analytics |
| `template_redirect` | Before template loaded | Redirects, custom templates |
| `the_content` (filter) | Post content display | Modify post content |

### AJAX Hooks

| Hook | Use For |
|------|---------|
| `wp_ajax_{action}` | Logged-in AJAX |
| `wp_ajax_nopriv_{action}` | Public AJAX |

### REST API

| Hook | When It Fires | Use For |
|------|--------------|---------|
| `rest_api_init` | REST API init | Register REST routes |

---

## Filter Hooks

### Content Filters

| Hook | What It Filters | Common Use |
|------|----------------|------------|
| `the_content` | Post content | Add/modify content |
| `the_title` | Post title | Modify titles |
| `the_excerpt` | Post excerpt | Customize excerpts |
| `comment_text` | Comment text | Modify comments |

### Query Filters

| Hook | What It Filters | Common Use |
|------|----------------|------------|
| `pre_get_posts` | Query before execution | Modify queries |
| `posts_where` | SQL WHERE clause | Custom WHERE |
| `posts_orderby` | SQL ORDER BY | Custom sorting |

### Admin Filters

| Hook | What It Filters | Common Use |
|------|----------------|------------|
| `manage_{post_type}_posts_columns` | Admin columns | Add columns |
| `admin_footer_text` | Admin footer text | Custom footer |

---

##  Hook Priority

Default priority is `10`. Lower numbers run first.

```php
// Runs early (priority 5)
add_action( 'init', 'my_function', 5 );

// Runs late (priority 20)
add_action( 'init', 'my_other_function', 20 );
```

---

## Resources

- **Hook Reference**: https://developer.wordpress.org/reference/hooks/
- **Plugin API**: https://codex.wordpress.org/Plugin_API
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 470kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 470kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 470kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall