Opened 7 years ago
Closed 7 years ago
#41055 closed enhancement (fixed)
WP-API JS Client: Improve support for meta
Reported by: | adamsilverstein | Owned by: | adamsilverstein |
---|---|---|---|
Milestone: | 4.9 | Priority: | normal |
Severity: | normal | Version: | 4.7 |
Component: | General | Keywords: | has-patch has-unit-tests commit |
Focuses: | javascript, rest-api | Cc: |
Description
The wp.api JavaScript client support for meta needs some attention:
- Meta helper isn't available for comments, terms and users
- Meta pieces haven't been updated for the new-style meta model
The getMeta
helper should work correctly for all object types that support meta. We should also consider adding a matching setMeta
helper.
Attachments (4)
Change History (12)
This ticket was mentioned in Slack in #core by jeffpaul. View the logs.
7 years ago
#4
@
7 years ago
- Keywords has-unit-tests commit added; needs-unit-tests removed
In 41055.2.diff:
REST API JS Client - improve support for meta.
- Add
getMeta
,getMetas
,setMeta
,setMetas
helpers for models that contain meta. - Add tests for new helpers.
- Include meta data in fixture generation and fixture file driving tests.
This ticket was mentioned in Slack in #core-restapi by adamsilverstein. View the logs.
7 years ago
#6
@
7 years ago
In 41055.4.diff:
- Add tests: test meta support for
Posts
,Comments
,Tags
andUsers
. - Add meta for these types to
test_build_wp_api_client_fixtures
- Update generated fixture data.
This ticket was mentioned in Slack in #core by jeffpaul. View the logs.
7 years ago
Note: See
TracTickets for help on using
tickets.
In 41055.diff :
Improve support for and detection of meta.
wp.api.models.Post
,User
,Comment
and other models supporting meta now include helpers forgetMeta()
andsetMeta()
.Some unit tests verifying at a minimum that the helpers are attached would be helpful.