简体   繁体   中英

Drupal: CCK API Docs

Any good CCK API docs out there? I have seen http://api.audean.com/ , but can't find what I want there.

Basically, I need a function that takes a field name and returns what node type has that field. I wrote my own, but would rather make an API call.

CCK is an awesome module but has terrible, outdated documentation. :(

Looking through the module files revealed content_fields($field_name) which may provide the functionality you are looking for.

The function takes in the field name and returns an array of all the settings for that field. The node type is stored in ['type_name'] so you could write something like the following:

$field = content_fields('field_myfield');
$node_type = $field['type_name'];

That should give you the node type for field_myfield.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM