Skip to main content
php typo and formatting
Source Link

You are looking for hook_node_insert()

This is from API page:

Respond to creation of a new node.

This hook is invoked from node_save() after the database query that will insert the node into the node table is scheduled for execution, after the type-specific hook_insert() is invoked, and after field_attach_insert() is called.

function MyModule_node_insert($node) {

  if($node->type == 'article') {
 
     //your code here
 
    custom_func();
  }
}
 

function custom_func() {
    

    //your code goes here
    
}

You are looking for hook_node_insert()

This is from API page:

Respond to creation of a new node.

This hook is invoked from node_save() after the database query that will insert the node into the node table is scheduled for execution, after the type-specific hook_insert() is invoked, and after field_attach_insert() is called.

function MyModule_node_insert($node) {

  if($node->type == 'article') {
 
     //your code here
 
   custom_func();
  }
}
 

function custom_func() {
    

    //your code goes here
    
}

You are looking for hook_node_insert()

This is from API page:

Respond to creation of a new node.

This hook is invoked from node_save() after the database query that will insert the node into the node table is scheduled for execution, after the type-specific hook_insert() is invoked, and after field_attach_insert() is called.

function MyModule_node_insert($node) {

  if($node->type == 'article') {
    //your code here
    custom_func();
  }
}

function custom_func() {
  //your code goes here
}
Source Link
shrish
  • 1.8k
  • 3
  • 19
  • 29

You are looking for hook_node_insert()

This is from API page:

Respond to creation of a new node.

This hook is invoked from node_save() after the database query that will insert the node into the node table is scheduled for execution, after the type-specific hook_insert() is invoked, and after field_attach_insert() is called.

function MyModule_node_insert($node) {

  if($node->type == 'article') {

     //your code here

   custom_func();
  }
}


function custom_func() {
    

    //your code goes here
    
}