Skip to content

Commit

Permalink
Merge pull request #6 from strangerstudios/dev
Browse files Browse the repository at this point in the history
PMPro Pods 1.0.1
  • Loading branch information
sc0ttkclark authored Nov 12, 2021
2 parents d8c19f9 + cd87a8a commit 3cb969a
Show file tree
Hide file tree
Showing 11 changed files with 165 additions and 95 deletions.
9 changes: 6 additions & 3 deletions pmpro-pods.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Paid Memberships Pro - Pods Add On
Plugin URI: https://www.paidmembershipspro.com/add-ons/pods-integration/
Description: Integrates Paid Memberships Pro with the Pods Framework to add groups of fields to many areas of your membership site including Member Profiles, the Membership Checkout page, and admin screens including Membership Levels and Orders.
Version: 1.0
Version: 1.0.1
Author: Paid Memberships Pro
Author URI: https://www.paidmembershipspro.com/
Text Domain: pmpro-pods
Expand All @@ -19,10 +19,13 @@
use PMPro_Pods\Pods\Meta_Compatibility;
use PMPro_Pods\Pods\Permissions;

define( 'PMPRO_PODS_VERSION', '1.0.1' );
define( 'PMPRO_PODS_URL', plugin_dir_url( __FILE__ ) );

/**
* Autoload the classes for our namespace.
*
* @since TBD
* @since 1.0.0
*
* @param string $class The class name to load.
*/
Expand Down Expand Up @@ -51,7 +54,7 @@ function pmpro_pods_autoload( $class ) {
/**
* Handle init of the plugin hooks.
*
* @since TBD
* @since 1.0.0
*/
function pmpro_pods_init() {
if ( ! defined( 'PMPRO_VERSION' ) || version_compare( PMPRO_VERSION, '2.6', '<=' ) ) {
Expand Down
6 changes: 5 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: paid memberships pro, pods
Requires at least: 5.5
Tested up to: 5.8
Requires PHP: 5.6
Stable tag: 1.0
Stable tag: 1.0.1
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -87,5 +87,9 @@ Please visit our premium support site at [https://www.paidmembershipspro.com](ht

== Changelog ==

= 1.0.1 - November 12th, 2021 =
* Added support for showing PMPro Member fields on the Membership Account page under the Account Details area. #5 (@sc0ttkclark)
* Prevent PHP notices on checkout page when logged out. (@sc0ttkclark)

= 1.0 - October 26th, 2021 =
* Initial release
4 changes: 2 additions & 2 deletions src/Covered_Objects.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
/**
* Functionality for covered PMPro object types.
*
* @since TBD
* @since 1.0.0
* @package PMPro_Pods
*/
class Covered_Objects {

/**
* Get the list of PMPro integration types and their configurations.
*
* @since TBD
* @since 1.0.0
*
* @return array[] The list of PMPro integration types and their configurations.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/PMPro/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
/**
* Helper functionality for interfacing with PMPro.
*
* @since TBD
* @since 1.0.0
* @package PMPro_Pods
*/
class Helper {

/**
* Get the list of all level names keyed by ID.
*
* @since TBD
* @since 1.0.0
*
* @return string[] List of all level names keyed by ID.
*/
Expand Down
14 changes: 7 additions & 7 deletions src/PMPro/Objects/Level.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
* update_pmpro_membership_level_meta( $level_id, 'meta_key', 'value' );
* delete_pmpro_membership_level_meta( $level_id, 'meta_key' );
*
* @since TBD
* @since 1.0.0
* @package PMPro_Pods
*/
class Level {

/**
* Add hooks for class.
*
* @since TBD
* @since 1.0.0
*/
public function hook() {
add_action( 'pmpro_membership_level_after_billing_details_settings', [ $this, 'pmpro_membership_level_after_billing_details_settings' ] );
Expand All @@ -44,7 +44,7 @@ public function hook() {
/**
* Remove hooks from class.
*
* @since TBD
* @since 1.0.0
*/
public function unhook() {
remove_action( 'pmpro_membership_level_after_billing_details_settings', [ $this, 'pmpro_membership_level_after_billing_details_settings' ] );
Expand All @@ -56,7 +56,7 @@ public function unhook() {
/**
* Render the fields after billing details settings section.
*
* @since TBD
* @since 1.0.0
*
* @param object $level The membership level object.
*/
Expand All @@ -70,7 +70,7 @@ public function pmpro_membership_level_after_billing_details_settings( $level )
/**
* Render the fields after other settings section.
*
* @since TBD
* @since 1.0.0
*
* @param object $level The membership level object.
*/
Expand All @@ -84,7 +84,7 @@ public function pmpro_membership_level_after_other_settings( $level ) {
/**
* Render the fields after content settings section.
*
* @since TBD
* @since 1.0.0
*
* @param object $level The membership level object.
*/
Expand All @@ -98,7 +98,7 @@ public function pmpro_membership_level_after_content_settings( $level ) {
/**
* Handle saving the submitted fields for the object.
*
* @since TBD
* @since 1.0.0
*
* @param int $level_id The level ID.
*/
Expand Down
54 changes: 27 additions & 27 deletions src/PMPro/Objects/Member_Checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* update_user_meta( $user_id, 'meta_key', 'value' );
* delete_user_meta( $user_id, 'meta_key' );
*
* @since TBD
* @since 1.0.0
* @package PMPro_Pods
*/
class Member_Checkout {
Expand All @@ -48,7 +48,7 @@ class Member_Checkout {
/**
* Add hooks for class.
*
* @since TBD
* @since 1.0.0
*/
public function hook() {
add_action( 'pmpro_checkout_after_level_cost', [ $this, 'pmpro_checkout_after_level_cost' ] );
Expand Down Expand Up @@ -76,7 +76,7 @@ public function hook() {
/**
* Remove hooks from class.
*
* @since TBD
* @since 1.0.0
*/
public function unhook() {
remove_action( 'pmpro_checkout_after_level_cost', [ $this, 'pmpro_checkout_after_level_cost' ] );
Expand Down Expand Up @@ -104,7 +104,7 @@ public function unhook() {
/**
* Render the fields for the checkout page in the after level cost section.
*
* @since TBD
* @since 1.0.0
*
* @param WP_User $user The user object.
*/
Expand All @@ -113,7 +113,7 @@ public function pmpro_checkout_after_level_cost( $user ) {
return;
}

pods_form_render_fields( 'pmpro_membership_user', $user->ID, [
pods_form_render_fields( 'pmpro_membership_user', $user ? $user->ID : null, [
'section_field' => 'pmpro_section_checkout',
'section' => 'after_level_cost',
'render' => 'div-rows',
Expand All @@ -124,7 +124,7 @@ public function pmpro_checkout_after_level_cost( $user ) {
/**
* Render the fields for the checkout page in the after pricing fields section.
*
* @since TBD
* @since 1.0.0
*
* @param WP_User $user The user object.
*/
Expand All @@ -133,7 +133,7 @@ public function pmpro_checkout_after_pricing_fields( $user ) {
return;
}

pods_form_render_fields( 'pmpro_membership_user', $user->ID, [
pods_form_render_fields( 'pmpro_membership_user', $user ? $user->ID : null, [
'section_field' => 'pmpro_section_checkout',
'section' => 'after_pricing_fields',
'render' => 'div-rows',
Expand All @@ -144,7 +144,7 @@ public function pmpro_checkout_after_pricing_fields( $user ) {
/**
* Render the fields for the checkout page in the after username section.
*
* @since TBD
* @since 1.0.0
*
* @param WP_User $user The user object.
*/
Expand All @@ -153,7 +153,7 @@ public function pmpro_checkout_after_username( $user ) {
return;
}

pods_form_render_fields( 'pmpro_membership_user', $user->ID, [
pods_form_render_fields( 'pmpro_membership_user', $user ? $user->ID : null, [
'section_field' => 'pmpro_section_checkout',
'section' => 'after_username',
'render' => 'div-rows',
Expand All @@ -165,7 +165,7 @@ public function pmpro_checkout_after_username( $user ) {
/**
* Render the fields for the checkout page in the after password section.
*
* @since TBD
* @since 1.0.0
*
* @param WP_User $user The user object.
*/
Expand All @@ -174,7 +174,7 @@ public function pmpro_checkout_after_password( $user ) {
return;
}

pods_form_render_fields( 'pmpro_membership_user', $user->ID, [
pods_form_render_fields( 'pmpro_membership_user', $user ? $user->ID : null, [
'section_field' => 'pmpro_section_checkout',
'section' => 'after_password',
'render' => 'div-rows',
Expand All @@ -186,7 +186,7 @@ public function pmpro_checkout_after_password( $user ) {
/**
* Render the fields for the checkout page in the after email section.
*
* @since TBD
* @since 1.0.0
*
* @param WP_User $user The user object.
*/
Expand All @@ -195,7 +195,7 @@ public function pmpro_checkout_after_email( $user ) {
return;
}

pods_form_render_fields( 'pmpro_membership_user', $user->ID, [
pods_form_render_fields( 'pmpro_membership_user', $user ? $user->ID : null, [
'section_field' => 'pmpro_section_checkout',
'section' => 'after_email',
'render' => 'div-rows',
Expand All @@ -207,7 +207,7 @@ public function pmpro_checkout_after_email( $user ) {
/**
* Render the fields for the checkout page in the after billing fields section.
*
* @since TBD
* @since 1.0.0
*
* @param WP_User $user The user object.
*/
Expand All @@ -216,7 +216,7 @@ public function pmpro_checkout_after_billing_fields( $user ) {
return;
}

pods_form_render_fields( 'pmpro_membership_user', $user->ID, [
pods_form_render_fields( 'pmpro_membership_user', $user ? $user->ID : null, [
'section_field' => 'pmpro_section_checkout',
'section' => 'after_billing_fields',
'render' => 'div-rows',
Expand All @@ -227,7 +227,7 @@ public function pmpro_checkout_after_billing_fields( $user ) {
/**
* Render the fields for the checkout page in the after payment information fields section.
*
* @since TBD
* @since 1.0.0
*
* @param WP_User $user The user object.
*/
Expand All @@ -236,7 +236,7 @@ public function pmpro_checkout_after_payment_information_fields( $user ) {
return;
}

pods_form_render_fields( 'pmpro_membership_user', $user->ID, [
pods_form_render_fields( 'pmpro_membership_user', $user ? $user->ID : null, [
'section_field' => 'pmpro_section_checkout',
'section' => 'after_payment_information_fields',
'render' => 'div-rows',
Expand All @@ -247,7 +247,7 @@ public function pmpro_checkout_after_payment_information_fields( $user ) {
/**
* Render the fields for the checkout page in the after TOS fields section.
*
* @since TBD
* @since 1.0.0
*
* @param WP_User $user The user object.
*/
Expand All @@ -256,7 +256,7 @@ public function pmpro_checkout_after_tos_fields( $user ) {
return;
}

pods_form_render_fields( 'pmpro_membership_user', $user->ID, [
pods_form_render_fields( 'pmpro_membership_user', $user ? $user->ID : null, [
'section_field' => 'pmpro_section_checkout',
'section' => 'after_tos_fields',
'render' => 'div-rows',
Expand All @@ -267,7 +267,7 @@ public function pmpro_checkout_after_tos_fields( $user ) {
/**
* Render the fields for the checkout page in the after captcha section.
*
* @since TBD
* @since 1.0.0
*
* @param WP_User $user The user object.
*/
Expand All @@ -276,7 +276,7 @@ public function pmpro_checkout_after_captcha( $user ) {
return;
}

pods_form_render_fields( 'pmpro_membership_user', $user->ID, [
pods_form_render_fields( 'pmpro_membership_user', $user ? $user->ID : null, [
'section_field' => 'pmpro_section_checkout',
'section' => 'after_captcha',
'render' => 'div-rows',
Expand All @@ -287,7 +287,7 @@ public function pmpro_checkout_after_captcha( $user ) {
/**
* Render the fields for the checkout page in the before submit button section.
*
* @since TBD
* @since 1.0.0
*
* @param WP_User $user The user object.
*/
Expand All @@ -296,7 +296,7 @@ public function pmpro_checkout_before_submit_button( $user ) {
return;
}

pods_form_render_fields( 'pmpro_membership_user', $user->ID, [
pods_form_render_fields( 'pmpro_membership_user', $user ? $user->ID : null, [
'section_field' => 'pmpro_section_checkout',
'section' => 'before_submit_button',
'render' => 'div-rows',
Expand All @@ -307,7 +307,7 @@ public function pmpro_checkout_before_submit_button( $user ) {
/**
* Handle validation of fields.
*
* @since TBD
* @since 1.0.0
*
* @param bool $is_valid Whether the registration validation passed.
*
Expand Down Expand Up @@ -351,7 +351,7 @@ public function pmpro_registration_checks( $check ) {
/**
* Handle setting session variables for PayPal Express payments based on field values.
*
* @since TBD
* @since 1.0.0
*/
public function pmpro_paypalexpress_session_vars() {
// Map the $_POST submitted fields to $_SESSION.
Expand All @@ -375,7 +375,7 @@ public function pmpro_paypalexpress_session_vars() {
/**
* Handle session variables from PayPal Express payments and move them back to $_POST data.
*
* @since TBD
* @since 1.0.0
*
* @param int $user_id The user ID.
* @param MemberOrder $morder The member order object.
Expand Down Expand Up @@ -406,7 +406,7 @@ public function pmpro_after_checkout( $user_id, $morder ) {
/**
* Handle saving checkout from PayPal Standard payments and move them back to $_POST data.
*
* @since TBD
* @since 1.0.0
*
* @param int $user_id The user ID.
* @param null|MemberOrder $morder The member order object.
Expand Down
Loading

0 comments on commit 3cb969a

Please sign in to comment.