can you point me to what modifcations I need to do to use the media selector to input multiple Images ? I have a database table that carries all the images of an entity so it might be 1 image it might be a 100, how can I modify this code to accept multiple images
Thanks for the great episodes!. A couple of things the (e) being past is for event not element. eg. event.preventDefault. and I wondered why you didnt target the button using the selector $('.js-image-upload').on('click touch', function() .... also with variable naming conventions the $ is used when the variable is a jQuery Object. Great videos mate thanks!
Thanks for the tutorial, this was very helpful. The wordpress codex on wp.media isn't particularly helpful, any ideas on where to go for more information? Specifically, I'm looking for a way to have the media uploader resize the image and only save the resized image. I just put this up on Stack Overflow too.
Why save button is disabled after selecting an image? To actually be able to save the changes, we have to type anything in any field text to enable the save button. That's kinda weird
That's WordPress not detecting any changes to the widget. You can overcome this issue by removing the diasbled attribute from the button after the image was picked. You can do that in the javascript file.
Im having the same issue , can you pretty please with sugar on top , explain with a little bit more details on how to solve this problem ? . "You can overcome this issue by removing the diasbled attribute from the button after the image was picked. You can do that in the javascript file." I have no "diasbled" attribute on the button in the js file. Thanks. You're awesome.
This was again a Very Nice Trip through WordPress! Thanks so much Alexander!!! A simple solution to enable the button seems to be triggering a change on the input: button.siblings(".image-upload").val(attachment.url).trigger("change"); Credit goes to wordpress.stackexchange.com/questions/153080/changes-in-widget-customizer-not-triggering-save-and-publish
If you select an image and then click on 'Save' button the widget will be refreshed, which will break the 'click' event binding from the 'Select image' button. So you will not be able to open the media uploader again till you refresh the admin page. Setting 'customize_selective_refresh = false' will not help. PS. Thanks A LOT for the giant work that you're doing!
Thanks #Alecad for this great series. learned a lot from this series. While following the tutorials just stepped on this issue. Problem is related to widget lifecycle and Found a solution here: wordpress.stackexchange.com/questions/91455/how-do-i-rebind-event-after-widget-save
Hi alex ... Thanks for your effort in your courses i really appreciate it I just finished WP 101 and i will go to Sunset series but i inquiry what we will build excatly in this Plugin development series .. I try to understand but nothing ... Thanks alot bro for every thing and keep going
This plugin series is a bit more advanced and it's based on OOP, it's normal to not grasp it the first time, but you'll get there. Keep watching my videos and you'll learn everything you need. Happy Coding!
Oh, sorry :D Not a specific plugin, but a massive collection of multiple features that can be activated from within the plugin. So far we built a CPT manager, Taxonomy Manager, Custom Widgets, and we'll continue with more awesome stuff.
hi on this tutorial, i know that you saw a problem after selecting the image you needed to change the image url to activate the save button. i think you did not select the right event in js
Excellent as usual; I have learnt so much from your tutorials. However, in my copy of your code if I select a new image this does not trigger the save button in the widget form. The button will show save if I edit the input field directly. I don't know what is happening yet, but will have to look at it later this evening. I thank you once again for your brilliant tutorials.
Yeah, that happens to me too. You could simply remove the disabled attribute of the button in jQuery when you select an image. That should be an easy workaround.
Hi, thanks for the tutorial. I have been using this method but recently it stopped working, maybe because of a wordpress update. I think that file_frame.on('select', function... no longer works. Have you come across this issue?
Ehehe, well, yeah :D If you're following a tutorial, better not using your own methods because if something doesn't work it gets pretty hard to troubleshoot. Happy Coding
I was watching your tutorials for long time, u r awesome man
you are the best wordpress teacher, thank you a lot
Totally loving it, Alex!! This is WordPress heaven! THX a bunch, Alex!!
You're very welcome :D
can you point me to what modifcations I need to do to use the media selector to input multiple Images ? I have a database table that carries all the images of an entity so it might be 1 image it might be a 100, how can I modify this code to accept multiple images
This knowledge might get me out of a pickle.
Thanks for the great episodes!. A couple of things the (e) being past is for event not element. eg. event.preventDefault. and I wondered why you didnt target the button using the selector $('.js-image-upload').on('click touch', function() .... also with variable naming conventions the $ is used when the variable is a jQuery Object. Great videos mate thanks!
Thanks for the tutorial, this was very helpful. The wordpress codex on wp.media isn't particularly helpful, any ideas on where to go for more information? Specifically, I'm looking for a way to have the media uploader resize the image and only save the resized image. I just put this up on Stack Overflow too.
Why save button is disabled after selecting an image? To actually be able to save the changes, we have to type anything in any field text to enable the save button. That's kinda weird
That's WordPress not detecting any changes to the widget. You can overcome this issue by removing the diasbled attribute from the button after the image was picked. You can do that in the javascript file.
Im having the same issue , can you pretty please with sugar on top , explain with a little bit more details on how to solve this problem ? . "You can overcome this issue by removing the diasbled attribute from the button after the image was picked. You can do that in the javascript file." I have no "diasbled" attribute on the button in the js file. Thanks. You're awesome.
This was again a Very Nice Trip through WordPress! Thanks so much Alexander!!! A simple solution to enable the button seems to be triggering a change on the input: button.siblings(".image-upload").val(attachment.url).trigger("change"); Credit goes to wordpress.stackexchange.com/questions/153080/changes-in-widget-customizer-not-triggering-save-and-publish
yep, best wp tutorials on youtube
Thank you so much :D
If you select an image and then click on 'Save' button the widget will be refreshed, which will break the 'click' event binding from the 'Select image' button. So you will not be able to open the media uploader again till you refresh the admin page. Setting 'customize_selective_refresh = false' will not help.
PS. Thanks A LOT for the giant work that you're doing!
Mh, interesting, I didn't notice this behaviour, and sorry for the issue.
Thanks for watching
Thanks #Alecad for this great series. learned a lot from this series. While following the tutorials just stepped on this issue. Problem is related to widget lifecycle and Found a solution here: wordpress.stackexchange.com/questions/91455/how-do-i-rebind-event-after-widget-save
Any way I could get my scss files to affect the widget on the frontpage? So far, it doesn't seem to work. Only applies to widget on the Dashboard
Thank you for another great tutorial, have a good one :)
Cheers :D
Hi alex ... Thanks for your effort in your courses i really appreciate it
I just finished WP 101 and i will go to Sunset series but i inquiry what we will build excatly in this Plugin development series .. I try to understand but nothing ... Thanks alot bro for every thing and keep going
This plugin series is a bit more advanced and it's based on OOP, it's normal to not grasp it the first time, but you'll get there.
Keep watching my videos and you'll learn everything you need.
Happy Coding!
Alessandro Castellani i mean what the plugin we will build ?
Oh, sorry :D
Not a specific plugin, but a massive collection of multiple features that can be activated from within the plugin.
So far we built a CPT manager, Taxonomy Manager, Custom Widgets, and we'll continue with more awesome stuff.
hi on this tutorial, i know that you saw a problem after selecting the image you needed to change the image url to activate the save button. i think you did not select the right event in js
Can you provide a code example to corroborate your statement?
What did I do wrong?
Excellent as usual; I have learnt so much from your tutorials. However, in my copy of your code if I select a new image this does not trigger the save button in the widget form. The button will show save if I edit the input field directly. I don't know what is happening yet, but will have to look at it later this evening. I thank you once again for your brilliant tutorials.
Yeah, that happens to me too.
You could simply remove the disabled attribute of the button in jQuery when you select an image. That should be an easy workaround.
Or just trigger a change event like this:
$button.siblings('.image-upload').change();
Hi, thanks for the tutorial. I have been using this method but recently it stopped working, maybe because of a wordpress update. I think that file_frame.on('select', function... no longer works. Have you come across this issue?
I think I have it. I used to use the selector text: meta_image.button which it seems no longer works. I should just follow your examples!
Ehehe, well, yeah :D
If you're following a tutorial, better not using your own methods because if something doesn't work it gets pretty hard to troubleshoot. Happy Coding
Thanks from Algeria
You're very welcome, from Canada :D
Thanks sir 😊
You're welcome :D
Nice video.
Thanks
tanks
You're welcome
Riusciamo a raggiungere questo risultato autonomamente?
i.postimg.cc/yYkSX3rd/Cattura.jpg
ty
Mh, si, se non sbaglio quello e' il risultato che andremo ad ottenere.
Non mi ricordo al 100% 😅
$button.siblings('.image-upload').val(attachment.url);
//here
$('.widget-control-save', '.widget-control-actions').removeAttr('disabled');
Sorry, can you please explain this. Thank you :D
Solute from China
Cheers