Created
July 27, 2016 22:05
-
-
Save bappi-d-great/cf36d9b737de122807d2f662abe11903 to your computer and use it in GitHub Desktop.
WPMU Membership2: Show membership information in the register page for direct link
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
<!-- Customization begin --> | |
<?php | |
/** | |
* 1. Copy /wp-content/plugins/membership/app/view/templates/membership_registration_form.php | |
* 2. Create a folder in your active theme folder, called membership2. The path should be /wp-content/themes/YOUR_THEME/membership2/ | |
* 3. Paste membership_registration_form.php in there | |
* 4. Then copy the following code and replace the content of membership_registration_form.php. | |
*/ | |
?> | |
<?php | |
if( isset( $_REQUEST['membership_id'] ) ) : | |
$membership_id = $_REQUEST['membership_id']; | |
$api = ms_api(); | |
$membership = $api->get_membership( $membership_id ); | |
?> | |
<div class="custom_membership_details"> | |
<h2><?php echo $membership->name; ?></h2> | |
<p><?php echo $membership->description; ?></p> | |
<p><?php echo $membership->price; ?></p> | |
</div> | |
<style> | |
/* ADD CUSTOM CSS HERE */ | |
</style> | |
<?php | |
endif; | |
?> | |
<!-- End Customization --> | |
<?php if ( is_ms_registration_form_title_exists() ) : ?> | |
<legend><?php echo get_ms_registration_form_title(); ?></legend> | |
<?php endif; ?> | |
<?php | |
echo get_ms_registration_form_fields(); | |
echo '<div class="ms-extra-fields">'; | |
/** | |
* Trigger default WordPress action to allow other plugins | |
* to add custom fields to the registration form. | |
* | |
* signup_extra_fields Defined in wp-signup.php which is used | |
* for Multisite signup process. | |
* | |
* register_form Defined in wp-login.php which is only used for | |
* Single site registration process. | |
* | |
* @since 1.0.0 | |
*/ | |
ms_registration_form_extra_fields(); | |
echo '</div>'; | |
echo get_ms_registration_form_register_button(); | |
ms_registration_form_error(); | |
/** | |
* This hook is intended to output hidden fields or JS code | |
* at the end of the form tag. | |
* | |
* @since 1.0.1.0 | |
*/ | |
do_action( 'ms_shortcode_register_form_end', ms_registration_form_obj() ); | |
?> | |
<br><br> | |
<?php | |
if ( is_ms_registration_form_login_link_exists() ) { | |
echo get_ms_registration_form_login_link(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment