Commit inicial - WordPress Análisis de Precios Unitarios

- WordPress core y plugins
- Tema Twenty Twenty-Four configurado
- Plugin allow-unfiltered-html.php simplificado
- .gitignore configurado para excluir wp-config.php y uploads

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2025-11-03 21:04:30 -06:00
commit a22573bf0b
24068 changed files with 4993111 additions and 0 deletions

View File

@@ -0,0 +1,321 @@
<?php
/**
* Card Form - Full
*
* This template is for displaying credit card form details. It's shown on the registration
* form when selecting a gateway that supports taking credit/debit card details directly and
* requires a full billing address.
*
* For modifying this template, please see: http://docs.restrictcontentpro.com/article/1738-template-files
*
* @package Restrict Content Pro
* @subpackage Templates/Card Form Full
* @copyright Copyright (c) 2017, Restrict Content Pro
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
*/
?>
<fieldset class="rcp_card_fieldset">
<p id="rcp_card_number_wrap">
<label><?php _e( 'Card Number', 'rcp' ); ?></label>
<input type="text" size="20" maxlength="20" name="rcp_card_number" class="rcp_card_number card-number" />
</p>
<p id="rcp_card_cvc_wrap">
<label><?php _e( 'Card CVC', 'rcp' ); ?></label>
<input type="text" size="4" maxlength="4" name="rcp_card_cvc" class="rcp_card_cvc card-cvc" />
</p>
<p id="rcp_card_address_wrap">
<label><?php _e( 'Address', 'rcp' ); ?></label>
<input type="text" size="20" name="rcp_card_address" class="rcp_card_address card-address" />
</p>
<p id="rcp_card_city_wrap">
<label><?php _e( 'City', 'rcp' ); ?></label>
<input type="text" size="20" name="rcp_card_city" class="rcp_card_city card-city" />
</p>
<p id="rcp_card_state_wrap">
<label><?php _e( 'State or Province', 'rcp' ); ?></label>
<input type="text" size="20" name="rcp_card_state" class="rcp_card_state card-state" />
</p>
<p id="rcp_card_country_wrap">
<label><?php _e( 'Country', 'rcp' ); ?></label>
<select name="rcp_card_country" class="rcp_card_country card-country">
<option value="">Country</option>
<option value="US">United States</option>
<option value="CA">Canada</option>
<option value="GB">United Kingdom</option>
<option value="AF">Afghanistan</option>
<option value="AX">Åland Islands</option>
<option value="AL">Albania</option>
<option value="DZ">Algeria</option>
<option value="AS">American Samoa</option>
<option value="AD">Andorra</option>
<option value="AO">Angola</option>
<option value="AI">Anguilla</option>
<option value="AQ">Antarctica</option>
<option value="AG">Antigua and Barbuda</option>
<option value="AR">Argentina</option>
<option value="AM">Armenia</option>
<option value="AW">Aruba</option>
<option value="AU">Australia</option>
<option value="AT">Austria</option>
<option value="AZ">Azerbaijan</option>
<option value="BS">Bahamas</option>
<option value="BH">Bahrain</option>
<option value="BD">Bangladesh</option>
<option value="BB">Barbados</option>
<option value="BY">Belarus</option>
<option value="BE">Belgium</option>
<option value="BZ">Belize</option>
<option value="BJ">Benin</option>
<option value="BM">Bermuda</option>
<option value="BT">Bhutan</option>
<option value="BO">Bolivia</option>
<option value="BQ">Bonaire, Saint Eustatius and Saba</option>
<option value="BA">Bosnia and Herzegovina</option>
<option value="BW">Botswana</option>
<option value="BV">Bouvet Island</option>
<option value="BR">Brazil</option>
<option value="IO">British Indian Ocean Territory</option>
<option value="BN">Brunei Darrussalam</option>
<option value="BG">Bulgaria</option>
<option value="BF">Burkina Faso</option>
<option value="BI">Burundi</option>
<option value="KH">Cambodia</option>
<option value="CM">Cameroon</option>
<option value="CV">Cape Verde</option>
<option value="KY">Cayman Islands</option>
<option value="CF">Central African Republic</option>
<option value="TD">Chad</option>
<option value="CL">Chile</option>
<option value="CN">China</option>
<option value="CX">Christmas Island</option>
<option value="CC">Cocos Islands</option>
<option value="CO">Colombia</option>
<option value="KM">Comoros</option>
<option value="CD">Congo, Democratic People's Republic</option>
<option value="CG">Congo, Republic of</option>
<option value="CK">Cook Islands</option>
<option value="CR">Costa Rica</option>
<option value="CI">Cote D&#39;Ivoire</option>
<option value="HR">Croatia/Hrvatska</option>
<option value="CU">Cuba</option>
<option value="CW">CuraÇao</option>
<option value="CY">Cyprus</option>
<option value="CZ">Czechia</option>
<option value="DK">Denmark</option>
<option value="DJ">Djibouti</option>
<option value="DM">Dominica</option>
<option value="DO">Dominican Republic</option>
<option value="TP">East Timor</option>
<option value="EC">Ecuador</option>
<option value="EG">Egypt</option>
<option value="GQ">Equatorial Guinea</option>
<option value="SV">El Salvador</option>
<option value="ER">Eritrea</option>
<option value="EE">Estonia</option>
<option value="ET">Ethiopia</option>
<option value="FK">Falkland Islands</option>
<option value="FO">Faroe Islands</option>
<option value="FJ">Fiji</option>
<option value="FI">Finland</option>
<option value="FR">France</option>
<option value="GF">French Guiana</option>
<option value="PF">French Polynesia</option>
<option value="TF">French Southern Territories</option>
<option value="GA">Gabon</option>
<option value="GM">Gambia</option>
<option value="GE">Georgia</option>
<option value="DE">Germany</option>
<option value="GR">Greece</option>
<option value="GH">Ghana</option>
<option value="GI">Gibraltar</option>
<option value="GL">Greenland</option>
<option value="GD">Grenada</option>
<option value="GP">Guadeloupe</option>
<option value="GU">Guam</option>
<option value="GT">Guatemala</option>
<option value="GG">Guernsey</option>
<option value="GN">Guinea</option>
<option value="GW">Guinea-Bissau</option>
<option value="GY">Guyana</option>
<option value="HT">Haiti</option>
<option value="HM">Heard and McDonald Islands</option>
<option value="VA">Holy See (City Vatican State)</option>
<option value="HN">Honduras</option>
<option value="HK">Hong Kong</option>
<option value="HU">Hungary</option>
<option value="IS">Iceland</option>
<option value="IN">India</option>
<option value="ID">Indonesia</option>
<option value="IR">Iran</option>
<option value="IQ">Iraq</option>
<option value="IE">Ireland</option>
<option value="IM">Isle of Man</option>
<option value="IL">Israel</option>
<option value="IT">Italy</option>
<option value="JM">Jamaica</option>
<option value="JP">Japan</option>
<option value="JE">Jersey</option>
<option value="JO">Jordan</option>
<option value="KZ">Kazakhstan</option>
<option value="KE">Kenya</option>
<option value="KI">Kiribati</option>
<option value="KW">Kuwait</option>
<option value="KG">Kyrgyzstan</option>
<option value="LA">Lao People's Democratic Republic</option>
<option value="LV">Latvia</option>
<option value="LB">Lebanon</option>
<option value="LS">Lesotho</option>
<option value="LR">Liberia</option>
<option value="LY">Libyan Arab Jamahiriya</option>
<option value="LI">Liechtenstein</option>
<option value="LT">Lithuania</option>
<option value="LU">Luxembourg</option>
<option value="MO">Macau</option>
<option value="MK">Macedonia</option>
<option value="MG">Madagascar</option>
<option value="MW">Malawi</option>
<option value="MY">Malaysia</option>
<option value="MV">Maldives</option>
<option value="ML">Mali</option>
<option value="MT">Malta</option>
<option value="MH">Marshall Islands</option>
<option value="MQ">Martinique</option>
<option value="MR">Mauritania</option>
<option value="MU">Mauritius</option>
<option value="YT">Mayotte</option>
<option value="MX">Mexico</option>
<option value="FM">Micronesia</option>
<option value="MD">Moldova, Republic of</option>
<option value="MC">Monaco</option>
<option value="MN">Mongolia</option>
<option value="ME">Montenegro</option>
<option value="MS">Montserrat</option>
<option value="MA">Morocco</option>
<option value="MZ">Mozambique</option>
<option value="MM">Myanmar</option>
<option value="NA">Namibia</option>
<option value="NR">Nauru</option>
<option value="NP">Nepal</option>
<option value="NL">Netherlands</option>
<option value="AN">Netherlands Antilles</option>
<option value="NC">New Caledonia</option>
<option value="NZ">New Zealand</option>
<option value="NI">Nicaragua</option>
<option value="NE">Niger</option>
<option value="NG">Nigeria</option>
<option value="NU">Niue</option>
<option value="NF">Norfolk Island</option>
<option value="KP">North Korea</option>
<option value="MP">Northern Mariana Islands</option>
<option value="NO">Norway</option>
<option value="OM">Oman</option>
<option value="PK">Pakistan</option>
<option value="PW">Palau</option>
<option value="PS">Palestinian Territories</option>
<option value="PA">Panama</option>
<option value="PG">Papua New Guinea</option>
<option value="PY">Paraguay</option>
<option value="PE">Peru</option>
<option value="PH">Philippines</option>
<option value="PN">Pitcairn Island</option>
<option value="PL">Poland</option>
<option value="PT">Portugal</option>
<option value="PR">Puerto Rico</option>
<option value="QA">Qatar</option>
<option value="XK">Republic of Kosovo</option>
<option value="RE">Reunion Island</option>
<option value="RO">Romania</option>
<option value="RU">Russian Federation</option>
<option value="RW">Rwanda</option>
<option value="BL">Saint Barthélemy</option>
<option value="SH">Saint Helena</option>
<option value="KN">Saint Kitts and Nevis</option>
<option value="LC">Saint Lucia</option>
<option value="MF">Saint Martin (French)</option>
<option value="SX">Saint Martin (Dutch)</option>
<option value="PM">Saint Pierre and Miquelon</option>
<option value="VC">Saint Vincent and the Grenadines</option>
<option value="SM">San Marino</option>
<option value="ST">São Tomé and Príncipe</option>
<option value="SA">Saudi Arabia</option>
<option value="SN">Senegal</option>
<option value="RS">Serbia</option>
<option value="SC">Seychelles</option>
<option value="SL">Sierra Leone</option>
<option value="SG">Singapore</option>
<option value="SK">Slovak Republic</option>
<option value="SI">Slovenia</option>
<option value="SB">Solomon Islands</option>
<option value="SO">Somalia</option>
<option value="ZA">South Africa</option>
<option value="GS">South Georgia</option>
<option value="KR">South Korea</option>
<option value="SS">South Sudan</option>
<option value="ES">Spain</option>
<option value="LK">Sri Lanka</option>
<option value="SD">Sudan</option>
<option value="SR">Suriname</option>
<option value="SJ">Svalbard and Jan Mayen Islands</option>
<option value="SZ">Swaziland</option>
<option value="SE">Sweden</option>
<option value="CH">Switzerland</option>
<option value="SY">Syrian Arab Republic</option>
<option value="TW">Taiwan</option>
<option value="TJ">Tajikistan</option>
<option value="TZ">Tanzania</option>
<option value="TH">Thailand</option>
<option value="TL">Timor-Leste</option>
<option value="TG">Togo</option>
<option value="TK">Tokelau</option>
<option value="TO">Tonga</option>
<option value="TT">Trinidad and Tobago</option>
<option value="TN">Tunisia</option>
<option value="TR">Turkey</option>
<option value="TM">Turkmenistan</option>
<option value="TC">Turks and Caicos Islands</option>
<option value="TV">Tuvalu</option>
<option value="UG">Uganda</option>
<option value="UA">Ukraine</option>
<option value="AE">United Arab Emirates</option>
<option value="UY">Uruguay</option>
<option value="UM">US Minor Outlying Islands</option>
<option value="UZ">Uzbekistan</option>
<option value="VU">Vanuatu</option>
<option value="VE">Venezuela</option>
<option value="VN">Vietnam</option>
<option value="VG">Virgin Islands (British)</option>
<option value="VI">Virgin Islands (USA)</option>
<option value="WF">Wallis and Futuna Islands</option>
<option value="EH">Western Sahara</option>
<option value="WS">Western Samoa</option>
<option value="YE">Yemen</option>
<option value="ZM">Zambia</option>
<option value="ZW">Zimbabwe</option>
</select>
</p>
<p id="rcp_card_zip_wrap">
<label><?php _e( 'Card ZIP or Postal Code', 'rcp' ); ?></label>
<input type="text" size="10" name="rcp_card_zip" class="rcp_card_zip card-zip" />
</p>
<p id="rcp_card_name_wrap">
<label><?php _e( 'Name on Card', 'rcp' ); ?></label>
<input type="text" size="20" name="rcp_card_name" class="rcp_card_name card-name" />
</p>
<p id="rcp_card_exp_wrap">
<label><?php _e( 'Expiration (MM/YYYY)', 'rcp' ); ?></label>
<select name="rcp_card_exp_month" class="rcp_card_exp_month card-expiry-month">
<?php for( $i = 1; $i <= 12; $i++ ) : ?>
<option value="<?php echo $i; ?>"><?php echo $i . ' - ' . rcp_get_month_name( $i ); ?></option>
<?php endfor; ?>
</select>
<span class="rcp_expiry_separator"> / </span>
<select name="rcp_card_exp_year" class="rcp_card_exp_year card-expiry-year">
<?php
$year = date( 'Y' );
for( $i = $year; $i <= $year + 10; $i++ ) : ?>
<option value="<?php echo $i; ?>"><?php echo $i; ?></option>
<?php endfor; ?>
</select>
</p>
</fieldset>

