Commit Graph

16768 Commits

Author SHA1 Message Date
Jeff Stieler 8b0416c4b2 When saving settings, only allow values found in “options” for “select” type fields. 2016-07-19 10:41:22 -07:00
Jeff Stieler cf65ff53c5 Add test coverage for all WP_Error-returning cases in the Settings API. 2016-07-19 10:41:22 -07:00
Jeff Stieler ca15237332 Add test coverage for register_legacy_settings(). 2016-07-19 10:41:22 -07:00
Jeff Stieler 1fc539992c Break “legacy” setting to “new” conversion into it’s own method. 2016-07-19 10:41:22 -07:00
Jeff Stieler 6c53cfa167 Add test for register_legacy_group() and coverage annotations. 2016-07-19 10:41:22 -07:00
Jeff Stieler 3747505d83 Add initial test file for WC_Register_Legacy_Settings, with test for constructor. 2016-07-19 10:41:22 -07:00
Jeff Stieler 1cde743121 Reuse WC Admin Setting’s save_fields() instead of duplicating code for sanitizing saved values. 2016-07-19 10:41:22 -07:00
Jeff Stieler 832df9ab3e Use WC Admin Settings’s get_option() in REST Settings controller instead of duplicating code. 2016-07-19 10:41:22 -07:00
Jeff Stieler 586bf5d842 Take in options data to be saved as an optional argument, defaulting to $_POST.
This allows for reuse of the options field saving mechanism.
2016-07-19 10:41:22 -07:00
Jeff Stieler a53040f186 Remove namespace from Settings API unit test file.
This fails builds on PHP 5.2.x.
2016-07-19 10:41:22 -07:00
Jeff Stieler fde3318b41 Fix unit tests. 2016-07-19 10:41:22 -07:00
Jeff Stieler 8939af0d0f Add _links to returned settings groups. 2016-07-19 10:41:22 -07:00
Jeff Stieler 7209369eab Don’t register legacy settings without IDs. 2016-07-19 10:41:22 -07:00
Jeff Stieler 0b940badeb Handle select options in setting sanitization function. 2016-07-19 10:41:22 -07:00
Jeff Stieler 49b1c188c7 Move bulk settings updating to the Settings controller, following existing batch endpoint patterns. 2016-07-19 10:41:22 -07:00
Jeff Stieler c9636bff39 Add _links to /settings/<group> and /settings/<group>/<setting> responses. 2016-07-19 10:41:22 -07:00
Jeff Stieler 0ddb8e777a Move settings group endpoint to Settings controller and only return settings-schema’d items. 2016-07-19 10:41:22 -07:00
Jeff Stieler aff1c82de2 Add Settings controller getter method for all group settings. 2016-07-19 10:41:22 -07:00
Jeff Stieler 092bfcb196 Match parent signature of prepare_item_for_response(), add getter method for settings. 2016-07-19 10:41:22 -07:00
Claudio Sanches cd01e71c3f Small tweaks to make it follow the REST API standards 2016-07-19 10:41:22 -07:00
Justin Shreve 5cb823f6c6 edit_item should be update_item 2016-07-19 10:41:22 -07:00
Justin Shreve 2580c39708 Rename update_ functions to edit_item, and get_groups/get_settings to get_item and get_items per feedback. Also move the namespace into each class. 2016-07-19 10:41:22 -07:00
Justin Shreve 170e2a1346 Split settings and groups controllers into two separate files. 2016-07-19 10:41:22 -07:00
Justin Shreve 5d0e15fdae Rename classic settings file to legacy settings 2016-07-19 10:41:22 -07:00
Justin Shreve e814dcc2f4 Rename classic -> legacy 2016-07-19 10:41:22 -07:00
Justin Shreve 8c211b87ef Fix how classic groups/settings are registered so that they are always avaiable when calling filters. 2016-07-19 10:41:22 -07:00
Justin Shreve 9f7c769c4f Remove settings api docs, moving to wiki 2016-07-19 10:41:22 -07:00
Justin Shreve 6bb546e11c Wrap up settings api 2016-07-19 10:41:22 -07:00
Justin Shreve 05a2644066 Wrap up settings endpoints for updating, finish tests. 2016-07-19 10:41:22 -07:00
Justin Shreve fa5425109e Refactor down to two concepts - settings groups and settings. Fix up tests, and start working on returning actual settings and their values. 2016-07-19 10:41:22 -07:00
Justin Shreve f425a3735a Add a test for settings groups, make sure any bad keys/values are filtered out, update docs. 2016-07-19 10:41:22 -07:00
Justin Shreve 785e43a207 Add group info to the single locations endpoint & update our docs 2016-07-19 10:41:22 -07:00
Justin Shreve 06e787a26d Misc cleanup. 2016-07-19 10:41:22 -07:00
Justin Shreve 6c2be482ca Add a permissions check to the locations endpoints and fill out the tests for them. 2016-07-19 10:41:22 -07:00
Justin Shreve eb4291f699 More setting location tests. 2016-07-19 10:41:22 -07:00
Justin Shreve 9369d55ff4 Add the ability to get data on a single location. 2016-07-19 10:41:22 -07:00
Justin Shreve eb9e5edd22 API Docs for our endpoints this far. 2016-07-19 10:41:22 -07:00
Justin Shreve c6b0debe26 Make /settings/locations work properly. Add skeleton for tests and add register_routes test. 2016-07-19 10:41:22 -07:00
Justin Shreve fc076eb57e Initial /settings API controller and /settings/locations route. Loads the WP-API and registers our namespace temporarily until WP-API is loaded by WC core. 2016-07-19 10:41:22 -07:00
Justin Shreve 4a8e3a5f62 Settings API Doc - To be removed later. 2016-07-19 10:41:22 -07:00
Claudio Sanches 2b6cbc7629 Sanitize image metadata 2016-07-19 14:24:11 -03:00
Claudio Sanches 4ed8d46867 [REST API] Make easy to update order line items #11450 2016-07-19 14:11:44 -03:00
Mike Jolley ea69a1ace8 Readme 2016-07-19 18:08:45 +01:00
Mike Jolley 4e83d45491 POT and min 2016-07-19 18:08:45 +01:00
Mike Jolley 1db6da14c0 Readme and version 2016-07-19 18:08:45 +01:00
Mike Jolley f69c36729d Merge pull request #11475 from helgatheviking/filter_cart_id
add woocommerce_cart_id filter
2016-07-19 17:47:23 +02:00
Mike Jolley 664597b5c8 Tweak zone text
Closes #11472
2016-07-19 16:45:10 +01:00
Mike Jolley e5634c6946 Do not sanitize passwords
Closes #11473
@claudiosmweb
2016-07-19 16:43:15 +01:00
Kathy Darling cfafff192d add woocommerce_cart_id filter 2016-07-19 10:20:08 -05:00
Mike Jolley bf93f747c2 Handle range conversion during update
Closes #11403
2016-07-19 16:16:32 +01:00