@@ -132,9 +132,12 @@ public function store_settings_form_options() {
132132 \check_admin_referer ( 'progress_planner ' );
133133
134134 if ( isset ( $ _POST ['pages ' ] ) ) {
135- foreach ( \wp_unslash ( $ _POST ['pages ' ] ) as $ type => $ page_args ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
136-
137- $ need_page = \sanitize_text_field ( \wp_unslash ( $ page_args ['have_page ' ] ) );
135+ $ pages = (array ) \wp_unslash ( $ _POST ['pages ' ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
136+ foreach ( $ pages as $ type => $ page_args ) {
137+ $ page_args = (array ) $ page_args ;
138+ $ need_page = isset ( $ page_args ['have_page ' ] )
139+ ? \sanitize_text_field ( \wp_unslash ( $ page_args ['have_page ' ] ) ) // @phpstan-ignore-line argument.type
140+ : 'not-applicable ' ;
138141
139142 \progress_planner ()->get_page_types ()->set_no_page_needed (
140143 $ type ,
@@ -165,7 +168,7 @@ public function store_settings_form_options() {
165168
166169 if ( 'no ' !== $ page_args ['have_page ' ] ) {
167170 // Add the term to the `progress_planner_page_types` taxonomy.
168- \progress_planner ()->get_page_types ()->set_page_type_by_id ( (int ) $ page_args ['id ' ], $ type );
171+ \progress_planner ()->get_page_types ()->set_page_type_by_id ( (int ) $ page_args ['id ' ], $ type ); // @phpstan-ignore-line cast.int
169172 }
170173 }
171174 }
@@ -188,7 +191,7 @@ public function save_settings() {
188191 \check_admin_referer ( 'progress_planner ' );
189192
190193 $ redirect_on_login = isset ( $ _POST ['prpl-redirect-on-login ' ] )
191- ? \sanitize_text_field ( \wp_unslash ( $ _POST ['prpl-redirect-on-login ' ] ) )
194+ ? \sanitize_text_field ( \wp_unslash ( $ _POST ['prpl-redirect-on-login ' ] ) ) // @phpstan-ignore-line argument.type
192195 : false ;
193196
194197 \update_user_meta ( \get_current_user_id (), 'prpl_redirect_on_login ' , (bool ) $ redirect_on_login );
@@ -204,7 +207,7 @@ public function save_post_types() {
204207 \check_admin_referer ( 'progress_planner ' );
205208
206209 $ include_post_types = isset ( $ _POST ['prpl-post-types-include ' ] )
207- ? \array_map ( 'sanitize_text_field ' , \wp_unslash ( $ _POST ['prpl-post-types-include ' ] ) ) // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
210+ ? \array_map ( 'sanitize_text_field ' , \wp_unslash ( $ _POST ['prpl-post-types-include ' ] ) ) // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized @phpstan-ignore-line argument.type
208211 // If no post types are selected, use the default post types (post and page can be deregistered).
209212 : \array_intersect ( [ 'post ' , 'page ' ], \progress_planner ()->get_settings ()->get_public_post_types () );
210213
0 commit comments