Skip to content

Instantly share code, notes, and snippets.

@MaryOJob
Last active September 17, 2020 20:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MaryOJob/808f295c1f711922c567b6a89033ea87 to your computer and use it in GitHub Desktop.
Save MaryOJob/808f295c1f711922c567b6a89033ea87 to your computer and use it in GitHub Desktop.
My PMPro Sponsored Members Code Example
<?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