View File

@@ -0,0 +1,50 @@
<?php
/**
* Card Form
*
* This template is for displaying credit card form details. It's shown on the registration
* form when selecting a gateway that supports taking credit/debit card details directly.
*
* For modifying this template, please see: http://docs.restrictcontentpro.com/article/1738-template-files
*
* @package Restrict Content Pro
* @subpackage Templates/Card Form
* @copyright Copyright (c) 2017, Restrict Content Pro
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
*/
?>
<fieldset class="rcp_card_fieldset">
<p id="rcp_card_number_wrap">
<label><?php _e( 'Card Number', 'rcp' ); ?></label>
<input type="text" size="20" maxlength="20" name="rcp_card_number" class="rcp_card_number card-number" />
</p>
<p id="rcp_card_cvc_wrap">
<label><?php _e( 'Card CVC', 'rcp' ); ?></label>
<input type="text" size="4" maxlength="4" name="rcp_card_cvc" class="rcp_card_cvc card-cvc" />
</p>
<p id="rcp_card_zip_wrap">
<label><?php _e( 'Card ZIP or Postal Code', 'rcp' ); ?></label>
<input type="text" size="10" name="rcp_card_zip" class="rcp_card_zip card-zip" />
</p>
<p id="rcp_card_name_wrap">
<label><?php _e( 'Name on Card', 'rcp' ); ?></label>
<input type="text" size="20" name="rcp_card_name" class="rcp_card_name card-name" />
</p>
<p id="rcp_card_exp_wrap">
<label><?php _e( 'Expiration (MM/YYYY)', 'rcp' ); ?></label>
<select name="rcp_card_exp_month" class="rcp_card_exp_month card-expiry-month">
<?php for( $i = 1; $i <= 12; $i++ ) : ?>
<option value="<?php echo $i; ?>"><?php echo $i . ' - ' . rcp_get_month_name( $i ); ?></option>
<?php endfor; ?>
</select>
<span class="rcp_expiry_separator"> / </span>
<select name="rcp_card_exp_year" class="rcp_card_exp_year card-expiry-year">
<?php
$year = date( 'Y' );
for( $i = $year; $i <= $year + 10; $i++ ) : ?>
<option value="<?php echo $i; ?>"><?php echo $i; ?></option>
<?php endfor; ?>
</select>
</p>
</fieldset>

View File

@@ -0,0 +1,57 @@
<?php
/**
* Card Update Form Fields
*
* This form is displayed with the [rcp_update_card] shortcode.
* @link http://docs.restrictcontentpro.com/article/1608-rcpupdatecard
*
* The shortcode loads the `card-update-form.php` template, which then loads this template
* for individual fields. Note that some gateways may not use these fields and may load
* their own.
* @see RCP_Payment_Gateway::update_card_fields()
*
* For modifying this template, please see: http://docs.restrictcontentpro.com/article/1738-template-files
*
* @package Restrict Content Pro
* @subpackage Templates/Card Update Form
* @copyright Copyright (c) 2019, Restrict Content Pro
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
*/
?>
<fieldset id="rcp-card-name-wrapper" class="rcp_card_fieldset">
<p id="rcp_card_name_wrap">
<label for="rcp-update-card-name"><?php _e( 'Name on Card', 'rcp' ); ?></label>
<input type="text" size="20" id="rcp-update-card-name" name="rcp_card_name" class="rcp_card_name card-name" />
</p>
</fieldset>
<fieldset id="rcp-card-wrapper" class="rcp_card_fieldset">
<p id="rcp_card_number_wrap">
<label for="rcp-update-card-number"><?php _e( 'Card Number', 'rcp' ); ?></label>
<input type="text" size="20" maxlength="20" id="rcp-update-card-number" name="rcp_card_number" class="rcp_card_number card-number" />
</p>
<p id="rcp_card_cvc_wrap">
<label for="rcp-update-card-cvc"><?php _e( 'Card CVC', 'rcp' ); ?></label>
<input type="text" size="4" maxlength="4" id="rcp-update-card-cvc" name="rcp_card_cvc" class="rcp_card_cvc card-cvc" />
</p>
<p id="rcp_card_zip_wrap">
<label for="rcp-update-card-zip"><?php _e( 'Card ZIP or Postal Code', 'rcp' ); ?></label>
<input type="text" size="10" id="rcp-update-card-zip" name="rcp_card_zip" class="rcp_card_zip card-zip" />
</p>
<p id="rcp_card_exp_wrap">
<label for="rcp-update-card-expiration-month"><?php _e( 'Expiration (MM/YYYY)', 'rcp' ); ?></label>
<select name="rcp_card_exp_month" id="rcp-update-card-expiration-month" class="rcp_card_exp_month card-expiry-month">
<?php for( $i = 1; $i <= 12; $i++ ) : ?>
<option value="<?php echo $i; ?>"><?php echo $i . ' - ' . rcp_get_month_name( $i ); ?></option>
<?php endfor; ?>
</select>
<span class="rcp_expiry_separator"> / </span>
<select name="rcp_card_exp_year" id="rcp-update-card-expiration-year" class="rcp_card_exp_year card-expiry-year">
<?php
$year = date( 'Y' );
for( $i = $year; $i <= $year + 10; $i++ ) : ?>
<option value="<?php echo $i; ?>"><?php echo $i; ?></option>
<?php endfor; ?>
</select>
</p>
</fieldset>

View File

@@ -0,0 +1,114 @@
<?php
/**
* Card Update Form
*
* This form is displayed with the [rcp_update_card] shortcode.
* @link http://docs.restrictcontentpro.com/article/1608-rcpupdatecard
*
* For modifying this template, please see: http://docs.restrictcontentpro.com/article/1738-template-files
*
* @package Restrict Content Pro
* @subpackage Templates/Card Update Form
* @copyright Copyright (c) 2017, Restrict Content Pro
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
*/
/**
* @var RCP_Membership $rcp_membership
*/
global $rcp_membership;
$customer = $rcp_membership->get_customer();
$gateway = rcp_get_gateway_class( $rcp_membership->get_gateway() );
/*
* If the customer has more than one membership, display a navigation menu that:
*
* 1) Clarifies which membership they're currently updating the details for.
* 2) Allows the customer to quickly switch to a different membership.
*/
if ( $customer instanceof RCP_Customer && count( $customer->get_memberships() ) > 1 ) {
$membership_list = array();
$current_page = remove_query_arg( 'membership_id' );
foreach ( $customer->get_memberships() as $membership ) {
if ( $membership->get_id() === $rcp_membership->get_id() ) {
$membership_list[] = $membership->get_membership_level_name();
continue;
}
$update_card_url = add_query_arg( 'membership_id', urlencode( $membership->get_id() ), $current_page );
$membership_list[] = '<a href="' . esc_url( $update_card_url ) . '">' . $membership->get_membership_level_name() . '</a>';
}
?>
<p class="rcp-update-payment-method-membership-menu">
<?php echo implode( ' | ', $membership_list ); ?>
</p>
<?php
}
?>
<form id="rcp_update_card_form" class="rcp_form" action="" method="POST">
<?php $cards = $rcp_membership->get_card_details(); ?>
<?php if( ! empty( $cards ) ) : ?>
<h3><?php _e( 'Your Cards', 'rcp' ); ?></h3>
<ul class="rcp-gateway-saved-payment-methods">
<?php foreach( $cards as $card ) : ?>
<li>
<label for="<?php echo ! empty( $card['id'] ) ? esc_attr( $card['id'] ) : ''; ?>">
<input type="radio" id="<?php echo ! empty( $card['id'] ) ? esc_attr( $card['id'] ) : ''; ?>" name="rcp_gateway_existing_payment_method" value="<?php echo ! empty( $card['id'] ) ? esc_attr( $card['id'] ) : ''; ?>" <?php checked( ! empty( $card['current'] ) ); ?> />
<span class="rcp-gateway-saved-card-brand"><?php echo esc_html( ucfirst( $card['type'] ) ); ?></span>
<span class="rcp-gateway-saved-card-ending-label"><?php _e( 'ending in', 'rcp' ); ?></span>
<span class="rcp-gateway-saved-card-last-4"><?php echo esc_html( $card['last4'] ); ?></span>
<span class="rcp-gateway-saved-payment-method-sep">&mdash; </span>
<span class="rcp-gateway-saved-card-expires-label"><?php _e( 'expires', 'rcp' ); ?></span>
<span class="rcp-gateway-saved-card-expiration"><?php printf( '%s / %s', esc_html( $card['exp_month'] ), esc_html( $card['exp_year'] ) ); ?></span>
<?php if ( ! empty( $card['current'] ) ) : ?>
<span class="rcp-gateway-saved-payment-method-sep">&mdash; </span>
<span class="rcp-gateway-saved-card-current"><?php _e( 'current', 'rcp' ); ?></span>
<?php endif; ?>
<?php
/**
* Add extra information / actions for an individual card.
*
* @param array $card Array of card details.
* @param RCP_Membership $rcp_membership Current membership object.
*
* @since 3.3
*/
do_action( 'rcp_update_billing_card_list_item', $card, $rcp_membership );
?>
</label>
</li>
<?php endforeach; ?>
<?php else : ?>
<ul class="rcp-gateway-saved-payment-methods" style="display:none;">
<?php endif; ?>
<li class="rcp-gateway-add-payment-method-wrap">
<label for="rcp-gateway-add-payment-method">
<input type="radio" id="rcp-gateway-add-payment-method" name="rcp_gateway_existing_payment_method" value="new" <?php checked( empty( $cards ) ); ?> />
<?php _e( 'Add New Card', 'rcp' ); ?>
</label>
</li>
</ul>
<?php
/**
* Load update billing card fields via the payment gateway class
*
* @see RCP_Payment_Gateway::update_card_fields()
*/
if ( ! empty( $gateway ) ) {
$gateway->update_card_fields();
}
?>
<p id="rcp_submit_wrap">
<input type="hidden" name="rcp_membership_id" value="<?php echo esc_attr( $rcp_membership->get_id() ); ?>"/>
<input type="hidden" name="rcp_update_card_nonce" value="<?php echo wp_create_nonce( 'rcp-update-card-nonce' ); ?>"/>
<input type="submit" name="rcp_submit_card_update" id="rcp_submit" class="rcp-button" value="<?php esc_attr_e( 'Update Payment Method', 'rcp' ); ?>"/>
</p>
</form>

View File

