Is it possible to get the node ID of the node that will be created?
Trying to pass some information to third party API, every time a new node is created.
So far I have managed to identify the node insert/create when a node is created in hook_node_presave()
. Done it by using empty($node->id())
.
Now I want to anticipate what the node ID will be once the node is saved. Is it possible to get the node ID before the node is created?
This article was republished from its original source.
Pixeldust is a 20-year-old web development agency specializing in Drupal and WordPress and working with clients all over the country. With our best in class capabilities, we work with small businesses and fortune 500 companies alike. Give us a call at 1(800)730-2416 and let’s talk about your project.