# ablocks/2.9.1/includes/import/theme-options/code-star.php

aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder &amp; Animation Builder, version 2.9.1. 40 lines.

- Page: https://pluginprobe.com/plugins/ablocks/2.9.1/code/includes/import/theme-options/code-star.php
- Raw: https://pluginprobe.com/plugins/ablocks/2.9.1/raw/includes/import/theme-options/code-star.php
- Modified: 2025-04-22T12:59:06+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/ablocks/2.9.1/code/includes/import/theme-options/code-star.php#L10-L20`.

```php
<?php

namespace ABlocks\import\ThemeOptions;

use ABlocks\Helper;

class CodeStar {

	public static function import( string $file_path ) {
		Helper::emit_sse_message([
			'action' => 'log',
			'level' => 'info',
			'message' => __( 'Starting CodeStar theme options import process.', 'ablocks' ),
		]);
		if ( file_exists( $file_path ) ) {
			//phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
			$options_data = json_decode( file_get_contents( $file_path ), true );

			// Apply the options data using Codestar functions
			if ( function_exists( 'cs_set_option' ) ) {
				foreach ( $options_data as $option_key => $option_value ) {
					cs_set_option( $option_key, $option_value );
				}
			}
			Helper::emit_sse_message([
				'action' => 'log',
				'level' => 'info',
				'message' => __( 'Codestar theme options imported successfully.', 'ablocks' ),
			]);
		} else {
			Helper::emit_sse_message([
				'action' => 'log',
				'level' => 'warning',
				'message' => __( 'Codestar theme options import file not found!', 'ablocks' ),
			]);
		}//end if
	}

}

```
