'; } /** * Register and enqueue backend admin scripts and styles. */ public function enqueueBackendFiles($hook_suffix) { global $post; // phpcs:ignore WordPress.Security.NonceVerification.Recommended $post_type = isset($post->post_type) ? $post->post_type : (isset($_GET['post_type']) ? sanitize_text_field(wp_unslash($_GET['post_type'] ?? '')) : null); // Admin script & styles wp_register_script('bp3d-admin-script', BP3D_DIR . 'build/admin.js', ['jquery'], BP3D_VERSION, true); wp_register_style('bp3d-admin-style', BP3D_DIR . 'admin/css/admin-style.css', [], BP3D_VERSION); if (in_array($post_type, ['bp3d-model-viewer', 'product'], true)) { wp_enqueue_style('bp3d-admin-style'); wp_enqueue_style('bp3d-readonly-style'); wp_enqueue_script('bp3d-admin-script'); } } }