'string', 'single' => true, 'show_in_rest' => false, 'auth_callback' => function ( $allowed, $meta_key, $post_id ): bool { return $post_id ? current_user_can( 'edit_post', $post_id ) : current_user_can( 'edit_products' ); }, ) ); } add_filter( 'woocommerce_duplicate_product_exclude_meta', array( self::class, 'excludeMarksFromDuplicate' ) ); } /** * Exclude content-marking postmeta from WooCommerce product duplication so a * cloned product does not inherit the source product's AI provenance marks. * * @param array $meta_keys Meta keys WooCommerce already excludes from the clone. * @return array */ public static function excludeMarksFromDuplicate( array $meta_keys ): array { return array_values( array_unique( array_merge( $meta_keys, MetaKeys::allKeys() ) ) ); } }