PluginProbe
Boxzilla – WordPress Popup Builder / 3.4.8
Boxzilla – WordPress Popup Builder v3.4.8
3.4.11 3.4.10 3.4.9 3.4.3 3.4.4 3.4.5 3.4.6 3.4.7 3.4.8 trunk 3.0 3.0.1 3.0.2 3.0.3 3.1 3.1.1 3.1.10 3.1.11 3.1.12 3.1.13 3.1.14 3.1.15 3.1.16 3.1.17 3.1.18 All 72 releases
boxzilla / src / admin / migrations / 3.1-cookie-option.php

3.1-cookie-option.php in Boxzilla – WordPress Popup Builder 3.4.8, at src/admin/migrations/3.1-cookie-option.php

25 lines 577 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 defined('ABSPATH') or exit;
4
5 $posts = get_posts([ 'post_type' => 'boxzilla-box' ]);
6
7 if (! empty($posts)) {
8 foreach ($posts as $post) {
9 $settings = get_post_meta($post->ID, 'boxzilla_options', true);
10
11 if (! is_array($settings)) {
12 continue;
13 }
14
15 // translate from days to hours
16 $new_value = intval($settings['cookie']) * 24;
17
18 // store in new location
19 $settings['cookie'] = [
20 'dismissed' => $new_value,
21 ];
22 update_post_meta($post->ID, 'boxzilla_options', $settings);
23 }
24 }
25