Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions pmpro-network.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,12 @@ function pmpron_init() {
First we need to add some fields to the checkout page.
*/
//add the fields to the form
function pmpron_pmpro_checkout_boxes()
{
global $current_user, $wpdb, $pmpro_network_non_site_levels;
function pmpron_pmpro_checkout_boxes() {
global $current_user, $wpdb, $pmpro_network_non_site_levels, $current_site;
//Bail if it's not a multiste install
if(! isset( $current_site ) ) {
return;
}

$level_id = null;

Expand Down Expand Up @@ -156,7 +159,6 @@ function pmpron_pmpro_checkout_boxes()
<label for="sitename"><?php esc_html_e( 'Site Name', 'pmpro-network' ); ?></label>
<input id="sitename" name="sitename" type="text" class="input" size="30" value="<?php echo esc_attr(stripslashes($sitename)); ?>" /><span class="pmpro_asterisk"> <abbr title="Required Field">*</abbr></span>
<?php
global $current_site;
$site_domain = preg_replace( '|^www\.|', '', $current_site->domain );

if ( !is_subdomain_install() )
Expand Down Expand Up @@ -326,6 +328,11 @@ function pmpron_pmpro_save_membership_level( $level_id ) {

//Display the setting for the number of site credits on the Edit Membership Level page
function pmpron_pmpro_membership_level_after_other_settings() {
global $current_site;
//Bail if it's not a multisite install
if(! isset( $current_site ) ) {
return;
}
$level_id = intval($_REQUEST['edit']);
if($level_id > 0) {
//want to specifically get the value from options here
Expand All @@ -338,7 +345,7 @@ function pmpron_pmpro_membership_level_after_other_settings() {
$pmpro_site_credits = '';
}
?>
<h2 class="topborder"><?php esc_html_e( 'Site Credits', 'pmpro-network' ); ?></h2>
<h3 class="topborder"><?php esc_html_e( 'Site Credits', 'pmpro-network' ); ?></h3>
<table class="form-table">
<tbody>
<tr>
Expand Down