You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wonder whether it would make sense for isset() to take empty arrays into account?
If I correctly understand the application, it is used to check if a widget field is undefined, null or ''.
However, unpopulated media-input-fields with a "multiple" parameter set to true, can return an empty array, right?
(At least I get an empty array, when I delete all existing videos from a 'video-input' field.)
Of course, a user could simply implement something like the following:
// Uses the input of a media field to test whether media was added to it.functionisMediaFieldPopulated(input){return(input&&(Array.isArray(input) ? (input.length>0) : true));}
The text was updated successfully, but these errors were encountered:
The isset function was made in reference to the PHP counterpart.
For the specific case of this toolset, I just added an option to check for empty strings as well.
What you mean would be something like empty, but that is a very blunt function and might introduce some unexpected bugs, so I decided against it.
But yeah, I might add something specifically for (multiple) media-inputs in the future.
There are a few things I wanted to update anyways, when I find some time.
I wonder whether it would make sense for
isset()
to take empty arrays into account?If I correctly understand the application, it is used to check if a widget field is
undefined
,null
or''
.However, unpopulated media-input-fields with a "multiple" parameter set to
true
, can return an empty array, right?(At least I get an empty array, when I delete all existing videos from a 'video-input' field.)
Of course, a user could simply implement something like the following:
The text was updated successfully, but these errors were encountered: