get('Version'); // Register and enqueue styles wp_register_style( 'blynex-block-styles', get_template_directory_uri() . '/build/style-index.css', [], $theme_version ); wp_enqueue_style('blynex-block-styles'); // Bail early if not in admin (we only need scripts in editor) if (! is_admin()) { return; } // Load editor scripts $asset_path = get_template_directory() . '/build/index.asset.php'; if (file_exists($asset_path)) { $asset_data = require $asset_path; // Register helper script wp_register_script( 'blynex-helper-script', get_template_directory_uri() . '/assets/js/helper.js', [], $theme_version, true ); // Register main editor script wp_register_script( 'blynex-block-editor-script', get_template_directory_uri() . '/build/index.js', $asset_data['dependencies'], $asset_data['version'], true ); // Enqueue scripts wp_enqueue_script('blynex-helper-script'); wp_enqueue_script('blynex-block-editor-script'); } } } // Initialize the class new Blynex_Block_Assets(); }