Skip to content

Ticket/aotech 6694 data validation#46

Open
phatsk wants to merge 132 commits intothemarcusbattle:ticket/AOTECH-6694-data-validationfrom
jmichaelward:ticket/AOTECH-6694-data-validation
Open

Ticket/aotech 6694 data validation#46
phatsk wants to merge 132 commits intothemarcusbattle:ticket/AOTECH-6694-data-validationfrom
jmichaelward:ticket/AOTECH-6694-data-validation

Conversation

@phatsk
Copy link
Copy Markdown
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
Comment thread includes/validation/Taxonomy.php Outdated

foreach ( get_taxonomies() as $taxonomy ) {
$terms = get_terms( array( 'taxonomy' => $taxonomy ) );
$data[ $taxonomy ]['terms'] = $this->get_term_slugs( $terms );
Copy link
Copy Markdown
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' )

Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown

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

*
* @param array $data Data to prepare for rendering.
*
*Ø
Copy link
Copy Markdown
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