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

  Рет қаралды 33,004

WPCasts

WPCasts

4 жыл бұрын

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/alexander-young/3-...
💖 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

Пікірлер: 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!
@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!
@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!
@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.
@dnyaneshmj
@dnyaneshmj 2 жыл бұрын
Great work! Helped a lot
@jacobharris3929
@jacobharris3929 2 жыл бұрын
the rewrite rule stuff is super clever, thanks for sharing
@ezdevv3160
@ezdevv3160 3 жыл бұрын
it makes so much sense to have vs-code tools on the right
@a.i.r912
@a.i.r912 2 жыл бұрын
very cool i was searching this from long time
@lorenzomijorus
@lorenzomijorus 3 жыл бұрын
very good tutorials. !! great job
@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).
@MaximusMcCullough
@MaximusMcCullough 2 жыл бұрын
Very Cool, thanks bro!
@professeurish
@professeurish 3 жыл бұрын
Thank you ❤
@Ateens97
@Ateens97 4 жыл бұрын
Thank you
@pavelasafov
@pavelasafov 8 ай бұрын
Thank you, Alex! I'm starting to master WordPress using your lessons.
@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!!!!!
@manavbudhia
@manavbudhia 4 жыл бұрын
Very good tutorial.... really helpful thanks for this great post. When you are launching wordpress course ??
@RodrigoChavesOficial
@RodrigoChavesOficial 4 жыл бұрын
THANK YOU.
@WPCasts
@WPCasts 4 жыл бұрын
You’re welcome :)
@msvmanikantasrivishnu7788
@msvmanikantasrivishnu7788 4 жыл бұрын
1st like comment...thank u
@danielmkowalewski
@danielmkowalewski 4 жыл бұрын
....benchmarking using artillery... - o yeah! seatbelt fastened! :D
@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?
@padamsubba1973
@padamsubba1973 4 жыл бұрын
please make videos about ajaxing pages (single.php, page.php, archives etc )
@stephanroder1371
@stephanroder1371 9 ай бұрын
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".
@zahiribishi7943
@zahiribishi7943 2 жыл бұрын
Can you create a video that explains CORS and making requests from outside
@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
@azizultex
@azizultex 4 жыл бұрын
What do you think of GraphQL? Is it better than all these 3?
@VeganGaymer
@VeganGaymer 25 күн бұрын
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
@filipvanreeth
@filipvanreeth 4 жыл бұрын
What’s the vscode theme you used 🤪?
@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?
@adamsDevArt
@adamsDevArt Жыл бұрын
Can you please do another wordpress ajax video but with jQuery?
@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...
@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?
@HaifengZhu-pn3uq
@HaifengZhu-pn3uq 10 ай бұрын
what is ajax used for
@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!
@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
@nielsofficeofficial9706
@nielsofficeofficial9706 11 ай бұрын
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?
@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.
@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.
Must-have gadget for every toilet! 🤩 #gadget
00:27
GiGaZoom
Рет қаралды 12 МЛН
ROCK PAPER SCISSOR! (55 MLN SUBS!) feat @PANDAGIRLOFFICIAL #shorts
00:31
Introduction to JavaScript in WordPress
19:50
WPCasts
Рет қаралды 20 М.
Form Submit Using Ajax - WordPress Form Ajax
1:09:25
Joshua Herbison
Рет қаралды 18 М.
What Is Ajax?
10:03
WebConcepts
Рет қаралды 321 М.
What is the Interactivity API in WordPress 6.5?
16:32
Elliott Richmond
Рет қаралды 3,7 М.
Custom Queries In WordPress
14:50
WPCasts
Рет қаралды 19 М.
System Design: Design a URL Shortener like TinyURL
16:00
Code Tour
Рет қаралды 80 М.
tRPC, gRPC, GraphQL or REST: when to use what?
10:46
Software Developer Diaries
Рет қаралды 71 М.
GamePad İle Bisiklet Yönetmek #shorts
0:26
Osman Kabadayı
Рет қаралды 337 М.