Forum Replies Created
-
AuthorPosts
-
March 22, 2019 at 3:27 PM in reply to: ✅Fields not showing: Warning: Invalid argument supplied for foreach() #13865
Ale
ParticipantEmail sent, thanks.
March 21, 2019 at 5:43 PM in reply to: ✅Fields not showing: Warning: Invalid argument supplied for foreach() #13842Ale
ParticipantI re-uploaded one image and then that one and others start showing up, this is what I get with the images that are being displayed:
array(1) { [0]=> string(4) "1227" }I've tried to re upload all images and the message Warning: Invalid argument supplied for foreach() randomly shows in some images every time I update.
??♂️
March 20, 2019 at 7:12 PM in reply to: ✅Fields not showing: Warning: Invalid argument supplied for foreach() #13817Ale
ParticipantHere's the relevant part of the code.
the line with Warning: Invalid argument supplied for foreach() is the one with:
foreach ( $image_fields as $object_img ) {Ale
ParticipantThanks Anh! Works great.
Ale
ParticipantThanks Anh.
Ale
ParticipantAdding clone_default for every subfield did the trick, thanks.
Ale
ParticipantThis is great and std is working as expected.
Not sure if I should open a new topic but now the values from a field inside a group aren't being copied when a field is in a group. Each clonable group has 'clone_default' => true
Ale
ParticipantThanks Anh for your reply, I will try what you suggest.
Ale
ParticipantAny new reply on this? Thanks.
Ale
ParticipantThanks Anh Tran, as you guessed and after updating to PHP 7.0, the error has stopped showing.
Ale
ParticipantI'm having similar issues with std values not being added, I've updated today
MB Group to Version 1.2.18 and Metabox to Version 4.16.1.Is there any upcoming update that will fix this?
Ale
ParticipantThanks, it works well but I am looking for a way that password protection applies to all registered metaboxes, otherwise I need to add the conditionals in every place that I display a metabox field.
Is there such a way?
Ale
ParticipantThis is my metabox
The problem appears when I try to use metaboxes with a private or password protected post.
Thanks!
Ale
ParticipantHello Farheen,
Sure no problem. A text field can be set with a default value using:
'std' => 'The default text.'If I actually change the text field with anything other, I have no way to go back to the original default value, is there a way to add a button that resets the original default value?
Thanks.
Ale
ParticipantHello Anh,
Interestingly, I've found that if set clone_default for the container groups to false, the TypeError error disappears.
Could clone_default be what triggers this error?
BTW, I've tried the previous code in a new WordPress installation with a TwentySeventeen and I still had the same TypeError problem.
-
AuthorPosts