wordpress/wp-content/themes/basic/themify/themify-builder/classes/class-themify-builder-stylesheet.php
/**
	* If post doesn't have generated css file,generate an unique Id for each component in the builder
	* 
	* @return array
	*/
If post doesn't have generated css file,generate an unique Id for each component in the builder

@return array
If post doesn ' t have generated css file generate an unique Id for each component in the builder @return array
private  static function reSaveData($data){
	    foreach($data as &$r){
		if(isset($r['cid'])){
		    unset($r['cid']);
		}
		if(!isset($r['element_id'])){
		    $r['element_id'] = Themify_Builder_Model::generateID();
		}
		unset($r['row_order']);
		$r['element_id'] = self::checkUniqId($r['element_id']);
		if (!empty($r['cols'])) {
		    foreach($r['cols'] as &$c){
			if(!isset($c['element_id'])){
			    $c['element_id'] = Themify_Builder_Model::generateID();
			}
			unset($c['column_order']);
			$c['element_id'] = self::checkUniqId($c['element_id']);
			if(isset($c['cid'])){
			    unset($c['cid']);
			}
			if (!empty($c['modules'])) {
			    foreach($c['modules'] as &$m){
					if ( ! is_array( $m ) ) {
						continue;
					}
				if(!isset($m['element_id'])){
				    $m['element_id'] = Themify_Builder_Model::generateID();
				}
				unset($m['row_order']);
				$m['element_id'] = self::checkUniqId($m['element_id']);
				if(isset($m['mod_settings']['cid'])){
				    unset($m['mod_settings']['cid']);
				}
				if (!empty($m['cols'])) {
				    foreach ($m['cols'] as &$sub_col) {
					if(!isset($sub_col['element_id'])){
					    $sub_col['element_id'] = Themify_Builder_Model::generateID();
					}
					unset($sub_col['column_order']);
					$sub_col['element_id'] = self::checkUniqId($sub_col['element_id']);
					if(isset($sub_col['cid'])){
					    unset($sub_col['cid']);
					}
					if (!empty($sub_col['modules'])) {
					    foreach ($sub_col['modules'] as &$sub_m) {
						if(!isset($sub_m['element_id'])){
						    $sub_m['element_id'] = Themify_Builder_Model::generateID();
						}
						$sub_m['element_id'] = self::checkUniqId($sub_m['element_id']);
						if(isset($sub_m['mod_settings']['cid'])){
						    unset($sub_m['mod_settings']['cid']);
						}
					    }
					}
				    }
				}
			    }
			}
		    }
		}
	    }
	    self::$ids = array();
	    return $data;
	}
private static function reSaveData ( $ data ) { foreach ( $ data as & $ r ) { if ( isset ( $ r [ 'cid' ] ) ) { unset ( $ r [ 'cid' ] ) ; } if ( ! isset ( $ r [ 'element_id' ] ) ) { $ r [ 'element_id' ] = Themify_Builder_Model :: generateID ( ) ; } unset ( $ r [ 'row_order' ] ) ; $ r [ 'element_id' ] = self :: checkUniqId ( $ r [ 'element_id' ] ) ; if ( ! empty ( $ r [ 'cols' ] ) ) { foreach ( $ r [ 'cols' ] as & $ c ) { if ( ! isset ( $ c [ 'element_id' ] ) ) { $ c [ 'element_id' ] = Themify_Builder_Model :: generateID ( ) ; } unset ( $ c [ 'column_order' ] ) ; $ c [ 'element_id' ] = self :: checkUniqId ( $ c [ 'element_id' ] ) ; if ( isset ( $ c [ 'cid' ] ) ) { unset ( $ c [ 'cid' ] ) ; } if ( ! empty ( $ c [ 'modules' ] ) ) { foreach ( $ c [ 'modules' ] as & $ m ) { if ( ! is_array ( $ m ) ) { continue ; } if ( ! isset ( $ m [ 'element_id' ] ) ) { $ m [ 'element_id' ] = Themify_Builder_Model :: generateID ( ) ; } unset ( $ m [ 'row_order' ] ) ; $ m [ 'element_id' ] = self :: checkUniqId ( $ m [ 'element_id' ] ) ; if ( isset ( $ m [ 'mod_settings' ] [ 'cid' ] ) ) { unset ( $ m [ 'mod_settings' ] [ 'cid' ] ) ; } if ( ! empty ( $ m [ 'cols' ] ) ) { foreach ( $ m [ 'cols' ] as & $ sub_col ) { if ( ! isset ( $ sub_col [ 'element_id' ] ) ) { $ sub_col [ 'element_id' ] = Themify_Builder_Model :: generateID ( ) ; } unset ( $ sub_col [ 'column_order' ] ) ; $ sub_col [ 'element_id' ] = self :: checkUniqId ( $ sub_col [ 'element_id' ] ) ; if ( isset ( $ sub_col [ 'cid' ] ) ) { unset ( $ sub_col [ 'cid' ] ) ; } if ( ! empty ( $ sub_col [ 'modules' ] ) ) { foreach ( $ sub_col [ 'modules' ] as & $ sub_m ) { if ( ! isset ( $ sub_m [ 'element_id' ] ) ) { $ sub_m [ 'element_id' ] = Themify_Builder_Model :: generateID ( ) ; } $ sub_m [ 'element_id' ] = self :: checkUniqId ( $ sub_m [ 'element_id' ] ) ; if ( isset ( $ sub_m [ 'mod_settings' ] [ 'cid' ] ) ) { unset ( $ sub_m [ 'mod_settings' ] [ 'cid' ] ) ; } } } } } } } } } } self :: $ ids = array ( ) ; return $ data ; }
If post doesn't have generated css file,generate an unique Id for each component in the builder
If post doesn ' t have generated css file generate an unique Id for each component in the builder