Add filters on taxonomy and post page #1373
Request For Code Review
The text was updated successfully, but these errors were encountered:
For example, onclick. This will have JS in it, so this error code is more accurate. On Weston's suggestion in code review.
Beginnings Of The Query Var For Type Implemented
But this still needs the filter UI.
For example, this URL will only show CSS errors:
On clicking the 'Filter' button on the 'AMP Validation Errors' taxonomy page, edit-tags.php processes the POST request that this submits. Then, it redirects to a URL to display the page again. This filter callback looks for a value for VALIDATION_ERROR_TYPE_QUERY_VAR in the request. That means that the user filtered by error type, like 'js_error'. It then passes that value to the redirect URL as a query var, So that the taxonomy page will be filtered for that error type. @see AMP_Validation_Error_Taxonomy::add_error_type_clauses_filter() for the filtering of the 'where' clause, based on that query var.
This still doesn't use the new terminology, like 'Identified.' There wasn't much to change, as filtering by error type worked thanks to Weston.
Though these views are now applied in a <select> filter, this uses much of their infrastructure. Also, it uses their counts for each status. For example, if there are 0 accepted errors, this won't display the <option> for 'Accepted Error'.
Filtering By Error Status
The UI to view errors by status is now in a
This uses the existing work to filter by status, and merely applies it to the
The AMP validation error page also needs these filters, but it doesn't need all of render_taxonomy_filters(). So abstract it into 2 functions that can be reused.
Before, that didn't take account of the filter for error type So if that filtered for js_error, the total count of error status was the same as if it were for 'All Error Types.' So look for the query var for the error type, and pass that to the WP_Query if it's valid.
…rors' This is how the text was when it was inside a link. Check for the current screen, and conditionally add the 'With'.
… redirect Before, the filter for the redirect URL did not accept -1, which is for 'All Error Types' and 'All Statuses'. This means that the URL sometimes did not redirect, and it sometimes showed the same results as before.