Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: christophherr/Genesis-Connect-for-Woothemes-Sensei
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.0.3
Choose a base ref
...
head repository: christophherr/Genesis-Connect-for-Woothemes-Sensei
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Oct 24, 2015

  1. Added POT file

    christophherr committed Oct 24, 2015
    Copy the full SHA
    c51d4e6 View commit details
  2. clean up git

    christophherr committed Oct 24, 2015
    Copy the full SHA
    a592c76 View commit details
  3. Expanded readme.txt, clarified inline comment

    christophherr committed Oct 24, 2015
    Copy the full SHA
    1a269e0 View commit details
  4. Corrects oversight in original code

    christophherr committed Oct 24, 2015
    Copy the full SHA
    2a4e7a9 View commit details
  5. Tagging version 1.0.3

    christophherr committed Oct 24, 2015
    Copy the full SHA
    115b924 View commit details

Commits on Nov 26, 2015

  1. Copy the full SHA
    3990647 View commit details
  2. Copy the full SHA
    093d74e View commit details
  3. Added POT file

    christophherr committed Nov 26, 2015
    Copy the full SHA
    eeabc59 View commit details
  4. clean up git

    christophherr committed Nov 26, 2015
    Copy the full SHA
    ce1436b View commit details
  5. Copy the full SHA
    591f7a7 View commit details
  6. Copy the full SHA
    d40eb64 View commit details
  7. Copy the full SHA
    92efcc7 View commit details
  8. Copy the full SHA
    1344c8d View commit details
  9. Added POT file

    christophherr authored and christophherr committed Nov 26, 2015
    Copy the full SHA
    6359334 View commit details
  10. clean up git

    christophherr authored and christophherr committed Nov 26, 2015
    Copy the full SHA
    2a68321 View commit details
  11. Corrects oversight in original code

    christophherr authored and christophherr committed Nov 26, 2015
    Copy the full SHA
    dee8b36 View commit details
  12. Updated -Tested up to- to new WordPress version 4.4

    christophherr authored and christophherr committed Nov 26, 2015
    Copy the full SHA
    f177da8 View commit details
  13. Small updates to readme.txt

    christophherr authored and christophherr committed Nov 26, 2015
    Copy the full SHA
    efb1aec View commit details
  14. clean up git

    christophherr committed Nov 26, 2015
    Copy the full SHA
    f3905ed View commit details
  15. Copy the full SHA
    df62972 View commit details
  16. Added POT file

    christophherr committed Nov 26, 2015
    Copy the full SHA
    124f986 View commit details
  17. clean up git

    christophherr committed Nov 26, 2015
    Copy the full SHA
    08b6144 View commit details
  18. Copy the full SHA
    a78b9b9 View commit details
  19. Copy the full SHA
    095113f View commit details

Commits on Mar 4, 2016

  1. Copy the full SHA
    bde3f32 View commit details
  2. Copy the full SHA
    899dab4 View commit details
  3. Copy the full SHA
    98fe324 View commit details
  4. Adds a check for the Woothemes Sensei version to use the appropriate …

    …array when removing the default sensei wrappers
    christophherr committed Mar 4, 2016
    Copy the full SHA
    8998692 View commit details
  5. Updates readme.txt

    christophherr committed Mar 4, 2016
    Copy the full SHA
    b8d2fea View commit details
  6. Deletes dmp file

    christophherr committed Mar 4, 2016
    Copy the full SHA
    3c77f69 View commit details

