WP REST API - Custom Endpoints

แชร์
ฝัง
  • เผยแพร่เมื่อ 17 ต.ค. 2024

ความคิดเห็น • 173

  • @ThomasBui359
    @ThomasBui359 ปีที่แล้ว +1

    It's a privilege to meet you all. I hope your families experience excellent health, prosperity, and plenty of good fortune.

  • @justinianoleo
    @justinianoleo 11 หลายเดือนก่อน +1

    Wow, i was looking for this information. Thank you! Grettings from Bolivia.

  • @OmarBadran-i2r
    @OmarBadran-i2r 4 ปีที่แล้ว +12

    Amazing! I was too lazy to read the developer docs and this video saved me.

    • @WatchandLearnTutorials
      @WatchandLearnTutorials  4 ปีที่แล้ว +1

      Hehe :)

    • @iamanderson
      @iamanderson 4 ปีที่แล้ว

      yep, straight to the point, only 5 minutes and I'm subscribed

    • @iamanderson
      @iamanderson 4 ปีที่แล้ว +1

      moreover I solved my problem in 2 minutes, this channel is superb

    • @WatchandLearnTutorials
      @WatchandLearnTutorials  4 ปีที่แล้ว +1

      @@iamanderson Thanks man. Glad you like the channel :)

  •  5 หลายเดือนก่อน +1

    Thanks for sharing this!
    I'm using LearnPress plugin data to be consumed from an external web service.
    Thanks!

  • @christopherlikins6321
    @christopherlikins6321 3 ปีที่แล้ว +2

    Thank you for this. I needed to send the output of a js function I built to an API endpoint for the app developer I am working with. This video was one of the links in the chain that I needed. I appreciate how clearly stated and demonstrated this was.

  • @murtuzamakda1952
    @murtuzamakda1952 3 ปีที่แล้ว +1

    Very use full video hidden gem for me i am creating one mobile app and i want this kind of solution thankyou so much for this sir...

  • @MrCelik999
    @MrCelik999 3 ปีที่แล้ว

    I'm a simple guy who needs simple explanations. This video was awesome, thank you!

    • @WatchandLearnTutorials
      @WatchandLearnTutorials  3 ปีที่แล้ว

      Glad I could help. I try to make my videos as simple as possible, thanks for noticing 😀

  • @florinberechet6375
    @florinberechet6375 ปีที่แล้ว +1

    Thank you for the tutorial! And many thanks for using a dark background editor👌, my eyes are sore from other's tutorials with light themed editors 😒😒

  • @ECSYL247
    @ECSYL247 ปีที่แล้ว

    Thank you for this wonderful project but Is it only exclusive to WordPress or can be use in other website.

  • @MrChrisJ74
    @MrChrisJ74 ปีที่แล้ว +1

    Thankyou, you are a great teacher, keep it up. And I like the outro music

  • @skaramicke
    @skaramicke 3 ปีที่แล้ว +1

    I didn't see the video you mentioned and I'm only here to learn about custom endpoints. Surprise!! :D

  • @sgotTube
    @sgotTube 4 ปีที่แล้ว +2

    Thank you man, watched and learnt...neat and clean!
    I just subscribed, yes, because of your great content, but above all after seeing again the pic at 6:48...actually also because you didn't bore any of us with wasting time in asking us to subscribe, to ring the bell, to comment below, to pet our cat, to clean our room, etc etc...
    Hvala!
    (Am i right if I guess that your English is pretty amazingly Serbian?)

    • @WatchandLearnTutorials
      @WatchandLearnTutorials  4 ปีที่แล้ว +2

      Thanks for watching and subscribing man :) I appreciate it. My accent is Croatian, but Serbian and Croatian are very similar languages :) so I understand why you would think that.

  • @evgeniisharaborin8071
    @evgeniisharaborin8071 ปีที่แล้ว

    Thank you, that is what I am looking for) how to make it only for authorized people? And get his user id? I want to save user data to the database

  • @josykial2541
    @josykial2541 10 หลายเดือนก่อน

    Thanks for video. How can i do with a external API. Would you help use with short video ? Thanks again.

  • @motohiker3435
    @motohiker3435 2 ปีที่แล้ว

    hello, I have a question. Hove can I get (_embedded -> author-> url) for exampl: $data[$i]['_embedded']['author'] = ...? Thanks.

  • @tedspens
    @tedspens 4 ปีที่แล้ว +2

    Thank you for keeping it simple. I need a bit more information for my purpose but now I understand how custom endpoints work. You put me on the right track. Happy New Year!

  • @lisacarlson2502
    @lisacarlson2502 9 หลายเดือนก่อน +1

    This was so helpful. Thank you!

  • @abdul_qadir7780
    @abdul_qadir7780 2 ปีที่แล้ว +1

    Your my new teacher.

  • @darickquinto7798
    @darickquinto7798 4 ปีที่แล้ว +2

    hi do you have a video for WP REST API where we can update the data? I dont see any videos regarding to that. all of the youtube videos available are just getting data

    • @WatchandLearnTutorials
      @WatchandLearnTutorials  4 ปีที่แล้ว

      I think the lack of those videos have something to do with the authentication. It's pretty tricky to do in WP. But that is a good idea. I will see what I can do. Thanks for the suggestions.

  • @danmusiceasy
    @danmusiceasy 3 ปีที่แล้ว +1

    Great tutorial man, very useful. It makes the output of the json object so much cleaner. With custom fields, I believe I can use it to create an online task organizer.

  • @Taooflu
    @Taooflu 5 ปีที่แล้ว +2

    Good stuff thanks. I noticed how bloated the default end points are, I will use a custom one thanks to you!

  • @nurulfarhana2773
    @nurulfarhana2773 4 ปีที่แล้ว +2

    I would like to ask, ermm where you got that wp-json? I'm so sorry to ask this since i'm a beginner and i don't quite understand to this topic

    • @WatchandLearnTutorials
      @WatchandLearnTutorials  4 ปีที่แล้ว +1

      What do you mean exactly? URL wp-json/... comes with WP, out of the box. I don't know if that answeres your question.

    • @nurulfarhana2773
      @nurulfarhana2773 4 ปีที่แล้ว

      @@WatchandLearnTutorials actually, i'm also not sure about that wp-json. Because most of tutorial use that to call json. But i dont know where to find it. Like where it is come from

    • @WatchandLearnTutorials
      @WatchandLearnTutorials  4 ปีที่แล้ว

      @@nurulfarhana2773 You are going to have to be more specific with your questions, I'm not sure what you mean. And also if you are a beginner you probably don't even need this right now, this is used if you want to make your frontend with JavaScript (React, Vue, Next) or maybe provide data for mobile applications.

    • @nurulfarhana2773
      @nurulfarhana2773 4 ปีที่แล้ว

      @@WatchandLearnTutorials ohhh okay thank you for replying me

    • @TheMarchewkaPL
      @TheMarchewkaPL 3 ปีที่แล้ว +1

      ​@@nurulfarhana2773 I think that I know what you mean and I had the same issue. I'm also getting a 404 when I try to access /wp-json/wl/v1/posts.
      Try:
      /?rest_route=/wl/v1/posts
      It worked for me.

  • @ep4r4
    @ep4r4 ปีที่แล้ว +1

    Uff me has ayudado un montón, gracias!

  • @rdmspeed
    @rdmspeed 3 ปีที่แล้ว

    This video is very helpful and to the point. Thank you.

  • @raminbagherian3914
    @raminbagherian3914 4 ปีที่แล้ว +1

    Amazing ! thank you bro. this tutorial was awesome !

    • @WatchandLearnTutorials
      @WatchandLearnTutorials  4 ปีที่แล้ว

      Thanks, glad I could help :) Check out the two latest videos on the channel also, they are part 2 and part 3 of this video.

  • @lalitsaini8907
    @lalitsaini8907 ปีที่แล้ว

    Can You share which font you are using in Your Coding tool.I like it and How to I set it in my VS code

  • @Mayanktaker
    @Mayanktaker 5 ปีที่แล้ว

    Hey Great Tutorial. Much needed.
    I have one problem. How can I get the link/url of the current post? I am adding post_link but its not working. I want the permalink of a post or all posts.
    $data['Link'] = $post[0]->post_link;
    not working.
    Please HELP!

  • @irinairina4399
    @irinairina4399 3 ปีที่แล้ว

    Thanks, but how can I get my custom taxonomies, usually recieved them by 'get_field()' method, but in the plugin wl-api it doesn't work. Please, help, if you know.

    • @WatchandLearnTutorials
      @WatchandLearnTutorials  3 ปีที่แล้ว

      Isn't get_field() an ACF function? Are you defining your taxonomies with ACF? If not, then this not the function you should be using. Also take a look at these videos: th-cam.com/video/76sJL9fd12Y/w-d-xo.html , th-cam.com/video/5rSfAkLO5eo/w-d-xo.html maybe you get the idea from there. You can use WP_Query to get pretty much anything from WP. I also have a whole series about it, so you can also take a look at that: th-cam.com/play/PLUBR53Dw-Ef8RvXF4iEU6UnhOlrcfIYn6.html

  • @projectsaathi5588
    @projectsaathi5588 4 ปีที่แล้ว +1

    thanks, and love the way you taking

  • @amarmaharjan464
    @amarmaharjan464 3 ปีที่แล้ว +1

    Thanks it was really helpful

  • @jessicastevens6102
    @jessicastevens6102 2 ปีที่แล้ว

    What font do you have that makes the comments and keywords cursive like that? I love it!

  • @urgise
    @urgise 2 ปีที่แล้ว

    Thanks for the tutorial! Works great! How can we use this custom endpoint to POST/update the field from postman using the same custom structure?
    Because ACF needs something like this:
    {
    "acf" : {
    "item1" : "somedescription",
    "item2" : "description"
    }
    }
    And I am hoping to POST a new item from postman without "acf", only the fields, like this:
    {
    "item1" : "somedescription",
    "item2" : "description"
    }

    • @WatchandLearnTutorials
      @WatchandLearnTutorials  2 ปีที่แล้ว

      Try this episode, maybe that can lead you in the right direction. th-cam.com/video/_w4Ok-lI48g/w-d-xo.html But I don't know exact steps to do what you need.

  • @arafathusseinbinriaskhan8922
    @arafathusseinbinriaskhan8922 2 ปีที่แล้ว

    where are you setting "/wp-json/wl" please advice

  • @rfl.aguilera
    @rfl.aguilera 3 ปีที่แล้ว

    One question the same structure works if we are talking about woocommerce?

    • @WatchandLearnTutorials
      @WatchandLearnTutorials  3 ปีที่แล้ว

      I believe that you could make custom endpoints for WooCommerce. However Woo comes with it's own API, so maybe better use that: docs.woocommerce.com/document/woocommerce-rest-api/ and documentation is here: woocommerce.github.io/woocommerce-rest-api-docs/#introduction

  • @akhilatk4397
    @akhilatk4397 2 ปีที่แล้ว +1

    Useful one... thank you...

  • @HurikaneTv
    @HurikaneTv 5 ปีที่แล้ว +1

    I subscribed immediately you said "crushing it" ... lol

    • @WatchandLearnTutorials
      @WatchandLearnTutorials  5 ปีที่แล้ว +1

      :D giphy.com/gifs/silicon-valley-siliconvalleyedit-GpvGNDIruGFQk

  • @srdjagunjic
    @srdjagunjic 5 ปีที่แล้ว +1

    Odlican tutorijal!

  • @bicanmarianvaleriu5400
    @bicanmarianvaleriu5400 5 ปีที่แล้ว

    Post structure only contains the ID for good reasons. Imagine a react app with couple of posts. First you get post data, almost instantly then Ajax requests to that media endpoint to lazy load images. For medium scale apps that structure is amazing. I was thinking the same but is not worth it to write custom endpoint for reasons in the video but I guess the purpose of it is to introduce the api.

    • @WatchandLearnTutorials
      @WatchandLearnTutorials  5 ปีที่แล้ว +1

      This was actually more intended for people that are building fully static sites with Nuxt, in my other series. Because in that case the API would never go live, and this would be an easier way to get your images and other data, there would be no lazy loading or something like that. But your point is valid, yeah.

  • @ravisinghit
    @ravisinghit 2 ปีที่แล้ว

    Very nice and easy.

  • @inocampo
    @inocampo 2 ปีที่แล้ว

    Hello, Thank you for the video, ¿How I can add security to this API? Happy New Year!

    • @WatchandLearnTutorials
      @WatchandLearnTutorials  2 ปีที่แล้ว

      You could probably install CORS plugin. And there you can define what domains are able to access your API. But I'm not 100% sure.

  • @shivamshukla2333
    @shivamshukla2333 5 ปีที่แล้ว

    this is awesome video ...but if I wanna categories data so how can i define that...(Menus url ) page data how can I fetch that data

    • @WatchandLearnTutorials
      @WatchandLearnTutorials  5 ปีที่แล้ว

      You would have to learn some basics of PHP and how WordPress loop works, and also how WordPress custom queries work. I have a playlist for WP custom query so you can check that out: th-cam.com/play/PLUBR53Dw-Ef8RvXF4iEU6UnhOlrcfIYn6.html ... But before that I recommend that you get familiar with the basics of PHP.

  • @peterelkin6140
    @peterelkin6140 4 ปีที่แล้ว +1

    good lesson

  • @MohamedBessalah
    @MohamedBessalah 4 ปีที่แล้ว

    Hi thanks for your video! I'm looking for a way to disable Rest API for a user role called 'external_user'.
    This user role can see right now alot of posts and pages information with when we put wp-json on the URL (users, pages, posts...)
    I use actually the plugin DISABLE REST API but it prevent only not logged users to see json informations. i need to do the same thing with external_user role.
    If it's not possible, can I redirect this user role (and only external_user role) to 404 pages if we try to put an URL with wp-json ?
    Thanks.

  • @rodolphonetto1
    @rodolphonetto1 5 ปีที่แล้ว

    First of all thank you for the video it will help me a lot
    Im a kind of a newbe with php... is it dificult to get author name? since the default API gives me an ID and my host block the users endpoint for security reasons (and I think it should stay like that)

    • @WatchandLearnTutorials
      @WatchandLearnTutorials  5 ปีที่แล้ว

      Maybe you could do it by doing something like:
      $data[$i]['author'] = get_the_author_meta( 'display_name' , $post->post_author )
      Maybe something like that will, work, but I haven't tested it.

    • @rodolphonetto1
      @rodolphonetto1 5 ปีที่แล้ว

      @@WatchandLearnTutorials Thank you, I'll try that looking on the documentations. Now I having a problem, in the browser and postman my request works fine, on an axios request from react I receive a CORS error.... I added a function to allow it but seens to not work, I need to do some kind of restart?

    • @WatchandLearnTutorials
      @WatchandLearnTutorials  5 ปีที่แล้ว

      @@rodolphonetto1 You probably getting CORS because your React application is on different domain. You can try Googling something like "WordPress CORS" or something like that. Also take a look at this, maybe it can help: stackoverflow.com/questions/25702061/enable-cors-on-json-api-wordpress ... Are you trying to POST something to WP API? I never had this problem, if I just tried to read the data from the API.

  • @hndzn5941
    @hndzn5941 3 ปีที่แล้ว

    This is great, but after implementing it seems paging no longer works by using: ?page=X... any suggestions?

    • @WatchandLearnTutorials
      @WatchandLearnTutorials  3 ปีที่แล้ว +1

      You need to handle pagination yourself, by using something like WP_Query it has pagination built in. You would use that instead of get_posts. I can't explain the entire process in the comment. Maybe I will make a video about it.

    • @hndzn5941
      @hndzn5941 3 ปีที่แล้ว +1

      @@WatchandLearnTutorials That would be amazing!

  • @vjnvisakh
    @vjnvisakh 3 ปีที่แล้ว +1

    Thank you. Loved it

  • @saicharandevireddy4140
    @saicharandevireddy4140 4 ปีที่แล้ว

    Thank you for keeping it simple. how can i write custom endpoints to the pages

    • @WatchandLearnTutorials
      @WatchandLearnTutorials  4 ปีที่แล้ว

      The same way I showed in this video. You just need to write a custom query to get the pages and the data that you need from them. Check out my custom query series if you need help with that: th-cam.com/play/PLUBR53Dw-Ef8RvXF4iEU6UnhOlrcfIYn6.html

  • @CodeMastersChannel
    @CodeMastersChannel 4 ปีที่แล้ว

    sorry for asking that,but where did you store this file on wordpress and how you did that I'm confused it's noob question but I'm noob too

    • @WatchandLearnTutorials
      @WatchandLearnTutorials  4 ปีที่แล้ว +1

      It's explained from 02:00 . You create a plugin in your plugins directory of the WordPress installation.

    • @CodeMastersChannel
      @CodeMastersChannel 4 ปีที่แล้ว

      @@WatchandLearnTutorials thank you I used WordPress one time only and it was in AWS lightsail VM , I now understand from you we going to install something on our device with folders in real WordPress is am right.

    • @WatchandLearnTutorials
      @WatchandLearnTutorials  4 ปีที่แล้ว

      @@CodeMastersChannel Yup, we are doing this on our local machine. But after that you can just upload those files to your hosting.

  • @ok-ho4ju
    @ok-ho4ju 4 ปีที่แล้ว +1

    Nice and simple COde

  • @seanraz
    @seanraz 4 ปีที่แล้ว +1

    Great video!

  • @sameermishra3598
    @sameermishra3598 3 ปีที่แล้ว

    Loved the explanation! Can I send audio files through the REST api? Please help

    • @WatchandLearnTutorials
      @WatchandLearnTutorials  3 ปีที่แล้ว +1

      You probably can, but it's not something I can explain in a comment.

    • @sameermishra3598
      @sameermishra3598 3 ปีที่แล้ว

      @@WatchandLearnTutorials Understandable! Could you recommend a resource or a video for the same, sir? I am literally stuck. Thanks in advance
      (I have to send audio files to the Media Library & then grab & share there link on my flutter application...)

    • @WatchandLearnTutorials
      @WatchandLearnTutorials  3 ปีที่แล้ว

      @@sameermishra3598 I don't know of any such link, sorry. But just keep this in mind, audio file is just a file, so try looking for tutorials about file upload, it doesn't matter if it's an audio, image or text document, the procedure should be the same.

  • @abdouazizfall7822
    @abdouazizfall7822 4 ปีที่แล้ว

    Thank. so i have one problem if i want to display all my content but only four elements i seen but i have more than four element sory for my bad english

  • @tamesshka
    @tamesshka 4 ปีที่แล้ว

    Tell me please, how do you thing? What CMS is better for creating restAPI ? WordPress or October?

    • @WatchandLearnTutorials
      @WatchandLearnTutorials  4 ปีที่แล้ว

      You should use whatever you are comfortable with. WordPress and October both have powerful options to create the any kind of REST API that you want.

  • @kengfaing7513
    @kengfaing7513 3 ปีที่แล้ว

    how can you do for custom tables?

  • @anassazeroual4586
    @anassazeroual4586 4 ปีที่แล้ว +1

    That's hopeful thank you so much 👍👍👍👍👍👍🌟

  • @ilclaudio123
    @ilclaudio123 5 ปีที่แล้ว +1

    Simple and clear, thank you :-)

  • @ivanalekseymarchenko
    @ivanalekseymarchenko 3 ปีที่แล้ว +1

    foreach($posts, $key => $value){...} instead of $i++;

  • @bloggerpilot
    @bloggerpilot 4 ปีที่แล้ว +1

    Great content. Thank you!

  • @Abdulkalam-zg3bk
    @Abdulkalam-zg3bk 3 ปีที่แล้ว

    Hello sir. It's a request. Could you please make a video on. How to integrate Rest API into WordPress.i want to fetch data from another website.full Complete video please.

    • @WatchandLearnTutorials
      @WatchandLearnTutorials  3 ปีที่แล้ว

      I won't make that kind of video, sorry. This is a edge case and also not something I wanna do on this channel.

  • @samb.4260
    @samb.4260 4 ปีที่แล้ว

    Really good video! The speaker sounds like an Easter European selling soviet weapons on the black market “Far be it from me to question your logic, you must have your reason you want this nuclear warhead. Not my business.”

    • @WatchandLearnTutorials
      @WatchandLearnTutorials  4 ปีที่แล้ว

      Heh :) I'm from Croatia, I'm guessing most Slavs have this kind of accent :)

  • @DipakKumarPusti
    @DipakKumarPusti 4 ปีที่แล้ว

    Please tell me that font name being used in the editor, I really love that font to be on my Sublime text, if supported

  • @travelsense9314
    @travelsense9314 3 ปีที่แล้ว

    When I try it, it returns empty array and not returning post data. Why?

    • @WatchandLearnTutorials
      @WatchandLearnTutorials  3 ปีที่แล้ว

      I don't know. You need to provide more information for me to be able to help you.

  • @GRACK0
    @GRACK0 4 ปีที่แล้ว +1

    Odlicno! Tnx!

  • @mohitkumbhare1491
    @mohitkumbhare1491 4 ปีที่แล้ว +1

    Thank you

  • @SMARTHELP92
    @SMARTHELP92 3 ปีที่แล้ว

    How can we detect installed plugins and theme info

    • @WatchandLearnTutorials
      @WatchandLearnTutorials  3 ปีที่แล้ว

      You can use developer.wordpress.org/reference/functions/wp_get_theme/ for getting the theme and probably developer.wordpress.org/reference/functions/get_plugins/ for getting the plugins. Never used those two functions but I hope they will work.

    • @SMARTHELP92
      @SMARTHELP92 3 ปีที่แล้ว +1

      @@WatchandLearnTutorials thanks

  • @rhcarlosweb
    @rhcarlosweb 5 ปีที่แล้ว +1

    Very nice! Thanks for the tip :D

  • @stasonnl777
    @stasonnl777 4 ปีที่แล้ว

    Great video! And can you please explain how to filter posts by custom field from custom endpoint?

    • @WatchandLearnTutorials
      @WatchandLearnTutorials  4 ปีที่แล้ว +1

      If you are using ACF for custom fields, check this out, it should help you implemnt it in custom endpoint: www.advancedcustomfields.com/resources/query-posts-custom-fields/

  • @juanantoniosotocabrera7045
    @juanantoniosotocabrera7045 5 ปีที่แล้ว +1

    gracias amigo!, your are the best!

  • @flameemaster
    @flameemaster 3 ปีที่แล้ว

    Thank you so much ❤️❤️❤️❤️

  • @sofakritic6914
    @sofakritic6914 4 ปีที่แล้ว

    you show slug what about URL? How to show entire URL? thanks

    • @WatchandLearnTutorials
      @WatchandLearnTutorials  4 ปีที่แล้ว

      What do you mean. I'm just using the slug to get the post I need. You could probably filter the data by URL, but that would not be the best way to approach it.

  • @chimauchenjoku3494
    @chimauchenjoku3494 4 ปีที่แล้ว

    Great Video, thanks
    Please how do I include author name to custom

    • @WatchandLearnTutorials
      @WatchandLearnTutorials  4 ปีที่แล้ว +1

      Not 100% sure, haven't tested it, but I think something like this should work: $data[$i]['author_name'] = get_author_meta('first_name', $post->post_author ) - check out get_author_meta docs for more information of what data you can get from it. developer.wordpress.org/reference/functions/get_the_author_meta/

  • @notetomgaming6701
    @notetomgaming6701 4 ปีที่แล้ว

    is it possible to explain how to add custom fields to the custom route? seem it has special behavior.

    • @andrinsuter6403
      @andrinsuter6403 4 ปีที่แล้ว +1

      I'm using advanced custom fields and this line helped me return their value through the API:
      $data[$i]['acf'] = get_fields($post->ID);

    • @notetomgaming6701
      @notetomgaming6701 4 ปีที่แล้ว

      @@andrinsuter6403 Perfect, Its worked like charm. Please is possible to advise me how to show the Categories, tags and its sub values?

    • @andrinsuter6403
      @andrinsuter6403 4 ปีที่แล้ว

      @@notetomgaming6701 sorry no idea... This is literally my first WP project

    • @WatchandLearnTutorials
      @WatchandLearnTutorials  4 ปีที่แล้ว +2

      @@notetomgaming6701 I will make a few videos about this soon. There has been a surge in WP Custom Endpoint questions, so I will expand on it a bit with a few more video examples.

    • @notetomgaming6701
      @notetomgaming6701 4 ปีที่แล้ว +1

      Thank you alot for such great efforts.
      Your channel already convinced me to change my way of thinking.
      Good luck.

  • @ToyohisaTV
    @ToyohisaTV 4 ปีที่แล้ว

    Amazing! Thank you so much

  • @absolutelynothing6324
    @absolutelynothing6324 4 ปีที่แล้ว

    4:45 thanks for "awesome endpoint" how could i return a html-file ? i tried an then just it returns just FALSE.

    • @WatchandLearnTutorials
      @WatchandLearnTutorials  4 ปีที่แล้ว +1

      You can't return HTML file. That is not what the REST API is for. You can only return JSON data, like shown in the video.

    • @absolutelynothing6324
      @absolutelynothing6324 4 ปีที่แล้ว

      And another way too return html by reading the url? May so? : function cathy_plugin_demo_filter_content($content) if (isset($_GET['pups'])) $content = 'huhu';

    • @WatchandLearnTutorials
      @WatchandLearnTutorials  4 ปีที่แล้ว

      @@absolutelynothing6324 You can return the content (with html tags) of the post as an object property, yes. That is how default API endopoints work.

  • @Djsiya27
    @Djsiya27 5 ปีที่แล้ว +1

    Thanks A lot Man.

  • @MobiusCoin
    @MobiusCoin 4 ปีที่แล้ว

    How do you add pagination here?

    • @WatchandLearnTutorials
      @WatchandLearnTutorials  4 ปีที่แล้ว

      You don't. You handle pagination on the frontend, however, you can needed data to this endpoint if you want, something like number_of_posts, number_of_pages etc. Default routes already send that data in the response header, so maybe custom end points do the same, I'm not sure. Check this video to see what I mean, I create pagination here on frontend with Svelte: th-cam.com/video/eKHoFSVyRV0/w-d-xo.html

  • @LittleWhite0067
    @LittleWhite0067 4 ปีที่แล้ว

    Thank you!

  • @prateekbhardwaj9943
    @prateekbhardwaj9943 3 ปีที่แล้ว +1

    llike your accent are you Russian?

  • @percUlles
    @percUlles 5 ปีที่แล้ว

    How to secure endpoint s

    • @WatchandLearnTutorials
      @WatchandLearnTutorials  5 ปีที่แล้ว

      Check this article out, maybe it has the info you need. www.wpwhitesecurity.com/wordpress-rest-api-and-the-security-worries/

  • @waltermelo1033
    @waltermelo1033 3 ปีที่แล้ว

    why do i do the f* same thing in ANY tutorial and the WP does not give the endpoint?!

    • @WatchandLearnTutorials
      @WatchandLearnTutorials  3 ปีที่แล้ว

      You probably screwed something up 😀 ... it's rarely WPs fault. What error do you get?

  • @agentstona
    @agentstona 3 ปีที่แล้ว

    Air duction 2mins 18 secs

  • @browncow6644
    @browncow6644 5 ปีที่แล้ว

    Brother Please make a WP Woocomerce tutorial, finish your tutorial. message me i can pay if need be.

    • @WatchandLearnTutorials
      @WatchandLearnTutorials  5 ปีที่แล้ว +2

      I'm not doing WooCommerce tutorial until they write better documentation for it. Sorry.

  • @lucasmatheusfjg
    @lucasmatheusfjg ปีที่แล้ว

    just open my home page

  • @KarolCud
    @KarolCud 4 ปีที่แล้ว

    Thanks man, it's very simple now. But your PHP code.. really bad :P