Conseguir lista de key|value para un campo CCK concreto

22 February 2011 – 13:00

Muy sencillo: si nuestro campo se llama ‘field_categoria’ solo tenemos que hacer lo siguiente:

$field = content_fields('field_categoria');
$values = content_allowed_values($field);

Y listo. En la variable $values tenemos un array con los diferentes valores que puede coger ese campo CCK (gracias a Jacinto por la ayuda)


Publicado originalmente en mi antiguo blog, 3oheme.com, y recuperado de archive.org.

This is the personal website of Ignacio Palomo Duarte, Product Manager. If you're looking for my portfolio and more information just have a look at the homepage, and if you liked this article maybe you can share it on Bluesky.