Skip to content

Commit

Permalink
Merge pull request #231 from memberful/add-ultimate-recipes-premium
Browse files Browse the repository at this point in the history
Add support for Ultimate Recipe Premium
  • Loading branch information
mrhead committed Nov 26, 2018
2 parents 887ba2d + a45c944 commit 6190dc7
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
8 changes: 6 additions & 2 deletions wordpress/wp-content/plugins/memberful-wp/memberful-wp.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
Plugin Name: Memberful WP
Plugin URI: http://github.com/memberful/memberful-wp
Description: Sell memberships and restrict access to content with WordPress and Memberful.
Version: 1.42.1
Version: 1.43.0
Author: Memberful
Author URI: http://memberful.com
License: GPLv2 or later
*/

if ( ! defined( 'MEMBERFUL_VERSION' ) )
define( 'MEMBERFUL_VERSION', '1.42.1' );
define( 'MEMBERFUL_VERSION', '1.43.0' );

if ( ! defined( 'MEMBERFUL_PLUGIN_FILE' ) )
define( 'MEMBERFUL_PLUGIN_FILE', __FILE__ );
Expand Down Expand Up @@ -78,6 +78,10 @@
require_once MEMBERFUL_DIR . '/src/contrib/wp-ultimate-recipe.php';
}

if ( in_array( 'wp-ultimate-recipe/wp-ultimate-recipe-premium.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
require_once MEMBERFUL_DIR . '/src/contrib/wp-ultimate-recipe-premium.php';
}

function memberful_wp_plugin_activate() {
add_option( 'memberful_wp_activation_redirect' , true );
memberful_clear_obsolete_cron_jobs();
Expand Down
6 changes: 5 additions & 1 deletion wordpress/wp-content/plugins/memberful-wp/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: matt-button, drewstrojny, dwestendorf, rusuandreirobert, sumobi, W
Tags: memberful, member, membership, memberships, recurring payments, recurring billing, paywall, subscriptions, stripe, oauth, oauth2
Requires at least: 3.6
Tested up to: 4.9
Stable tag: 1.42.1
Stable tag: 1.43.0
License: GPLv2 or later

Sell memberships and restrict access to content with WordPress and Memberful.
Expand Down Expand Up @@ -48,6 +48,10 @@ Glad you asked! We manage development of the plugin over at the [Memberful WP Gi

== Changelog ==

= 1.43.0 =

* Add support for WP Ultimate Recipe Premium.

= 1.42.1 =

* Send site URL to Memberful during activation.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
if ( in_array( 'wp-ultimate-recipei-premium/wp-ultimate-recipe-premium.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
add_action( 'wp', 'memberful_disable_wp_ultimate_recipe_premium_content_filter' );

function memberful_disable_wp_ultimate_recipe_premium_content_filter() {
global $post;

if ( ! memberful_can_user_access_post( wp_get_current_user()->ID, $post->ID ) ) {
$wp_ultimate_recipe_premium = WPUltimateRecipe::get();
$recipe_content = $wp_ultimate_recipe_premium->helper( "recipe_content" );

remove_filter( 'the_content', array( $recipe_content, 'content_filter' ), 10 );
}
}
}

0 comments on commit 6190dc7

Please sign in to comment.