omo posso usar a função de fechamento do PHP como function () use () na versão do PHP 5.
Como posso usar a função de fechamento do PHP como function () use () na versão do PHP 5.2, pois ele não suporta funções anônima
Atualmente, meu código é algo como abaixo
$this->init(function() use($taxonomy_name, $plural, $post_type_name, $options)
{
// Override defaults with user provided options
$options = array_merge(
array(
"hierarchical" => false,
"label" => $taxonomy_name,
"singular_label" => $plural,
"show_ui" => true,
"query_var" => true,
"rewrite" => array("slug" => strtolower($taxonomy_name))
), $options
);
// name of taxonomy, associated post type, options
register_taxonomy(strtolower($taxonomy_name), $post_type_name, $options);
});