get('Version'); // Register and enqueue styles wp_register_style( 'caliph-block-styles', get_template_directory_uri() . '/build/style-index.css', [], $theme_version ); wp_enqueue_style('caliph-block-styles'); // Load frontend scripts (for non-admin pages) if (! is_admin()) { // Register and enqueue image filter frontend script wp_register_script( 'caliph-image-filter-frontend', get_template_directory_uri() . '/assets/js/image-filter-frontend.js', [], $theme_version, true ); wp_enqueue_script('caliph-image-filter-frontend'); } // Load editor scripts (for admin pages) if (is_admin()) { $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( 'caliph-helper-script', get_template_directory_uri() . '/assets/js/helper.js', [], $theme_version, true ); // Register main editor script wp_register_script( 'caliph-block-editor-script', get_template_directory_uri() . '/build/index.js', $asset_data['dependencies'], $asset_data['version'], true ); // Enqueue scripts wp_enqueue_script('caliph-helper-script'); wp_enqueue_script('caliph-block-editor-script'); } } } } // Initialize the class new Caliph_Block_Assets(); }