PluginProbe
User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor / 2.7.1
User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor v2.7.1
4.0.2 4.0.1 4.0.0 3.16.6 3.16.5 3.16.4 3.16.3 3.16.2 3.16.1 3.16.0 3.15.9 3.9.9 3.9.5 3.9.6 3.9.7 3.9.8 1.1.7 1.1.8 1.1.9 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 All 340 releases
profile-builder / features / upgrades / upgrades.php

upgrades.php in User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor 2.7.1, at features/upgrades/upgrades.php

77 lines 2.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 include_once ( WPPB_PLUGIN_DIR.'/features/upgrades/upgrades-functions.php' );
3
4 /**
5 * Function that assures backwards compatibility for all future versions, where this is needed
6 *
7 * @since v.1.3.13
8 *
9 * @return void
10 */
11 function wppb_update_patch(){
12 if ( !get_option( 'wppb_version' ) ) {
13 add_option( 'wppb_version', '1.3.13' );
14
15 do_action( 'wppb_set_initial_version_number', PROFILE_BUILDER_VERSION );
16 }
17
18 $wppb_version = get_option( 'wppb_version' );
19
20 do_action( 'wppb_before_default_changes', PROFILE_BUILDER_VERSION, $wppb_version );
21
22 if ( version_compare( PROFILE_BUILDER_VERSION, $wppb_version, '>' ) ) {
23 if ( ( PROFILE_BUILDER == 'Profile Builder Pro' ) || ( PROFILE_BUILDER == 'Profile Builder Hobbyist' ) ){
24
25 /* stopped creating them on 01.02.2016 */
26 /*$upload_dir = wp_upload_dir();
27 wp_mkdir_p( $upload_dir['basedir'].'/profile_builder' );
28 wp_mkdir_p( $upload_dir['basedir'].'/profile_builder/attachments/' );
29 wp_mkdir_p( $upload_dir['basedir'].'/profile_builder/avatars/' );*/
30
31 // Flush the rewrite rules and add them, if need be, the proper way.
32 if ( function_exists( 'wppb_flush_rewrite_rules' ) )
33 wppb_flush_rewrite_rules();
34
35 wppb_pro_hobbyist_v1_3_13();
36 }
37
38 if ( PROFILE_BUILDER == 'Profile Builder Pro' ){
39 wppb_pro_v1_3_15();
40 }
41
42 update_option( 'wppb_version', PROFILE_BUILDER_VERSION );
43 }
44
45 //this should run only once, mainly if the old version is < 2.0 (can be anything)
46 if ( version_compare( $wppb_version, 2.0, '<' ) ) {
47 if ( ( PROFILE_BUILDER == 'Profile Builder Pro' ) || ( PROFILE_BUILDER == 'Profile Builder Hobbyist' ) || ( PROFILE_BUILDER == 'Profile Builder Free' ) ){
48 wppb_pro_hobbyist_free_v2_0();
49 }
50
51 if ( PROFILE_BUILDER == 'Profile Builder Pro' ){
52 wppb_pro_userlisting_compatibility_upgrade();
53 wppb_pro_email_customizer_compatibility_upgrade();
54 }
55 }
56
57 // this should run only once, mainly if the old version is < 2.2.5 (can be anything)
58 if ( version_compare( $wppb_version, '2.2.5', '<' ) ) {
59 if ( PROFILE_BUILDER == 'Profile Builder Pro' ) {
60 wppb_new_custom_redirects_compatibility();
61 }
62 }
63
64 if ( version_compare( $wppb_version, '2.2.5', '<=' ) ) {
65 if( is_multisite() ){
66 $wppb_general_settings = get_option( 'wppb_general_settings', 'not_set' );
67 if ( $wppb_general_settings != 'not_set' ) {
68 $wppb_general_settings['emailConfirmation'] = 'yes';
69 update_option('wppb_general_settings', $wppb_general_settings);
70 }
71 }
72
73 }
74
75 do_action ( 'wppb_after_default_changes', PROFILE_BUILDER_VERSION, $wppb_version );
76 }
77 add_action ( 'init', 'wppb_update_patch' );