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

Defer to HeadSpace2 when active

parent 9566c1f5
No related branches found
No related tags found
1 merge request!6Defer to HeadSpace2 when active
......@@ -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 );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment