$style ) { if ( isset( $style['label'] ) && Template_Library_Import_Export_Utils::LOCAL_CLASS_LABEL === $style['label'] ) { return $style_id; } } return null; } private static function is_global_class_id( string $class_id ): bool { return str_starts_with( $class_id, Template_Library_Import_Export_Utils::GLOBAL_CLASS_ID_PREFIX ); } private static function should_flatten_class_id( string $class_id, array $items, ?array $ids_to_flatten ): bool { if ( ! isset( $items[ $class_id ] ) ) { return false; } if ( null !== $ids_to_flatten && ! isset( $ids_to_flatten[ $class_id ] ) ) { return false; } return true; } private static function create_local_class_id( array $element_data ): string { return Template_Library_Import_Export_Utils::LOCAL_CLASS_ID_PREFIX . substr( $element_data['id'] ?? '', 0, 8 ) . '-' . Template_Library_Import_Export_Utils::generate_random_string(); } private static function build_local_class_style( string $local_id, array $variants ): array { return [ 'id' => $local_id, 'label' => Template_Library_Import_Export_Utils::LOCAL_CLASS_LABEL, 'type' => 'class', 'variants' => $variants, ]; } }