Last active
July 14, 2017 11:05
-
-
Save sumanthkumarc/6bdf281012f8de03864aff8da6208b12 to your computer and use it in GitHub Desktop.
Drupal 7 : Disable commenting on existing nodes of particular content type
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
| <?php | |
| $nodes = node_load_multiple(array(), array('type' => $type)); | |
| foreach($nodes as $nid => $node){ | |
| // Comment status : | |
| // 2 - open | |
| // 1 - closed | |
| // 0 - hidden | |
| $node->comment = 1; | |
| node_save($node); | |
| } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment