Area/Polygon Bias

Polygon Area Bias

Getting everyone to agree on a standard set of shapes of locations is difficult. Because of this challenge Slipstream and HJI WordPress plugins can switch between the 2 prevailing ideas of what a location shape should be with a simple filter.

The 2 types of city level areas available in Slipstream are called Postal Cities and Census Places. You can read more about the differences and how this works directly on the Slipstream documentation page for Area Bias which covers this topic in great depth. The default bias for our WordPress plugins is Postal City but this can be altered with a standard WordPress hook.

Changing the Area Bias

Changing the area bias for a website is easy and requires a simple WordPress hook which can be added to your themes function.php file or as a plugin (the preferred method). The hook is actually loaded in the Membership plugin but documentation is under the rIDX plugin because most of the issues related to users wanting to change the bias are because of inconsistencies with listing results for a specific shape.

Membership version 2.6.0 introduced the area bias hook. The default bias is  Postal City.

Area Bias WordPress Hooks

Please Note
It's important to note that changing the area bias for a website is a global option. This could negatively impact your website's user experience if you have GeoFarms or other content pages with listings already setup on the site. For more information about the ramifications of changing this setting, please contact an HJI support specialist.

Census Place Bias Hook

<?php

/**
 * @since 2.6.0
 */
function setCensusPlaceAreaBias()
{
    // Turn on Census Place bias

    \hji\membership\Membership::settings()->setCensusPlaceBias();
}
add_action('init', 'setCensusPlaceAreaBias', 9);

Postal City Bias Hook

There should be no reason to use the code below as Membership defaults to the Postal City bias. But the code is posted here anyway for posterity.

<?php

/**
 * @since 2.6.0
 */
function setPostalCityAreaBias()
{
    // Turn on Postal City bias

    \hji\membership\Membership::settings()->setPostalCityBias();
}
add_action('init', 'setPostalCityAreaBias', 9);

Still need help? Contact Us Contact Us