Skip to content

Conversation

@benhuson
Copy link
Owner

Includes API for display term subtitles (based on term ID) and archive subtitles (displayed for taxonomy term pages):

// Example: Display term subtitle
do_action( 'plugins/wp_subtitle/the_term_subtitle', array(
   'before'        => '<p class="subtitle">',  // Before subtitle HTML output (default empty string)
   'after'         => '</p>',                  // After subtitle HTML output (default empty string)
   'term_id'       => 0,                       // Term ID (default to none)
   'default_value' => ''                       // Default output (if no subtitle)
) );

// Example: Get term subtitle display
$subtitle = apply_filters( 'plugins/wp_subtitle/get_term_subtitle', '', array(
   'before' => '<p class="subtitle">',  // Before subtitle HTML output (default empty string)
   'after'  => '</p>',                  // After subtitle HTML output (default empty string)
   'term_id' => 0                       // Term ID (default to none)
) );

// Example: Display archive subtitle
do_action( 'plugins/wp_subtitle/the_archive_subtitle', array(
   'before'        => '<p class="subtitle">',  // Before subtitle HTML output (default empty string)
   'after'         => '</p>',                  // After subtitle HTML output (default empty string)
   'default_value' => ''                       // Default output (if no subtitle)
) );

// Example: Get archive subtitle display
$subtitle = apply_filters( 'plugins/wp_subtitle/get_archive_subtitle', '', array(
   'before' => '<p class="subtitle">',  // Before subtitle HTML output (default empty string)
   'after'  => '</p>',                  // After subtitle HTML output (default empty string)
) );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants