ChrisB
1
Hey,
I tried using an old snippet @yevhen shared to change the maximum number of tags allowed, but it doesn’t seem to be working…
add_filter(
'hivepress/v1/models/listing/attributes',
function( $attributes ) {
if ( isset( $attributes['tags'] ) ) {
$attributes['tags']['edit_field'] = array_merge(
$attributes['tags']['edit_field'],
[
'max_values' => 20,
]
);
}
return $attributes;
},
1000
);
Much appreciated if you’re able to help make this work! 
Cheers,
Chris 
ihor
6
Hi,
Please try this code snippet instead:
add_filter(
'hivepress/v1/models/listing/attributes',
function ( $attributes ) {
if ( isset( $attributes['tags'] ) ) {
$attributes['tags']['edit_field']['max_values'] = 20;
}
return $attributes;
},
1000
);
add_filter(
'hivepress/v1/models/listing',
function ( $model ) {
if ( isset( $model['fields']['tags'] ) ) {
$model['fields']['tags']['max_values'] = 20;
}
return $model;
},
1000
);
2 Likes
ChrisB
7
As always, many thanks for your help, @ihor! - You’re a legend.
Cheers,
Chris 
1 Like
system
Closed
8
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.