Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created May 7, 2014 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billerickson/eae1345d8df6c45c47aa to your computer and use it in GitHub Desktop.
Save billerickson/eae1345d8df6c45c47aa to your computer and use it in GitHub Desktop.
<?php
/**
* Alternate Title for Subpages
*
* @author Bill Erickson
* @link https://gist.github.com/billerickson/eae1345d8df6c45c47aa
*
* @param string $title
* @param object $subpage
* @return string $title
*/
function be_subpages_alternate_title( $title, $subpage ) {
$alt = esc_attr( get_post_meta( $subpage->ID, 'be_alt_link_title', true ) );
if( $alt )
$title = $alt;
return $title;
}
add_filter( 'be_subpages_page_title', 'be_subpages_alternate_title', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment