Add more formatting options to textarea fields

I added the below code snippet in order to delete links in the editor and to add more formatting options. However, the user then can not write messages to the listings (reply to listing button).

add_filter( 
	'hivepress/v1/fields/textarea', 
	function ($field_args, $field){
		$html = hivepress()->helper->get_array_value($field_args, 'html');
		
		if(!$html){
			return $field_args;
		}
		
		$field_args['editor'] = [
			'toolbar1'    => implode(
				',',
				[
					'italic',
					'underline',
					'strikethrough',
				]
			),
			'toolbar2'    => '',
			'toolbar3'    => '',
			'toolbar4'    => '',
			'elementpath' => false,
		];
		return $field_args;
	}, 
	1000,
	2
);

Any way to fix this code snippet to allow the messages? Thank you

1 Like

Please try using other filter hooks, e.g. hivepress/v1/models/listing instead of the global textarea one because it’ll affect any other textarea fields, not just the listing description.

1 Like

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