Skip to content
This repository was archived by the owner on Aug 14, 2019. It is now read-only.

Update/site options schema properties 2#9

Open
kjbenk wants to merge 4 commits into
WP-API:masterfrom
kjbenk:update/site-options-schema-properties-2
Open

Update/site options schema properties 2#9
kjbenk wants to merge 4 commits into
WP-API:masterfrom
kjbenk:update/site-options-schema-properties-2

Conversation

@kjbenk

@kjbenk kjbenk commented Mar 1, 2016

Copy link
Copy Markdown

@kjbenk

kjbenk commented Mar 2, 2016

Copy link
Copy Markdown
Author

@fjarrett this is ready to merge :)

Comment thread lib/class-wp-rest-site-controller.php Outdated
'title' => array(
'description' => __( 'Site Title' ),

// Reference: https://docs.google.com/spreadsheets/d/1vI-s8MjbEllCR0_0BmBgaGvKNm1Fa42MCoqaKCwbRyQ/edit#gid=0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this code comment.

@danielbachhuber

Copy link
Copy Markdown
Member

@kjbenk Can you make sure there are tests for each of these?

Comment thread lib/class-wp-rest-site-controller.php Outdated
'type' => 'string',
'screen' => 'discussion',
'context' => array( 'view', 'edit' ),
'public' => true,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure it makes sense to introduce new screen and public attributes in the schema.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that maybe the screen attribute is not that useful but since some options are private and others are public we will need a mapping system to determine what options can be retrieved as an unauthenticated user...right?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ill need a mapping system to determine what options can be retrieved as an unauthenticated user...right?

Right — that's context. view means "frontend", and edit means "editor" (or backend).

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok...that makes more sense now. I will remove the public and screen attribute.

kjbenk added 2 commits March 2, 2016 10:01
* UPDATED: The unit test to check for the item schema has been updated
to account for all the site options
* REMOVED: Screen and public attribute from each property
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants