Skip to main content
3 of 3
edited tags
avpaderno
  • 97.9k
  • 15
  • 164
  • 284

Returning body values only

I have the following function that simply grabs nodes:

function getWords() {
    $query = new EntityFieldQuery();
    $query->entityCondition('entity_type', 'node', '=')
            ->propertyCondition('status', 1, '=')
            ->propertyCondition('type', 'wall_of_words', '=');
    $result = $query->execute();
    return node_load_multiple(array_keys($result['node']));

}

Right now it's working but it's returning everything, is there a way I can return the contents of the body or title field only?