You can use following code in "Execute custom PHP code" for Actions of Rule.
$master_nid = $node_id; # Set current node id here.
$field_name = $ref_node_field; # Set reference node field here.
// Load the 'master' node
$master_node = node_load($master_nid);
// Get the node reference items attached to this node
$items = field_get_items('node', $node, $field_name);
// Loop through and grab the nids
$nids = array();
foreach ($items as $item) {
$nids[] = $item['nid'];
}
print("<pre> :: Reference NIDs");
print_r($nids);
print("</pre>");
Comments
Comment #1
Snehal Brahmbhatt commentedYou can use following code in "Execute custom PHP code" for Actions of Rule.
Hope this helps you.
Thanks,
Snehal Brahmbhatt | AddWeb Solution
https://www.drupal.org/user/3147795/track
Comment #2
nwom commentedDuplicate of #893750: Event: "Content is going to be deleted"