Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
WP Plugins
ETH Escape Headspace
Commits
549e1370
Commit
549e1370
authored
Feb 15, 2016
by
Erick Hitter
Browse files
Page titles for older themes
parent
ace6bfe6
Changes
1
Hide whitespace changes
Inline
Side-by-side
eth-escape-headspace.php
View file @
549e1370
...
...
@@ -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
;
}
/**
*
*/
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment