Skip to content

Instantly share code, notes, and snippets.

@JustinSainton
Created August 20, 2012 22:03
Show Gist options
  • Save JustinSainton/3408345 to your computer and use it in GitHub Desktop.
Save JustinSainton/3408345 to your computer and use it in GitHub Desktop.
function avr_replace_title_with_meta( $title, $id ) {
$type = get_post_type();
if ( in_array( $type, array( 'property', 'rate' ) ) )
$title = get_post_meta( $id, 'avr_' . $type . '_title', true );
return $title;
}
add_filter( 'the_title', 'avr_replace_title_with_meta', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment