Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808
Warning: foreach() argument must be of type array|object, string given in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 813
pum_theme_migration_1( PUM_Model_Theme $theme )
Upgrade popup data to model v2.
Description Description
Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808
Warning: foreach() argument must be of type array|object, string given in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 813
Parameters Parameters
- $theme
-
(Required)
Source Source
File: includes/functions/themes/migrations.php
function pum_theme_migration_1( &$theme ) { $delete_meta = array( 'popup_theme_defaults_set' ); // Used to merge with existing values to ensure data integrity. $meta_defaults = pum_get_theme_v2_meta_defaults(); foreach ( array_keys( $meta_defaults ) as $group ) { // Get old data. $v1_meta_values = pum_get_theme_v1_meta( $group, $theme->ID ); // Loop over all fields which were merged and mark their meta keys for deletion. foreach ( $v1_meta_values as $old_meta_key => $old_meta_value ) { $delete_meta[] = "popup_theme_{$group}_{$old_meta_key}"; } $existing_v2_meta = $theme->get_meta( "popup_theme_{$group}" ); if ( ! empty( $existing_v2_meta ) ) { continue; } // Merge defaults. $values = wp_parse_args( $v1_meta_values, $meta_defaults[ $group ] ); // Update meta storage. $theme->update_meta( "popup_theme_{$group}", $values ); } /** * Clean up automatically. */ pum_cleanup_post_meta_keys( $theme->ID, $delete_meta ); }
Expand full source code Collapse full source code View on Trac
Changelog Changelog
Version | Description |
---|---|
1.8.0 | Introduced. |