Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /** Removes registration/profile step if the user is already logged in */
- add_filter('wcfm_membership_registration_steps', function ($steps) {
- if (is_user_logged_in()) {
- if (isset($steps['registration'])) unset($steps['registration']);
- }
- return $steps;
- });
- /** Channge the current step to choose_membership if the user is already logged in */
- add_filter('wcfm_membership_registration_current_step', function ($step) {
- if (is_user_logged_in() && $step == 'registration') {
- $step = 'choose_membership';
- }
- return $step;
- });
- /** Recalculate the width of the progress step bar */
- add_action('wp_enqueue_scripts', function () {
- ob_start();
- ?>
- <style>
- .wcfm-membership-wrapper .wc-progress-steps li,
- .woocommerce-progress-form-wrapper .wc-progress-steps li {
- width: calc(100%/3);
- }
- </style>
- <?php
- $style = ob_get_clean();
- wp_add_inline_style('wcfm_membership_steps_css', $style, 'after');
- }, 11);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement