-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
After import action should pass user selected data #120
Comments
I agree, but I also found a workaround using the index. function merlin_after_import_setup_function ( $selected_import_index ) {
// Grab the selected import file.
$selected_import_file = $GLOBALS['wizard']->import_files[ $selected_import_index ];
/* $GLOBALS['wizard'] is the default Merlin class instance defined in "merlin-config.php",
you could call it something else if you'd like. */
// You may access the currently selected import file like so:
if ( 'Some Demo Name' === $selected_import_file['import_file_name'] ) {
// Do something for this particular demo...
}
}
add_action( 'merlin_after_all_import', 'merlin_after_import_setup_function' ); I hope this helps. |
To clarify, my current multi-demo testing has options for "Business" and "News" demo/configurations. I want to run some code on I don't see a way to do this right now. |
I'm thinking a simple solution may be to convert I'm not sure if this is the best approach, still seems easier to just pass that data like:
but that may take more refactoring I'm unaware of. |
i use this code but not working. |
@monparaashvin make sure the $GLOBALS['wizard'] matches what's been defined as the Merlin class instance in "merlin-config.php", that's key. If you changed it then update the code respectively. |
i have some code update merlin-config.php. |
not sure why it's not working for you, works for me. Do some debugging, maybe you have a typo somewhere... |
Right now
merlin_after_all_import
only passesselected_import_index
. IMO it would be better to also (or in place of) pass the data fromget_import_data_info()
. This would allow devs to only run certain after_import code depending on what options the user has selected.I just hit this issue during testing. If the user has selected to import content I want to run code, but not any other time.
The text was updated successfully, but these errors were encountered: