Created
June 1, 2016 22:08
-
-
Save Unifex/bd5f650b604d3695e94746be62b6e3aa to your computer and use it in GitHub Desktop.
I do a lot of prototyping on the command line with drush. This allowed me to test switching content types. It's very bare bones but it's a good place to start.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
drush ev ' | |
$query = new EntityFieldQuery; | |
print_r($query); | |
$result = $query->entityCondition("entity_type", "node") | |
->propertyCondition("type", "morning_message") | |
->execute(); | |
print_r($result); | |
foreach ($result['node'] as $row) { | |
print_r($row); | |
$node = node_load($row->nid); | |
print_r($node); | |
$node->type = "news"; | |
node_save($node); | |
} | |
' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment