-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ticket/aotech 6694 data validation #46
base: ticket/AOTECH-6694-data-validation
Are you sure you want to change the base?
Ticket/aotech 6694 data validation #46
Conversation
…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
…an be used in more than one route.
…validation 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
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.
…for consistency with other recent change.
…plementations of AbstractOutput for taxonomies.
… AbstractOutput class.
@phatsk This PR includes output for taxonomy count comparisons now. |
@@ -48,7 +47,7 @@ private function output( $data, $message = '' ) { | |||
* Prepare the data for rendering. | |||
* | |||
* @param array $data Data to prepare for rendering. | |||
* | |||
*Ø |
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.
…differ between sites.
…nate value to be colorized based on comparison.
No description provided.