Skip to content

Commit

Permalink
Adds a check for the Woothemes Sensei version to use the appropriate …
Browse files Browse the repository at this point in the history
…array when removing the default sensei wrappers
  • Loading branch information
christophherr committed Mar 4, 2016
1 parent 98fe324 commit 8998692
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions genesis-connect-for-woothemes-sensei.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,24 @@ function gcfws_force_content_sidebar_layout() {
add_action( 'genesis_meta', 'gcfws_force_content_sidebar_layout' );

/**
* Remove the default Sensei wrappers
* Remove the default Woothemes Sensei wrappers.
* Checks which version of Woothemes Sensei is running
* and removes the wrappers accordingly.
* @since 1.1
*/
global $woothemes_sensei;
remove_action( 'sensei_before_main_content', array( $woothemes_sensei->frontend, 'sensei_output_content_wrapper' ), 10 );
remove_action( 'sensei_after_main_content', array( $woothemes_sensei->frontend, 'sensei_output_content_wrapper_end' ), 10 );
function gcfws_remove_default_sensei_wrappers() {

if ( Sensei()->version >= '1.9.0' ) {
remove_action( 'sensei_before_main_content', array( Sensei()->frontend, 'sensei_output_content_wrapper' ), 10 );
remove_action( 'sensei_after_main_content', array( Sensei()->frontend, 'sensei_output_content_wrapper_end' ), 10 );
return;
}
global $woothemes_sensei;
remove_action( 'sensei_before_main_content', array( $woothemes_sensei->frontend, 'sensei_output_content_wrapper' ), 10 );
remove_action( 'sensei_after_main_content', array( $woothemes_sensei->frontend, 'sensei_output_content_wrapper_end' ), 10 );
}

add_action( 'genesis_meta', 'gcfws_remove_default_sensei_wrappers' );


// Add custom Sensei content wrappers for Genesis.
Expand Down

0 comments on commit 8998692

Please sign in to comment.