Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.984
diff -u -p -r1.984 common.inc
--- includes/common.inc	5 Sep 2009 15:05:01 -0000	1.984
+++ includes/common.inc	9 Sep 2009 23:42:44 -0000
@@ -4425,13 +4425,7 @@ function element_info($type) {
   if (!isset($cache)) {
     $basic_defaults = element_basic_defaults();
     $cache = array();
-
-    foreach (module_implements('elements') as $module) {
-      $elements = module_invoke($module, 'elements');
-      if (isset($elements) && is_array($elements)) {
-        $cache = array_merge_recursive($cache, $elements);
-      }
-    }
+    $elements = module_invoke_all('element_info');
     if (!empty($cache)) {
       foreach ($cache as $element_type => $info) {
         $cache[$element_type] = array_merge_recursive($basic_defaults, $info);
Index: includes/form.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/form.inc,v
retrieving revision 1.370
diff -u -p -r1.370 form.inc
--- includes/form.inc	5 Sep 2009 15:05:01 -0000	1.370
+++ includes/form.inc	9 Sep 2009 23:29:18 -0000
@@ -1932,7 +1932,7 @@ function form_process_radios($element) {
  *   $form_state['values']['body_format'] = 1;
  * @endcode
  *
- * @see system_elements(), filter_form()
+ * @see system_element_info(), filter_form()
  */
 function form_process_text_format($element) {
   if (isset($element['#text_format'])) {
Index: modules/field/field.api.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/field/field.api.php,v
retrieving revision 1.33
diff -u -p -r1.33 field.api.php
--- modules/field/field.api.php	9 Sep 2009 21:21:53 -0000	1.33
+++ modules/field/field.api.php	9 Sep 2009 23:29:40 -0000
@@ -603,7 +603,7 @@ function hook_field_widget_info_alter(&$
  * Return a single form element for a form.
  *
  * It will be built out and validated in the callback(s) listed in
- * hook_elements. We build it out in the callbacks rather than in
+ * hook_element_info(). We build it out in the callbacks rather than in
  * hook_field_widget so it can be plugged into any module that can
  * provide it with valid $field information.
  *
Index: modules/field/modules/number/number.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/field/modules/number/number.module,v
retrieving revision 1.16
diff -u -p -r1.16 number.module
--- modules/field/modules/number/number.module	9 Sep 2009 21:21:54 -0000	1.16
+++ modules/field/modules/number/number.module	9 Sep 2009 23:43:54 -0000
@@ -292,32 +292,26 @@ function number_field_widget_info() {
 }
 
 /**
- * Implement FAPI hook_elements().
- *
- * Any FAPI callbacks needed for individual widgets can be declared here,
- * and the element will be passed to those callbacks for processing.
- *
- * Drupal will automatically theme the element using a theme with
- * the same name as the hook_elements key.
+ * Implement hook_element_info().
  *
  * Includes a regex to check for valid values as an additional parameter
  * the validator can use. The regex can be overridden if necessary.
  */
-function number_elements() {
-  return array(
-    'number' => array(
-      '#input' => TRUE,
-      '#columns' => array('value'), '#delta' => 0,
-      '#process' => array('number_elements_process'),
-    ),
+function number_element_info() {
+  $type['number'] = array(
+    '#input' => TRUE,
+    '#columns' => array('value'),
+    '#delta' => 0,
+    '#process' => array('number_elements_process'),
   );
+  return $type;
 }
 
 /**
  * Implement hook_field_widget().
  *
  * Attach a single form element to the form. It will be built out and
- * validated in the callback(s) listed in hook_elements. We build it
+ * validated in the callback(s) listed in hook_element_info(). We build it
  * out in the callbacks rather than here in hook_widget so it can be
  * plugged into any module that can provide it with valid
  * $field information.
Index: modules/field/modules/options/options.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/field/modules/options/options.module,v
retrieving revision 1.9
diff -u -p -r1.9 options.module
--- modules/field/modules/options/options.module	27 Aug 2009 00:33:51 -0000	1.9
+++ modules/field/modules/options/options.module	9 Sep 2009 23:44:31 -0000
@@ -67,32 +67,28 @@ function options_field_widget_info() {
 }
 
 /**
- * Implement FAPI hook_elements().
- *
- * Any FAPI callbacks needed for individual widgets can be declared here,
- * and the element will be passed to those callbacks for processing.
- *
- * Drupal will automatically theme the element using a theme with
- * the same name as the hook_elements key.
+ * Implement hook_element_info().
  */
-function options_elements() {
-  return array(
-    'options_select' => array(
-      '#input' => TRUE,
-      '#columns' => array('value'), '#delta' => 0,
-      '#process' => array('options_select_elements_process'),
-      ),
-    'options_buttons' => array(
-      '#input' => TRUE,
-      '#columns' => array('value'), '#delta' => 0,
-      '#process' => array('options_buttons_elements_process'),
-      ),
-    'options_onoff' => array(
-      '#input' => TRUE,
-      '#columns' => array('value'), '#delta' => 0,
-      '#process' => array('options_onoff_elements_process'),
-      ),
-    );
+function options_element_info() {
+  $type['options_select'] = array(
+    '#input' => TRUE,
+    '#columns' => array('value'),
+    '#delta' => 0,
+    '#process' => array('options_select_elements_process'),
+  );
+  $type['options_buttons'] = array(
+    '#input' => TRUE,
+    '#columns' => array('value'),
+    '#delta' => 0,
+    '#process' => array('options_buttons_elements_process'),
+  );
+  $type['options_onoff'] = array(
+    '#input' => TRUE,
+    '#columns' => array('value'),
+    '#delta' => 0,
+    '#process' => array('options_onoff_elements_process'),
+  );
+  return $type;
 }
 
 /**
Index: modules/field/modules/text/text.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/field/modules/text/text.module,v
retrieving revision 1.26
diff -u -p -r1.26 text.module
--- modules/field/modules/text/text.module	9 Sep 2009 21:21:54 -0000	1.26
+++ modules/field/modules/text/text.module	9 Sep 2009 23:45:02 -0000
@@ -521,48 +521,44 @@ function text_field_widget_settings_form
 }
 
 /**
- * Implement FAPI hook_elements().
- *
- * Any FAPI callbacks needed for individual widgets can be declared here,
- * and the element will be passed to those callbacks for processing.
- *
- * Drupal will automatically theme the element using a theme with
- * the same name as the hook_elements key.
+ * Implement hook_element_info().
  *
  * Autocomplete_path is not used by text_field_widget but other
  * widgets can use it (see nodereference and userreference).
  */
-function text_elements() {
-  return array(
-    'text_textfield' => array(
-      '#input' => TRUE,
-      '#columns' => array('value'), '#delta' => 0,
-      '#process' => array('text_textfield_elements_process'),
-      '#theme_wrappers' => array('text_textfield'),
-      '#autocomplete_path' => FALSE,
-    ),
-    'text_textarea' => array(
-      '#input' => TRUE,
-      '#columns' => array('value', 'format'), '#delta' => 0,
-      '#process' => array('text_textarea_elements_process'),
-      '#theme_wrappers' => array('text_textarea'),
-      '#filter_value' => FILTER_FORMAT_DEFAULT,
-    ),
-    'text_textarea_with_summary' => array(
-      '#input' => TRUE,
-      '#columns' => array('value', 'format', 'summary'), '#delta' => 0,
-      '#process' => array('text_textarea_with_summary_process'),
-      '#theme_wrappers' => array('text_textarea'),
-      '#filter_value' => FILTER_FORMAT_DEFAULT,
-    ),
+function text_element_info() {
+  $type['text_textfield'] = array(
+    '#input' => TRUE,
+    '#columns' => array('value'),
+    '#delta' => 0,
+    '#process' => array('text_textfield_elements_process'),
+    '#theme_wrappers' => array('text_textfield'),
+    '#autocomplete_path' => FALSE,
+  );
+  $type['text_textarea'] = array(
+    '#input' => TRUE,
+    '#columns' => array('value', 'format'),
+    '#delta' => 0,
+    '#process' => array('text_textarea_elements_process'),
+    '#theme_wrappers' => array('text_textarea'),
+    '#filter_value' => FILTER_FORMAT_DEFAULT,
+  );
+  $type['text_textarea_with_summary'] = array(
+    '#input' => TRUE,
+    '#columns' => array('value', 'format', 'summary'),
+    '#delta' => 0,
+    '#process' => array('text_textarea_with_summary_process'),
+    '#theme_wrappers' => array('text_textarea'),
+    '#filter_value' => FILTER_FORMAT_DEFAULT,
   );
+  return $type;
 }
 
 /**
  * Implement hook_field_widget().
  *
  * Attach a single form element to the form. It will be built out and
- * validated in the callback(s) listed in hook_elements. We build it
+ * validated in the callback(s) listed in hook_element_info(). We build it
  * out in the callbacks rather than here in hook_field_widget so it can be
  * plugged into any module that can provide it with valid
  * $field information.
Index: modules/file/file.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/file/file.module,v
retrieving revision 1.3
diff -u -p -r1.3 file.module
--- modules/file/file.module	9 Sep 2009 21:21:54 -0000	1.3
+++ modules/file/file.module	9 Sep 2009 23:37:14 -0000
@@ -30,15 +30,13 @@ function file_menu() {
 }
 
 /**
- * Implement hook_elements().
+ * Implement hook_element_info().
+ *
+ * The managed file element may be used independently anywhere in Drupal.
  */
-function file_elements() {
-  $elements = array();
-
+function file_element_info() {
   $file_path = drupal_get_path('module', 'file');
-
-  // The managed file element may be used independently anywhere in Drupal.
-  $elements['managed_file'] = array(
+  $type['managed_file'] = array(
     '#input' => TRUE,
     '#process' => array('file_managed_file_process'),
     '#value_callback' => 'file_managed_file_value',
@@ -55,8 +53,7 @@ function file_elements() {
       'js' => array($file_path . '/file.js'),
     ),
   );
-
-  return $elements;
+  return $type;
 }
 
 /**
Index: modules/simpletest/tests/field_test.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/field_test.module,v
retrieving revision 1.21
diff -u -p -r1.21 field_test.module
--- modules/simpletest/tests/field_test.module	31 Aug 2009 05:35:47 -0000	1.21
+++ modules/simpletest/tests/field_test.module	9 Sep 2009 23:31:19 -0000
@@ -470,7 +470,7 @@ function field_test_field_widget_info() 
  * Implement hook_field_widget().
  *
  * Attach a single form element to the form. It will be built out and
- * validated in the callback(s) listed in hook_elements. We build it
+ * validated in the callback(s) listed in hook_element_info(). We build it
  * out in the callbacks rather than here in hook_widget so it can be
  * plugged into any module that can provide it with valid
  * $field information.
Index: modules/system/system.api.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.api.php,v
retrieving revision 1.72
diff -u -p -r1.72 system.api.php
--- modules/system/system.api.php	5 Sep 2009 13:05:31 -0000	1.72
+++ modules/system/system.api.php	9 Sep 2009 23:31:36 -0000
@@ -216,7 +216,7 @@ function hook_db_rewrite_sql($query, $pr
  *  - "#post_render": array of callback functions taking $element and $form_state.
  *  - "#submit": array of callback functions taking $form and $form_state.
  */
-function hook_elements() {
+function hook_element_info() {
   $type['filter_format'] = array('#input' => TRUE);
   return $type;
 }
@@ -228,9 +228,9 @@ function hook_elements() {
  * defined by a module.
  *
  * @param &$type
- *   All element type defaults as collected by hook_elements().
+ *   All element type defaults as collected by hook_element_info().
  *
- * @see hook_elements()
+ * @see hook_element_info()
  */
 function hook_element_info_alter(&$type) {
   // Decrease the default size of textfields.
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.785
diff -u -p -r1.785 system.module
--- modules/system/system.module	5 Sep 2009 15:05:04 -0000	1.785
+++ modules/system/system.module	9 Sep 2009 23:31:59 -0000
@@ -279,9 +279,9 @@ function system_entity_info() {
 }
 
 /**
- * Implement hook_elements().
+ * Implement hook_element_info().
  */
-function system_elements() {
+function system_element_info() {
   // Top level form
   $type['form'] = array(
     '#method' => 'post',
Index: modules/taxonomy/taxonomy.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.module,v
retrieving revision 1.509
diff -u -p -r1.509 taxonomy.module
--- modules/taxonomy/taxonomy.module	9 Sep 2009 21:21:54 -0000	1.509
+++ modules/taxonomy/taxonomy.module	9 Sep 2009 23:35:31 -0000
@@ -2144,23 +2144,16 @@ function taxonomy_autocomplete_validate(
 }
 
 /**
- * Implement FAPI hook_elements().
- *
- * Any FAPI callbacks needed for individual widgets can be declared here,
- * and the element will be passed to those callbacks for processing.
- *
- * Drupal will automatically theme the element using a theme with
- * the same name as the hook_elements key.
+ * Implement hook_element_info().
  */
-function taxonomy_elements() {
-  return array(
-    'taxonomy_autocomplete' => array(
-      '#input' => TRUE,
-      '#columns' => array('value'),
-      '#delta' => 0,
-      '#process' => array('taxonomy_autocomplete_elements_process'),
-    ),
+function taxonomy_element_info() {
+  $type['taxonomy_autocomplete'] = array(
+    '#input' => TRUE,
+    '#columns' => array('value'),
+    '#delta' => 0,
+    '#process' => array('taxonomy_autocomplete_elements_process'),
   );
+  return $type;
 }
 
 /**
Index: modules/user/user.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.module,v
retrieving revision 1.1040
diff -u -p -r1.1040 user.module
--- modules/user/user.module	9 Sep 2009 11:27:00 -0000	1.1040
+++ modules/user/user.module	9 Sep 2009 23:36:13 -0000
@@ -838,17 +838,16 @@ function user_search_execute($keys = NUL
 }
 
 /**
- * Implement hook_elements().
+ * Implement hook_element_info().
  */
-function user_elements() {
-  return array(
-    'user_profile_category' => array(
-      '#theme_wrappers' => array('user_profile_category')
-    ),
-    'user_profile_item' => array(
-      '#theme' => 'user_profile_item'
-    ),
+function user_element_info() {
+  $type['user_profile_category'] = array(
+    '#theme_wrappers' => array('user_profile_category'),
+  );
+  $type['user_profile_item'] = array(
+    '#theme' => 'user_profile_item',
   );
+  return $type;
 }
 
 /**
