cf7-conditional-fields
Last commit date
js
19 hours ago
jsdoc-out
19 hours ago
test-results
2 months ago
Wpcf7cfMailParser.php
3 days ago
admin-style.css
2 years ago
admin-style.css.map
2 years ago
admin-style.scss
4 years ago
admin.php
19 hours ago
cf7cf.php
2 weeks ago
conditional-fields.php
19 hours ago
contact-form-7-conditional-fields.php
1 year ago
init.php
19 hours ago
readme.txt
19 hours ago
style.css
2 months ago
tg_pane_group.php
2 months ago
wpcf7cf-options.php
2 months ago
contact-form-7-conditional-fields.php
29 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Old main file upgrade routine (Thanks to RavanH for the idea) |
| 4 | * |
| 5 | * This is the old plugin main file, it was the main plugin file until version 2.5.4 |
| 6 | * We'll keep this file for a couple more versions before removing it definitively. |
| 7 | * |
| 8 | */ |
| 9 | |
| 10 | defined( 'WPINC' ) || die; |
| 11 | |
| 12 | $old = 'contact-form-7-conditional-fields.php'; |
| 13 | $new = 'conditional-fields.php'; |
| 14 | |
| 15 | // Change the active plugin settings to make WP start using the new one. |
| 16 | $active_plugins = (array) get_option( 'active_plugins', array() ); |
| 17 | |
| 18 | $old_plugin_array = array( basename( __DIR__ ) . '/' . $old ); |
| 19 | $active_plugins = array_diff( $active_plugins, $old_plugin_array ); |
| 20 | |
| 21 | $new_plugin = basename( __DIR__ ) . '/' . $new; |
| 22 | if ( ! in_array( $new_plugin, $active_plugins ) ) { |
| 23 | $active_plugins[] = $new_plugin; |
| 24 | |
| 25 | include_once __DIR__ . '/' . $new; |
| 26 | } |
| 27 | |
| 28 | // Update active plugins and never come back here. |
| 29 | update_option( 'active_plugins', $active_plugins ); |