call_user_func_array() error after moving to another server

The code contained the line add_action( 'admin_init', 'my_admin' ); at the end, but my_admin wasn’t declared anywhere. Changed it to all_post_types, my function to register all the custom post types at once and it worked.