wp_ensure_category
Ensure a WordPress category exists by returning its ID if present or creating it when missing. Use with slug and parent options for precise control.
Instructions
Return an existing category, or create it. Safe to call repeatedly.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| slug | No | ||
| parent | No | ||
| dry_run | No | Preview changes without writing |