post_type ) && AHA_ORBIT_TESTIMONIALS_CPT === $post->post_type ) || ( 'edit.php' === $hook && isset( $_GET['post_type'] ) && AHA_ORBIT_TESTIMONIALS_CPT === sanitize_key( $_GET['post_type'] ) // phpcs:ignore WordPress.Security.NonceVerification.Recommended ); // Always load admin.css so notice styles are available on every admin page. wp_enqueue_style( 'aha-orbit-testimonials-admin', AHA_ORBIT_TESTIMONIALS_URL . 'assets/css/admin.css', array(), AHA_ORBIT_TESTIMONIALS_VERSION ); // (Settings page no longer needs the color picker — colours are per-orbit in the metabox.) // Enqueue media uploader, color picker, and repeater JS only on the CPT edit screens. if ( in_array( $hook, array( 'post.php', 'post-new.php' ), true ) && isset( $post->post_type ) && AHA_ORBIT_TESTIMONIALS_CPT === $post->post_type ) { wp_enqueue_media(); // Color picker — used for the Design & Colours section in the Slider Settings metabox. wp_enqueue_style( 'wp-color-picker' ); wp_enqueue_script( 'wp-color-picker' ); wp_enqueue_script( 'aha-orbit-testimonials-admin-metabox', AHA_ORBIT_TESTIMONIALS_URL . 'assets/js/admin-metabox.js', array( 'jquery', 'wp-color-picker', 'jquery-ui-sortable' ), AHA_ORBIT_TESTIMONIALS_VERSION, true ); } unset( $is_settings_page, $is_cpt_screen ); } }