Skip to content

Commit

Permalink
Load ACFExportManager on acf/init
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Thulin committed Sep 4, 2023
1 parent 57b2fbe commit 48c6740
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions modularity-products.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@
require_once MODULARITY_PRODUCTS_PATH . 'Public.php';

// Acf auto import and export
$acfExportManager = new \AcfExportManager\AcfExportManager();
$acfExportManager->setTextdomain('modularity-products');
$acfExportManager->setExportFolder(MODULARITY_PRODUCTS_PATH . 'source/php/AcfFields/');
$acfExportManager->autoExport(array(
'products-module' => 'group_62a30b29785f0', //Update with acf id here, module view
));
$acfExportManager->import();
add_action('acf/init', function () {
$acfExportManager = new \AcfExportManager\AcfExportManager();
$acfExportManager->setTextdomain('modularity-products');
$acfExportManager->setExportFolder(MODULARITY_PRODUCTS_PATH . 'source/php/AcfFields/');
$acfExportManager->autoExport(array(
'products-module' => 'group_62a30b29785f0', //Update with acf id here, module view
));
$acfExportManager->import();
});

// Modularity 3.0 ready - ViewPath for Component library
add_filter('/Modularity/externalViewPath', function ($arr) {
Expand Down

0 comments on commit 48c6740

Please sign in to comment.