How do I add reCaptcha to a form programmatically? I have a custom form on my site, and I want to attach a reCaptcha to it. I wasn't successful using the Drupal 7 code for this. Suggestions?
This is the Drupal 7 code I'm using:

$form['recaptcha'] = array(
  '#type' =&gt; 'recaptcha'
);
Use the following (after installing the reCaptcha module):

$form['captcha'] = array(
  '#type' =&gt; 'captcha',
  '#captcha_type' =&gt; 'recaptcha/reCAPTCHA',
);