ShowMeta
\Benecaster\Show\ShowMeta
Accessor class for show-level post meta. Wraps get_post_meta / update_post_meta with typed getters and setters. Meta-key strings are held in constants.
Methods
| Method | Visibility | Since | Description |
|---|---|---|---|
is_email_cancellation_confirmation_enabled(): bool |
Public | — | Returns whether the cancellation_confirmation email is enabled for this show. Defaults to true when the meta row is absent (matches the four sibling billing-email toggles). |
set_email_cancellation_confirmation_enabled( bool $value ): static |
Public | — | Persists the cancellation_confirmation email toggle for this show. |
get_default_required_buyups(): int[] |
Public | — | Returns the show's default buy-up IDs, seeded onto a new episode's _benecaster_required_buyups at creation only. Never consulted by the feed; contributes no slug to FeedController::resolve_tier_slugs(). |
set_default_required_buyups( int[] $buyup_ids ): static |
Public | — | Persists the default. An empty array deletes the meta row rather than storing []. Read/write via REST PUT /shows/{id} (default_required_buyups param). |
has_download_tracking_enabled(): bool |
Public | — | Returns the show's default for download tracking. This is the top of the resolution chain — there is no install-wide download-tracking switch. An episode's own three-state override (EpisodeMeta::get_download_tracking()) wins when set; an episode left on 'inherit' falls back to this value. |
set_download_tracking_enabled( bool $value ): static |
Public | — | Persists the show's download-tracking default. Read/write via REST PUT /shows/{id} (download_tracking_enabled param). |
is_email_price_change_reminder_enabled(): bool |
Public | — | Whether the optional price_change_reminder email sends for this show. Defaults to true. Surfaced on Show Settings → Subscription → Subscriber Billing Emails, and in the show REST payload as email_price_change_reminder_enabled. The other two price-change emails (price_change_notice, price_change_cancelled) have no switch — they always send. |
set_email_price_change_reminder_enabled( bool $value ): static |
Public | — | Persists the price_change_reminder email toggle for this show. Fluent. |
get_email_business_address(): string |
Public | — | Returns the show's CAN-SPAM-compliant business address, or an empty string when unset. Rendered as its own footer line on every email this show sends (via benecaster_email_wrapper_args) when non-empty; omitted entirely when empty. Set from Settings → [Show] → Emails, or the setup wizard's details step. Read/write via REST PUT /shows/{id} (business_address param). |
set_email_business_address( string $value ): static |
Public | — | Persists the show's business address. An empty string is stored as-is — a podcaster clearing the field turns the footer line off. |
get_enclosure_url_prefix(): string |
Public | — | Returns the show's Enclosure URL prefix (Show Settings → Feeds), '' when unset (off). The join rule is implemented in Feed\EnclosureUrlPrefixer::join(), not here: a leading https:// is dropped from the media URL and http:// is kept, a URL already starting with the prefix is left alone (idempotent), and a /benecaster-download/ proxy URL is never wrapped — DownloadProxy's 302 target carries the prefix instead, applied via EnclosureUrlPrefixer::for_show(). Applies to feed enclosures and , not the web player. |
set_enclosure_url_prefix( string $value ): static |
Public | — | Persists the prefix through sanitize_enclosure_url_prefix() — '' persists as ''. Also the register_post_meta sanitize callback (show_in_rest), so the same rule applies whether the value comes from the admin screen or REST PUT /shows/{id}. Changing it clears the show's feed cache through FeedCacheInvalidator's _benecaster_* meta-key watch. |
sanitize_enclosure_url_prefix( mixed $value ): string |
— | — | Strips whitespace and markup (sanitize_text_field, then whitespace removed). A value with a scheme other than http/https (javascript:, data:) is stored as ''. An http/https value goes through esc_url_raw(). A scheme-less value (e.g. a bare CDN path) is kept exactly as typed — esc_url_raw() would silently prepend http://, and a scheme-less prefix is a valid, deliberately-allowed input; the editor warns rather than refuses. |
Constants
| Name | Value | Description |
|---|---|---|
EMAIL_CANCELLATION_CONFIRMATION_ENABLED |
_benecaster_show_email_cancellation_confirmation_enabled |
Post meta key for the per-show cancellation_confirmation email toggle. |
EMAIL_PRICE_CHANGE_REMINDER_ENABLED |
_benecaster_show_email_price_change_reminder_enabled |
Listed in ShowMeta::EMAIL_SWITCHES. Post meta key for the per-show price_change_reminder email toggle. Boolean, default true (enabled) when unset. |
EMAIL_BUSINESS_ADDRESS |
_benecaster_show_email_business_address |
Post meta key for the per-show CAN-SPAM business address. String, default empty (no footer line) when unset. |
DEFAULT_REQUIRED_BUYUPS |
_benecaster_show_default_required_buyups |
Post meta key for the show's default buy-up list. Named _default_ deliberately, distinct from the episode-level _benecaster_required_buyups — it is not a gate. |
DOWNLOAD_TRACKING_ENABLED |
_benecaster_show_download_tracking_enabled |
Post meta key, boolean, default false. The show-level default an episode's _benecaster_episode_download_tracking falls back to when left on 'inherit'. |
ENCLOSURE_URL_PREFIX |
_benecaster_show_enclosure_url_prefix |
Post meta key for the show's Enclosure URL prefix (Show Settings → Feeds → Enclosure URL prefix). '' = off. Registered with show_in_rest; sanitised by ShowMeta::sanitize_enclosure_url_prefix(), also its register_post_meta sanitize callback. Changing it clears the show's feed cache (FeedCacheInvalidator's _benecaster_* meta-key watch). Join logic (Feed\EnclosureUrlPrefixer): a leading https:// is dropped from the media URL and http:// is kept; a URL already starting with the prefix is left alone; a /benecaster-download/ proxy URL is never wrapped — DownloadProxy's 302 target carries the prefix instead. Applies to enclosures and , not the web player. |