Ejemplo n.º 1
0
 public function check_for_revisions()
 {
     global $wp_customize;
     if (get_option('layers_init_revisions')) {
         return;
     }
     // Get a list of the migrator
     $get_layers_pages = layers_get_builder_pages(500);
     if (empty($get_layers_pages)) {
         return;
     }
     $revisions_exist = FALSE;
     // Loop through the builder pages spooling up the widget data each time
     foreach ($get_layers_pages as $page) {
         if ('' !== get_post_meta($page->ID, '_layers_hash', true)) {
             $revisions_exist = TRUE;
         }
     }
     if (!$revisions_exist) {
         add_filter('_wp_post_revision_fields', array($this, 'add_revision_fields'));
         layers_backup_sidebars_widgets(TRUE);
         add_option('layers_init_revisions', TRUE);
     }
 }
Ejemplo n.º 2
0
/**
 * Port Widgets between Layers Parent theme and Child themes
 */
function layers_backup_site($value)
{
    $theme = wp_get_theme();
    $widget_data = $value['data'];
    if (isset($widget_data['wp_inactive_widgets'])) {
        unset($widget_data['wp_inactive_widgets']);
    }
    update_option('layers_tm_backup', get_theme_mods());
    update_option('layers_wgt_backup', $widget_data);
    layers_backup_sidebars_widgets();
}