@@ -0,0 +1,49 @@
<?php
/**
* Change Password Form
*
* This form is for changing an account password.
*
* For modifying this template, please see: http://docs.restrictcontentpro.com/article/1738-template-files
*
* @package Restrict Content Pro
* @subpackage Templates/Change Password Form
* @copyright Copyright (c) 2017, Restrict Content Pro
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
*/
global $rcp_password_form_args; ?>
<?php
rcp_show_error_messages( 'password' );
// Bail if the reset link is invalid. This prevents the change password fields from showing.
$errors = rcp_errors();
if ( rcp_errors()->get_error_data( 'invalid_key' ) === 'password' ) {
return;
}
?>
<?php if( isset( $_GET['password-reset']) && $_GET['password-reset'] == 'true') { ?>
<div class="rcp_message success">
<span><?php _e( 'Password changed successfully', 'rcp' ); ?></span>
</div>
<?php } ?>
<form id="rcp_password_form" class="rcp_form" method="POST" action="<?php echo esc_url( rcp_get_current_url() ); ?>">
<fieldset class="rcp_change_password_fieldset">
<p>
<label for="rcp_user_pass"><?php echo apply_filters( 'rcp_registration_new_password_label', __( 'New Password', 'rcp' ) ); ?></label>
<input name="rcp_user_pass" id="rcp_user_pass" class="required" type="password"/>
</p>
<p>
<label for="rcp_user_pass_confirm"><?php echo apply_filters( 'rcp_registration_confirm_password_label', __( 'Password Confirm', 'rcp' ) ); ?></label>
<input name="rcp_user_pass_confirm" id="rcp_user_pass_confirm" class="required" type="password"/>
</p>
<p>
<input type="hidden" name="rcp_action" value="reset-password"/>
<input type="hidden" name="rcp_redirect" value="<?php echo esc_url( $rcp_password_form_args['redirect'] ); ?>"/>
<input type="hidden" name="rcp_password_nonce" value="<?php echo wp_create_nonce('rcp-password-nonce' ); ?>"/>
<input id="rcp_password_submit" class="rcp-button" type="submit" value="<?php esc_attr_e( apply_filters( 'rcp_registration_change_password_button', __( 'Change Password', 'rcp' ) ) ); ?>"/>
</p>
</fieldset>
</form>

View File

@@ -0,0 +1,18 @@
<?php
/**
* Comments - No Access
*
* This template is loaded into the comment area on a restricted post.
* By loading a blank template, we ensure that unauthorized users are not able
* to read comments on restricted posts.
*
* For modifying this template, please see: http://docs.restrictcontentpro.com/article/1738-template-files
*
* @package Restrict Content Pro
* @subpackage Templates/Comments No Access
* @copyright Copyright (c) 2017, Restrict Content Pro
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
*/
// Intentionally blank
do_action( 'rcp_comments_no_access' );

View File

@@ -0,0 +1,23 @@
<?php
/**
* Email Body for the Default Template
*
* Use {email} as a placeholder for the content entered in Restrict > Settings > Emails.
*
* For modifying this template, please see: http://docs.restrictcontentpro.com/article/1738-template-files
*
* @package Restrict Content Pro
* @subpackage Templates/Emails/Body
* @copyright Copyright (c) 2017, Restrict Content Pro
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 2.7
*/
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) exit;
// {email} is replaced by the content entered in Restrict > Settings > Emails
?>
{email}

View File

@@ -0,0 +1,70 @@
<?php
/**
* Email Footer for the Default Template
*
* For modifying this template, please see: http://docs.restrictcontentpro.com/article/1738-template-files
*
* @package Restrict Content Pro
* @subpackage Templates/Emails/Footer
* @copyright Copyright (c) 2017, Restrict Content Pro
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 2.7
*/
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) exit;
// For gmail compatibility, including CSS styles in head/body are stripped out therefore styles need to be inline. These variables contain rules which are added to the template inline.
$template_footer = "
border-top:0;
-webkit-border-radius:3px;
";
$credit = "
border:0;
color: #000000;
font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;
font-size:12px;
line-height:125%;
text-align:center;
";
?>
</div>
</td>
</tr>
</table>
<!-- End Content -->
</td>
</tr>
</table>
<!-- End Body -->
</td>
</tr>
<tr>
<td align="center" valign="top">
<!-- Footer -->
<table border="0" cellpadding="10" cellspacing="0" width="600" id="template_footer" style="<?php echo $template_footer; ?>">
<tr>
<td valign="top">
<table border="0" cellpadding="10" cellspacing="0" width="100%">
<tr>
<td colspan="2" valign="middle" id="credit" style="<?php echo $credit; ?>">
<?php echo wpautop( wp_kses_post( wptexturize( apply_filters( 'rcp_email_footer_text', '<a href="' . esc_url( home_url() ) . '">' . get_bloginfo( 'name' ) . '</a>' ) ) ) ); ?>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- End Footer -->
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</body>
</html>

View File

@@ -0,0 +1,115 @@
<?php
/**
* Email Header for the Default Template
*
* For modifying this template, please see: http://docs.restrictcontentpro.com/article/1738-template-files
*
* @package Restrict Content Pro
* @subpackage Templates/Emails/Header
* @copyright Copyright (c) 2017, Restrict Content Pro
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 2.7
*/
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) exit;
global $rcp_options;
// For gmail compatibility, including CSS styles in head/body are stripped out therefore styles need to be inline. These variables contain rules which are added to the template inline. !important; is a gmail hack to prevent styles being stripped if it doesn't like something.
$body = "
background-color: #f6f6f6;
font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;
";
$wrapper = "
width:100%;
-webkit-text-size-adjust:none !important;
margin:0;
padding: 70px 0 70px 0;
";
$template_container = "
box-shadow:0 0 0 1px #f3f3f3 !important;
border-radius:3px !important;
background-color: #ffffff;
border: 1px solid #e9e9e9;
border-radius:3px !important;
padding: 20px;
";
$template_header = "
color: #00000;
border-top-left-radius:3px !important;
border-top-right-radius:3px !important;
border-bottom: 0;
font-weight:bold;
line-height:100%;
text-align: center;
vertical-align:middle;
";
$body_content = "
border-radius:3px !important;
font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;
";
$body_content_inner = "
color: #000000;
font-size:14px;
font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;
line-height:150%;
text-align:left;
";
$header_content_h1 = "
color: #000000;
margin:0;
padding: 28px 24px;
display:block;
font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;
font-size:32px;
font-weight: 500;
line-height: 1.2;
";
$header_img = isset( $rcp_options['email_header_img'] ) ? trim( $rcp_options['email_header_img'] ) : '';
$header_text = isset( $rcp_options['email_header_text'] ) ? trim( $rcp_options['email_header_text'] ) : '';
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><?php echo get_bloginfo( 'name' ); ?></title>
</head>
<body leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" offset="0" style="<?php echo $body; ?>">
<div style="<?php echo $wrapper; ?>">
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
<tr>
<td align="center" valign="top">
<?php if( ! empty( $header_img ) ) : ?>
<div id="template_header_image">
<?php echo '<p style="margin-top:0;"><img src="' . esc_url( $header_img ) . '" alt="' . get_bloginfo( 'name' ) . '" /></p>'; ?>
</div>
<?php endif; ?>
<table border="0" cellpadding="0" cellspacing="0" width="520" id="template_container" style="<?php echo $template_container; ?>">
<?php if( ! empty( $header_text ) ) : ?>
<tr>
<td align="center" valign="top">
<!-- Header -->
<table border="0" cellpadding="0" cellspacing="0" width="520" id="template_header" style="<?php echo $template_header; ?>" bgcolor="#ffffff">
<tr>
<td>
<h1 style="<?php echo $header_content_h1; ?>"><?php echo $header_text; ?></h1>
</td>
</tr>
</table>
<!-- End Header -->
</td>
</tr>
<?php endif; ?>
<tr>
<td align="center" valign="top">
<!-- Body -->
<table border="0" cellpadding="0" cellspacing="0" width="520" id="template_body">
<tr>
<td valign="top" style="<?php echo $body_content; ?>">
<!-- Content -->
<table border="0" cellpadding="20" cellspacing="0" width="100%">
<tr>
<td valign="top">
<div style="<?php echo $body_content_inner; ?>">

View File

@@ -0,0 +1 @@
<?php // Silence is golden.

View File

@@ -0,0 +1 @@
<?php // Silence is golden.

View File

