Тёмный

3 Methods for AJAX in WordPress | Which Method is the Best? 

WPCasts
Подписаться 30 тыс.
Просмотров 34 тыс.
50% 1

In this video, I show you how to use admin-ajax.php, the REST API, and the Rewrite API to make AJAX calls. I also compare the three to see which is the fastest!
Link to the repository: github.com/ale...
💖 Become a Patron to show support & get perks!
/ wpcasts
Sign up for the newsletter. Free course coming in 2020:
wpcasts.tv
*SOCIAL*
Twitter: / alexanderbyoung
Instagram: / the_alex_young
Facebook: / wpcasts.tv
#WordPress #AJAX #Development

Опубликовано:

 

14 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 45   
@WPCasts
@WPCasts 4 года назад
I hope you guys learned something! If you want to chat, follow me on Twitter: twitter.com/AlexanderBYoung
@TheMarouuu
@TheMarouuu 4 года назад
42 people forgot to like the video so far. Cmon folks, give this dude some likes. Too many beginner videos out there. We need intermediate knowledge like this. For free too! Give this dude some support!
@vhugoxgnu
@vhugoxgnu 2 года назад
Excellent video. I've used "admin-ajax" for 2 years so fat and realized now It's not the best WP practice. Thank you!
@jaspzhy3589
@jaspzhy3589 3 года назад
YES!! I have been using admin-ajax for so long but struggle to understand where does REST API come in, or what Rewrite API does this really helped a lot! Thank you!
@pavelasafov
@pavelasafov 11 месяцев назад
Thank you, Alex! I'm starting to master WordPress using your lessons.
@ezdevv3160
@ezdevv3160 3 года назад
it makes so much sense to have vs-code tools on the right
@jacobharris3929
@jacobharris3929 2 года назад
the rewrite rule stuff is super clever, thanks for sharing
@Rbog17
@Rbog17 3 года назад
Wow...never even heard of the rewrite api for Ajax. Guess I been under a rock. I don't understand regex very well, but seems I need to give it a shot. Never heard of artillery either. Bravo. That's some quality WP developer content. Hats off.
@apisitmhungchomphu4205
@apisitmhungchomphu4205 4 года назад
I try to understand what you said because i'm still practice english and i work about wordpress with westerner( Thank you for share your knowledge).
@a.i.r912
@a.i.r912 3 года назад
very cool i was searching this from long time
@attilabalog6753
@attilabalog6753 3 года назад
Thanks for the great tutorial, have to do some ajax request via admin-ajax, but i keep getting 403 forbidden. Couldn't fix for a day (i'm at work don't have too much time to debug properly). The rest-api solution works for me. BIG THANK YOU!!!!!
@VeganGaymer
@VeganGaymer 4 месяца назад
Hi Alex! I got a problem where my cart does not adjust the shipping automatically when adding or removing the same item from the cart. The customer would have to reload the cart page or go to the checkout to see the right shipping price. Do you have any videos on this? Thanks
@dnyaneshmj
@dnyaneshmj 2 года назад
Great work! Helped a lot
@manavbudhia
@manavbudhia 4 года назад
Very good tutorial.... really helpful thanks for this great post. When you are launching wordpress course ??
@billwoods4935
@billwoods4935 4 года назад
Nice tutorial!!! Good job, I’m a big fan! I have seen you work with the form submission often times, so just out of curiosity, is there any reason that you don’t use “wp-nonce” for the form submission?
@MaximusMcCullough
@MaximusMcCullough 2 года назад
Very Cool, thanks bro!
@lorenzomijorus
@lorenzomijorus 4 года назад
very good tutorials. !! great job
@errorerror1337
@errorerror1337 4 года назад
TLDR; Rewrite API FTW! Fucking awesome video dude, thank you for doing this, very helpful.
@WPCasts
@WPCasts 4 года назад
You’re very welcome!
@nielsofficeofficial9706
@nielsofficeofficial9706 Год назад
Is this really all about the fastest? I a bit wonder because does javascript can do that alone? why do you need to extend the rest class wp in php? are you registering a new API end point with wordpress? such stores? instead fetching the data from post/{} or user/{} for this demonstraion?
@azizultex
@azizultex 4 года назад
What do you think of GraphQL? Is it better than all these 3?
@maurypovich4033
@maurypovich4033 4 года назад
if you do a headless Wordpress do you still gotta write PHP code? Just curious how that works since the front-end that's displaying all the data is using javascript and an API.. I'm a jr so still wrapping my head around how things work. Also you seem to be very knowledgable with WP but your title at your job is frontend related, shouldn't you be considered fullstack? By the way thank you for all the content. You are paving your own path with this headless Wordpress stuff. It really is the future
@zahiribishi7943
@zahiribishi7943 2 года назад
Can you create a video that explains CORS and making requests from outside
@GregRobinsonHD
@GregRobinsonHD 3 года назад
Great video, thanks! @WPCasts - what's the extension or tool you're using at 11:01 to make the JSON appear neatly formatted and readable? Just curious, thanks.
@WPCasts
@WPCasts 3 года назад
It's called JSONView
@GregRobinsonHD
@GregRobinsonHD 3 года назад
@@WPCasts Thanks for the response! Loving your vids...
@stephanroder1371
@stephanroder1371 Год назад
I haven't seen more than 4:50 minutes of his video, but I can already tell: he's an export and "listens to him".
@junglized
@junglized 4 года назад
....benchmarking using artillery... - o yeah! seatbelt fastened! :D
@professeurish
@professeurish 3 года назад
Thank you ❤
@adamsDevArt
@adamsDevArt 2 года назад
Can you please do another wordpress ajax video but with jQuery?
@ruhaanshWorld
@ruhaanshWorld 3 года назад
I copied your code in the themes folder and activated but I am still getting 404 errors when I click the submit button because of the routes.. How do I fix that?
@padamsubba1973
@padamsubba1973 4 года назад
please make videos about ajaxing pages (single.php, page.php, archives etc )
@zansmolic1114
@zansmolic1114 4 года назад
I wish there would be a beginner level video to this video, to understand what's you're saying better.
@braulioacosta6816
@braulioacosta6816 3 года назад
What is it you're not understanding?
@filipvanreeth
@filipvanreeth 4 года назад
What’s the vscode theme you used 🤪?
@annietrinh1452
@annietrinh1452 3 года назад
Can you make live search for products with images result? I’m searching for many days but no one teach it
@vecseiszilveszter4672
@vecseiszilveszter4672 3 года назад
yes
@RodrigoChavesOficial
@RodrigoChavesOficial 4 года назад
THANK YOU.
@WPCasts
@WPCasts 4 года назад
You’re welcome :)
@JohnChandlerEdmonton
@JohnChandlerEdmonton Год назад
I'd like for ajax calls to not load plugins (like All in One SEO) that have no business being loaded and slow it all down.
@Ateens97
@Ateens97 4 года назад
Thank you
@learnwithkhubbaib
@learnwithkhubbaib 3 года назад
Sorry to say but never use /wp-admin/admin-ajax.php instead localize script using admin_url function so if some change wp-admin directory it will return correct one.
@msvmanikantasrivishnu7788
@msvmanikantasrivishnu7788 4 года назад
1st like comment...thank u
@HaifengZhu-pn3uq
@HaifengZhu-pn3uq Год назад
what is ajax used for
Далее
How To Create Dynamic Routes In WordPress
16:15
Просмотров 17 тыс.
САМАЯ ТУПАЯ СМЕРТЬ / ЧЕРНЕЦ
1:04:43
Introduction to JavaScript in WordPress
19:50
Просмотров 20 тыс.
How to do AJAX in WordPress correctly (2023)
34:58
Просмотров 5 тыс.
What is the Interactivity API in WordPress 6.5?
16:32
Просмотров 4,5 тыс.
Custom Queries In WordPress
14:50
Просмотров 20 тыс.