Possible Duplicate:
How can I use PHP closure function like function() use() on PHP 5.2 version?
I'm trying to run this on a server that's running php 5.2.
function add_post_type($name, $args = array() ) {
add_action('init',function() use($name, $args) {
// execute custom post type code here
});
};
The 2nd line is throwing an unexpected T_FUNCTION error, I suspect its cause of the "use" operator. Can someone help point me as to how I can rewrite this function to run in php 5.2?
function(). but what actually you are trying to do?