Bootstrap wires post type support, a private spoken-article CPT, REST, ElevenLabs clients, schema, admin assets, and player blocks.
Key classes
| Class | Path | Role |
|---|---|---|
Bootstrap | includes/class-bootstrap.php | Loader, post type support, CLI |
Content_Type | includes/class-content-type.php | Private spoken-article CPT |
Post_Meta | includes/class-post-meta.php | Audio and play-count meta |
Rest_API | includes/class-rest-api.php | TTS text, ElevenLabs proxy, CPT helpers |
ElevenLabs_Settings / ElevenLabs_TTS | includes/ | API key, models, HTTP TTS |
Interstitial_Ads | includes/class-interstitial-ads.php | Settings UI + interstitial REST |
Schema | includes/class-schema.php | AudioObject via prc_schema_seo_post_schema |
Generate_Spoken_Article | includes/ai-experiments/ | WP Ability prc-spoken-article/generate |
Data flow
- Text extraction —
Rest_API::get_text_for_tts()prefersprc-markdown-for-agentsMarkdown conversion; falls back tothe_contentwith tags stripped. - Summarization — When the WordPress AI Client is available,
/tts-textcan condense copy into a Listener's Digest (~target minutes). - TTS — Editor JS calls
POST /elevenlabs/tts. PHP holdsPRC_PLATFORM_ELEVENLABS_API_KEY(or theelevenlabs_api_keyoption). The browser never receives the key. - Storage — Audio lands in the media library; metadata links through the
spoken-articleCPT / parent meta (attachment_id,audio_url,duration). - Playback — Player blocks render from server-side meta with an Interactivity API store.
Flow
5 relationships
Generate and play
Post type support
Meta registration, sidebar visibility, and schema output key off prc-spoken-article support. Default enabled type: post.
Environment notes
- In
localenvironments, block PHP may load fromsrc/; otherwise frombuild/. - Play count increment is public (anonymous frontend tracking).
- Player session state uses
sessionStoragekeyprc-spoken-article-playback(24h expiry).
Dependencies
- Upstream:
prc-schema-seo(AudioObject), optionalprc-markdown-for-agents, optional WordPress AI Client - External: ElevenLabs TTS API