API page: http://api.drupal.org/api/drupal/modules%21taxonomy%21taxonomy.module/fu...

It would be incredibly helpful if the return value objects from core functions (like the above mentioned) were documented as well as the functions themselves. For example, the taxonomy_term_load function's return value is documented as "A taxonomy term object, or FALSE if the term was not found. Results are statically cached.". Which is well and great... but what's a taxonomy term object? What properties does it have? What array values does it expose? The only way for me to find out is to install the Devel module and Krumo() that function with one of my existing taxonomy terms.

An example of what I'm referring to can be seen on any MSDN documentation for the .NET framework. For example: http://msdn.microsoft.com/en-us/library/system.intptr.toint32%28v=vs.100... is the documentation for the IntPtr.ToInt32 method. You're able to click "System.Int32" under Return Value to see the documentation for that type, including methods, properties etc... This would be incredibly helpful for new Drupal developers.

Comments

jhodgdon’s picture

Title: More descriptive documentation of return values from core functions. » Return value of taxonomy_term_load() and other taxonomy functions need specifics
Category: feature » bug

Agreed. Let's make this issue specific to taxonomy though. If you find others that should be updated, please file issues for them to. And they are documentation *bugs*, since incomplete information is a bug in docuemnentation.

And this is D7 only; in D8 the return value is a class object, which is documented.

Status: Active » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.