Verify the user sending POST data to WordPress REST API Endpoint

Поділитися
Вставка
  • Опубліковано 2 лис 2024

КОМЕНТАРІ • 8

  • @miyunasatoru4222
    @miyunasatoru4222 2 роки тому

    Thank you for these videos, you explain everything very clearly.
    I changed the code so that I could GET datas from users by using the parameter name.

  • @afq677
    @afq677 Рік тому

    Hi sir, i did followed ur guide until i still can’t submit to my endpoint within my localhost wordpress. Is it only working on hosted domain?

  • @dan3470
    @dan3470 Рік тому

    Great videos! Super helpful.

  • @luopro871
    @luopro871 4 роки тому

    Nice explanation. Thanks for video.

  • @tidjanihappy
    @tidjanihappy 3 роки тому

    Thank for your video, but i have another problem, and i don't know if you can help me with.
    How can i Get current user inside register_rest_route method. I made custom Stripe checkout integration in my wordpress theme and everything working well, after payment in stripe chekout, it checkout close and send event to an custom endpoint that i've created by registered new rest_route locally and this rest route call a function which will save data inside Stripe event that it receive. So in this function i essentially need to update user_meta data of the connected user but it's not working, in this function when i make and echo of current_user->ID , it print me 0. I make a search , and it appear that i need to authenticate user on WP REST API too, but i don't really found how to do it. Can you help me please ?

    • @TechiePress
      @TechiePress  3 роки тому +1

      You can use the sessions and cookies to detect the current user for that purpose. Is there info you can send to stripe and stripe returns as well? You can send an ID of the customer and it’s returned as a string. All this depends if you don’t allow guest checkout. However, stripe should be able to give you the order ID you sent for payment and you can use that to evaluate which payment was done.