Skip to content

Commit

Permalink
Membership autoselect options on installing on extension
Browse files Browse the repository at this point in the history
  • Loading branch information
y000yal committed Jan 7, 2025
1 parent f8206d6 commit 53491ae
Show file tree
Hide file tree
Showing 7 changed files with 6,070 additions and 8 deletions.
45 changes: 44 additions & 1 deletion assets/css/user-registration-default-frontend-rtl.css
Original file line number Diff line number Diff line change
@@ -1 +1,44 @@
.user-registration.ur-frontend-form{background:#fff;border:none;padding:24px 30px 30px}.user-registration.ur-frontend-form .ur-button-container{display:block}.user-registration.ur-frontend-form .ur-form-row{gap:24px;margin-bottom:28px}.user-registration.ur-frontend-form .ur-button-container{display:block;margin-top:36px}.user-registration.ur-frontend-form .ur-button-container .ur-submit-button br{display:none}.user-registration.ur-frontend-form.ur-frontend-form--default .ur-form-row{gap:24px}.user-registration.ur-frontend-form.ur-frontend-form--default .ur-form-row .form-row .ur-label{font-weight:500;font-size:15px;color:#383838}.user-registration.ur-frontend-form.ur-frontend-form--default .ur-form-row .form-row .input-wrapper input{padding:8px 14px 8px 10px;margin-bottom:4px;border:1px solid #e9e9e9;border-radius:4px}.user-registration.ur-frontend-form.ur-frontend-form--default .ur-form-row .form-row .input-wrapper input::placeholder{font-size:14px;font-weight:400;color:#bababa;text-transform:capitalize}.user-registration.ur-frontend-form.ur-frontend-form--default button[type=submit]{padding:10px 16px 8px;border-radius:4px;background:#475bb2;color:#fff;font-size:14px;font-weight:500}.user-registration.ur-frontend-form.ur-frontend-form--default .ur-button-container{display:block;margin-top:36px}
<<<<<<< Updated upstream
.user-registration.ur-frontend-form{background:#fff;border:none;padding:24px 30px 30px}.user-registration.ur-frontend-form .ur-button-container{display:block}.user-registration.ur-frontend-form .ur-form-row{gap:24px;margin-bottom:28px}.user-registration.ur-frontend-form .ur-button-container{display:block;margin-top:36px}.user-registration.ur-frontend-form .ur-button-container .ur-submit-button br{display:none}.user-registration.ur-frontend-form.ur-frontend-form--default .ur-form-row{gap:24px}.user-registration.ur-frontend-form.ur-frontend-form--default .ur-form-row .form-row .ur-label{font-weight:500;font-size:15px;color:#383838}.user-registration.ur-frontend-form.ur-frontend-form--default .ur-form-row .form-row .input-wrapper input{padding:8px 14px 8px 10px;margin-bottom:4px;border:1px solid #e9e9e9;border-radius:4px}.user-registration.ur-frontend-form.ur-frontend-form--default .ur-form-row .form-row .input-wrapper input::placeholder{font-size:14px;font-weight:400;color:#bababa;text-transform:capitalize}.user-registration.ur-frontend-form.ur-frontend-form--default button[type=submit]{padding:10px 16px 8px;border-radius:4px;background:#475bb2;color:#fff;font-size:14px;font-weight:500}.user-registration.ur-frontend-form.ur-frontend-form--default .ur-button-container{display:block;margin-top:36px}
=======
.user-registration.ur-frontend-form {
background: #fff;
border: none;
padding: 24px 30px 30px; }
.user-registration.ur-frontend-form .ur-button-container {
display: block; }
.user-registration.ur-frontend-form .ur-form-row {
gap: 24px;
margin-bottom: 28px; }
.user-registration.ur-frontend-form .ur-button-container {
display: block;
margin-top: 36px; }
.user-registration.ur-frontend-form .ur-button-container .ur-submit-button br {
display: none; }
.user-registration.ur-frontend-form.ur-frontend-form--default .ur-form-row {
gap: 24px; }
.user-registration.ur-frontend-form.ur-frontend-form--default .ur-form-row .form-row .ur-label {
font-weight: 500;
font-size: 15px;
color: #383838; }
.user-registration.ur-frontend-form.ur-frontend-form--default .ur-form-row .form-row .input-wrapper input {
padding: 8px 14px 8px 10px;
margin-bottom: 4px;
border: 1px solid #E9E9E9;
border-radius: 4px; }
.user-registration.ur-frontend-form.ur-frontend-form--default .ur-form-row .form-row .input-wrapper input::placeholder {
font-size: 14px;
font-weight: 400;
color: #bababa;
text-transform: capitalize; }
.user-registration.ur-frontend-form.ur-frontend-form--default button[type=submit] {
padding: 10px 16px 8px;
border-radius: 4px;
background: #475bb2;
color: #fff;
font-size: 14px;
font-weight: 500; }
.user-registration.ur-frontend-form.ur-frontend-form--default .ur-button-container {
display: block;
margin-top: 36px; }
>>>>>>> Stashed changes
45 changes: 44 additions & 1 deletion assets/css/user-registration-default-frontend.css
Original file line number Diff line number Diff line change
@@ -1 +1,44 @@
.user-registration.ur-frontend-form{background:#fff;border:none;padding:24px 30px 30px}.user-registration.ur-frontend-form .ur-button-container{display:block}.user-registration.ur-frontend-form .ur-form-row{gap:24px;margin-bottom:28px}.user-registration.ur-frontend-form .ur-button-container{display:block;margin-top:36px}.user-registration.ur-frontend-form .ur-button-container .ur-submit-button br{display:none}.user-registration.ur-frontend-form.ur-frontend-form--default .ur-form-row{gap:24px}.user-registration.ur-frontend-form.ur-frontend-form--default .ur-form-row .form-row .ur-label{font-weight:500;font-size:15px;color:#383838}.user-registration.ur-frontend-form.ur-frontend-form--default .ur-form-row .form-row .input-wrapper input{padding:8px 10px 8px 14px;margin-bottom:4px;border:1px solid #e9e9e9;border-radius:4px}.user-registration.ur-frontend-form.ur-frontend-form--default .ur-form-row .form-row .input-wrapper input::placeholder{font-size:14px;font-weight:400;color:#bababa;text-transform:capitalize}.user-registration.ur-frontend-form.ur-frontend-form--default button[type=submit]{padding:10px 16px 8px;border-radius:4px;background:#475bb2;color:#fff;font-size:14px;font-weight:500}.user-registration.ur-frontend-form.ur-frontend-form--default .ur-button-container{display:block;margin-top:36px}
<<<<<<< Updated upstream
.user-registration.ur-frontend-form{background:#fff;border:none;padding:24px 30px 30px}.user-registration.ur-frontend-form .ur-button-container{display:block}.user-registration.ur-frontend-form .ur-form-row{gap:24px;margin-bottom:28px}.user-registration.ur-frontend-form .ur-button-container{display:block;margin-top:36px}.user-registration.ur-frontend-form .ur-button-container .ur-submit-button br{display:none}.user-registration.ur-frontend-form.ur-frontend-form--default .ur-form-row{gap:24px}.user-registration.ur-frontend-form.ur-frontend-form--default .ur-form-row .form-row .ur-label{font-weight:500;font-size:15px;color:#383838}.user-registration.ur-frontend-form.ur-frontend-form--default .ur-form-row .form-row .input-wrapper input{padding:8px 10px 8px 14px;margin-bottom:4px;border:1px solid #e9e9e9;border-radius:4px}.user-registration.ur-frontend-form.ur-frontend-form--default .ur-form-row .form-row .input-wrapper input::placeholder{font-size:14px;font-weight:400;color:#bababa;text-transform:capitalize}.user-registration.ur-frontend-form.ur-frontend-form--default button[type=submit]{padding:10px 16px 8px;border-radius:4px;background:#475bb2;color:#fff;font-size:14px;font-weight:500}.user-registration.ur-frontend-form.ur-frontend-form--default .ur-button-container{display:block;margin-top:36px}
=======
.user-registration.ur-frontend-form {
background: #fff;
border: none;
padding: 24px 30px 30px; }
.user-registration.ur-frontend-form .ur-button-container {
display: block; }
.user-registration.ur-frontend-form .ur-form-row {
gap: 24px;
margin-bottom: 28px; }
.user-registration.ur-frontend-form .ur-button-container {
display: block;
margin-top: 36px; }
.user-registration.ur-frontend-form .ur-button-container .ur-submit-button br {
display: none; }
.user-registration.ur-frontend-form.ur-frontend-form--default .ur-form-row {
gap: 24px; }
.user-registration.ur-frontend-form.ur-frontend-form--default .ur-form-row .form-row .ur-label {
font-weight: 500;
font-size: 15px;
color: #383838; }
.user-registration.ur-frontend-form.ur-frontend-form--default .ur-form-row .form-row .input-wrapper input {
padding: 8px 10px 8px 14px;
margin-bottom: 4px;
border: 1px solid #E9E9E9;
border-radius: 4px; }
.user-registration.ur-frontend-form.ur-frontend-form--default .ur-form-row .form-row .input-wrapper input::placeholder {
font-size: 14px;
font-weight: 400;
color: #bababa;
text-transform: capitalize; }
.user-registration.ur-frontend-form.ur-frontend-form--default button[type=submit] {
padding: 10px 16px 8px;
border-radius: 4px;
background: #475bb2;
color: #fff;
font-size: 14px;
font-weight: 500; }
.user-registration.ur-frontend-form.ur-frontend-form--default .ur-button-container {
display: block;
margin-top: 36px; }
>>>>>>> Stashed changes
483 changes: 482 additions & 1 deletion assets/css/user-registration-form-preview-rtl.css

Large diffs are not rendered by default.

483 changes: 482 additions & 1 deletion assets/css/user-registration-form-preview.css

Large diffs are not rendered by default.

2,506 changes: 2,505 additions & 1 deletion assets/css/user-registration-rtl.css

Large diffs are not rendered by default.

2,506 changes: 2,505 additions & 1 deletion assets/css/user-registration.css

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions modules/functions-ur-modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -359,21 +359,27 @@ function ur_membership_install_required_pages() {
'name' => _x( 'membership-registration', 'Page slug', 'user-registration' ),
'title' => _x( 'Membership Registration', 'Page title', 'user-registration' ),
'content' => '[' . apply_filters( 'user_registration_form_shortcode_tag', 'user_registration_form' ) . ' id="' . esc_attr( $default_form_page_id ) . '"]',
'option' => 'user_registration_member_registration_page_id',
);

$pages['membership_pricing'] = array(
'name' => _x( 'membership-pricing', 'Page slug', 'user-registration' ),
'title' => _x( 'Membership Pricing', 'Page title', 'user-registration' ),
'content' => '[user_registration_membership_listing]',
'option' => ''
);
$pages['membership_thankyou'] = array(
'name' => _x( 'membership-thankyou', 'Page slug', 'user-registration' ),
'title' => _x( 'Membership Thankyou', 'Page title', 'user-registration' ),
'content' => '[user_registration_membership_thank_you]',
'option' => 'user_registration_thank_you_page_id',
);

foreach ( $pages as $key => $page ) {
ur_create_page( esc_sql( $page['name'] ), 'user_registration_' . $key . '_page_id', wp_kses_post( ( $page['title'] ) ), wp_kses_post( $page['content'] ) );
$post_id = ur_create_page( esc_sql( $page['name'] ), 'user_registration_' . $key . '_page_id', wp_kses_post( ( $page['title'] ) ), wp_kses_post( $page['content'] ) );
if ( ! empty( $page['option'] ) ) {
update_option( $page['option'], $post_id );
}
}

update_option( 'user_registration_membership_installed_flag', true );
Expand Down Expand Up @@ -450,7 +456,7 @@ function check_membership_field_in_form() {
foreach ( $modules as $module_key => $function_name ) {
if ( ! function_exists( $function_name ) ) {
eval(
"
"
function $function_name() {
return ur_check_module_activation('$module_key');
}
Expand Down

0 comments on commit 53491ae

Please sign in to comment.