| @@ -1,26 +1,72 @@ | ||
| 1 | -<?php | |
| 1 | +<?php | |
| 2 | +if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly | |
| 3 | + | |
| 2 | 4 | // include individual modules |
| 3 | -$wppb_generalSettings = get_option('wppb_general_settings', 'not_found' ); | |
| 4 | -if ( ( $wppb_generalSettings != 'not_found' ) && ( $wppb_generalSettings['loginWith'] != 'email' ) ) | |
| 5 | - include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/username/username.php' ); | |
| 6 | - | |
| 7 | -include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/first-name/first-name.php' ); | |
| 8 | -include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/last-name/last-name.php' ); | |
| 9 | -include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/password/password.php' ); | |
| 10 | -include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/password-repeat/password-repeat.php' ); | |
| 5 | +function wppb_include_default_fields_files() { | |
| 6 | + $wppb_generalSettings = get_option('wppb_general_settings', 'not_found' ); | |
| 7 | + if ( ( $wppb_generalSettings != 'not_found' ) && ( $wppb_generalSettings['loginWith'] != 'email' ) ) | |
| 8 | + include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/username/username.php' ); | |
| 9 | + else{ | |
| 10 | + add_filter( 'wppb_output_display_form_field', 'wppb_remove_username_field_when_login_with_email', 10, 5 ); | |
| 11 | + function wppb_remove_username_field_when_login_with_email( $bool, $field, $form_type, $role, $user_id ){ | |
| 12 | + if( $field['field'] == 'Default - Username' ) | |
| 13 | + return false; | |
| 11 | 14 | |
| 12 | -// Default contact methods were removed in WP 3.6. A filter dictates contact methods. | |
| 13 | -if ( apply_filters( 'wppb_remove_default_contact_methods', get_site_option( 'initial_db_version' ) < 23588 ) ){ | |
| 14 | - include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/aim/aim.php' ); | |
| 15 | - include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/yim/yim.php' ); | |
| 16 | - include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/jabber/jabber.php' ); | |
| 15 | + return $bool; | |
| 16 | + } | |
| 17 | + } | |
| 18 | + | |
| 19 | + include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/first-name/first-name.php' ); | |
| 20 | + include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/last-name/last-name.php' ); | |
| 21 | + include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/password/password.php' ); | |
| 22 | + include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/password-repeat/password-repeat.php' ); | |
| 23 | + | |
| 24 | + // Default contact methods were removed in WP 3.6. A filter dictates contact methods. | |
| 25 | + if ( apply_filters( 'wppb_remove_default_contact_methods', get_site_option( 'initial_db_version' ) < 23588 ) ){ | |
| 26 | + include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/aim/aim.php' ); | |
| 27 | + include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/yim/yim.php' ); | |
| 28 | + include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/jabber/jabber.php' ); | |
| 29 | + } | |
| 30 | + | |
| 31 | + include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/nickname/nickname.php' ); | |
| 32 | + include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/description/description.php' ); | |
| 33 | + include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/website/website.php' ); | |
| 34 | + include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/email/email.php' ); | |
| 35 | + include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/display-name/display-name.php' ); | |
| 36 | + include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/headings/name.php' ); | |
| 37 | + include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/headings/contact-info.php' ); | |
| 38 | + include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/headings/about-yourself.php' ); | |
| 39 | + if ( wppb_can_users_signup_blog() ) { | |
| 40 | + include_once(WPPB_PLUGIN_DIR . '/front-end/default-fields/blog-details/blog-details.php'); | |
| 41 | + } | |
| 42 | + | |
| 43 | + /* added recaptcha and user role field since version 2.6.2 */ | |
| 44 | + include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/recaptcha/recaptcha.php' ); | |
| 45 | + include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/user-role/user-role.php' ); | |
| 46 | + | |
| 47 | + /* added recaptcha and user role field since version 2.8.2 */ | |
| 48 | + include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/gdpr/gdpr.php' ); | |
| 49 | + include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/gdpr-delete/gdpr-delete.php' ); | |
| 50 | + | |
| 51 | + /* added email-confirmation field in main plugin since version 3.3.4 */ | |
| 52 | + include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/email-confirmation/email-confirmation.php' ); | |
| 53 | + | |
| 54 | + // added extra fields since version 3.8.1 | |
| 55 | + if( !defined( 'WPPB_PAID_PLUGIN_DIR' ) || ( defined( 'WPPB_PAID_PLUGIN_DIR' ) && defined( 'PROFILE_BUILDER_PAID_VERSION' ) ) ){ | |
| 56 | + | |
| 57 | + include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/avatar/avatar.php' ); | |
| 58 | + include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/checkbox/checkbox.php' ); | |
| 59 | + include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/heading/heading.php' ); | |
| 60 | + include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/input/input.php' ); | |
| 61 | + include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/radio/radio.php' ); | |
| 62 | + include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/select/select.php' ); | |
| 63 | + include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/select2/select2.php' ); | |
| 64 | + include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/textarea/textarea.php' ); | |
| 65 | + | |
| 66 | + } | |
| 67 | + | |
| 68 | + /* added turnstile field since version 3.15. */ | |
| 69 | + include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/turnstile/turnstile.php' ); | |
| 70 | + | |
| 17 | 71 | } |
| 18 | - | |
| 19 | -include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/nickname/nickname.php' ); | |
| 20 | -include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/description/description.php' ); | |
| 21 | -include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/website/website.php' ); | |
| 22 | -include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/email/email.php' ); | |
| 23 | -include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/display-name/display-name.php' ); | |
| 24 | -include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/headings/name.php' ); | |
| 25 | -include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/headings/contact-info.php' ); | |
| 26 | -include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/headings/about-yourself.php' ); | |
| 72 | +wppb_include_default_fields_files(); | |