@@ -0,0 +1,419 @@
<?php
/**
* Invoice
*
* Template for displaying invoice details.
*
* For modifying this template, please see: http://docs.restrictcontentpro.com/article/1738-template-files
*
* @package Restrict Content Pro
* @subpackage Templates/Invoice
* @copyright Copyright (c) 2017, Restrict Content Pro
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
*/
global $rcp_options, $rcp_payment, $rcp_member; ?>
<!DOCTYPE html>
<html lang="en-US" prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#">
<head>
<!-- Metadata -->
<meta charset="UTF-8">
<meta name="HandheldFriendly" content="true" />
<!-- Title -->
<title><?php printf( __( 'Invoice %s', 'rcp' ), $rcp_payment->id ); ?></title>
<!-- CSS -->
<style>
* {
box-sizing: border-box;
moz-box-sizing: border-box;
webkit-box-sizing: border-box;
}
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td {
background: transparent;
border: 0;
font-size: 100%;
margin: 0;
outline: 0;
padding: 0;
vertical-align: baseline;
}
body {
line-height: 1;
}
ol,ul {
list-style: none;
}
blockquote,q {
quotes: none;
}
blockquote:before,blockquote:after,q:before,q:after {
content: none;
}
:focus {
outline: 0;
}
ins {
text-decoration: none;
}
del {
text-decoration: line-through;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
header,footer,aside,nav,article {
display: block;
}
html,body {
webkit-font-smoothing: antialiased;
}
body {
color: #555;
font: 0.75em/160% Arial,sans-serif;
margin: 0 auto;
overflow-x: none;
webkit-text-size-adjust: 100%;
width: 595px;
}
#main {
clear: both;
float: left;
width: 100%;
}
.alignleft {
float: left;
width: 50%;
}
.alignright {
float: right;
width: 50%;
}
section {
clear: both;
float: left;
width: 100%;
}
section header {
background: #efebeb;
border-bottom: 1px solid #ddd;
border-top: 1px solid #ddd;
color: #555;
float: left;
font-size: 14px;
height: 38px;
line-height: 38px;
padding: 0 20px 0 20px;
text-transform: uppercase;
width: 100%;
}
section header .right {
float: right;
}
section article {
clear: both;
float: left;
width: 100%;
}
thead {
background: #efebeb;
border-bottom: 1px solid #ddd;
border-top: 1px solid #ddd;
font-size: 14px;
line-height: 38px;
text-transform: uppercase;
}
thead tr th {
padding: 0 20px 0 20px;
text-align: left;
}
p {
font-size: 14px;
font-weight: 400;
line-height: 20px;
moz-word-wrap: break-word;
ms-word-wrap: break-word;
word-wrap: break-word;
}
header#header {
float: left;
margin: 30px 0;
width: 100%;
}
header#header .alignleft img {
float: left;
}
header#header .alignright h1 {
color: #555;
font-size: 18px;
font-weight: 400;
line-height: 1;
text-align: right;
}
section#contacts article {
float: left;
padding: 20px;
width: 100%;
}
section#contacts .alignright {
border-left: 1px solid #ddd;
}
section#items table {
clear: both;
float: left;
width: 100%;
}
section#items table tbody tr td {
border-bottom: 1px solid #ddd;
font-size: 14px;
line-height: 60px;
}
section#items table tbody tr td.name {
padding: 0 20px;
}
section#items table tbody tr td.price {
padding: 0 20px;
text-align: right;
width: 70px;
}
section#items table tfoot tr td {
font-size: 14px;
line-height: 35px;
}
section#items table tfoot tr td.name {
text-align: right;
}
section#items table tfoot tr td.price {
padding: 0 20px;
text-align: right;
}
section#additional-info header {
border: none;
margin: 0 0 30px 0;
width: 170px;
}
section#additional-info .alignright {
margin: 60px 0 0 0;
text-align: right;
}
img {
max-width: 100%;
}
@media print {
.print {
display: none;
}
}
<?php
/**
* RTL styles
*/
if ( is_rtl() ) {
?>
body.rcp-is-rtl {
direction: rtl;
unicode-bidi: embed;
}
.rcp-is-rtl #main,
.rcp-is-rtl .alignleft,
.rcp-is-rtl section,
.rcp-is-rtl section header,
.rcp-is-rtl section article,
.rcp-is-rtl header#header,
.rcp-is-rtl header#header .alignleft img,
.rcp-is-rtl section#contacts article,
.rcp-is-rtl section#items table {
float: right;
}
.rcp-is-rtl .alignright,
section header .right {
float: left;
}
.rcp-is-rtl thead tr th {
text-align: right;
}
.rcp-is-rtl header#header .alignright h1,
.rcp-is-rtl section#items table tbody tr td.price,
.rcp-is-rtl section#items table tfoot tr td.name,
.rcp-is-rtl section#items table tfoot tr td.price,
.rcp-is-rtl section#additional-info .alignright {
text-align: left;
}
<?php
}
?>
</style>
</head>
<body<?php echo is_rtl() ? ' class="rcp-is-rtl"' : ''; ?>>
<div id="main">
<header id="header">
<!-- Logo -->
<div class="logo">
<?php if ( ! empty( $rcp_options['invoice_logo'] ) ) : ?>
<img src="<?php echo esc_attr( $rcp_options['invoice_logo'] ); ?>" />
<?php endif; ?>
</div>
<!-- Invoice Details -->
<div class="alignright">
<h1><?php printf( __( 'Invoice %s', 'rcp' ), $rcp_payment->id ); ?></h1>
</div>
<?php if( ! empty( $rcp_options['invoice_header'] ) ) : ?>
<p><?php echo $rcp_options['invoice_header']; ?></p>
<?php endif; ?>
</header>
<section id="contacts">
<div class="alignleft">
<header><?php printf( __( 'Invoice %s', 'rcp' ), $rcp_payment->id ); ?></header>
<article>
<?php if ( ! empty( $rcp_options['invoice_company'] ) ) : ?>
<p><strong><?php echo $rcp_options['invoice_company']; ?></strong></p>
<?php endif; ?>
<?php if ( ! empty( $rcp_options['invoice_name'] ) ) : ?>
<p><strong><?php echo $rcp_options['invoice_name']; ?></strong></p>
<?php endif; ?>
<?php if ( ! empty( $rcp_options['invoice_address'] ) ) : ?>
<p><strong><?php echo $rcp_options['invoice_address']; ?></strong></p>
<?php endif; ?>
<?php if ( ! empty( $rcp_options['invoice_address_2'] ) ) : ?>
<p><strong><?php echo $rcp_options['invoice_address_2']; ?></strong></p>
<?php endif; ?>
<?php if ( ! empty( $rcp_options['invoice_city_state_zip'] ) ) : ?>
<p><strong><?php echo $rcp_options['invoice_city_state_zip']; ?></strong></p>
<?php endif; ?>
<?php if ( ! empty( $rcp_options['invoice_email'] ) ) : ?>
<p><strong><?php echo $rcp_options['invoice_email']; ?></strong></p>
<?php endif; ?>
</article>
</div>
<div class="alignright">
<header><?php _e( 'Bill To:', 'rcp' ); ?></header>
<article>
<p><strong><?php echo $rcp_member->first_name . ' ' . $rcp_member->last_name; ?></strong></p>
<p><strong><?php echo $rcp_member->user_email; ?></strong></p>
<?php
/**
* Insert content after the member's name and email.
*
* @param object $rcp_payment Payment object from the database.
* @param RCP_Member $rcp_member Member object.
*/
do_action( 'rcp_invoice_bill_to', $rcp_payment, $rcp_member );
?>
</article>
</div>
</section>
<!-- Items -->
<section id="items">
<table>
<thead>
<tr>
<th><?php _e( 'Description', 'rcp' ); ?></th>
<th><?php _e( 'Amount', 'rcp' ); ?></th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><?php echo $rcp_payment->subscription; ?></td>
<td class="price"><?php echo rcp_currency_filter( $rcp_payment->subtotal ); ?></td>
</tr>
<?php do_action( 'rcp_invoice_items', $rcp_payment ); ?>
</tbody>
<tfoot>
<?php do_action( 'rcp_invoice_items_before_total_price', $rcp_payment ); ?>
<!-- Fees -->
<?php if ( $rcp_payment->fees != 0 ) : ?>
<tr>
<td class="name"><?php _e( 'Fees:', 'rcp' ); ?></td>
<td class="price"><?php echo rcp_currency_filter( $rcp_payment->fees ); ?></td>
</tr>
<?php endif; ?>
<!-- Subtotal -->
<tr>
<td class="name"><?php _e( 'Subtotal:', 'rcp' ); ?></td>
<td class="price"><?php echo rcp_currency_filter( $rcp_payment->subtotal + $rcp_payment->fees ); ?></td>
</tr>
<!-- Credits -->
<?php if ( $rcp_payment->credits != 0 ) : ?>
<tr>
<td class="name"><?php _e( 'Credits:', 'rcp' ); ?></td>
<td class="price"><?php echo rcp_currency_filter( -1 * abs( $rcp_payment->credits ) ); ?></td>
</tr>
<?php endif; ?>
<!-- Discount -->
<?php if ( $rcp_payment->discount_amount != 0 ) : ?>
<tr>
<td class="name"><?php _e( 'Discount:', 'rcp' ); ?></td>
<td class="price"><?php echo rcp_currency_filter( -1 * abs( $rcp_payment->discount_amount ) ); ?></td>
</tr>
<?php endif; ?>
<!-- Total -->
<tr>
<td class="name"><strong><?php _e( 'Total Price:', 'rcp' ); ?></strong></td>
<td class="price"><strong><?php echo rcp_currency_filter( $rcp_payment->amount ); ?></strong></td>
</tr>
<!-- Paid -->
<tr>
<td class="name"><?php _e( 'Payment Status:', 'rcp' ); ?></td>
<td class="price"><?php echo rcp_get_payment_status_label( $rcp_payment ); ?></td>
</tr>
</tfoot>
</table>
</section>
<!-- Additional Info -->
<section id="additional-info">
<div class="alignleft">
<header><?php _e( 'Additional Info:', 'rcp' ); ?></header>
<?php if ( in_array( $rcp_payment->status, array( 'complete', 'refunded' ) ) ) : ?>
<article>
<p><?php echo __( 'Payment Date:', 'rcp' ) . ' ' . date_i18n( get_option( 'date_format' ), strtotime( $rcp_payment->date, current_time( 'timestamp' ) ) ); ?></p>
</article>
<?php endif; ?>
<?php if( ! empty( $rcp_options['invoice_notes'] ) ) : ?>
<article>
<?php echo wpautop( wp_kses_post( $rcp_options['invoice_notes'] ) ); ?>
</article>
<?php endif; ?>
<?php do_action( 'rcp_invoice_additional_info', $rcp_payment ); ?>
</div>
</section>
<?php do_action( 'rcp_invoice_after_additional_info', $rcp_payment ); ?>
<footer id="footer">
<?php if( ! empty( $rcp_options['invoice_footer'] ) ) : ?>
<p><?php echo $rcp_options['invoice_footer']; ?></p>
<?php endif; ?>
<p class="print alignright"><a href="#" onclick="window.print()"><?php _e( 'Print', 'rcp' ); ?></a></p>
</footer>
</div>
</body>
</html>

View File

@@ -0,0 +1,64 @@
<?php
/**
* Login Form
*
* Template for displaying the login form. This is used in the [login_form] shortcode.
* @link http://docs.restrictcontentpro.com/article/1598-loginform
*
* For modifying this template, please see: http://docs.restrictcontentpro.com/article/1738-template-files
*
* @package Restrict Content Pro
* @subpackage Templates/Login
* @copyright Copyright (c) 2017, Restrict Content Pro
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
*/
global $rcp_login_form_args; ?>
<?php if ( isset( $_GET['password-reset'] ) && 'true' == $_GET['password-reset'] ) { ?>
<p class="rcp_success">
<span><?php _e( 'Your password has been successfully reset.', 'rcp' ); if ( ! is_user_logged_in() ) _e( ' You may now log in.', 'rcp' ); ?></span>
</p>
<?php } ?>
<?php if ( ! is_user_logged_in() ) : ?>
<?php rcp_show_error_messages( 'login' ); ?>
<form id="rcp_login_form" class="<?php echo esc_attr( $rcp_login_form_args['class'] ); ?>" method="POST" action="<?php echo esc_url( rcp_get_current_url() ); ?>">
<?php do_action( 'rcp_before_login_form_fields' ); ?>
<fieldset class="rcp_login_data">
<p>
<label for="rcp_user_login"><?php _e( 'Username or Email', 'rcp' ); ?></label>
<input name="rcp_user_login" id="rcp_user_login" class="required" type="text"/>
</p>
<p>
<label for="rcp_user_pass"><?php _e( 'Password', 'rcp' ); ?></label>
<input name="rcp_user_pass" id="rcp_user_pass" class="required" type="password"/>
</p>
<?php do_action( 'rcp_login_form_fields_before_submit' ); ?>
<p>
<input type="checkbox" name="rcp_user_remember" id="rcp_user_remember" value="1"/>
<label for="rcp_user_remember"><?php _e( 'Remember me', 'rcp' ); ?></label>
</p>
<p class="rcp_lost_password"><a href="<?php echo esc_url( add_query_arg( 'rcp_action', 'lostpassword') ); ?>"><?php _e( 'Lost your password?', 'rcp' ); ?></a></p>
<p>
<input type="hidden" name="rcp_action" value="login"/>
<?php if ( ! empty( $_GET['rcp_redirect'] ) ) : ?>
<input type="hidden" name="rcp_redirect" value="<?php echo esc_url( $_GET['rcp_redirect'] ); ?>"/>
<?php else : ?>
<input type="hidden" name="rcp_redirect" value="<?php echo esc_url( $rcp_login_form_args['redirect'] ); ?>"/>
<?php endif; ?>
<input type="hidden" name="rcp_login_nonce" value="<?php echo wp_create_nonce( 'rcp-login-nonce' ); ?>"/>
<input id="rcp_login_submit" class="rcp-button" type="submit" value="<?php esc_attr_e( 'Login', 'rcp' ); ?>"/>
</p>
<?php do_action( 'rcp_login_form_fields_after_submit' ); ?>
</fieldset>
<?php do_action( 'rcp_after_login_form_fields' ); ?>
</form>
<?php else : ?>
<div class="rcp_logged_in"><a href="<?php echo wp_logout_url( home_url() ); ?>"><?php _e( 'Log out', 'rcp' ); ?></a></div>
<?php endif; ?>

View File

@@ -0,0 +1,44 @@
<?php
/**
* Lost Password Form
*
* Template for displaying the lost password form. This is used in the [login_form] shortcode
* when a user clicks the "lost your password" link.
*
* For modifying this template, please see: http://docs.restrictcontentpro.com/article/1738-template-files
*
* @package Restrict Content Pro
* @subpackage Templates/Lost Password
* @copyright Copyright (c) 2017, Restrict Content Pro
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
*/
if( ! is_user_logged_in() ) : ?>
<?php rcp_show_error_messages( 'lostpassword' ); ?>
<form id="rcp_lostpassword_form" class="rcp_form" method="POST" action="<?php echo esc_url( add_query_arg( 'rcp_action', 'lostpassword') ); ?>">
<?php do_action( 'rcp_before_lostpassword_form_fields' ); ?>
<fieldset class="rcp_lostpassword_data">
<p>
<label for="rcp_user_login"><?php _e( 'Username or E-mail:', 'rcp' ); ?></label>
<input name="rcp_user_login" id="rcp_user_login" class="required" type="text"/>
</p>
<?php do_action( 'rcp_lostpassword_form_fields_before_submit' ); ?>
<p>
<input type="hidden" name="rcp_action" value="lostpassword"/>
<input type="hidden" name="rcp_redirect" value="<?php echo esc_url( rcp_get_current_url() ); ?>"/>
<input type="hidden" name="rcp_lostpassword_nonce" value="<?php echo wp_create_nonce( 'rcp-lostpassword-nonce' ); ?>"/>
<input id="rcp_lostpassword_submit" class="rcp-button" type="submit" value="<?php esc_attr_e( 'Request Password Reset', 'rcp' ); ?>"/>
</p>
<?php do_action( 'rcp_lostpassword_form_fields_after_submit' ); ?>
</fieldset>
<?php do_action( 'rcp_after_lostpassword_form_fields' ); ?>
</form>
<?php else : ?>
<div class="rcp_logged_in"><a href="<?php echo wp_logout_url( home_url() ); ?>"><?php _e( 'Log out', 'rcp' ); ?></a></div>
<?php endif; ?>

