You are here

function rb_cck_action_get_field_value in Rules Bonus Pack 6

Action for 'rb_cck_action_get_field_value'.

File

./rb_cck.module, line 525
Functions for extending CCK field management with Rules.

Code

function rb_cck_action_get_field_value($node, $settings) {

  // Get required metadata for the field.
  $storage_key = rb_cck_field_storage_key($settings['field']);
  $raw = $node->{$settings['field']}[0][$storage_key];
  $formatted = content_format($settings['field'], $node->{$settings['field']}[0]);
  return array(
    'raw' => $raw,
    'formatted' => $formatted,
  );
}