-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
When working with inputfields you can add notes like this from the API:
$f->notes = 'I have something to say...';
This is great. However, this will overwrite any notes that the inputfield might have had set before. This might be intentional or might not.
If you do want to keep previously set notes, you can do this:
$f->notes .= "\nThis is a new note";
Easy, right? Not quite. The problem here is that if the field did not have any notes it will lead to an empty newline at the beginning of the note.
This is my fix:
$f->notes .= $f->notes ? "\n" : '';
$f->notes .= 'My new note';
But this is tedious! Could the admin trim spaces and newlines from notes automatically?
Thx in advance!
Metadata
Metadata
Assignees
Labels
No labels