Skip to content

Add a description below the subtitle field

Ben Huson edited this page Jul 29, 2013 · 1 revision

With the wps_subtitle_field_description filter you can add text below the subtitle field in the meta box that is displayed in the admin.

Examples

Simple filter usage:

<?php
function my_wps_subtitle_field_description( $description ) {
	return '<p>' . __( 'Enter a brief subheading above.' ) . '</p>';
}
add_filter( 'wps_subtitle_field_description', 'my_wps_subtitle_field_description' );
?>

Advanced filter usage to show a different description for a post type called 'property':

<?php
function my_wps_subtitle_field_description( $description, $post ) {
	if ( 'property' == get_post_type ( $post ) ) {
		return '<p>' . __( 'Enter a location for the property.' ) . '</p>';
	}
	return $description;
}
add_filter( 'wps_subtitle_field_description', 'my_wps_subtitle_field_description', 10, 2 );
?>