View File

@@ -0,0 +1,25 @@
<?php
/**
* Lost Password - Check Email
*
* This message is shown after filling out the lost password form.
*
* For modifying this template, please see: http://docs.restrictcontentpro.com/article/1738-template-files
*
* @package Restrict Content Pro
* @subpackage Templates/Lost Password/Check Email
* @copyright Copyright (c) 2017, Restrict Content Pro
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
*/
if( ! is_user_logged_in() ) : ?>
<?php do_action( 'rcp_before_lostpassword_checkemail_message' ); ?>
<p><?php _e('Check your e-mail for the confirmation link.', 'rcp'); ?></p>
<?php do_action( 'rcp_after_lostpassword_checkemail_message' ); ?>
<?php else : ?>
<div class="rcp_logged_in"><a href="<?php echo wp_logout_url( home_url() ); ?>"><?php _e( 'Log out', 'rcp' ); ?></a></div>
<?php endif; ?>

View File

@@ -0,0 +1,91 @@
<?php
/**
* PayPal Express Confirmation
*
* This template is loaded while processing a PayPal Express payment. The customer is
* asked to confirm the subscription details.
*
* For modifying this template, please see: http://docs.restrictcontentpro.com/article/1738-template-files
*
* @package Restrict Content Pro
* @subpackage Templates/PayPal Express Confirmation
* @copyright Copyright (c) 2017, Restrict Content Pro
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
*/
use RCP\Membership_Level;
global $rcp_checkout_details;
$payments = new RCP_Payments();
$customer = rcp_get_customer(); // current customer
$membership_id = ! empty( $rcp_checkout_details['membership_id'] ) ? absint( $rcp_checkout_details['membership_id'] ) : 0;
$payment_id = ! empty( $membership_id ) ? rcp_get_membership_meta( $membership_id, 'pending_payment_id', true ) : false;
$payment = $payments->get_payment( $payment_id );
$membership_level = rcp_get_membership_level( $payment->object_id );
?>
<div class="rcp-confirm-details" id="billing_info">
<h3><?php _e( 'Please confirm your payment', 'rcp' ); ?></h3>
<p><strong><?php echo isset( $rcp_checkout_details['FIRSTNAME'] ) ? esc_html( $rcp_checkout_details['FIRSTNAME'] ) : ''; ?> <?php echo isset( $rcp_checkout_details['LASTNAME'] ) ? esc_html( $rcp_checkout_details['LASTNAME'] ) : ''; ?></strong><br />
<?php _e( 'PayPal Status:', 'rcp' ); ?> <?php echo isset( $rcp_checkout_details['PAYERSTATUS'] ) ? esc_html( $rcp_checkout_details['PAYERSTATUS'] ) : ''; ?><br />
<?php _e( 'Email:', 'rcp' ); ?> <?php echo isset( $rcp_checkout_details['EMAIL'] ) ? esc_html( $rcp_checkout_details['EMAIL'] ) : ''; ?></p>
</div>
<table id="order_summary" class="rcp-table">
<thead>
<tr>
<th><?php _e( 'Description', 'rcp' ); ?></th>
<th><?php _e( 'Amount', 'rcp' ); ?></th>
</tr>
</thead>
<tbody>
<tr>
<td data-th="<?php esc_attr_e( 'Subscription', 'rcp' ); ?>" class="rcp-ppe-confirm-name"><?php echo isset( $rcp_checkout_details['DESC'] ) ? esc_html( $rcp_checkout_details['DESC'] ) : esc_html( $payment->subscription ); ?></td>
<td data-th="<?php esc_attr_e( 'Subtotal', 'rcp' ); ?>" class="rcp-ppe-confirm-price"><?php echo $membership_level instanceof Membership_Level ? rcp_currency_filter( $membership_level->get_price() ) : ''; ?></td>
</tr>
</tbody>
<tfoot>
<?php if ( ! empty( $payment->discount_amount ) ) : ?>
<tr>
<th scope="row" class="rcp-ppe-confirm-name"><?php _e( 'Discount:', 'rcp' ); ?></th>
<td data-th="<?php esc_attr_e( 'Discount', 'rcp' ); ?>" class="rcp-ppe-confirm-price"><?php echo rcp_currency_filter( -1 * abs( $payment->discount_amount ) ); ?></td>
</tr>
<?php endif; ?>
<?php if ( ! empty( $payment->fees ) ) : ?>
<tr>
<th scope="row" class="rcp-ppe-confirm-name"><?php _e( 'Fees:', 'rcp' ); ?></th>
<td data-th="<?php esc_attr_e( 'Fees', 'rcp' ); ?>" class="rcp-ppe-confirm-price"><?php echo rcp_currency_filter( $payment->fees ); ?></td>
</tr>
<?php endif; ?>
<?php if ( ! empty( $payment->credits ) ) : ?>
<tr>
<th scope="row" class="rcp-ppe-confirm-name"><?php _e( 'Credits:', 'rcp' ); ?></th>
<td data-th="<?php esc_attr_e( 'Credits', 'rcp' ); ?>" class="rcp-ppe-confirm-price"><?php echo rcp_currency_filter( -1 * abs( $payment->credits ) ); ?></td>
</tr>
<?php endif; ?>
<tr>
<th scope="row" class="rcp-ppe-confirm-name"><?php _e( 'Total Today:', 'rcp' ); ?></th>
<td data-th="<?php esc_attr_e( 'Total Today', 'rcp' ); ?>" class="rcp-ppe-confirm-price"><?php echo rcp_currency_filter( $payment->amount ); ?></td>
</tr>
<?php if ( ! empty( $_GET['rcp-recurring'] ) ) : ?>
<?php
if ( $membership_level->get_duration() == 1 ) {
$recurring_heading = sprintf( __( 'Total Recurring Per %s:', 'rcp' ), rcp_filter_duration_unit( $membership_level->get_duration_unit(), 1 ) );
} else {
$recurring_heading = sprintf( __( 'Total Recurring Every %s %s:', 'rcp' ), $membership_level->get_duration(), rcp_filter_duration_unit( $membership_level->get_duration_unit(), $membership_level->get_duration() ) );
}
?>
<tr>
<th scope="row" class="rcp-ppe-confirm-name"><?php echo $recurring_heading; ?></th>
<td data-th="<?php echo esc_attr( $recurring_heading ); ?>" class="rcp-ppe-confirm-price"><?php echo rcp_currency_filter( $rcp_checkout_details['PAYMENTREQUEST_0_AMT'] ); // @todo ?></td>
</tr>
<?php endif; ?>
</tfoot>
</table>
<form id="rcp-paypal-express-confirm-form" action="<?php echo esc_url( add_query_arg( 'rcp-confirm', 'paypal_express' ) ); ?>" method="post">
<input type="hidden" name="confirmation" value="yes" />
<input type="hidden" name="token" value="<?php echo esc_attr( $_GET['token'] ); ?>" />
<input type="hidden" name="payer_id" value="<?php echo esc_attr( $_GET['PayerID'] ); ?>" />
<input type="hidden" name="rcp_ppe_confirm_nonce" value="<?php echo wp_create_nonce( 'rcp-ppe-confirm-nonce' ); ?>"/>
<input type="submit" class="rcp-button" value="<?php esc_attr_e( 'Confirm', 'rcp' ); ?>" />
</form>

View File

@@ -0,0 +1,85 @@
<?php
/**
* Profile Editor Form
*
* This template is used to display the profile editor with [rcp_profile_editor]
* @link http://docs.restrictcontentpro.com/article/1602-rcpprofileeditor
*
* For modifying this template, please see: http://docs.restrictcontentpro.com/article/1738-template-files
*
* @package Restrict Content Pro
* @subpackage Templates/Profile Editor
* @copyright Copyright (c) 2017, Restrict Content Pro
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
*/
global $rcp_load_css;
$current_user = wp_get_current_user();
$rcp_load_css = true;
if ( is_user_logged_in() ):
$user_id = get_current_user_id();
$first_name = get_user_meta( $user_id, 'first_name', true );
$last_name = get_user_meta( $user_id, 'last_name', true );
$display_name = $current_user->display_name;
do_action( 'rcp_profile_editor_messages', $current_user );
rcp_show_error_messages(); ?>
<form id="rcp_profile_editor_form" class="rcp_form" action="<?php echo rcp_get_current_url(); ?>" method="post">
<fieldset>
<?php do_action( 'rcp_profile_editor_before', $current_user->ID ); ?>
<legend><?php _e( 'Change your Name', 'rcp' ); ?></legend>
<p id="rcp_profile_first_name_wrap">
<label for="rcp_first_name"><?php _e( 'First Name', 'rcp' ); ?></label>
<input name="rcp_first_name" id="rcp_first_name" class="text rcp-input" type="text" value="<?php echo esc_attr( $first_name ); ?>" />
</p>
<p id="rcp_profile_last_name_wrap">
<label for="rcp_last_name"><?php _e( 'Last Name', 'rcp' ); ?></label>
<input name="rcp_last_name" id="rcp_last_name" class="text rcp-input" type="text" value="<?php echo esc_attr( $last_name ); ?>" />
</p>
<p id="rcp_profile_display_name_wrap">
<label for="rcp_display_name"><?php _e( 'Display Name', 'rcp' ); ?></label>
<select name="rcp_display_name">
<?php if ( ! empty( $current_user->first_name ) ): ?>
<option <?php selected( $display_name, $current_user->first_name ); ?> value="<?php echo esc_attr( $current_user->first_name ); ?>"><?php echo $current_user->first_name; ?></option>
<?php endif; ?>
<option <?php selected( $display_name, $current_user->user_nicename ); ?> value="<?php echo esc_attr( $current_user->user_nicename ); ?>"><?php echo $current_user->user_nicename; ?></option>
<?php if ( ! empty( $current_user->last_name ) ): ?>
<option <?php selected( $display_name, $current_user->last_name ); ?> value="<?php echo esc_attr( $current_user->last_name ); ?>"><?php echo $current_user->last_name; ?></option>
<?php endif; ?>
<?php if ( ! empty( $current_user->first_name ) && ! empty( $current_user->last_name ) ): ?>
<option <?php selected( $display_name, $current_user->first_name . ' ' . $current_user->last_name ); ?> value="<?php echo esc_attr( $current_user->first_name ) . ' ' . esc_attr( $current_user->last_name ); ?>"><?php echo $current_user->first_name . ' ' . $current_user->last_name; ?></option>
<option <?php selected( $display_name, $current_user->last_name . ' ' . $current_user->first_name ); ?> value="<?php echo esc_attr( $current_user->last_name ) . ' ' . esc_attr( $current_user->first_name ); ?>"><?php echo $current_user->last_name . ' ' . $current_user->first_name; ?></option>
<?php endif; ?>
</select>
</p>
<p>
<label for="rcp_email"><?php _e( 'Email Address', 'rcp' ); ?></label>
<input name="rcp_email" id="rcp_email" class="text rcp-input required" type="email" value="<?php echo esc_attr( $current_user->user_email ); ?>" />
</p>
<?php do_action( 'rcp_profile_editor_after', $current_user->ID ); ?>
</fieldset>
<fieldset>
<legend><?php _e( 'Change your Password', 'rcp' ); ?></legend>
<p id="rcp_profile_password_wrap">
<label for="rcp_user_pass"><?php _e( 'New Password', 'rcp' ); ?></label>
<input name="rcp_new_user_pass1" id="rcp_new_user_pass1" class="password rcp-input" type="password"/>
</p>
<p id="rcp_profile_password_confirm_wrap">
<label for="rcp_user_pass"><?php _e( 'Re-enter Password', 'rcp' ); ?></label>
<input name="rcp_new_user_pass2" id="rcp_new_user_pass2" class="password rcp-input" type="password"/>
</p>
</fieldset>
<fieldset>
<p id="rcp_profile_submit_wrap">
<input type="hidden" name="rcp_profile_editor_nonce" value="<?php echo wp_create_nonce( 'rcp-profile-editor-nonce' ); ?>"/>
<input type="hidden" name="rcp_action" value="edit_user_profile" />
<input type="hidden" name="rcp_redirect" value="<?php echo esc_url( rcp_get_current_url() ); ?>" />
<input name="rcp_profile_editor_submit" id="rcp_profile_editor_submit" type="submit" class="rcp_submit rcp-button" value="<?php esc_attr_e( 'Save Changes', 'rcp' ); ?>"/>
</p>
</fieldset>
</form><!-- #rcp_profile_editor_form -->
<?php
else:
echo rcp_login_form_fields();
endif;

