# extendify/3.1.0/app/Shared/Services/Escaper.php

Extendify, version 3.1.0. 38 lines.

- Page: https://pluginprobe.com/plugins/extendify/3.1.0/code/app/Shared/Services/Escaper.php
- Raw: https://pluginprobe.com/plugins/extendify/3.1.0/raw/app/Shared/Services/Escaper.php
- Modified: 2025-05-22T18:26:12+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/extendify/3.1.0/code/app/Shared/Services/Escaper.php#L10-L20`.

```php
<?php

/**
 * The Sanitizer class
 */

namespace Extendify\Shared\Services;

defined('ABSPATH') || die('No direct access.');

/**
 * Class for escaping various data attributes.
 */

class Escaper
{
    /**
     * This function will escape the attribute of a multidimensional array.
     *
     * @param array $array - The array we need to escape.
     * @return array
     */
    public static function recursiveEscAttr($array): array
    {
        if (!is_array($array)) {
            return (array) esc_attr($array);
        }

        return array_map(static function ($value) {
            if (is_array($value)) {
                return self::recursiveEscAttr($value);
            }

            return esc_attr($value);
        }, $array);
    }
}

```
