AI Story Maker & the WordPress Abilities API
Automate content creation, enhancement, and scheduling — all through WordPress 7.0’s new Abilities API. No custom integration code needed.
Before You Begin
The Abilities API works out of the box on WordPress 7.0. In addition, any active plan — including the free tier — gives you full access to all three registered abilities.
Plug-and-Play Integration
AI Story Maker registers three named abilities in the WordPress 7.0 Ability Registry. As a result, any plugin or AI agent on the same site can discover and trigger them instantly — without writing custom integration code.
Discover
Query the Ability Registry with wp_ability_exists()
Validate
WordPress checks your input schema, permissions, and plan credits automatically
Invoke
Call wp_invoke_ability() and get a structured response back
Generate Story
ai-story-maker/generate-story
Generate a new AI-powered story and publish it as a WordPress post — draft or live, depending on your prompt settings. Run all active prompts at once or target a single prompt by ID.
Input Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
prompt_id | string | Optional | ID of a specific prompt to run. Omit to run all active prompts. |
force | boolean | Optional | Override the concurrent-generation lock. Use only if a previous run got stuck. |
Output Fields
| Field | Type | Description |
|---|---|---|
success | boolean | true if at least one story was generated. |
post_id | integer | null | ID of the created post. null in batch mode. |
post_url | string | null | Permalink of the created post. null in batch mode. |
message | string | Human-readable result or error. |
Code Examples
Common Errors
| Message | Cause | Fix |
|---|---|---|
No active plan or credits found. | Plan expired or credits at zero. | Upgrade your plan |
Story generation is already in progress. | Concurrent lock is active. | Wait a few minutes or pass force: true. |
prompt_id not found. | Prompt ID doesn’t exist. | Check Settings → Prompts. |
Enhance Content
ai-story-maker/enhance-content
Improve or rewrite any block of existing post content using AI. Pass the text and an instruction; get back enhanced HTML ready to save.
Input Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
post_id | integer | Required | ID of the post being edited. |
selected_text | string | Required | The text passage to enhance. |
instruction | string | Required | What to do — e.g. “make it more concise” or “rewrite in a friendlier tone”. |
operation | string | Optional | One of: text_improve (default), image_insert, image_replace. |
Output Fields
| Field | Type | Description |
|---|---|---|
success | boolean | true if enhancement succeeded. |
improved_content | string | null | Enhanced HTML, ready to save. |
message | string | Human-readable result or error. |
Code Examples
Permissions Note
The calling user must have edit_post capability for the specific post_id. The ability returns a structured permission error — not an exception — if the user lacks access.
Schedule Stories
ai-story-maker/schedule-stories
Enable or disable weekly automatic story generation for any user, and set which prompt to use. The ability saves the preference; WP-Cron fires generation at the configured interval.
Input Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
enabled | boolean | Required | true to enable weekly auto-generation, false to disable. |
prompt_id | string | int | Optional | Prompt to use for scheduled generation. |
user_id | integer | Optional | User to configure. Requires manage_options to set another user’s schedule. |
Output Fields
| Field | Type | Description |
|---|---|---|
success | boolean | true if the schedule was updated. |
enabled | boolean | The new enabled state. |
prompt_id | string | int | null | The prompt ID now saved for this user. |
next_generation | string | null | Estimated next run (Y-m-d H:i:s, WP timezone). null if disabled. |
message | string | Human-readable confirmation. |
Code Examples
Calling Abilities from PHP
Use wp_invoke_ability() for direct PHP invocation. Always check for WP_Error first — it indicates the ability was not found, permission was denied, or input was invalid.
Real-World Workflows
These recipes show how to combine AI Story Maker abilities with other plugins and WordPress hooks to build powerful, fully automated content pipelines.
📢 Recipe 1 — Weekly content pipeline with social share
Trigger weekly story generation and pass the result URL directly to a social-publishing ability from another plugin.
✍️ Recipe 2 — Auto-enhance excerpt on post save
Run the enhancement ability whenever a specific custom post type is saved, keeping excerpts fresh and compelling automatically.
Common Issues
Most issues fall into one of five categories. If the problem persists after trying the fix below, check debug.log for additional context.
wp_invoke_ability is undefinedWP_Error: ability_not_founddebug.log for PHP errors.WP_Error: rest_forbiddenedit_posts capability. Ensure the call runs as a capable user, or use wp_set_current_user() before invoking.No active plan or credits foundmessage field — not a WP_Error. View pricing →Story generation is already in progressforce: true if you’re confident the previous run stalled.Ready to Build With AI Story Maker?
Get started free — no credit card required. The Abilities API is available on every plan, including free.
Install Free WordPress.org →