Skip to content

atmosphere_teaser_thread_posts

github-actions[bot] edited this page May 19, 2026 · 16 revisions

Filters the default teaser-thread post texts.

Filtered entries are not shipped verbatim: each string passes through sanitize_text() and is clamped to 300 chars by truncate_to_budget(), and the array is silently capped at 5 entries (PDS rate-limit blast-radius guard for mid-thread failures). Returning a non-array, an empty array, or fewer than 2 valid string entries triggers _doing_it_wrong and falls back to the default array.

when the body is too short for a body chunk, otherwise 3 entries [ hook, body_chunk, cta ].

Auto-generated Example

/**
 * Filters the default teaser-thread post texts.
 * 
 * Filtered entries are not shipped verbatim: each string passes
 * through `sanitize_text()` and is clamped to 300 chars by
 * `truncate_to_budget()`, and the array is silently capped at 5
 * entries (PDS rate-limit blast-radius guard for mid-thread
 * failures). Returning a non-array, an empty array, or fewer
 * than 2 valid string entries triggers `_doing_it_wrong` and
 * falls back to the default array.
 * 
 * when the body is too short for a body
 * chunk, otherwise 3 entries
 * `[ hook, body_chunk, cta ]`.
 *
 * @param Atmosphere\string[] $posts 
 * @param WP_Post             $post 
 * @return Atmosphere\string[] The filtered value.
 */
function my_atmosphere_teaser_thread_posts_callback( Atmosphere\string[] $posts, WP_Post $post ) {
    // Your code here.
    return $posts;
}
add_filter( 'atmosphere_teaser_thread_posts', 'my_atmosphere_teaser_thread_posts_callback', 10, 2 );

Parameters

  • Atmosphere\string[] $posts Default array: 2 entries [ hook, cta ]
  • WP_Post $post The post being composed.

Files

\apply_filters( 'atmosphere_teaser_thread_posts', $default, $this->object )

← All Hooks

Clone this wiki locally