Open rmccue opened 10 years ago
@rmccue thanks for the feedback - @missjwo will hopefully be tackling this, so the above will be of use to her I imagine.
Also, if you do it with this format, creating the same widget as currently exists is pretty simple. :)
Using Mustache syntax, individual items are something like:
<li class="zone">
<span class="clock">{{ current_time }}</span>
<span class="humans"><img width="24" title="{{ author.name }} - {{ timezone }}" alt="{{ author.name }}" src="{{ author.avatar }}"></span>
</li>
From the readme:
The Extending the API guide is a good reference here.
Here's what I'd envision it looking more like:
/timezones
: Gives a list of objects, looking something like this:Where:
user
: User entity, similar to theauthor
attributes on posts.timezone
: Standard timezone identifiercurrent_time
: Current time in the user's local time. (Helpers for this in WP-API core)/timezones/<id>
: Same as above, but for singular user. i.e./timezones/1
/timezones/<id>
: Change timezone for user. Only allow changing thetimezone
key/timezones/<id>
: Create a timezone for a userThat's my cursory thinking, just looking at this quickly. :)