Skip to content

Conversation

@phatsk
Copy link
Collaborator

@phatsk phatsk commented Feb 15, 2018

No description provided.

phatsk and others added 30 commits January 25, 2018 11:35
…rcusbattle/press-sync into ticket/AOTECH-6694-data-validation
This is a first attempt at something working and somewhat dynamic, and attempting to split responsibility
for different roles into separate classes.
- Move API-related files for validation into PSR-4 file structure
- 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
…validation

Ticket/aotech 6713 taxonomy validation

foreach ( get_taxonomies() as $taxonomy ) {
$terms = get_terms( array( 'taxonomy' => $taxonomy ) );
$data[ $taxonomy ]['terms'] = $this->get_term_slugs( $terms );
Copy link
Collaborator Author

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' )

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.
Copy link
Collaborator Author

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(),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Note: alignment

Copy link
Collaborator Author

@phatsk phatsk left a 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.

@jmichaelward
Copy link

@phatsk This PR includes output for taxonomy count comparisons now.

*
* @param array $data Data to prepare for rendering.
*
*Ø
Copy link
Collaborator Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants