function action_migration_plugins_alter

Implements hook_migration_plugins_alter().

File

core/modules/action/action.module, line 60

Code

function action_migration_plugins_alter(array &$migrations) {
    foreach ($migrations as $migration_id => $migration) {
        // Add Actions plugins in actions module.
        
        /** @var \Drupal\migrate\Plugin\migrate\source\SqlBase $source_plugin */
        $source_plugin = \Drupal::service('plugin.manager.migration')->createStubMigration($migration)
            ->getSourcePlugin();
        if (is_a($source_plugin, Action::class) && isset($migration['process']['plugin'])) {
            $migrations[$migration_id]['process']['plugin'][0]['map']['comment_unpublish_by_keyword_action'] = 'comment_unpublish_by_keyword_action';
            $migrations[$migration_id]['process']['plugin'][0]['map']['node_unpublish_by_keyword_action'] = 'node_unpublish_by_keyword_action';
        }
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.