View File

@@ -0,0 +1,292 @@
<?php
/**
* Registration Form - Combined
*
* This template is used to display the registration form for a single
* membership level with [register_form id="3"] and the "non single:
* register form with [register_form]
* @link http://docs.restrictcontentpro.com/article/1597-registerform
*
* For modifying this template, please see: http://docs.restrictcontentpro.com/article/1738-template-files
*
* @package Restrict Content Pro
* @subpackage Templates/Register/Single
* @copyright Copyright (c) 2017, Restrict Content Pro
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
*/
global $rcp_options, $rcp_level, $post, $rcp_levels_db, $rcp_register_form_atts;
$discount = ! empty( $_REQUEST['discount'] ) ? sanitize_text_field( $_REQUEST['discount'] ) : '';
// We only have $level only used on "register-single.php"
$level = rcp_get_membership_level( $rcp_level );
?>
<h3 class="rcp_header">
<?php if ( ! is_user_logged_in() ) {
echo apply_filters( 'rcp_registration_header_logged_out', $rcp_register_form_atts['logged_out_header'] );
} else {
echo apply_filters( 'rcp_registration_header_logged_in', $rcp_register_form_atts['logged_in_header'] );
}
?>
</h3>
<?php
// show any error messages after form submission
rcp_show_error_messages( 'register' ); ?>
<form id="rcp_registration_form" class="rcp_form" method="POST" action="<?php echo esc_url( rcp_get_current_url() ); ?>">
<?php if ( $level ) { ?>
<div class="rcp_description"><?php echo wpautop( wptexturize( $level->get_description() ) ); ?></div>
<?php } ?>
<?php if ( ! is_user_logged_in() ) { ?>
<div class="rcp_login_link">
<p><?php printf( __( '<a href="%s">Log in</a> to renew or change an existing membership.', 'rcp' ), esc_url( rcp_get_login_url( rcp_get_current_url() ) ) ); ?></p>
</div>
<?php do_action( 'rcp_before_register_form_fields' ); ?>
<fieldset class="rcp_user_fieldset">
<p id="rcp_user_login_wrap">
<label for="rcp_user_login"><?php echo apply_filters ( 'rcp_registration_username_label', __( 'Username', 'rcp' ) ); ?></label>
<input name="rcp_user_login" id="rcp_user_login" class="required" type="text" <?php if( isset( $_POST['rcp_user_login'] ) ) { echo 'value="' . esc_attr( $_POST['rcp_user_login'] ) . '"'; } ?>/>
</p>
<p id="rcp_user_email_wrap">
<label for="rcp_user_email"><?php echo apply_filters ( 'rcp_registration_email_label', __( 'Email', 'rcp' ) ); ?></label>
<input name="rcp_user_email" id="rcp_user_email" class="required" type="text" <?php if( isset( $_POST['rcp_user_email'] ) ) { echo 'value="' . esc_attr( $_POST['rcp_user_email'] ) . '"'; } ?>/>
</p>
<p id="rcp_user_first_wrap" class="inline">
<label for="rcp_user_first"><?php echo apply_filters ( 'rcp_registration_firstname_label', __( 'First Name', 'rcp' ) ); ?></label>
<input name="rcp_user_first" id="rcp_user_first" type="text" <?php if( isset( $_POST['rcp_user_first'] ) ) { echo 'value="' . esc_attr( $_POST['rcp_user_first'] ) . '"'; } ?>/>
</p>
<p id="rcp_user_last_wrap" class="inline-block">
<label for="rcp_user_last"><?php echo apply_filters ( 'rcp_registration_lastname_label', __( 'Last Name', 'rcp' ) ); ?></label>
<input name="rcp_user_last" id="rcp_user_last" type="text" <?php if( isset( $_POST['rcp_user_last'] ) ) { echo 'value="' . esc_attr( $_POST['rcp_user_last'] ) . '"'; } ?>/>
</p>
<p id="rcp_password_wrap" class="inline">
<label for="rcp_password"><?php echo apply_filters ( 'rcp_registration_password_label', __( 'Password', 'rcp' ) ); ?></label>
<input name="rcp_user_pass" id="rcp_password" class="required" type="password"/>
</p>
<p id="rcp_password_again_wrap" class="inline-block">
<label for="rcp_password_again"><?php echo apply_filters ( 'rcp_registration_password_again_label', __( 'Password Again', 'rcp' ) ); ?></label>
<input name="rcp_user_pass_confirm" id="rcp_password_again" class="required" type="password"/>
</p>
<?php do_action( 'rcp_after_password_registration_field' ); ?>
</fieldset>
<?php } ?>
<?php do_action( 'rcp_before_subscription_form_fields' ); ?>
<?php // with if ( ! $level ) I'm checking if register.php is active ?>
<?php if ( ! $level ) { ?>
<fieldset class="rcp_subscription_fieldset">
<?php
$levels = rcp_get_membership_levels( array( 'status' => 'active', 'number' => 100 ) );
$i = 0;
if( $levels ) : ?>
<?php if ( count( $levels ) > 1 ) : ?>
<p class="rcp_subscription_message"><?php echo apply_filters ( 'rcp_registration_choose_subscription', __( 'Choose your membership level', 'rcp' ) ); ?></p>
<?php endif; ?>
<ul id="rcp_subscription_levels">
<?php foreach( $levels as $key => $each_level ) : ?>
<?php if( rcp_show_subscription_level( $each_level->get_id() ) ) : ?>
<li class="rcp_subscription_level rcp_subscription_level_<?php echo esc_attr( $each_level->get_id() ); ?>">
<input type="radio" id="rcp_subscription_level_<?php echo esc_attr( $each_level->get_id() ); ?>" class="required rcp_level" <?php if ( $i == 0 || ( isset( $_GET['level'] ) && $_GET['level'] == $each_level->get_id() ) ) { echo 'checked="checked"'; } ?> name="rcp_level" rel="<?php echo esc_attr( $each_level->get_price() ); ?>" value="<?php echo esc_attr( $each_level->get_id() ); ?>" <?php if( $each_level->is_lifetime() ) { echo 'data-duration="forever"'; } if ( $each_level->has_trial() ) { echo 'data-has-trial="true"'; } ?>/>
<label for="rcp_subscription_level_<?php echo esc_attr( $each_level->get_id() ); ?>">
<span class="rcp_subscription_level_name"><?php echo esc_html( $each_level->get_name() ); ?></span><span class="rcp_separator">&nbsp;-&nbsp;</span><span class="rcp_price" rel="<?php echo esc_attr( $each_level->get_price() ); ?>"><?php echo ! $each_level->is_free() ? rcp_currency_filter( $each_level->get_price() ) : __( 'free', 'rcp' ); ?></span><span class="rcp_separator">&nbsp;-&nbsp;</span>
<span class="rcp_level_duration"><?php echo ! $each_level->is_lifetime() ? $each_level->get_duration() . '&nbsp;' . rcp_filter_duration_unit( $each_level->get_duration_unit(), $each_level->get_duration() ) : __( 'unlimited', 'rcp' ); ?></span>
<?php if ( $each_level->get_maximum_renewals() > 0 ) : ?>
<span class="rcp_separator">&nbsp;-&nbsp;</span>
<span class="rcp_level_bill_times"><?php printf( __( '%d total payments', 'rcp' ), $each_level->get_maximum_renewals() + 1 ); ?></span>
<?php endif; ?>
<div class="rcp_level_description"> <?php echo $each_level->get_description(); ?></div>
</label>
</li>
<?php $i++; endif; ?>
<?php endforeach; ?>
</ul>
<?php else : ?>
<p><strong><?php _e( 'You have not created any membership levels yet', 'rcp' ); ?></strong></p>
<?php endif; ?>
</fieldset>
<?php
}
if ( ! function_exists( 'rcp_should_show_discounts' ) ) :
function rcp_should_show_discounts( $level ) {
// This one is easy. No discounts? Stop here.
if ( ! rcp_has_discounts() ) {
return false;
}
// On "register-single.php" and it's free.
if ( $level && $level->is_free() ) {
return false;
}
return true;
}
endif;
$show_discounts = rcp_should_show_discounts( $level );
if ( $show_discounts ) :
?>
<fieldset class="rcp_discounts_fieldset">
<p id="rcp_discount_code_wrap">
<label for="rcp_discount_code">
<?php _e( 'Discount Code', 'rcp' ); ?>
<span class="rcp_discount_valid" style="display: none;"> - <?php _e( 'Valid', 'rcp' ); ?></span>
<span class="rcp_discount_invalid" style="display: none;"> - <?php _e( 'Invalid', 'rcp' ); ?></span>
</label>
<span class="rcp_discount_code_field_wrap">
<input type="text" id="rcp_discount_code" name="rcp_discount" class="rcp_discount_code" value="<?php echo esc_attr( $discount ); ?>"/>
<button class="rcp_button" id="rcp_apply_discount"><?php _e( 'Apply', 'rcp' ); ?></button>
</span>
</p>
</fieldset>
<?php
endif;
// checking if $levels is a thing, so it can be passed along to add_actions
$do_we_have_levels = isset( $levels );
if ( $do_we_have_levels ) {
do_action( 'rcp_after_register_form_fields', $levels );
} else {
do_action( 'rcp_after_register_form_fields' );
}
// There is no conditional on register.php
// So we return true immediately if so
// If $level is a thing, we check if it's free, and return false
// Don't need gateways on free stuff
if ( ! function_exists( 'rcp_should_show_gateway_fields' ) ) :
function rcp_should_show_gateway_fields( $level ) {
if ( ! $level ) {
return true;
}
if ( $level->is_free() ) {
return false;
}
// We have a $level, but it ain't free
return true;
}
endif;
$should_show_gateway_fields = rcp_should_show_gateway_fields( $level );
if ( $should_show_gateway_fields ) :
?>
<div class="rcp_gateway_fields">
<?php
$gateways = rcp_get_enabled_payment_gateways();
if( count( $gateways ) > 1 ) :
$display = rcp_has_paid_levels() ? '' : ' style="display: none;"';
$i = 1;
?>
<fieldset class="rcp_gateways_fieldset">
<legend><?php _e( 'Choose Your Payment Method', 'rcp' ); ?></legend>
<p id="rcp_payment_gateways"<?php echo $display; ?>>
<?php foreach( $gateways as $key => $gateway ) :
$recurring = rcp_gateway_supports( $key, 'recurring' ) ? 'yes' : 'no';
$trial = rcp_gateway_supports( $key, 'trial' ) ? 'yes' : 'no'; ?>
<label for="rcp_gateway_<?php echo esc_attr( $key ); ?>" class="rcp_gateway_option_label">
<input id="rcp_gateway_<?php echo esc_attr( $key );?>" name="rcp_gateway" type="radio" class="rcp_gateway_option_input" value="<?php echo esc_attr( $key ); ?>" data-supports-recurring="<?php echo esc_attr( $recurring ); ?>" data-supports-trial="<?php echo esc_attr( $trial ); ?>" <?php checked( $i, 1 ); ?>>
<?php echo esc_html( $gateway ); ?>
</label>
<?php
$i++;
endforeach; ?>
</p>
</fieldset>
<?php else: ?>
<?php foreach( $gateways as $key => $gateway ) :
$recurring = rcp_gateway_supports( $key, 'recurring' ) ? 'yes' : 'no';
$trial = rcp_gateway_supports( $key, 'trial' ) ? 'yes' : 'no';
?>
<input type="hidden" name="rcp_gateway" value="<?php echo esc_attr( $key ); ?>" data-supports-recurring="<?php echo esc_attr( $recurring ); ?>" data-supports-trial="<?php echo esc_attr( $trial ); ?>"/>
<?php endforeach; ?>
<?php endif; ?>
</div>
<?php
endif;
?>
<?php if ( ! empty( $rcp_options['enable_terms'] ) ) : ?>
<fieldset class="rcp_agree_to_terms_fieldset">
<p id="rcp_agree_to_terms_wrap">
<input type="checkbox" id="rcp_agree_to_terms" name="rcp_agree_to_terms" value="1">
<label for="rcp_agree_to_terms">
<?php
if ( ! empty( $rcp_options['terms_link'] ) ) {
echo '<a href="' . esc_url( $rcp_options['terms_link'] ) . '" target="_blank">';
}
if ( ! empty( $rcp_options['terms_label'] ) ) {
echo $rcp_options['terms_label'];
} else {
_e( 'I agree to the terms and conditions', 'rcp' );
}
if ( ! empty( $rcp_options['terms_link'] ) ) {
echo '</a>';
}
?>
</label>
</p>
</fieldset>
<?php endif; ?>
<?php if ( ! empty( $rcp_options['enable_privacy_policy'] ) ) : ?>
<fieldset class="rcp_agree_to_privacy_policy_fieldset">
<p id="rcp_agree_to_privacy_policy_wrap">
<input type="checkbox" id="rcp_agree_to_privacy_policy" name="rcp_agree_to_privacy_policy" value="1">
<label for="rcp_agree_to_privacy_policy">
<?php
if ( ! empty( $rcp_options['privacy_policy_link'] ) ) {
echo '<a href="' . esc_url( $rcp_options['privacy_policy_link'] ) . '" target="_blank">';
}
if ( ! empty( $rcp_options['privacy_policy_label'] ) ) {
echo $rcp_options['privacy_policy_label'];
} else {
_e( 'I agree to the privacy policy', 'rcp' );
}
if ( ! empty( $rcp_options['privacy_policy_link'] ) ) {
echo '</a>';
}
?>
</label>
</p>
</fieldset>
<?php endif; ?>
<?php
if ( $do_we_have_levels ) {
do_action( 'rcp_before_registration_submit_field', $levels );
} else {
do_action( 'rcp_before_registration_submit_field' );
}
?>
<?php if ( ! empty( $_GET['rcp_redirect'] ) ) : ?>
<input type="hidden" name="rcp_redirect" value="<?php echo esc_url( $_GET[ 'rcp_redirect' ] ) ?>"/>
<?php endif; ?>
<p id="rcp_submit_wrap">
<?php if ( $level ) { ?>
<input type="hidden" name="rcp_level" class="rcp_level" value="<?php echo esc_attr( $level->get_id() ); ?>" rel="<?php echo esc_attr( $level->get_price() ); ?>" <?php if ( $level->has_trial() ) { echo 'data-has-trial="true"'; } ?> />
<?php } ?>
<input type="hidden" name="rcp_register_nonce" value="<?php echo wp_create_nonce('rcp-register-nonce' ); ?>"/>
<input type="submit" name="rcp_submit_registration" id="rcp_submit" class="rcp-button" value="<?php esc_attr_e( apply_filters ( 'rcp_registration_register_button', __( 'Register', 'rcp' ) ) ); ?>"/>
</p>
</form>

