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
4f66c572
Commit
4f66c572
authored
Feb 16, 2016
by
Erick Hitter
Browse files
Merge branch 'develop' into 'master'
Defer to HeadSpace2 when active See merge request
!6
parents
4b9ee0ae
9fa65125
Changes
1
Hide whitespace changes
Inline
Side-by-side
eth-escape-headspace.php
View file @
4f66c572
...
...
@@ -67,11 +67,24 @@ class ETH_Escape_HeadSpace2 {
);
/**
* Register plugin's hooks
* Defer plugin hook additions until all plugins are loaded
* Allows plugin to defer to HeadSpace2 when active
*
* @return null
*/
private
function
__construct
()
{
add_action
(
'plugins_loaded'
,
array
(
$this
,
'maybe_add_hooks'
)
);
}
/**
* Conditionally register plugin's hooks
*/
public
function
maybe_add_hooks
()
{
// Defer to HeadSpace2 when active
if
(
class_exists
(
'HeadSpace_Plugin'
)
)
{
return
;
}
add_filter
(
'pre_get_document_title'
,
array
(
$this
,
'filter_pre_get_document_title'
)
);
add_filter
(
'wp_title'
,
array
(
$this
,
'filter_wp_title'
),
10
,
3
);
...
...
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