Skip to content

Commit

Permalink
Sync with SVN version
Browse files Browse the repository at this point in the history
  • Loading branch information
christophherr committed Oct 11, 2017
1 parent a401eef commit 0a02980
Show file tree
Hide file tree
Showing 3 changed files with 140 additions and 34 deletions.
120 changes: 117 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,122 @@
# 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: woothemes sensei, woothemes, genesis, genesis connect, studiopress
Requires at least: 4.1
Tested up to: 4.8
Stable tag: 1.1.1
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

The base for this plugin is code taken from [WooThemes Support](https://support.woothemes.com/hc/en-us/articles/204428855-StudioPress-Genesis).

You will need the [WooThemes 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 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.
This plugin will only work (i.e. activate) if the Genesis Framework and its child themes and Woothemes Sensei 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.

To change this new feature, you have to use a remove_action on the code the plugin is adding.
Add <code>remove_action( 'genesis_meta', 'gcfws_force_content_sidebar_layout' );</code> to your functions.php.
If you want to use a different layout, the [Studiopress Snippets](https://my.studiopress.com/snippets/admin-management/) should help to get you started.

## 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.
That´s why a content-sidebar layout is forced on single course, lesson and questions posts since version 1.1.0.
To remove this behaviour, add <code>remove_action( 'genesis_meta', 'gcfws_force_content_sidebar_layout' );</code> to your functions.php.

### 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.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.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.
26 changes: 4 additions & 22 deletions genesis-connect-for-woothemes-sensei.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
* 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.
* Author: Christoph Herr
* Author URI: http://www.christophherr.com
* Version: 1.1.0
* Version: 1.1.1
* 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
*
* @package GenesisConnectforWoothemesSensei
* @author Christoph Herr
* @version 1.1.0
* @version 1.1.1
* @license GPL-2.0+
*
* Genesis Connect for Woothemes Sensei is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -47,11 +47,6 @@ function gcfws_activation() {
deactivate_plugins( plugin_basename( __FILE__ ) );
add_action( 'admin_notices', 'gcfws_admin_notice_message' );
}
if ( ! class_exists( ('Sensei_Main' ) || ( 'WooThemes_Sensei' ) ) ) {
// Deactivate.
deactivate_plugins( plugin_basename( __FILE__ ) );
add_action( 'admin_notices', 'gcfws_admin_notice_message_sensei' );
}
}

register_activation_hook( __FILE__, 'gcfws_activation' );
Expand Down Expand Up @@ -88,21 +83,6 @@ function gcfws_admin_notice_message() {
}
}

/**
* Error message if you're not using Woothemes Sensei.
*
* @since 1.1
*/
function gcfws_admin_notice_message_sensei() {
$error = sprintf( _e( 'Sorry, you can\'t use the Genesis Connect for Woothemes Sensei Plugin unless the <a href="%s">Sensei Plugin</a> is active. The plugin has been deactivated.', 'gcfws' ), 'http://senseilms.com' );

echo '<div class="error"><p>' . $error . '</p></div>';

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

/**
* Load plugin textdomain.
*
Expand All @@ -128,6 +108,7 @@ function gcfws_sensei_support() {

/**
* Force content-sidebar layout on Woothemes Sensei Course, Lesson and Question pages.
*
* @since 1.1
*/
function gcfws_force_content_sidebar_layout() {
Expand All @@ -142,6 +123,7 @@ function gcfws_force_content_sidebar_layout() {
* Remove the default Woothemes Sensei wrappers.
* Checks which version of Woothemes Sensei is running
* and removes the wrappers accordingly.
*
* @since 1.1
*/
function gcfws_remove_default_sensei_wrappers() {
Expand Down
28 changes: 19 additions & 9 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ 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.6
Stable tag: 1.1.0
Tested up to: 4.8
Stable tag: 1.1.1
License: GPL-2.0+
License URI: http://www.gnu.org/licenses/gpl-2.0.txt

Expand All @@ -15,7 +15,7 @@ This plugin integrates the Genesis Framework from Studiopress with the Woothemes

The base for this plugin is code taken from [WooThemes Support](https://support.woothemes.com/hc/en-us/articles/204428855-StudioPress-Genesis).

You will need the [WooThemes Sensei](http://www.woothemes.com/products/sensei/) plugin and the [Genesis Framework from Studiopress](http://www.studiopress.com) and/or one of its child themes.
You will need the [WooThemes 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 Woothemes Sensei plugin with the Genesis Framework and/or one of its child themes, this plugin is pretty much useless for you...

Expand All @@ -25,7 +25,7 @@ Version 1.1.0 forces a content-sidebar layout on course, lesson and question pos

To change this new feature, you have to use a remove_action on the code the plugin is adding.
Add <code>remove_action( 'genesis_meta', 'gcfws_force_content_sidebar_layout' );</code> to your functions.php.
If you want to use a different layout, the [Studiopress Snippets](https://my.studiopress.com/snippets/admin-management/) should help to get you started.
If you want to use a different layout, the [Studiopress Snippets](https://my.studiopress.com/snippets/admin-management/) should help to get you started.

== Installation ==

Expand Down Expand Up @@ -62,15 +62,20 @@ There are no settings and no settings screen. You would have to change the code

== Changelog ==

= 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.
* 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,
* 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 =

Expand All @@ -91,9 +96,14 @@ see: [Cobalt Apps Forum] (http://cobaltapps.com/forum/forum/main-category/main-f

== Upgrade Notice ==

= 1.1.0 =
= 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.
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.

Expand Down

0 comments on commit 0a02980

Please sign in to comment.