View File

@@ -0,0 +1,18 @@
<?php
/**
* Registration Form - Single
*
* This template is used to display the registration form for a single
* membership level with [register_form id="3"]
* @link http://docs.restrictcontentpro.com/article/1597-registerform
*
* For modifying this template, please see: http://docs.restrictcontentpro.com/article/1738-template-files
*
* @package Restrict Content Pro
* @subpackage Templates/Register/Single
* @copyright Copyright (c) 2017, Restrict Content Pro
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
*/
rcp_get_template_part( 'register-common' );
?>

View File

@@ -0,0 +1,151 @@
<?php
/**
* Registration Form - Total Details
*
* This template is loaded into register.php and register-single.php to display the total
* membership cost, fees, and any recurring costs.
* @link http://docs.restrictcontentpro.com/article/1597-registerform
*
* For modifying this template, please see: http://docs.restrictcontentpro.com/article/1738-template-files
*
* @since 3.4 Show discount information below fees if "Discount Signup Fees" is enabled.
*
* @package Restrict Content Pro
* @subpackage Templates/Register/Total Details
* @copyright Copyright (c) 2017, Restrict Content Pro
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
*/
use RCP\Membership_Level;
if ( ! rcp_is_registration() ) {
return;
}
$membership_level = rcp_get_membership_level( rcp_get_registration()->get_membership_level_id() );
if ( ! $membership_level instanceof Membership_Level ) {
return;
}
global $rcp_options;
?>
<div class="rcp_registration_total">
<table class="rcp_registration_total_details rcp-table">
<thead class="membership-amount">
<tr>
<th>Membership Details</th>
</tr>
</thead>
<tbody style="vertical-align: top;">
<tr>
<td><?php _e( 'Membership', 'rcp' ); ?></td>
<td data-title="Membership" data-th="<?php esc_attr_e( 'Membership', 'rcp' ); ?>"><?php echo esc_html( $membership_level->get_name() ); ?></td>
</tr>
<tr class="membership-level-price">
<td><?php _e( 'Amount', 'rcp' ); ?></td>
<td data-th="<?php esc_attr_e( 'Amount', 'rcp' ); ?>"><?php echo ! $membership_level->is_free() ? rcp_currency_filter( $membership_level->get_price() ) : __( 'free', 'rcp' ); ?></td>
</tr>
<?php if ( ! $membership_level->is_free() ) : ?>
<?php if ( rcp_get_registration()->get_fees() || rcp_get_registration()->get_discounts() ) : ?>
<tr class="discounts-fees">
<th><?php _e( 'Discounts and Fees', 'rcp' ); ?></th>
</tr>
<?php
/**
* Discounts
*
* We show discount information here if discounts *do not* apply to signup fees.
*/
?>
<?php if ( empty( $rcp_options['discount_fees'] ) ) : ?>
<?php if ( rcp_get_registration()->get_discounts() ) : foreach( rcp_get_registration()->get_discounts() as $code => $recuring ) : if ( ! $discount = rcp_get_discount_details_by_code( $code ) ) continue; ?>
<tr class="rcp-discount">
<td data-title="Discount" data-th="<?php esc_attr_e( 'Discount', 'rcp' ); ?>"><?php echo esc_html( $discount->get_name() ); ?></td>
<td data-title="Discount Amount" data-th="<?php esc_attr_e( 'Discount Amount', 'rcp' ); ?>"><?php echo esc_html( rcp_discount_sign_filter( $discount->get_amount(), $discount->get_unit() ) ); ?></td>
</tr>
<?php endforeach; endif; ?>
<?php endif; ?>
<?php // Fees ?>
<?php if ( rcp_get_registration()->get_fees() ) : foreach( rcp_get_registration()->get_fees() as $fee ) :
$sign = ( $fee['amount'] < 0 ) ? '-' : '';
$fee['amount'] = abs( $fee['amount'] );
?>
<tr class="rcp-fee">
<td data-title="Fee" data-th="<?php esc_attr_e( 'Fee/Credit', 'rcp' ); ?>"><?php echo esc_html( $fee['description'] ); ?></td>
<td data-title="Amount" data-th="<?php esc_attr_e( 'Amount', 'rcp' ); ?>"><?php echo esc_html( $sign . rcp_currency_filter( $fee['amount'] ) ); ?></td>
</tr>
<?php endforeach; endif; ?>
<?php
/**
* Discounts
*
* We show discount information here if discounts *do* apply to signup fees.
*/
?>
<?php if ( ! empty( $rcp_options['discount_fees'] ) ) : ?>
<?php if ( rcp_get_registration()->get_discounts() ) : foreach( rcp_get_registration()->get_discounts() as $code => $recuring ) : if ( ! $discount = rcp_get_discount_details_by_code( $code ) ) continue; ?>
<tr class="rcp-discount">
<td data-title="Discount" data-th="<?php esc_attr_e( 'Discount', 'rcp' ); ?>"><?php echo esc_html( $discount->get_name() ); ?></td>
<td data-title="Discount Amount" data-th="<?php esc_attr_e( 'Discount Amount', 'rcp' ); ?>"><?php echo esc_html( rcp_discount_sign_filter( $discount->get_amount(), $discount->unit ) ); ?></td>
</tr>
<?php endforeach; endif; ?>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
</tbody>
<tfoot>
<tr class="rcp-total">
<td data-title="Total Today" data-th="<?php rcp_registration_total(); ?>"><?php _e( 'Total Today', 'rcp' ); ?></td>
<td data-th="<?php esc_attr_e( 'Total Today', 'rcp' ); ?>"><?php rcp_registration_total(); ?></td>
</tr>
<?php if ( rcp_registration_is_recurring() ) : ?>
<?php
if ( 1 === $membership_level->get_duration() ) {
$label = sprintf( __( 'Total Recurring Per %s', 'rcp' ), rcp_filter_duration_unit( $membership_level->get_duration_unit(), 1 ) );
} else {
$label = sprintf( __( 'Total Recurring Every %s %s', 'rcp' ), $membership_level->get_duration(), rcp_filter_duration_unit( $membership_level->get_duration_unit(), $membership_level->get_duration() ) );
}
if ( $membership_level->get_maximum_renewals() > 0 ) {
$label = sprintf(
__( '%d Additional Payments Every %s %s', 'rcp' ),
$membership_level->get_maximum_renewals(),
$membership_level->get_duration(),
rcp_filter_duration_unit( $membership_level->get_duration_unit(), $membership_level->get_duration() )
);
}
?>
<tr class="rcp-recurring-total">
<td scope="row"><?php echo $label; ?></td>
<td data-th="<?php echo esc_attr( $label ); ?>"><?php rcp_registration_recurring_total(); ?></td>
</tr>
<?php endif; ?>
<?php
/**
* Insert content at the end of the table footer.
*
* @since 3.3
*/
do_action( 'rcp_register_total_details_footer_bottom' );
?>
</tfoot>
</table>
</div>

View File

@@ -0,0 +1,18 @@
<?php
/**
* Registration Form
*
* This template is used to display the registration form with [register_form].
* If the `id` attribute is passed into the shortcode then register-single.php is used instead.
* @link http://docs.restrictcontentpro.com/article/1597-registerform
*
* For modifying this template, please see: http://docs.restrictcontentpro.com/article/1738-template-files
*
* @package Restrict Content Pro
* @subpackage Templates/Register
* @copyright Copyright (c) 2017, Restrict Content Pro
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
*/
rcp_get_template_part( 'register-common' );
?>

View File

