FacetWP – use $_GET variables or the ajax equivalents

<?php

function custom_get_url_val( $name, $default_val = false ) {
    if ( isset( $_GET[ $name ] ) {
        return $_GET[ $name ];
    }
    elseif ( function_exists( 'FWP' ) ) {
        if ( isset( FWP()->facet->http_params['get'][ $name ] ) ) {
            return FWP()->facet->http_params['get'][ $name ];
        }
    }

    return $default_val;
}