wordpress/wp-content/themes/basic/themify/themify-builder/classes/class-builder-data-manager.php
/**
	 * Construct data builder for saving.
	 * 
	 * @access public
	 * @param array $builder_data 
	 * @param int $post_id 
	 * @param string $action 
	 * @return array
	 */
Construct data builder for saving.


Construct data builder for saving .
public static function construct_data( $builder_data, $post_id, $action='main' ) { 
		if( is_serialized( $builder_data ) ) {
			$builder_data = stripslashes_deep( unserialize( $builder_data ) );
		} elseif( is_string( $builder_data ) ) { 
			$converted = json_decode( $builder_data );
			if( is_array( $converted ) ) {
				$builder_data = $converted;
			}
			$converted=null;
		}
		$builder_data = apply_filters( 'themify_builder_data_before_construct', $builder_data, $post_id );
		if ($action==='import' && is_array($builder_data) && !empty($builder_data)) {
			$builder_data = Themify_Builder_Import_Export::replace_export(json_decode(json_encode($builder_data),true),$post_id);
		}
		elseif($action==='main'){
		    $builder_data = self::json_remove_unicode( $builder_data );
		    $builder_data = map_deep( $builder_data, array( __CLASS__, 'unescape_home_url' ) );
		}
		return $builder_data;
	}
public static function construct_data ( $ builder_data , $ post_id , $ action = 'main' ) { if ( is_serialized ( $ builder_data ) ) { $ builder_data = stripslashes_deep ( unserialize ( $ builder_data ) ) ; } elseif ( is_string ( $ builder_data ) ) { $ converted = json_decode ( $ builder_data ) ; if ( is_array ( $ converted ) ) { $ builder_data = $ converted ; } $ converted = null ; } $ builder_data = apply_filters ( 'themify_builder_data_before_construct' , $ builder_data , $ post_id ) ; if ( $ action === 'import' && is_array ( $ builder_data ) && ! empty ( $ builder_data ) ) { $ builder_data = Themify_Builder_Import_Export :: replace_export ( json_decode ( json_encode ( $ builder_data ) , true ) , $ post_id ) ; } elseif ( $ action === 'main' ) { $ builder_data = self :: json_remove_unicode ( $ builder_data ) ; $ builder_data = map_deep ( $ builder_data , array ( __CLASS__ , 'unescape_home_url' ) ) ; } return $ builder_data ; }
Construct data builder for saving.
Construct data builder for saving .
/* if it's serialized, convert to array */ /* perhaps it's a JSON string */ /* validation: convert to JSON and see if it works */ /**
		     * Ensure site URLs are saved without being escaped
		     * This is so the "search and replace" tools can later find the site URL without issue
		     * Ticket: #5336
		     */