In Drupal 8 , what the usage and function for the .post_update.php?

I saw the file of docroot/core/modules/menu_link_content/menu_link_content.post_update.php in my project. But I can not figure out what the destination for this file. Could any one can explain for it?

Answer

The MODULE.post_update.php file contains the hook_post_update_NAME functions. The purpose of these hook functions is to update data, such as entities. These updates are executed after all hook_update_N() implementations, which are executed when you run /update.php

References:

https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Extension%21module.api.php/function/hook_post_update_NAME/8.2.x

Leave a Reply

Your email address will not be published. Required fields are marked *