@@ -132,12 +132,9 @@ public function store_settings_form_options() {
132132 \check_admin_referer ( 'progress_planner ' );
133133
134134 if ( isset ( $ _POST ['pages ' ] ) ) {
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 ' ;
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 ' ] ) );
141138
142139 \progress_planner ()->get_page_types ()->set_no_page_needed (
143140 $ type ,
@@ -168,7 +165,7 @@ public function store_settings_form_options() {
168165
169166 if ( 'no ' !== $ page_args ['have_page ' ] ) {
170167 // Add the term to the `progress_planner_page_types` taxonomy.
171- \progress_planner ()->get_page_types ()->set_page_type_by_id ( (int ) $ page_args ['id ' ], $ type ); // @phpstan-ignore-line cast.int
168+ \progress_planner ()->get_page_types ()->set_page_type_by_id ( (int ) $ page_args ['id ' ], $ type );
172169 }
173170 }
174171 }
@@ -191,7 +188,7 @@ public function save_settings() {
191188 \check_admin_referer ( 'progress_planner ' );
192189
193190 $ redirect_on_login = isset ( $ _POST ['prpl-redirect-on-login ' ] )
194- ? \sanitize_text_field ( \wp_unslash ( $ _POST ['prpl-redirect-on-login ' ] ) ) // @phpstan-ignore-line argument.type
191+ ? \sanitize_text_field ( \wp_unslash ( $ _POST ['prpl-redirect-on-login ' ] ) )
195192 : false ;
196193
197194 \update_user_meta ( \get_current_user_id (), 'prpl_redirect_on_login ' , (bool ) $ redirect_on_login );
@@ -207,7 +204,7 @@ public function save_post_types() {
207204 \check_admin_referer ( 'progress_planner ' );
208205
209206 $ include_post_types = isset ( $ _POST ['prpl-post-types-include ' ] )
210- ? \array_map ( 'sanitize_text_field ' , \wp_unslash ( $ _POST ['prpl-post-types-include ' ] ) ) // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized @phpstan-ignore-line argument.type
207+ ? \array_map ( 'sanitize_text_field ' , \wp_unslash ( $ _POST ['prpl-post-types-include ' ] ) ) // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
211208 // If no post types are selected, use the default post types (post and page can be deregistered).
212209 : \array_intersect ( [ 'post ' , 'page ' ], \progress_planner ()->get_settings ()->get_public_post_types () );
213210
0 commit comments