Skip to content

Instantly share code, notes, and snippets.

@rang501
Last active December 4, 2015 14:46
Show Gist options
  • Save rang501/6db8b6f59b40a8a535d5 to your computer and use it in GitHub Desktop.
Save rang501/6db8b6f59b40a8a535d5 to your computer and use it in GitHub Desktop.

Revisions

  1. rang501 revised this gist Dec 4, 2015. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions gistfile1.php
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,4 @@
    <?php
    $query = new EntityFieldQuery();

    $query->entityCondition('entity_type', 'node')
  2. rang501 renamed this gist Dec 4, 2015. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. rang501 created this gist Dec 4, 2015.
    16 changes: 16 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    $query = new EntityFieldQuery();

    $query->entityCondition('entity_type', 'node')
    ->entityCondition('bundle', 'article');

    $result = $query->execute();

    if (isset($result['node'])) {
    $nodes = entity_load('node', array_keys($result['node']));

    foreach ($nodes as $node) {
    $node->field_show_feedback[LANGUAGE_NONE][0]['value'] = 1;
    $node->field_show_updated_date[LANGUAGE_NONE][0]['value'] = 1;
    node_save($node);
    }
    }