All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Help with WP-API. JSON API for WordPress [PHP]
I've spent about an hour going through the WP-API docs and I can't make heads or tails of this stuff. Instead of spending more time struggling, I figured since it's not urgent I can just wait and see if someone else who already has experience with this can just spoonfeed me in the right direction.
http://v2.wp-api.org/extending/modifying/
I'm trying to use the following snippet I found on Github.
Where would I even put this? I have no idea how the filters work and the documentation is jsut terrible. Granted, the plugin itself is amazing and provides an out-of-the-box json api for WP that I enjoy using, but trying to extend it has me puzzled. Am I supposed to be making my own plugin? How do I extend this?
If anyone has insight, that would be perfect (I also haven't had sleep for about 25 hours and I'm writing this as I go to sleep... so I might just be missing something really really obvious)
thanks all!
Jonchun
Comments
Test test. 1 2.1 2. Hear me?
Thanks for making LET up for beta
Test ended? Can I clean up?
Unhanded exception found in End_test.exe.
Test not ended.
This is NOT a test. I repeat: This is NOT a test. The cake is real.
https://css-tricks.com/using-the-wp-api-to-fetch-posts/#article-header-id-2
Scroll down to removing fields and adding fileds
I have also sent you a pm
You can place that code in one of the following places:
mu-plugins
insidewp-content
and place the snippet in a file.wp-content/plugins
with this header and place the snippet.functions.php
file of your current theme/child theme.With the first option, the code will always be active, with the second and third options it'll be active if the plugin or theme is active.
Thanks. This is what I needed. Will give it a shot later.
Edit: I haven't quite had a chance to try this yet, but I'm really confused at how this would work.
any ideas what the "10" and "3" mean? I see the numbers in like all the examples but I have no idea how that works.
RTMF
what?
10 is the priority of the filter/action(lower executed first higher executed later) and 3 is the number of args required for the function being passsed
I will send you a pm if i figure it out :-)
http://pastebin.com/NjSV8Ut3
My country just banned pastebin
Or some bug
http://pastebin.com/NjSV8Ut3
Redirects to
http://restrict.tw1.com/error.html
@Jonchun, message me on skype and I will help you out. Plus my active project is heavily WP-API based. User is pcfreak30.
Read the manual, fucking.
Makes it much more enjoyable.
I'll remember this next time I go to Ikea.
@Jonchun Who ever reads manuals? :P
Figured it out. For future reference, if anyone wants to add next and previous posts, here's what I did.
http://pastebin.com/8sknJ0eH