Skip to content
Snippets Groups Projects
Commit 549e1370 authored by Erick Hitter's avatar Erick Hitter
Browse files

Page titles for older themes

parent ace6bfe6
Branches
Tags
1 merge request!2Support for additional HeadSpace2 features
This commit is part of merge request !2. Comments created here will be created in the context of that merge request.
......@@ -73,6 +73,8 @@ class ETH_Escape_HeadSpace2 {
*/
private function __construct() {
add_filter( 'pre_get_document_title', array( $this, 'filter_pre_get_document_title' ) );
add_filter( 'wp_title', array( $this, 'filter_wp_title' ), 10, 3 );
add_action( 'wp_head', array( $this, 'action_wp_head' ) );
add_action( 'wp_footer', array( $this, 'action_wp_footer' ) );
}
......@@ -92,6 +94,27 @@ class ETH_Escape_HeadSpace2 {
return $title;
}
/**
*
*/
public function filter_wp_title( $title, $sep, $loc ) {
$_title = get_post_meta( get_the_ID(), '_headspace_page_title', true );
if ( ! empty( $_title ) ) {
$_title = esc_html( $_title );
if ( 'right' == $loc ) {
$title = $_title . ' ' . $sep . ' ';
} else {
$title = ' ' . $sep . ' ' . $_title;
}
}
unset( $_title );
return $title;
}
/**
*
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment