Last active
September 11, 2017 20:57
-
-
Save pravdomil/8ef3942ec10fdcde0e2d7c8afe08df62 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if(get_current_user_id() == 1) { | |
$ids = get_all_page_ids(); | |
foreach($ids as $id) { | |
$data = get_post_meta($id, 'panels_data'); | |
if(!$data) { continue; } | |
$data = $data[0]; | |
foreach($data['widgets'] as $key => $widget) { | |
if($widget['panels_info']['class'] == 'old_class') { | |
$data['widgets'][$key]['panels_info']['class'] = 'new_class'; | |
} | |
} | |
update_post_meta($id, 'panels_data', $data); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment