Last active
September 17, 2020 20:25
-
-
Save MaryOJob/808f295c1f711922c567b6a89033ea87 to your computer and use it in GitHub Desktop.
My PMPro Sponsored Members Code Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // Do not copy this line please. | |
/** | |
* This Sample shows how a Sponsor can create users (child accounts) at checkout | |
* Using the Sponsored/Group Members Add On for PMPro | |
* https://www.paidmembershipspro.com/add-ons/pmpro-sponsored-members/#checkoutoptions | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
global $pmprosm_sponsored_account_levels; | |
$pmprosm_sponsored_account_levels = array( | |
//set 5 seats at checkout | |
1 => array( | |
'main_level_id' => 1, //redundant but useful | |
'sponsored_level_id' => array(2), //array or single id | |
'min_seats' => 2, | |
'max_seats' => 5, | |
'seat_cost' => '21', | |
'sponsored_accounts_at_checkout' => true, // sponsored members to create child accounts at checkout if set to true | |
'children_get_name' => true, | |
'children_hide_email' => false, | |
'children_hide_username' => false, | |
'children_hide_password' => false | |
) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment