From 4cecedc88bf3f321d7cc53320eca18d6b3818f0f Mon Sep 17 00:00:00 2001 From: Derrick Koo Date: Mon, 10 Jan 2022 14:14:38 -0700 Subject: [PATCH] fix: lint errors --- .../class-wp-rest-newspack-author-list-controller.php | 6 +++--- src/blocks/author-list/edit.js | 4 +++- src/blocks/author-list/view.php | 2 +- src/blocks/author-profile/edit.js | 4 +++- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/blocks/author-list/class-wp-rest-newspack-author-list-controller.php b/src/blocks/author-list/class-wp-rest-newspack-author-list-controller.php index a6fa40388..b0ead48e1 100644 --- a/src/blocks/author-list/class-wp-rest-newspack-author-list-controller.php +++ b/src/blocks/author-list/class-wp-rest-newspack-author-list-controller.php @@ -108,7 +108,7 @@ public function api_get_all_authors( $request ) { } if ( ! empty( $request->get_param( 'exclude' ) ) && is_array( $request->get_param( 'exclude' ) ) ) { - $options['exclude'] = $request->get_param( 'exclude' ); + $options['exclude'] = $request->get_param( 'exclude' ); // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude } if ( ! empty( $request->get_param( 'excludeEmpty' ) ) ) { @@ -142,7 +142,7 @@ public function get_all_authors( $options = [] ) { 'author_type' => 'all', 'author_roles' => $this->get_editable_roles(), 'avatar_hide_default' => false, - 'exclude' => [], + 'exclude' => [], // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude 'exclude_empty' => false, 'fields' => [ 'id', 'name', 'bio', 'email', 'social', 'avatar', 'url' ], 'per_page' => 10, @@ -209,7 +209,7 @@ public function get_all_authors( $options = [] ) { ]; if ( ! empty( $options['exclude'] ) ) { - $user_args['exclude'] = $options['exclude']; + $user_args['exclude'] = $options['exclude']; // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude } $results = new \WP_User_Query( $user_args ); diff --git a/src/blocks/author-list/edit.js b/src/blocks/author-list/edit.js index c9e9358c9..8654a91f0 100644 --- a/src/blocks/author-list/edit.js +++ b/src/blocks/author-list/edit.js @@ -45,7 +45,7 @@ import { SingleAuthor } from '../author-profile/single-author'; import { AutocompleteWithSuggestions } from 'newspack-components'; import classnames from 'classnames'; -export default ( { attributes, clientId, setAttributes } ) => { +const AuthorList = ( { attributes, clientId, setAttributes } ) => { const [ authors, setAuthors ] = useState( null ); const [ error, setError ] = useState( null ); const [ isLoading, setIsLoading ] = useState( false ); @@ -523,3 +523,5 @@ export default ( { attributes, clientId, setAttributes } ) => { ); }; + +export default AuthorList; diff --git a/src/blocks/author-list/view.php b/src/blocks/author-list/view.php index e034c1349..760bbb6fc 100644 --- a/src/blocks/author-list/view.php +++ b/src/blocks/author-list/view.php @@ -51,7 +51,7 @@ function( $exclusion ) { $params = [ 'author_type' => $author_type, 'author_roles' => $author_roles, - 'exclude' => $exclude_ids, + 'exclude' => $exclude_ids, // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude 'fields' => [ 'id', 'name', 'bio', 'email', 'social', 'avatar', 'url' ], ]; diff --git a/src/blocks/author-profile/edit.js b/src/blocks/author-profile/edit.js index f308401df..0ece66692 100644 --- a/src/blocks/author-profile/edit.js +++ b/src/blocks/author-profile/edit.js @@ -131,7 +131,7 @@ export const avatarSizeOptions = [ }, ]; -export default ( { attributes, setAttributes } ) => { +const AuthorProfile = ( { attributes, setAttributes } ) => { const [ author, setAuthor ] = useState( null ); const [ error, setError ] = useState( null ); const [ isLoading, setIsLoading ] = useState( false ); @@ -426,3 +426,5 @@ export default ( { attributes, setAttributes } ) => { ); }; + +export default AuthorProfile;