@@ -0,0 +1,256 @@
<?php
/**
* Subscription Details
*
* This template displays the current user's membership details with [subscription_details]
*
* @link http://docs.restrictcontentpro.com/article/1600-subscriptiondetails
*
* For modifying this template, please see: http://docs.restrictcontentpro.com/article/1738-template-files
*
* @package Restrict Content Pro
* @subpackage Templates/Subscription
* @copyright Copyright (c) 2017, Restrict Content Pro
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
*/
use RCP\Membership_Level;
global $user_ID, $rcp_options;
$member = new RCP_Member( $user_ID );
$customer = rcp_get_customer(); // currently logged in customer
$memberships = is_object( $customer ) ? $customer->get_memberships() : false;
do_action( 'rcp_subscription_details_top' );
if ( isset( $_GET['profile'] ) && 'cancelled' == $_GET['profile'] && ! empty( $_GET['membership_id'] ) ) :
$cancelled_membership = rcp_get_membership( absint( $_GET['membership_id'] ) );
?>
<p class="rcp_success">
<span><?php printf( __( 'Your %s subscription has been successfully cancelled. Your membership will expire on %s.', 'rcp' ), $cancelled_membership->get_membership_level_name(), $cancelled_membership->get_expiration_date() ); ?></span>
</p>
<?php elseif ( isset( $_GET['cancellation_failure'] ) ) : ?>
<p class="rcp_error"><span><?php echo esc_html( urldecode( $_GET['cancellation_failure'] ) ); ?> </span></p>
<?php endif;
$has_payment_plan = false;
if ( ! empty( $memberships ) ) {
foreach ( $memberships as $membership ) {
/**
* @var RCP_Membership $membership
*/
if ( $membership->is_recurring() && $membership->is_expired() && $membership->can_update_billing_card() ) : ?>
<p class="rcp_error">
<span>
<?php
printf( __( 'Your %s membership has expired. <a href="%s">Update your payment method</a> to reactivate and renew your membership.', 'rcp' ),
$membership->get_membership_level_name(),
esc_url( add_query_arg( 'membership_id', urlencode( $membership->get_id() ), get_permalink( $rcp_options['update_card'] ) ) )
);
?>
</span>
</p>
<?php endif;
if ( $membership->has_payment_plan() ) {
$has_payment_plan = true;
}
}
}
?>
<div class="rcp-table-wrapper" id="rcp-table-wrapper">
<h3>Account Overview</h3>
<table class="rcp-table subscription" id="rcp-account-overview">
<thead class="hide-mobile">
<tr>
<th><?php _e( 'Membership', 'rcp' ); ?></th>
<th><?php _e( 'Status', 'rcp' ); ?></th>
<th><?php _e( 'Expiration/Renewal Date', 'rcp' ); ?></th>
<?php if ( $has_payment_plan ) : ?>
<th><?php _e( 'Times Billed', 'rcp' ); ?></th>
<?php endif; ?>
<th><?php _e( 'Actions', 'rcp' ); ?></th>
</tr>
</thead>
<tbody>
<?php if ( ! empty( $memberships ) ) : ?>
<?php foreach ( $memberships as $membership ) : ?>
<tr>
<td class="cell" data-title="Membership" data-th="<?php esc_attr_e( 'Membership', 'rcp' ); ?>">
<?php echo esc_html( $membership->get_membership_level_name() ); ?>
</td>
<td class="cell" data-title="Status" data-th="<?php esc_attr_e( 'Status', 'rcp' ); ?>">
<?php rcp_print_membership_status( $membership->get_id() ); ?>
</td>
<td class="cell" data-title="Expiration/Renewal Date" data-th="<?php esc_attr_e( 'Expiration/Renewal Date', 'rcp' ); ?>">
<?php
echo $membership->get_expiration_date();
if ( $membership->is_recurring() && 'active' === $membership->get_status() ) {
echo '<div class="rcp-membership-auto-renew-notice">' . __( '(renews automatically)', 'rcp' ) . '</div>';
}
if ( $membership->is_active() && $membership->can_toggle_auto_renew() ) {
echo '<div class="rcp-auto-renew-toggle">';
if ( $membership->is_recurring() ) {
$toggle_off_url = wp_nonce_url( add_query_arg( array(
'rcp-action' => 'disable_auto_renew',
'membership-id' => urlencode( $membership->get_id() )
) ), 'rcp_toggle_auto_renew_off' );
echo '<a href="' . esc_url( $toggle_off_url ) . '" class="rcp-disable-auto-renew"><button>' . __( 'Disable auto renew', 'rcp' ) . '</button></a>';
} else {
$toggle_on_url = wp_nonce_url( add_query_arg( array(
'rcp-action' => 'enable_auto_renew',
'membership-id' => urlencode( $membership->get_id() )
) ), 'rcp_toggle_auto_renew_on' );
echo '<a href="' . esc_url( $toggle_on_url ) . '" class="rcp-enable-auto-renew" data-expiration="' . esc_attr( $membership->get_expiration_date( true ) ) . '">' . __( 'Enable auto renew', 'rcp' ) . '</a>';
}
echo '</div>';
}
?>
</td>
<?php
if ( $has_payment_plan ) {
?>
<td class="cell" data-title="Times Billed" data-th="<?php esc_attr_e( 'Times Billed', 'rcp' ); ?>">
<?php
$membership_level = rcp_get_membership_level( $membership->get_object_id() );
if ( $membership_level instanceof Membership_Level ) {
if ( 0 == $membership->get_maximum_renewals() && ! $membership_level->is_lifetime() && ! $membership_level->is_free() ) {
printf( __( '%d / Until Cancelled', 'rcp' ), $membership->get_times_billed() );
} else {
$renewals = $membership_level->is_free() ? 1 : $membership->get_maximum_renewals() + 1;
printf( __( '%d / %d', 'rcp' ), $membership->get_times_billed(), $renewals );
}
}
?>
</td>
<?php
}
?>
<td class="cell" data-title="Actions" data-th="<?php esc_attr_e( 'Actions', 'rcp' ); ?>">
<?php
$links = array();
if ( $membership->can_update_billing_card() ) {
$links[] = '<a href="' . esc_url( add_query_arg( 'membership_id', urlencode( $membership->get_id() ), get_permalink( $rcp_options['update_card'] ) ) ) . '" title="' . esc_attr__( 'Update payment method', 'rcp' ) . '" class="rcp_sub_details_update_card"><button>' . __( 'Update payment method', 'rcp' ) . '</button></a>';
}
if ( $membership->can_renew() ) {
$links[] = apply_filters( 'rcp_subscription_details_action_renew', '<a href="' . esc_url( rcp_get_membership_renewal_url( $membership->get_id() ) ) . '" title="' . esc_attr__( 'Renew your membership', 'rcp' ) . '" class="rcp_sub_details_renew"><button>' . __( 'Renew your membership', 'rcp' ) . '</button></a>', $user_ID );
}
if ( $membership->upgrade_possible() ) {
$links[] = apply_filters( 'rcp_subscription_details_action_upgrade', '<a href="' . esc_url( rcp_get_membership_upgrade_url( $membership->get_id() ) ) . '" title="' . esc_attr__( 'Upgrade or change your membership', 'rcp' ) . '" class="rcp_sub_details_change_membership"><button>' . __( 'Upgrade or change your membership', 'rcp' ) . '</button></a>', $user_ID );
}
if ( $membership->is_active() && $membership->can_cancel() && ! $membership->has_payment_plan() ) {
$links[] = apply_filters( 'rcp_subscription_details_action_cancel', '<a href="' . esc_url( rcp_get_membership_cancel_url( $membership->get_id() ) ) . '" title="' . esc_attr__( 'Cancel your membership', 'rcp' ) . '" class="rcp_sub_details_cancel" id="rcp_cancel_membership_' . esc_attr( $membership->get_id() ) . '"><button>' . __( 'Cancel your membership', 'rcp' ) . '</button></a>', $user_ID );
}
/**
* Filters the action links HTML.
*
* @param string $actions Formatted HTML links.
* @param array $links Array of links before they're imploded into an HTML string.
* @param int $user_ID ID of the current user.
* @param RCP_Membership $membership Current membership record being displayed.
*/
echo apply_filters( 'rcp_subscription_details_actions', implode( '<br/>', $links ), $links, $user_ID, $membership );
/**
* Add custom HTML to the "Actions" column.
*
* @param array $links Existing links.
* @param RCP_Membership $membership Current membership record being displayed.
*/
do_action( 'rcp_subscription_details_action_links', $links, $membership );
if ( $membership->is_active() && $membership->can_cancel() && ! $membership->has_payment_plan() ) {
?>
<script>
// Adds a confirm dialog to the cancel link
var cancel_link = document.querySelector( "#rcp_cancel_membership_<?php echo $membership->get_id(); ?>" );
if ( cancel_link ) {
cancel_link.addEventListener( "click", function ( event ) {
event.preventDefault();
var message = '<?php printf( __( "Are you sure you want to cancel your %s subscription? If you cancel, your membership will expire on %s.", "rcp" ), $membership->get_membership_level_name(), $membership->get_expiration_date() ); ?>';
var confirmed = confirm( message );
if ( true === confirmed ) {
location.assign( document.querySelector( "#rcp_cancel_membership_<?php echo $membership->get_id(); ?>" ).href );
} else {
return false;
}
} );
}
</script>
<?php
}
?>
</td>
</tr>
<?php endforeach; ?>
<?php else : ?>
<tr>
<td data-th="<?php esc_attr_e( 'Membership', 'rcp' ); ?>" colspan="4"><?php _e( 'You do not have any memberships.', 'rcp' ); ?></td>
</tr>
<?php endif; ?>
</tbody>
</table> <!-- rcp-table -->
<h3>Payment History</h3>
<table class="rcp-table subscription" id="rcp-payment-history">
<thead class="hide-mobile">
<tr>
<th><?php _e( 'Invoice #', 'rcp' ); ?></th>
<th><?php _e( 'Membership', 'rcp' ); ?></th>
<th><?php _e( 'Amount', 'rcp' ); ?></th>
<th><?php _e( 'Payment Status', 'rcp' ); ?></th>
<th><?php _e( 'Date', 'rcp' ); ?></th>
<th><?php _e( 'Actions', 'rcp' ); ?></th>
</tr>
</thead>
<tbody>
<?php
$payments = is_object( $customer ) ? $customer->get_payments() : false;
if ( $payments ) : ?>
<?php foreach ( $payments as $payment ) : ?>
<tr>
<td data-title="Invoice #" data-th="<?php esc_attr_e( 'Invoice #', 'rcp' ); ?>"><?php echo $payment->id; ?></td>
<td data-title="Membership" data-th="<?php esc_attr_e( 'Membership', 'rcp' ); ?>"><?php echo esc_html( $payment->subscription ); ?></td>
<td data-title="Amount" data-th="<?php esc_attr_e( 'Amount', 'rcp' ); ?>"><?php echo rcp_currency_filter( $payment->amount ); ?></td>
<td data-title="Payment Status" data-th="<?php esc_attr_e( 'Payment Status', 'rcp' ); ?>"><?php echo rcp_get_payment_status_label( $payment ); ?></td>
<td data-title="Date" data-th="<?php esc_attr_e( 'Date', 'rcp' ); ?>"><?php echo date_i18n( get_option( 'date_format' ), strtotime( $payment->date, current_time( 'timestamp' ) ) ); ?></td>
<td data-title="Actions" data-th="<?php esc_attr_e( 'Actions', 'rcp' ); ?>">
<?php if ( in_array( $payment->status, array( 'pending', 'abandoned', 'failed' ) ) && empty( $payment->transaction_id ) ) : ?>
<a href="<?php echo esc_url( rcp_get_payment_recovery_url( $payment->id ) ); ?>">
<button><?php echo 'failed' === $payment->status ? __( 'Retry Payment', 'rcp' ) : __( 'Complete Payment', 'rcp' ); ?></button>
</a> <br/>
<?php endif; ?>
<a href="<?php echo esc_url( rcp_get_invoice_url( $payment->id ) ); ?>"><button><?php _e( 'View Receipt', 'rcp' ); ?></button></a>
</td>
</tr>
<?php endforeach; ?>
<?php else : ?>
<tr>
<td data-title="Membership" data-th="<?php _e( 'Membership', 'rcp' ); ?>" colspan="6"><?php _e( 'You have not made any payments.', 'rcp' ); ?></td>
</tr>
<?php endif; ?>
</tbody>
</table><!-- rcp-table -->
</div><!-- rcp-table-wrapper -->
<?php do_action( 'rcp_subscription_details_bottom' );

View File

@@ -0,0 +1,22 @@
<?php
/**
* WooCommerce - No Access Message
*
* This template is used to display the restriction message if an unauthorized user
* tries to view a restricted product.
*
* For modifying this template, please see: http://docs.restrictcontentpro.com/article/1738-template-files
*
* @package Restrict Content Pro
* @subpackage Templates/WooCommerce No Access
* @copyright Copyright (c) 2017, Restrict Content Pro
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
*/
global $rcp_options;
$message = rcp_get_restricted_content_message( true );
?>
<div class="rcp-woocommerce-no-access">
<?php echo rcp_format_teaser( $message ); ?>
</div>