Commits on Mar 11, 2016

  1. Copy the full SHA
    42fbdc1 View commit details
  2. Added POT file

    christophherr committed Mar 11, 2016
    Copy the full SHA
    892ddb0 View commit details
  3. Copy the full SHA
    0503ed2 View commit details
  4. clean up git

    christophherr committed Mar 11, 2016
    Copy the full SHA
    d901596 View commit details
  5. Copy the full SHA
    be3a041 View commit details
  6. Added POT file

    christophherr committed Mar 11, 2016
    Copy the full SHA
    620d1b2 View commit details
  7. clean up git

    christophherr committed Mar 11, 2016
    Copy the full SHA
    66560a8 View commit details
  8. Copy the full SHA
    4480dc2 View commit details
  9. Copy the full SHA
    ed6cf11 View commit details
  10. Copy the full SHA
    fa3e1d6 View commit details
  11. Copy the full SHA
    8227ed2 View commit details
  12. Adds a check for the Woothemes Sensei version to use the appropriate …

    …array when removing the default sensei wrappers
    christophherr committed Mar 11, 2016
    Copy the full SHA
    7f9aa02 View commit details
  13. Updates readme.txt

    christophherr committed Mar 11, 2016
    Copy the full SHA
    f5854b6 View commit details
  14. Deletes dmp file

    christophherr committed Mar 11, 2016
    Copy the full SHA
    003a121 View commit details
  15. Copy the full SHA
    507b1c3 View commit details
  16. Copy the full SHA
    093b8b7 View commit details
  17. Added POT file

    christophherr committed Mar 11, 2016
    Copy the full SHA
    3adaaf4 View commit details
  18. Copy the full SHA
    a1c710d View commit details
  19. clean up git

    christophherr committed Mar 11, 2016
    Copy the full SHA
    535670b View commit details
  20. Copy the full SHA
    f9e50e8 View commit details
140 changes: 136 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,140 @@
# Genesis Connect for Woothemes Sensei
Plugin wrapper to easily integrate the Woothemes Sensei plugin with the Genesis Framework.

The code for the integration is taken from https://support.woothemes.com/hc/en-us/articles/204428855-StudioPress-Genesis.
Contributors: christophherr
Donate link: https://www.christophherr.com/donate/
Tags: automattic sensei, sensei, genesis, genesis connect, studiopress, woocommerce sensei
Requires at least: 4.8
Tested up to: 5.1
Stable tag: 1.2.0
Requires PHP: 5.2.4
License: GPL-2.0+
License URI: http://www.gnu.org/licenses/gpl-2.0.txt

In other words, if you are not trying to integrate the Woothemes Sensei plugin with the Genesis Framework and/or one of its child themes, this plugin is pretty much useless for you...
This plugin integrates the Genesis Framework from StudioPress with the Sensei plugin.

This plugin will only work (i.e. activate) with the Genesis Framework and its child themes.
## Description

