Skip to content

Commit

Permalink
Merge pull request #65 from strangerstudios/dev
Browse files Browse the repository at this point in the history
Version 0.4.1 update for master branch
  • Loading branch information
andrewlimaza committed Jan 9, 2020
2 parents c5e30db + f4608e0 commit 9e19de3
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
18 changes: 9 additions & 9 deletions js/pmpro-series.js
Expand Up @@ -34,39 +34,39 @@ function pmpros_removePost(post_id) {

function pmpros_updatePost() {
var seriesid = jQuery('#post_ID').val();
$.ajax({
jQuery.ajax({
url: ajaxurl,
type: 'GET',
dataType: 'html',
data: "pmpros_add_post=1&pmpros_series=" + seriesid + "&pmpros_post=" + $('#pmpros_post').val() + '&pmpros_delay=' + $('#pmpros_delay').val(),
data: "pmpros_add_post=1&pmpros_series=" + seriesid + "&pmpros_post=" + jQuery('#pmpros_post').val() + '&pmpros_delay=' + jQuery('#pmpros_delay').val(),
error: function(xml){
alert('Error saving series post [1]');
//enable save button
$('#pmpros_save').html('Save');
jQuery('#pmpros_save').html('Save');
},
success: function(responseHTML){
if (responseHTML == 'error'){
alert('Error saving series post [2]');
//enable save button
$('#pmpros_save').html('Save');
jQuery('#pmpros_save').html('Save');
}else{
$('#pmpros_series_posts').html(responseHTML);
jQuery('#pmpros_series_posts').html(responseHTML);
pmpros_Setup();
}
}
});
}

function pmpros_Setup() {
$('#pmpros_post').select2({width: 'elements'});
jQuery('#pmpros_post').select2({width: 'elements'});

$('#pmpros_save').click(function() {
if($(this).html() != 'Saving...'){
jQuery('#pmpros_save').click(function() {
if(jQuery(this).html() != 'Saving...'){
pmpros_updatePost();
}
});
}

jQuery(document).ready(function($) {
jQuery(document).ready(function(jQuery) {
pmpros_Setup();
});
2 changes: 1 addition & 1 deletion pmpro-series.php
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Paid Memberships Pro - Series Add On
* Plugin URI: https://www.paidmembershipspro.com/add-ons/pmpro-series-for-drip-feed-content/
* Description: Offer serialized (drip feed) content to your PMPro members.
* Version: .4
* Version: .4.1
* Author: Paid Memberships Pro
* Author URI: https://www.paidmembershipspro.com
* Text Domain: pmpro-series
Expand Down
8 changes: 6 additions & 2 deletions readme.txt
Expand Up @@ -2,8 +2,8 @@
Contributors: strangerstudios
Tags: series, drip feed, serial, delayed, limited, memberships
Requires at least: 4
Tested up to: 5.0.3
Stable tag: .4
Tested up to: 5.3.2
Stable tag: .4.1

Create "Series" which are groups of posts/pages where content is revealed to members over time. This is the "drip feed content" module for Paid Memberships Pro.

Expand Down Expand Up @@ -61,6 +61,10 @@ Please post it in the issues section of GitHub and we'll fix it as soon as we ca

== Changelog ==

= .4.1 - 2020-01-09=
* BUG FIX: Fixed issues where posts belonging to more than one series would show up multiple times in the new content email.
* BUG FIX: Fixed JavaScript issues of posts/pages not being added to series.

= .4 =
* BUG FIX: Fixed issues that came up if PMPro was not active.
* BUG FIX: Fixes issues when running certain versions of PHP.
Expand Down
6 changes: 4 additions & 2 deletions scheduled/crons.php
Expand Up @@ -38,8 +38,10 @@ function pmpros_check_for_new_content() {
if(pmpros_hasAccess($user->user_id, $series_post->id) && !in_array($series_post->id, $notified)) {
//add email to array to send
if(empty($emails[$user->user_id]))
$emails[$user->user_id] = array();
$emails[$user->user_id][] = $series_post->id;
$emails[$user->user_id] = array();
//don't add to email if we're already emailing about this post
if( !in_array($series_post->id, $emails[$user->user_id]) )
$emails[$user->user_id][] = $series_post->id;
//$series->sendEmail($series_post->id, $user->user_id);
}
}
Expand Down

0 comments on commit 9e19de3

Please sign in to comment.