HEX
Server: nginx/1.24.0
System: Linux 0c1023d6c65e 6.8.0-137-generic #137-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 17 20:28:23 UTC 2026 x86_64
User: root (0)
PHP: 8.3.33
Disabled: NONE
Upload Files
File: /var/www/html/wp-content/mu-plugins/ethnic-consultation-routing.php
<?php
/**
 * Plugin Name: Ethnic Consultation Routing
 * Description: Routes consultation-focused CTAs to the Schedule a Call page.
 * Version: 1.0.0
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

if ( ! function_exists( 'ethnic_consultation_schedule_call_url' ) ) {
	function ethnic_consultation_schedule_call_url( $args = array() ) {
		$url = home_url( '/schedule-a-call/' );

		if ( empty( $args ) ) {
			return $url;
		}

		return add_query_arg( $args, $url );
	}
}

if ( ! function_exists( 'ethnic_consultation_route_contact_url' ) ) {
	function ethnic_consultation_route_contact_url( $args = array(), $contact_url = '' ) {
		$args        = is_array( $args ) ? $args : array();
		$contact_url = is_string( $contact_url ) && '' !== $contact_url ? $contact_url : home_url( '/contact-us/' );
		$intent      = isset( $args['intent'] ) ? sanitize_key( (string) $args['intent'] ) : '';

		if ( 'consultation' === $intent ) {
			return ethnic_consultation_schedule_call_url( $args );
		}

		if ( empty( $args ) ) {
			return $contact_url;
		}

		return add_query_arg( $args, $contact_url );
	}
}