Why isn't my programmaticlly created field showing up to be added to a content type I'm trying to create a field that I can add to content types via my module, here is how I'm doing it:

/* Create the field to hold RSVP info */
function kade_rsvp_enable(){
    if(field_info_field(FIELD_REQUIRE_RSVP)) return; //field already created

    $field = array(
        "field_name" =&gt; FIELD_REQUIRE_RSVP,
        'cardinality' =&gt; 1,
        'entity_type' =&gt; 'node',
        'type' =&gt; 'list_boolean',
        'description' =&gt; 'Enable RSVP for this event?',
        'label' =&gt; 'Enable RSVP',
        'widget' =&gt; array(
            'type' =&gt; 'options_onoff',
        ),
        'settings' =&gt; array(
            'allowed_values' =&gt; array(
                '0' =&gt; 'No',
                '1' =&gt; 'Yes',
            ),
        ),
    );

    field_create_field($field);
}


And the field is getting created when the module is enabled. Here is the var_dump of the field_info_field for it's id:

array(20) {
  ["entity_type"]=&gt;
  string(4) "node"
  ["description"]=&gt;
  string(27) "Enable RSVP for this event?"
  ["label"]=&gt;
  string(11) "Enable RSVP"
  ["widget"]=&gt;
  array(1) {
    ["type"]=&gt;
    string(13) "options_onoff"
  }
  ["settings"]=&gt;
  array(2) {
    ["allowed_values"]=&gt;
    array(2) {
      [0]=&gt;
      string(2) "No"
      [1]=&gt;
      string(3) "Yes"
    }
    ["allowed_values_function"]=&gt;
    string(0) ""
  }
  ["entity_types"]=&gt;
  array(0) {
  }
  ["translatable"]=&gt;
  string(1) "0"
  ["storage"]=&gt;
  array(5) {
    ["type"]=&gt;
    string(17) "field_sql_storage"
    ["settings"]=&gt;
    array(0) {
    }
    ["module"]=&gt;
    string(17) "field_sql_storage"
    ["active"]=&gt;
    string(1) "1"
    ["details"]=&gt;
    array(1) {
      ["sql"]=&gt;
      array(2) {
        ["FIELD_LOAD_CURRENT"]=&gt;
        array(1) {
          ["field_data_field_require_rsvp"]=&gt;
          array(1) {
            ["value"]=&gt;
            string(24) "field_require_rsvp_value"
          }
        }
        ["FIELD_LOAD_REVISION"]=&gt;
        array(1) {
          ["field_revision_field_require_rsvp"]=&gt;
          array(1) {
            ["value"]=&gt;
            string(24) "field_require_rsvp_value"
          }
        }
      }
    }
  }
  ["foreign keys"]=&gt;
  array(0) {
  }
  ["indexes"]=&gt;
  array(1) {
    ["value"]=&gt;
    array(1) {
      [0]=&gt;
      string(5) "value"
    }
  }
  ["id"]=&gt;
  string(2) "23"
  ["field_name"]=&gt;
  string(18) "field_require_rsvp"
  ["type"]=&gt;
  string(12) "list_boolean"
  ["module"]=&gt;
  string(4) "list"
  ["active"]=&gt;
  string(1) "1"
  ["locked"]=&gt;
  string(1) "0"
  ["cardinality"]=&gt;
  string(1) "1"
  ["deleted"]=&gt;
  string(1) "0"
  ["columns"]=&gt;
  array(1) {
    ["value"]=&gt;
    array(2) {
      ["type"]=&gt;
      string(3) "int"
      ["not null"]=&gt;
      bool(false)
    }
  }
  ["bundles"]=&gt;
  array(0) {
  }
}


However, it doesn't show up when I go to add it to a content type



What am I doing wrong?
You also need field instance to add that field to a content type.


  field_create_instance() : Creates an instance of a field, binding it
  to a bundle.



  // Create field.
  $field_name = 'field_rsvp';
  if (!field_info_field($field_name)) {
    $field = array(
      "field_name" => $field_name,
      'cardinality' => 1,
      'entity_type' => 'node',
      'type' => 'list_boolean',
      'description' => 'Enable RSVP for this event?',
      'label' => 'Enable RSVP',
      'widget' => array(
        'type' => 'options_onoff',
      ),
      'settings' => array(
        'allowed_values' => array(
          '0' => 'No',
          '1' => 'Yes',
        ),
      ),
    );
    field_create_field($field);

    // Create the instance.
    $instance = array(
      'field_name' => $field_name,
      'entity_type' => 'node',
      'bundle' => 'article',
      'label' => 'Enable RSVP',
      'description' => 'Enable RSVP for this event?',
      'required' => TRUE,
    );

    field_create_instance($instance);
  }


If you created a new field say for article content type, then you can see that field for other content types in the Add existing field field as mentioned in the comment by tenken