$node ) { if ( isset( $node->settings ) && is_object( $node->settings ) ) { $data[ $node_id ]->settings = self::filter_node_settings( $node->type, $node->settings ); } } return $data; } /** * Ensures settings are backwards compatible for a single node. * * @since 2.2 * @param string $type * @param object $settings * @return object */ static public function filter_node_settings( $type, $settings ) { // Filter raw module settings without defaults first. if ( 'module' === $type && isset( FLBuilderModel::$modules[ $settings->type ] ) ) { $module = FLBuilderModel::$modules[ $settings->type ]; $settings = $module->filter_raw_settings( $settings ); } // Make sure the defaults are merged. $settings = FLBuilderModel::get_node_settings_with_defaults_merged( $type, $settings ); // Filter with the generic helper for all node types. $settings = self::$helpers['generic']->filter_settings( $settings ); // Filter with a node specific helper if one is available. $helper = isset( self::$helpers[ $type ] ) ? self::$helpers[ $type ] : null; if ( $helper ) { $settings = $helper->filter_settings( $settings ); } // Filter with a module specific helper if one is available. if ( 'module' === $type && isset( FLBuilderModel::$modules[ $settings->type ] ) ) { $module = FLBuilderModel::$modules[ $settings->type ]; $settings = $module->filter_settings( $settings, self::$helpers['module'] ); } return $settings; } } FLBuilderSettingsCompat::init();