Skip to content

Instantly share code, notes, and snippets.

@Niloys7
Last active February 19, 2025 15:16
Show Gist options
  • Save Niloys7/4f7117f91488d8dda56aa73e18914496 to your computer and use it in GitHub Desktop.
Save Niloys7/4f7117f91488d8dda56aa73e18914496 to your computer and use it in GitHub Desktop.
one click demo import (OCDI) is not adding elementor global options
/**
* Function to perform setup after importing data.
* This function assigns the front page and the posts page (blog page) based on the imported demo.
* @param array $selected_import The selected import data.
* @link https://www.codeixer.com/addressing-the-issue-of-one-click-demo-import-not-add-elementor-global-options/
*/
function cdx_after_import_setup( $selected_import ) {
// Import Elementor kit data.
$cdx_kit_zip = get_parent_theme_file_path() . '/demo-content/elementor-kit.zip';
$import_export_module = \Elementor\Plugin::$instance->app->get_component( 'import-export' );
$import_settings['referrer'] = 'remote';
$import_export_module->import_kit( $cdx_kit_zip, $import_settings );
}
add_action( 'ocdi/after_import', 'cdx_after_import_setup' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment