Skip to content

Instantly share code, notes, and snippets.

@champsupertramp
Last active August 18, 2020 14:30
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 champsupertramp/b1cae3fe7867623e4c38ca850d331673 to your computer and use it in GitHub Desktop.
Save champsupertramp/b1cae3fe7867623e4c38ca850d331673 to your computer and use it in GitHub Desktop.
Ultimate Member - Terms & Conditions : Open to a new tab instead of displaying the full content in the form
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
<div class="um-field um-field-type_terms_conditions" data-key="use_terms_conditions_agreement" style="display: block;padding:0px">
<div class="um-field-area">
<div class="um-terms-conditions-content" style="display:none">
<?php if ( ! empty( $args['use_terms_conditions_content_id'] ) ) {
if ( isset( $um_content_query ) ) { ?>
<a href="<?php echo get_the_permalink( $args['use_terms_conditions_content_id'] );?>" target="_blank" class="um-hide-terms">
<?php echo ! empty( $args['use_terms_conditions_toggle_hide'] ) ? $args['use_terms_conditions_toggle_hide'] : __( 'Hide Terms', 'um-terms-conditions' ); ?>
</a>
<?php echo apply_filters( 'um_terms_conditions_tc_page_content', $um_content_query->post_content, $args );
}
} ?>
</div>
</div>
<div class="um-field-area">
<label class="um-field-checkbox">
<input type="checkbox" name="use_terms_conditions_agreement" value="1">
<span class="um-field-checkbox-state">
<i class="um-icon-android-checkbox-outline-blank"></i>
</span>
<span class="um-field-checkbox-option">
<a href="<?php echo get_the_permalink( $args['use_terms_conditions_content_id'] );?>" target="_blank" >
<?php echo ! empty( $args['use_terms_conditions_agreement'] ) ? $args['use_terms_conditions_agreement'] : __( 'Please confirm that you agree to our terms & conditions', 'um-terms-conditions' ); ?>
</a>
</span>
</label>
<div class="um-clear"></div>
<?php $errors = UM()->form()->errors;
if ( isset( $errors['use_terms_conditions_agreement'] ) ) {
$error_message = ! empty( $args['use_terms_conditions_error_text'] ) ? $args['use_terms_conditions_error_text'] : __( 'You must agree to our terms & conditions','um-terms-conditions' ); ?>
<p class="um-notice err">
<i class="um-icon-ios-close-empty" onclick="jQuery(this).parent().fadeOut();"></i><?php echo $error_message ?>
</p>
<br />
<?php } ?>
<div class="um-clear"></div>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment