Plugin Directory

Changeset 2311798


Ignore:
Timestamp:
05/25/2020 07:00:25 PM (6 years ago)
Author:
oskarn97
Message:

fix memberships

Location:
appful/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • appful/trunk/appful.php

    r2297094 r2311798  
    44Plugin URI: https://appful.io/
    55Description: appful is one of the world's most remarkable & beautiful app service for Blogger and Online magazines. It is designed to create outstanding real native iOS and Android Apps based on the content of your Wordpress site or YouTube channel. appful is surprisingly simple to use and not a single line of code is required.
    6 Version: 1.0.117
     6Version: 1.0.118
    77Author: appful GmbH
    88Author URI: https://appful.io/
     
    213213
    214214    $post = get_post($post_id);
     215    if($post->post_type == "wc_user_membership") {
     216        $appful_api->request('updateMembership', array('user_id' => $post->post_author));
     217        return;
     218    }
     219
    215220    $params = array("post_id" => $post_id, "push" => $push && $post->post_type != "page" ? 1:0);
    216221    if ($new_status) $params["new_status"] = $new_status;
  • appful/trunk/controllers/users.php

    r2293853 r2311798  
    115115        foreach($users as $user) {
    116116            foreach(wc_memberships_get_user_active_memberships($user) as $membership) {
    117                 $memberships[$user] = array('plan_id' => $membership->plan_id, 'end_date' => strtotime($membership->get_end_date()));
     117                $memberships[$user][] = array('plan_id' => $membership->plan_id, 'end_date' => strtotime($membership->get_end_date()));
    118118            }
    119119        }
  • appful/trunk/singletons/api.php

    r2297107 r2311798  
    3131        add_action('wp_ajax_nopriv_zaki_like_dislike_ajax', array(&$this,'onZakiCommentLike'), 1, 0);
    3232        add_action('profile_update', array(&$this,'user_profile_update'), 10, 2);
     33        add_action('woocommerce_subscription_status_updated', array(&$this,'user_membership_update'), 100, 3);
    3334
    3435
     
    14251426        }
    14261427    }
     1428 
     1429    function user_membership_update($subscription, $new_status, $old_status) {
     1430        $this->request('updateMembership', array('user_id' => $subscription->get_customer_id()));
     1431    }
     1432 
    14271433}
    14281434
Note: See TracChangeset for help on using the changeset viewer.