0

I have an array like this

[select_post_template_repeater] => Array
        (
            [0] => Array
                (
                    [0] => post
                    [template] => Array
                        (
                            [0] => Array
                                (
                                    [0] => 234
                                )

                        )

                )

        )

Is it the correct way to sanitize this like this?

$sanitary_values = array();
        if (isset($input['select_post_template_repeater'])) {
            foreach ($input['select_post_template_repeater'] as $key => $value) {
              sanitize_text_field($value [0]);
              intval( $value['template'][0][0]);
            }
            $sanitary_values['select_post_template_repeater'] = $input['select_post_template_repeater'];
        }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.