Skip to content

Instantly share code, notes, and snippets.

@pravdomil
Last active September 11, 2017 20:57
Show Gist options
  • Save pravdomil/8ef3942ec10fdcde0e2d7c8afe08df62 to your computer and use it in GitHub Desktop.
Save pravdomil/8ef3942ec10fdcde0e2d7c8afe08df62 to your computer and use it in GitHub Desktop.
<?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