Best practice when it comes to adding "description" and "placeholders"

First of all, I’d like to point out that I have close to zero experience and understanding when it comes to programming. I am mostly getting my snippets from hivepress resources.

That out of the way, I’ve got a question.

When I was gonna add a description to the “post a request” form, I’ve came across two ways of doing this:

add_filter(
	'hivepress/v1/models/request',
	function( $model ) {		
		$model['fields']['description'] = array_merge($model['fields']['description'], [
				'description'     => 'custom text here',
		]);*/

		return $model;
	},
	100
);

and

add_filter(
	'hivepress/v1/forms/request_update',
	function( $form ) {
		if(isset($form['fields']['description'])){		  	
			$form['fields']['description']['description'] = 'custom text here';			
		}
	
		
		return $form;
	},
	1000
);

Now, both of these code-snippets gets the job done. However, keeping in mind I want the core functionality of Hivepress/Taskhive to work today and in the future, also after updates to the plugin and theme, is there one way of doing it that is better/safer, or does it not matter?

Any explaination, ELI5, on the difference between these two?

The second snippet is more appropriate because it overrides the field description only, while the first one adds a description to the request itself (the form inherits it but it makes no sense to add description there). Also, the second one overrides the description parameter only, while the first one merges arrays of parameters.

Thank you for your input

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