Created
May 7, 2014 13:22
-
-
Save billerickson/eae1345d8df6c45c47aa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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