benhuson / wp-subtitle

Development of the WordPress WP Subtitle plugin. http://wordpress.org/plugins/wp-subtitle/
34 stars 16 forks source link

Add subtitle support for terms. #51

Open benhuson opened 4 years ago

benhuson commented 4 years ago

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)
) );