欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

where does the drupal6 cck field default value stored in database? 有大用

shiping1 的头像
 正确答案 有两种方法 
第一种方法 

 module_load_include('inc', 'content', 'includes/content.crud');
$definition = content_field_instance_read(array('field_name' => 'field_foo'));

// Your mileage may vary here, inspect $definition[0]['widget'] to see what you've got available.
$default = $definition[0]['widget']['default_value'][0]['value'];

第二种方法 
$content_field = content_fields('field_is_zhengguo');
$default = $content_field['widget']['default_value'][0]['value'];



If you're dead set on going into the database, the info is stored as a serialised PHP string in the widget_settings column of the content_node_field_instance table.





来自 
http://drupal.stackexchange.com/questions/86124/where-does-the-drupal6-cck-field-default-value-stored-in-database
普通分类: