Skip to main content

[benecaster_sponsor_message]

sponsor-manager

A sponsor message’s current copy, placed in an episode’s show notes. Registered by the Sponsor Manager add-on. A sponsor message is reusable sponsor copy written once on Benecaster → Sponsors → Messages, where each message shows the tag to paste. The copy is read each time the page or feed is built, never stamped in, so an edit there reaches every episode that carries the tag.

It shows the copy only when all of these hold, and nothing otherwise:

  • the message exists and is not archived
  • the episode belongs to the message’s own show (a message belongs to one show)
  • Sponsor Manager is on for that show
  • today, in the site’s time zone, is on or between the message’s start and end dates (an empty date is open)

The episode’s post status is not checked. The message’s body is not run through do_shortcode(), so a message cannot hold another tag.

It never prints itself. The tag is registered on every request, whether or not Sponsor Manager is on for any show, so a tag left in show notes disappears quietly when the add-on is off everywhere.

In the feed and in Episode Credits. Sponsor Manager resolves this tag in the feed’s full show notes, as the message’s HTML, and in the Podcatcher Description, as plain text with a line per paragraph. An Episode Credits template that holds the tag gets the copy as of the day the credit is applied, frozen into the stamp like the rest of the credit. An escaped tag, [[benecaster_sponsor_message id="12"]], is left to WordPress, which shows it as text on the episode page.

The output is <div class="benecaster-sponsor-message">{body}</div>, the body passed through wp_kses_post; style it with that class. The HTML can be changed with benecaster_sponsor_manager_message_output, and the attributes with WordPress’s own shortcode_atts_benecaster_sponsor_message. See Restyle or change a sponsor message where its tag shows it.

Parameters

Name Type Default Required Description
id int — Yes The message's id, as shown in the tag on the Messages tab.
episode_id int 0 No The episode the tag sits in. 0 or left out: the post being shown. In the feed and in Episode Credits, the episode being built is used whatever this says.

Example

<!-- The message in this episode's show notes -->
[benecaster_sponsor_message id="12"]

<!-- Naming the episode, for a tag placed outside its own show notes -->
[benecaster_sponsor_message id="12" episode_id="42"]