-
Notifications
You must be signed in to change notification settings - Fork 6
Ticket/aotech 6694 data validation#46
Ticket/aotech 6694 data validation#46phatsk wants to merge 132 commits intothemarcusbattle:ticket/AOTECH-6694-data-validationfrom jmichaelward:ticket/AOTECH-6694-data-validation
Conversation
for different roles into separate classes.
- Split out user validation methods into their own class
- Create an AbstractRoute class that extends the WP_REST_Controller, which will be used by our custom API routes
Ticket/aotech 6713 taxonomy validation
includes/validation/Taxonomy.php
Outdated
|
|
||
| foreach ( get_taxonomies() as $taxonomy ) { | ||
| $terms = get_terms( array( 'taxonomy' => $taxonomy ) ); | ||
| $data[ $taxonomy ]['terms'] = $this->get_term_slugs( $terms ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could replace the helper method with a call to wp_list_pluck( $terms, 'slug' )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Someday I'll remember when and how to use this function. Fixed.
| } | ||
|
|
||
| /** | ||
| * Get the number of users in the WordPress install. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing @return
|
|
||
| public function get_data() { | ||
| return array( | ||
| 'count' => $this->get_count(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: alignment
phatsk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This generally looks good. There are a couple notes to both myself and @jmichaelward but overall this is fairly solid. Testing locally shows expected results for posts.
|
@phatsk This PR includes output for taxonomy count comparisons now. |
| * | ||
| * @param array $data Data to prepare for rendering. | ||
| * | ||
| *O |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm seeing a weird character like a crossed-through zero.