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?