Set default value with PHP on a node field. I'm using Drupal 7 and have created a content type called abc. In abc there is a field called seller. When a logged in user creates a new piece of abc content, the value of the seller field would be the name of the person who is logged in. 

So what I want is a default value for the seller field for a small piece of PHP code. But I am not able to find the place to enter this PHP. In Drupal 6 there is text area for the php code to enter, how can this be done with Drupal 7.
I don't know if there is an UI for it, but fields allows either an array as allowed values or an callback.

This means that you most likely will need to create a function in a module instead of hardcoding the php which then would be saved in the database. IMO this is a good thing.

In your field config array you want something like this:

....
'settings' =&gt; array(
    'allowed_values' =&gt; array(),
    'allowed_values_function' =&gt; 'callback_function',
),
...


If you are new to this, take a look at field_create_field and field_update_field.