Functions
The Secondary Title plugin provides functions to manage and display secondary titles. Below, you'll find a list of functions, including parameters, return values, and examples.
the_secondary_title($post_id, $prefix, $suffix)
Parameters
$post_id
(optional): The ID of the post or page to retrieve the secondary title. Defaults to the current post or page.
Returns
string
: The secondary title of the current post or page
Description
Displays the secondary title of the current post or page.
Example
php
<?php the_secondary_title(); ?>
get_secondary_title($post_id)
Parameters
$post_id
(optional): The ID of the post or page to retrieve the secondary title. Defaults to the current post or page.
Returns
string
: The secondary title of the specified post or page
Description
Retrieves the secondary title of a post or page.
Example
php
<?php $secondary_title = get_secondary_title(123); ?>
has_secondary_title($post_id)
Parameters
$post_id
(optional): The ID of the post or page to check for a secondary title. Defaults to the current post or page.
Returns
bool
: Whether the specified post or page has a secondary title
Description
Check if a post or page has a secondary title.
Example
php
<?php
if ( has_secondary_title( 123 ) ) {
echo 'This post has a secondary title';
}
?>
the_secondary_title_output()
Parameters
$before
(optional): The HTML to display before the secondary title. Defaults to<h2 class="secondary-title">
.$after
(optional): The HTML to display after the secondary title. Defaults to</h2>
.
Returns
string
: The secondary title wrapped in the specified HTML
Description
Displays the secondary title wrapped in the specified HTML.
Example
php
<?php the_secondary_title_output('<h3>', '</h3>'); ?>
secondary_title_column()
Parameters
- None
Returns
void
Description
Adds a secondary title column to the post and page listings in the WordPress admin area.
Example
php
<?php secondary_title_column(); ?>
Note
This function is used internally by the plugin and is not intended for direct use in themes or plugins.