/* * PHP 8 create_function replacement. * Use apenas como um paliativo para o sistema antigo voltar * a funcionar e atualize em seguida. * coloque este trecho dentro do arquivo functions.php do tema ativo. */ if ( ! function_exists( "create_function" ) ) { function create_function( $arg, $body ) { static $cache = array(); static $max_cache_size = 64; static $sorter; if ( $sorter === NULL ) { $sorter = function( $a, $b ) { if ( $a->hits == $b->hits ) { return 0; } return ($a->hits < $b->hits) ? 1 : -1; }; } $crc = crc32($arg . "\\x00" . $body); if (isset($cache[$crc])) { ++$cache[$crc][1]; return $cache[$crc][0]; } if ( sizeof($cache) >= $max_cache_size ) { uasort($cache, $sorter); array_pop($cache); } $cache[$crc] = array( $cb = eval('return function('.$arg.'){'.$body.'};'), 0 ); return $cb; } }