The plugin expands on the [Sensei Documentation](https://docs.woocommerce.com/document/sensei-and-theme-compatibility/) about adding theme compatibility.

You will need the [Sensei](https://woocommerce.com/products/sensei/) plugin and the [Genesis Framework from StudioPress](https://www.studiopress.com) and/or one of its child themes.

In other words, if you are not trying to integrate the Sensei plugin with the Genesis Framework and/or one of its child themes, you don't need or want this plugin.

This plugin will only work (i.e. activate) if the Genesis Framework and its child themes are activated.

Version 1.1.0 forces a content-sidebar layout on course, lesson and question posts to avoid the sidebar showing underneath the main content.

Version 1.2.0 adds the Genesis Layout options to course, lesson and question posts and archives and the module taxonomy allowing better control about the layout options. For backwards-compatibiliy, The single posts are still set to a content-sidebar layout but this setting can be overwritten by the Genesis Layout options.

It should not be necessary to remove the formerly forced content-sidebar layout on single posts with

* <code>remove_action( 'genesis_meta', 'gcfws_force_content_sidebar_layout_on_cpt_posts' );</code>

in your functions.php anymore. Please use the Genesis Layout options instead.

## Installation

1. Upload the entire `Genesis-Connect-for-Woothemes-Sensei` folder to your `/wp-content/plugins` directory.
2. Activate the plugin through the 'Plugins' menu in WordPress.

Alternatively, you can

1. Click on 'Add new' in the 'Plugins' menu
2. Type (or copy and paste) the name of this plugin into the search box
3. Click on 'Install Now'

## Frequently Asked Questions

### Does this work with any WordPress theme?

No. This plugin only works with the Genesis Framework and its child themes.

### Does this work with any Genesis child theme?

Yes and no. Technically, it does.
However, depending on other factors such as the individual theme's styling and layout, the output may be unexpected, and require some tweaking.

Case in point, if the full-width layout is selected in the Genesis settings, lessons, course and question posts are showing a sidebar underneath the main content.
Version 1.1.0 forced a content-sidebar layout on single course, lesson and questions.
Since Version 1.2.0 the Genesis Layout options can be used to alter the appearance.

### Are there any settings?

You simply activate the plugin and the necessary wrappers are inserted into your Genesis child theme.
Since version 1.2.0, you can choose the layouts of your courses, lessons, questions and modules with the Genesis Layout options.

### How can I change how the plugin works?

There are no settings and no settings screen. You would have to change the code directly in the source.

## Changelog

### 1.2.0

* Adds Genesis Layout options to course, lesson, and question posts and archives and the module taxonomy.
* Previously forced content-sidebar layout can be overwritten by the Genesis Layout options.
* Updates Readme.
* More modular code structure.

### 1.1.1

* Better Code Standards.
* Removes unnecessary code.
* Updates Readme Urls.

### 1.1.0

* Adds check to only activate if Woothemes Sensei is already active.
* Forces a content-sidebar layout on single course, lesson and question posts.
To change this behaviour add <code>remove_action( 'genesis_meta', 'gcfws_force_content_sidebar_layout' );</code> to your functions.php.
* After Woothemes Sensei changed their code base dramatically in the 1.9 update,
the previous method of removing the sensei wrappers started to throw error messages.
This update introduces a version check to use the appropriate array for removing the sensei wrappers.

### 1.0.3

* Corrected oversight in the original code. First closing tag should be `</main>` instead of `</div>`
see: [Cobalt Apps Forum](http://cobaltapps.com/forum/forum/main-category/main-forum/81542-woo-sensei?p=82210#post82210)

### 1.0.2

* POT file added

### 1.0.1

* Loading textdomain for i18n

### 1.0

* Initial release on Github

## Upgrade Notice

### 1.2.0

This version forces a content-sidebar layout on course, lesson and question archives and the module taxonomy.
Please refer to the readme.txt if you want to remove this feature.

### 1.1.1

This version removes unnecessary code, follows WordPress Coding Standards better and updates links in the readme.

### 1.1.0

This version adds a version check for Woothemes Sensei to use the appropriate array when removing the standard Sensei wrappers.
Version 1.1.0 also forces a content-sidebar layout on single course, lesson and question posts to avoid the sidebar showing underneath the main content.
Please refer to the readme.txt if you want to remove this feature.
Woothemes Sensei has to be already active before the plugin will activate.

### 1.0.3

This version corrects an oversight in the original code
that caused issues with Cobalt Apps' Dynamik theme.

### 1.0.2

This version adds a POT file for translations.

### 1.0.1

This version loads the textdomain to enable translations.
110 changes: 44 additions & 66 deletions genesis-connect-for-woothemes-sensei.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<?php
/**
* Plugin Name: Genesis Connect for Woothemes Sensei
* Plugin URI: http://www.christophherr.com
* Description: Plugin wrapper to easily integrate the Woothemes Sensei plugin with the Genesis Framework. This plugin will only work with the Genesis Framework and its child themes.
* Plugin URI: https://www.christophherr.com
* Description: Plugin wrapper to easily integrate the Automattic Sensei plugin with the Genesis Framework. This plugin will only work with the Genesis Framework and its child themes.
* Author: Christoph Herr
* Author URI: http://www.christophherr.com
* Version: 1.0.3
* Author URI: https://www.christophherr.com
* Version: 1.2.0
* Text Domain: genesis-connect-for-woothemes-sensei
* Domain Path: /languages
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* License URI: https://www.gnu.org/licenses/gpl-2.0.txt
*
* @package GenesisConnectforWoothemesSensei
* @author Christoph Herr
* @version 1.0.3
* @version 1.2.0
* @license GPL-2.0+
*
* Genesis Connect for Woothemes Sensei is free software: you can redistribute it and/or modify
@@ -35,11 +35,26 @@
wp_die( _e( 'Sorry, you are not allowed to access this page directly.', 'gcfws' ) );
}

add_action( 'plugins_loaded', 'gcfws_load_textdomain' );
/**
* Load plugin textdomain.
*
* @since 1.0.1
*
* @return void
*/
function gcfws_load_textdomain() {
load_plugin_textdomain( 'genesis-connect-for-woothemes-sensei', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' );
}

register_activation_hook( __FILE__, 'gcfws_activation' );
/**
* This function runs on plugin activation. It checks to make sure the
* Genesis Framework is active. If not, it deactivates the plugin.
* Genesis Framework and Woothemes Sensei are active. If not, it deactivates the plugin.
*
* @since 1.0
* @since 1.0.0
*
* @return void
*/
function gcfws_activation() {
if ( ! function_exists( 'genesis' ) ) {
@@ -49,13 +64,15 @@ function gcfws_activation() {
}
}

register_activation_hook( __FILE__, 'gcfws_activation' );

add_action( 'admin_init', 'gcfws_plugin_deactivate' );
add_action( 'switch_theme', 'gcfws_plugin_deactivate' );
/**
* This function is triggered when the WordPress theme is changed.
* It checks if the Genesis Framework is active. If not, it deactivates the plugin.
*
* @since 1.0
* @since 1.0.0
*
* @return void
*/
function gcfws_plugin_deactivate() {
if ( ! function_exists( 'genesis' ) ) {
@@ -65,76 +82,37 @@ function gcfws_plugin_deactivate() {
}
}

add_action( 'admin_init', 'gcfws_plugin_deactivate' );
add_action( 'switch_theme', 'gcfws_plugin_deactivate' );

/**
* Error message if you're not using the Genesis Framework.
*
* @since 1.0
* @since 1.0.0
*
* @return void
*/
function gcfws_admin_notice_message() {
$error = sprintf( _e( 'Sorry, you can\'t use the Genesis Connect for Woothemes Sensei Plugin unless the <a href="%s">Geneis Framework</a> is active. The plugin has been deactivated.', 'gcfws' ), 'http://www.studiopress.com' );
$error = sprintf(
// translators: Link to the StudioPress website.
__( 'Sorry, you can\'t use the Genesis Connect for Woothemes Sensei Plugin unless the <a href="%s">Genesis Framework</a> is active. The plugin has been deactivated.', 'gcfws' ),
'https://www.studiopress.com'
);

echo '<div class="error"><p>' . $error . '</p></div>';
printf( '<div class="error"><p>%s</p></div>', $error );

if ( isset( $_GET['activate'] ) ) {
unset( $_GET['activate'] );
}
}

/**
* Load plugin textdomain.
*
* @since 1.0.1
*/
function gcfws_load_textdomain() {
load_plugin_textdomain( 'genesis-connect-for-woothemes-sensei', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' );
}

add_action( 'plugins_loaded', 'gcfws_load_textdomain' );

// Sensei Integration.
/**
* Declare theme support for Sensei
*
* @since 1.0
*/
function gcfws_sensei_support() {
add_theme_support( 'sensei' );
}

add_action( 'after_setup_theme', 'gcfws_sensei_support' );

/**
* Remove the default Sensei wrappers
*/
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 custom Sensei content wrappers for Genesis.
/**
* Opening the custom Sensei wrapper
* Load the plugin files.
*
* @since 1.0
*/
function gcfws_genesis_sensei_wrapper_start() {
echo '<div class="content-sidebar-wrap"><main class="content" role="main" itemprop="mainContentOfPage">';
}

add_action( 'sensei_before_main_content', 'gcfws_genesis_sensei_wrapper_start', 10 );

/**
* Closing the custom Sensei wrapper
* @since 1.2.0
*
* @since 1.0
* @return void
*/
function gcfws_genesis_sensei_wrapper_end() {
echo'</main> <!-- end main-->';
get_sidebar();
echo'</div> <!-- end .content-sidebar-wrap-->';
function gcfws_autoloader() {
require 'src/sensei-integration/sensei-integration.php';
require 'src/site-layout/site-layout.php';
}

add_action( 'sensei_after_main_content', 'gcfws_genesis_sensei_wrapper_end', 10 );
gcfws_autoloader();
12 changes: 12 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php
/**
* Index.
*
* @package GenesisConnectforWoothemesSensei
* @since 1.2.0
* @author Christoph Herr
* @link https://www.christophherr.com
* @license GNU General Public License 2.0+
*/

// Nothing to see here.
21 changes: 11 additions & 10 deletions languages/genesis-connect-for-woothemes-sensei.pot
Original file line number Diff line number Diff line change
@@ -1,43 +1,44 @@
# Copyright (C) 2015 Genesis Connect for Woothemes Sensei
# Copyright (C) 2018 Genesis Connect for Woothemes Sensei
# This file is distributed under the same license as the Genesis Connect for Woothemes Sensei package.
msgid ""
msgstr ""
"Project-Id-Version: Genesis Connect for Woothemes Sensei 1.0.1\n"
"Project-Id-Version: Genesis Connect for Woothemes Sensei 1.2.0\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/genesis-connect-"
"for-woothemes-sensei\n"
"POT-Creation-Date: 2015-10-13 03:35:28+00:00\n"
"POT-Creation-Date: 2018-04-03 01:10:48+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"PO-Revision-Date: 2015-MO-DA HO:MI+ZONE\n"
"PO-Revision-Date: 2018-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

#: genesis-connect-for-woothemes-sensei.php:35
msgid "Sorry, you are not allowed to access this page directly."
msgstr ""

#: genesis-connect-for-woothemes-sensei.php:77
#. translators: Link to the Studiopress website.
#: genesis-connect-for-woothemes-sensei.php:95
msgid ""
"Sorry, you can't use the Genesis Connect for Woothemes Sensei Plugin unless "
"the <a href=\"%s\">Geneis Framework</a> is active. The plugin has been "
"the <a href=\"%s\">Genesis Framework</a> is active. The plugin has been "
"deactivated."
msgstr ""

#. Plugin Name of the plugin/theme
msgid "Genesis Connect for Woothemes Sensei"
msgstr ""

#. #-#-#-#-# plugin.pot (Genesis Connect for Woothemes Sensei 1.0.1) #-#-#-#-#
#. #-#-#-#-# genesis-connect-for-woothemes-sensei.pot (Genesis Connect for Woothemes Sensei 1.2.0) #-#-#-#-#
#. Plugin URI of the plugin/theme
#. #-#-#-#-# plugin.pot (Genesis Connect for Woothemes Sensei 1.0.1) #-#-#-#-#
#. #-#-#-#-# genesis-connect-for-woothemes-sensei.pot (Genesis Connect for Woothemes Sensei 1.2.0) #-#-#-#-#
#. Author URI of the plugin/theme
msgid "http://www.christophherr.com"
msgid "https://www.christophherr.com"
msgstr ""

#. Description of the plugin/theme
msgid ""
"Plugin wrapper to easily integrate the Woothemes Sensei plugin with the "
"Plugin wrapper to easily integrate the Automattic Sensei plugin with the "
"Genesis Framework. This plugin will only work with the Genesis Framework and "
"its child themes."
msgstr ""
228 changes: 141 additions & 87 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,87 +1,141 @@
=== Genesis Connect for Woothemes Sensei ===

Contributors: christophherr
Donate link: https://www.christophherr.com/donate/
Tags: woothemes sensei, woothemes, genesis, genesis connect, studiopress
Requires at least: 4.1
Tested up to: 4.3
Stable tag: 1.0.3
License: GPL-2.0+
License URI: http://www.gnu.org/licenses/gpl-2.0.txt

This plugin integrates the Genesis Framework from Studiopress with the Woothemes Sensei plugin.

== Description ==

This plugin uses code taken from https://support.woothemes.com/hc/en-us/articles/204428855-StudioPress-Genesis.

You will need the Woothemes Sensei plugin (http://www.woothemes.com/products/sensei/)
and the Genesis Framework and/or one of its child themes (http://www.studiopress.com).

In other words, if you are not trying to integrate the Woothemes Sensei plugin with the Genesis Framework
and/or one of its child themes, this plugin is pretty much useless for you...

This plugin will only work (i.e. activate) with the Genesis Framework and its child themes.

== Installation ==

1. Upload the entire `Genesis-Connect-for-Woothemes-Sensei` folder to your `/wp-content/plugins` directory.
2. Activate the plugin through the 'Plugins' menu in WordPress.

Alternatively, you can

1. Click on 'Add new" in the 'Plugins' menu
2. Type (or copy and paste) the name of this plugin into the search box
3. Click on 'Install Now'

== Frequently Asked Questions ==

= Does this work with any WordPress theme? =

No. This plugin only works with the Genesis Framework and its child themes.

= Does this work with any Genesis child theme? =

Yes and no. Technically, it does, even older (XHTML) themes. However, depending on other factors such as the individual theme's styling and layout, the output may be unexpected, and require some tweaking.

= Are there any settings? =

No. You simply activate the plugin and the necessary wrappers are inserted into your Genesis child theme.

= How can I change how the plugin works? =

There are no settings and no settings screen. You would have to change the code directly in the source

== Changelog ==

= 1.0.3 =

* Corrected oversight in original code. First closing tag should be </main> instead of </div>
see: http://cobaltapps.com/forum/forum/main-category/main-forum/81542-woo-sensei?p=82210#post82210

= 1.0.2 =

* POT file added

= 1.0.1 =

* Loading textdomain for i18n

= 1.0 =

* Initial release on Github

== Upgrade Notice ==

= 1.0.3 =

This version corrects an oversight in the original code
that caused issues with Cobalt Apps' Dynamik theme.

= 1.0.2 =

This version adds a POT file for translations.

= 1.0.1 =

This version loads the textdomain to enable translations.
=== Genesis Connect for Woothemes Sensei ===

Contributors: christophherr
Donate link: https://www.christophherr.com/donate/
Tags: automattic sensei, sensei, genesis, genesis connect, studiopress, woocommerce sensei
Requires at least: 4.8
Tested up to: 5.1
Stable tag: 1.2.0
Requires PHP: 5.2.4
License: GPL-2.0+
License URI: http://www.gnu.org/licenses/gpl-2.0.txt

This plugin integrates the Genesis Framework from StudioPress with the Sensei plugin.

== Description ==
The plugin expands on the [Sensei Documentation](https://docs.woocommerce.com/document/sensei-and-theme-compatibility/) about adding theme compatibility.

You will need the [Sensei](https://woocommerce.com/products/sensei/) plugin and the [Genesis Framework from StudioPress](https://www.studiopress.com) and/or one of its child themes.

In other words, if you are not trying to integrate the Sensei plugin with the Genesis Framework and/or one of its child themes, you don't need or want this plugin.

This plugin will only work (i.e. activate) if the Genesis Framework and its child themes are activated.

Version 1.1.0 forces a content-sidebar layout on course, lesson and question posts to avoid the sidebar showing underneath the main content.

Version 1.2.0 adds the Genesis Layout options to course, lesson and question posts and archives and the module taxonomy allowing better control about the layout options.
For backwards compatibility, the single posts are still set to a content-sidebar layout but this can be overwritten by the Genesis Layout options.

It should not be necessary to remove the formerly forced content-sidebar layout on single posts with

<code>remove_action( 'genesis_meta', 'gcfws_force_content_sidebar_layout_on_cpt_posts' );</code>

in your functions.php anymore. Please use the Genesis Layout options instead.

== Installation ==

1. Upload the entire `Genesis-Connect-for-Woothemes-Sensei` folder to your `/wp-content/plugins` directory.
2. Activate the plugin through the 'Plugins' menu in WordPress.

Alternatively, you can

1. Click on 'Add new' in the 'Plugins' menu
2. Type (or copy and paste) the name of this plugin into the search box
3. Click on 'Install Now'

== Frequently Asked Questions ==

= Does this work with any WordPress theme? =

No. This plugin only works with the Genesis Framework and its child themes.

= Does this work with any Genesis child theme? =

Yes and no. Technically, it does.
However, depending on other factors such as the individual theme's styling and layout, the output may be unexpected, and require some tweaking.
Case in point, if the full-width layout is selected in the Genesis settings, lessons, course and question posts are showing a sidebar underneath the main content.

Version 1.1.0 forced a content-sidebar layout on single course, lesson and questions.
Since Version 1.2.0 the Genesis Layout options can be used to alter the appearance.

= Are there any settings? =

You simply activate the plugin and the necessary wrappers are inserted into your Genesis child theme.

Since version 1.2.0, you can choose the layouts of your courses, lessons, questions and modules with the Genesis Layout options.

= How can I change how the plugin works? =

There are no settings and no settings screen. You would have to change the code directly in the source.

== Changelog ==

= 1.2.0 =

* Adds Genesis Layout options to course, lesson, and question posts and archives and the module taxonomy.
* Previously forced content-sidebar layout can be overwritten by the Genesis Layout options.
* Updates Readme.
* More modular code structure.

= 1.1.1 =

* Better Code Standards.
* Removes unnecessary code.
* Updates Readme Urls.

= 1.1.0 =

* Adds check to only activate if Woothemes Sensei is already active.
* Forces a content-sidebar layout on single course, lesson and question posts.
To change this behaviour add <code>remove_action( 'genesis_meta', 'gcfws_force_content_sidebar_layout' );</code> to your functions.php.
* After Woothemes Sensei changed their code base dramatically in the 1.9 update,
the previous method of removing the sensei wrappers started to throw error messages.
This update introduces a version check to use the appropriate array for removing the sensei wrappers.

= 1.0.3 =

* Corrected oversight in the original code. First closing tag should be `</main>` instead of `</div>`
see: [Cobalt Apps Forum] (http://cobaltapps.com/forum/forum/main-category/main-forum/81542-woo-sensei?p=82210#post82210)

= 1.0.2 =

* POT file added

= 1.0.1 =

* Loading textdomain for i18n

= 1.0 =

* Initial release on Github

== Upgrade Notice ==

= 1.2.0 =

This version adds the Genesis Layout options to course, lesson and question posts and archives and the module taxonomy.
Please refer to the readme.txt for more information.

= 1.1.1 =

This version removes unnecessary code, follows WordPress Coding Standards better and updates links in the Readme.

= 1.1.0 =

This version adds a version check for Woothemes Sensei to use the appropriate array when removing the standard Sensei wrappers.
Version 1.1.0 also forces a content-sidebar layout on single course, lesston and question posts to avoid the sidebar showing underneath the main content.
Please refer to the readme.txt if you want to remove this feature.
Woothemes Sensei has to be already active before the plugin will activate.

= 1.0.3 =

This version corrects an oversight in the original code
that caused issues with Cobalt Apps' Dynamik theme.

= 1.0.2 =

This version adds a POT file for translations.

= 1.0.1 =

This version loads the textdomain to enable translations.
12 changes: 12 additions & 0 deletions src/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php
/**
* Index.
*
* @package GenesisConnectforWoothemesSensei
* @since 1.2.0
* @author Christoph Herr
* @link https://www.christophherr.com
* @license GNU General Public License 2.0+
*/

// Nothing to see here.
12 changes: 12 additions & 0 deletions src/sensei-integration/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php
/**
* Index.
*
* @package GenesisConnectforWoothemesSensei
* @since 1.2.0
* @author Christoph Herr
* @link https://www.christophherr.com
* @license GNU General Public License 2.0+
*/

// Nothing to see here.
62 changes: 62 additions & 0 deletions src/sensei-integration/sensei-integration.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?php
/**
* Sensei integration
*
* @package GenesisConnectforWoothemesSensei
* @since 1.2.0
* @author Christoph Herr
* @link https://www.christophherr.com
* @license GNU General Public License 2.0+
*/

add_action( 'after_setup_theme', 'gcfws_sensei_support' );
/**
* Declare theme support for Sensei
*
* @since 1.0.0
*/
function gcfws_sensei_support() {
add_theme_support( 'sensei' );
}

add_action( 'genesis_meta', 'gcfws_remove_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.0
*/
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( 'sensei_before_main_content', 'gcfws_genesis_sensei_wrapper_start', 10 );
/**
* Genesis-specific opening wrapper for Sensei
*
* @since 1.0.0
*/
function gcfws_genesis_sensei_wrapper_start() {
echo '<div class="content-sidebar-wrap"><main class="content" role="main" itemprop="mainContentOfPage">';
}

add_action( 'sensei_after_main_content', 'gcfws_genesis_sensei_wrapper_end', 10 );
/**
* Genesis-specific closing wrapper for Sensei
*
* @since 1.0.0
*/
function gcfws_genesis_sensei_wrapper_end() {
echo '</main> <!-- end main-->';
get_sidebar();
echo '</div> <!-- end .content-sidebar-wrap-->';
}
12 changes: 12 additions & 0 deletions src/site-layout/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php
/**
* Index.
*
* @package GenesisConnectforWoothemesSensei
* @since 1.2.0
* @author Christoph Herr
* @link https://www.christophherr.com
* @license GNU General Public License 2.0+
*/

// Nothing to see here.
41 changes: 41 additions & 0 deletions src/site-layout/site-layout.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php
/**
* Sets the Layout for the Sensei CPT posts and adds Genesis Layout options to the Sensei CPTs and Taxonomy.
*
* @package GenesisConnectforWoothemesSensei
* @since 1.2.0
* @author Christoph Herr
* @link https://www.christophherr.com
* @license GNU General Public License 2.0+
*/

add_action( 'genesis_meta', 'gcfws_force_content_sidebar_layout_on_cpt_posts' );
/**
* Force content-sidebar layout on Sensei Course, Lesson and Question posts.
*
* @since 1.2.0
*
* @return void
*/
function gcfws_force_content_sidebar_layout_on_cpt_posts() {

if ( ! is_singular( array( 'course', 'lesson', 'question' ) ) ) {
return;
}
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_content_sidebar' );
}


add_action( 'genesis_setup', 'gcfws_add_genesis_layout_to_sensei_cpts' );
/**
* Add the Genesis Layout options to single CPT posts and Genesis CPT archive Settings to the CPT archives.
*
* @since 1.2.0
*
* @return void
*/
function gcfws_add_genesis_layout_to_sensei_cpts() {
add_post_type_support( 'course', array( 'genesis-layouts', 'genesis-cpt-archives-settings' ) );
add_post_type_support( 'lesson', array( 'genesis-layouts', 'genesis-cpt-archives-settings' ) );
add_post_type_support( 'question', array( 'genesis-layouts', 'genesis-cpt-archives-settings' ) );
}