Is there official documentation on this - attributes not an option in the filter
add_filter(
'hivepress/v1/models/listing/attributes', function( $attributes ) {
$attributes['towns'] = [
'editable' => true,
full current code is add_filter(
'hivepress/v1/models/listing/attributes', function( $attributes ) {
$attributes['towns'] = [
'editable' => true,
'searchable' => true, // Make the attribute searchable
//'filterable' => true,
'sortable' => true,
'indexable' => true,
'display_areas' => ['view_block_secondary','view_page_primary','view_page_secondary'],
'edit_field' => [
'label' => 'Town',
'type' => 'select',
'source' => hivepress()->router->get_url('http://api.geonames.org/searchJSON?country=IE&featureClass=P&maxRows=1000&username=swdadmin'),
'_external' => true,
'_order' => 103,
'options' => fetch_irish_towns_from_geonames(),
'required' => false,
'attributes' => _location,
'data-options' => wp_json_encode(
[
'disable-search' => false
]),
],
But it throws errors: Warning : Undefined variable $attributes in /home/customer/www/storycinn.com/public_html/wp-content/themes/listinghive/functions.php on line 76
Fatal error : Uncaught Error: Undefined constant “_location” in /home/customer/www/storycinn.com/public_html/wp-content/themes/listinghive/functions.php:28 Stack trace: #0 /home/customer/www/storycinn.com/public_html/wp-includes/class-wp-hook.php(324): {closure}(Array) #1 /home/customer/www/storycinn.com/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array) #2 /home/customer/www/storycinn.com/public_html/wp-content/plugins/hivepress/includes/components/class-attribute.php(590): apply_filters(‘hivepress/v1/mo…’, Array) #3 /home/customer/www/storycinn.com/public_html/wp-includes/class-wp-hook.php(324): HivePress\Components\Attribute->register_attributes(‘’) #4 /home/customer/www/storycinn.com/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #5 /home/customer/www/storycinn.com/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #6 /home/customer/www/storycinn.com/public_html/wp-settings.php(700): do_action(‘init’) #7 /home/customer/www/storycinn.com/public_html/wp-config.php(103): require_once(‘/home/customer/…’) #8 /home/customer/www/storycinn.com/public_html/wp-load.php(50): require_once(‘/home/customer/…’) #9 /home/customer/www/storycinn.com/public_html/wp-blog-header.php(13): require_once(‘/home/customer/…’) #10 /home/customer/www/storycinn.com/public_html/index.php(17): require(‘/home/customer/…’) #11 {main} thrown in /home/customer/www/storycinn.com/public_html/wp-content/themes/listinghive/functions.php on line 28
There has been a critical error on this website.
THe values are to be dynamic if I send the current request its not pulling the dynamic value change. So it works for the initial set value but not on values that are outside the intial value