Change property "maxlength" for title on submit listing form

Hi, I want to change the ‘maxlength’ property for the title field in the submit listing form, I’m trying this snippet but its not working, any help where am I making a mistake?

add_filter(
	'hivepress/v1/models/listing/attributes',
	function( $attributes ) {
		if ( isset( $attributes['title'] ) ) {
			$attributes['title']['edit_field']['maxlength'] = '20';
		}

		return $attributes;
	},
	1000
);

Thanks!

Hi,

Please use this PHP sample snippet: Change maximum length of title and description for listings #hivepress #listings · GitHub

​I hope this is helpful to you.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.