PATH:
home
/
lab2454c
/
gemition.com
/
wp-content
/
plugins
/
mailchimp-for-wp
/
includes
/
admin
/
migrations
<?php defined( 'ABSPATH' ) or exit; $global_options = (array) get_option( 'mc4wp_form', array() ); // find all form posts $posts = get_posts( array( 'post_type' => 'mc4wp-form', 'post_status' => 'publish', 'numberposts' => -1, ) ); $css_map = array( 'default' => 'basic', 'custom' => 'styles-builder', 'light' => 'theme-light', 'dark' => 'theme-dark', 'red' => 'theme-red', 'green' => 'theme-green', 'blue' => 'theme-blue', 'custom-color' => 'theme-custom-color', ); $stylesheets = array(); foreach ( $posts as $post ) { // get form options from post meta directly $options = (array) get_post_meta( $post->ID, '_mc4wp_settings', true ); // store all global options in scoped form settings // do this BEFORE changing css key, so we take that as well. foreach ( $global_options as $key => $value ) { if ( strlen( $value ) > 0 && ( ! isset( $options[ $key ] ) || strlen( $options[ $key ] ) == 0 ) ) { $options[ $key ] = $value; } } // update "css" option value if ( isset( $options['css'] ) && isset( $css_map[ $options['css'] ] ) ) { $options['css'] = $css_map[ $options['css'] ]; } // create stylesheets option if ( ! empty( $options['css'] ) ) { $stylesheet = $options['css']; if ( strpos( $stylesheet, 'theme-' ) === 0 ) { $stylesheet = 'themes'; } if ( ! in_array( $stylesheet, $stylesheets ) ) { $stylesheets[] = $stylesheet; } } update_post_meta( $post->ID, '_mc4wp_settings', $options ); } // update stylesheets option update_option( 'mc4wp_form_stylesheets', $stylesheets ); // delete old options delete_option( 'mc4wp_form' );
[-] 3.0.0-form-3-messages.php
[edit]
[-] 4.1.3-reschedule-event.php
[edit]
[+]
..
[-] 3.0.0-integration-options.php
[edit]
[-] 4.0.0-hidden-fields-value-delimiter.php
[edit]
[-] 4.1.2-flush-list-cache.php
[edit]
[-] 3.0.0-general-options.php
[edit]
[-] 4.8.2-move-debug-log-to-subdirectory.php
[edit]
[-] 3.0.0-form-1-post-type.php
[edit]
[-] 3.1.6-woocommerce-position-prefix.php
[edit]
[-] 4.0.0-groupings-to-interests.php
[edit]
[-] 3.0.0-styles-builder.php
[edit]
[-] 3.0.3-usage-tracking-schedule.php
[edit]
[-] 3.0.0-widget-base-id.php
[edit]
[-] 3.0.0-form-2-options.php
[edit]
[-] 4.0.7-rename-debug-log-file.php
[edit]
[-] 4.6.0-remove-lists-from-options.php
[edit]