$data) { foreach ($data as $key => $value) { // Convert array key string to property name. // Remove other then char, dash, give related prefix and hyphen and prefix. $newName = preg_replace('/[^a-zA-Z0-9_\-]/', '', $key); $newName = preg_replace('/(-|_)?give(-|_)?/', '', $newName); $keyParts = preg_split('/(-|_)/', $newName); $keyParts = array_map('ucfirst', array_filter($keyParts)); $newName = lcfirst(implode('', $keyParts)); // Remove old key/value pair if renamed. if ($key !== $newName) { unset($data[$key]); } if (is_array($value)) { // Process array. $data[$newName] = $this->renameArrayKeysToPropertyNames($value); continue; } $data[$newName] = $value; } return $data; } /** * Validate data. * * @since 2.7.0 * * @param mixed $data * */ protected function validateData($data) { if (is_array($data) && isset($data[0])) { throw new InvalidArgumentException('Invalid value. Please pass an associative array'); } } }
Fatal error: Uncaught Error: Class "Give\Session\Accessor" not found in /htdocs/wp-content/plugins/give/src/Session/SessionDonation/DonationAccessor.php:19 Stack trace: #0 /htdocs/wp-content/plugins/elementor/vendor/composer/ClassLoader.php(576): include() #1 /htdocs/wp-content/plugins/elementor/vendor/composer/ClassLoader.php(427): Composer\Autoload\{closure}('/htdocs/wp-cont...') #2 /htdocs/wp-content/plugins/give/src/Helpers/Form/Template/Utils/Frontend.php(60): Composer\Autoload\ClassLoader->loadClass('Give\\Session\\Se...') #3 /htdocs/wp-content/plugins/give/src/Helpers/Form/Utils.php(36): Give\Helpers\Form\Template\Utils\Frontend::getFormId() #4 /htdocs/wp-content/plugins/give/src/Controller/Form.php(222): Give\Helpers\Form\Utils::isProcessingForm() #5 /htdocs/wp-includes/class-wp-hook.php(341): Give\Controller\Form->embedFormRedirectURIHandler('') #6 /htdocs/wp-includes/class-wp-hook.php(365): WP_Hook->apply_filters(NULL, Array) #7 /htdocs/wp-includes/plugin.php(522): WP_Hook->do_action(Array) #8 /htdocs/wp-settings.php(742): do_action('init') #9 /htdocs/wp-config.php(98): require_once('/htdocs/wp-sett...') #10 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #11 /htdocs/wp-blog-header.php(14): require_once('/htdocs/wp-load...') #12 /htdocs/index.php(17): require('/htdocs/wp-blog...') #13 {main} thrown in /htdocs/wp-content/plugins/give/src/Session/SessionDonation/DonationAccessor.php on line 19