1. Home
  2. Demi
  3. Developer Guide
  4. Register Demos

Register Demos

If you are a theme developer, you can make your WordPress theme compatible with Demi WordPress Plugin by registering demo websites. This allows users to import ready-made demo content directly from the Appearance → Demi → Demo Import page.

Demi provides a WordPress filter hook called demi_import_demos which you can use to register your demo packages. Using this hook, you can define multiple demos, assign required or optional plugins, set preview images, and mark demos as premium (pro) or free.

Creating the Demo ZIP File

Before registering a demo, you need a demo ZIP file. You can create this directly from your website using Demi:

  1. Navigate to Appearance → Demi → Backup.
  2. Click the Create Content Backup button.
  3. After the backup is generated, click Download to save the ZIP file.

This ZIP file can now be used as the zip_source in your demo registration.

Registering Demos Using Hook

Add the following code to your theme’s functions.php file or a custom plugin:

How This Works

  1. Filter Hook: demi_import_demos is used to register demo data for your theme.
  2. Demo Array: Each demo is defined as an array with keys like:
    • slug – Unique ID for the demo
    • name – Demo name displayed in Demi
    • description – Short description of the demo
    • category – Category of the demo
    • zip_source – URL to the demo zip file
    • preview_screenshot – URL to the demo preview image
    • preview_url – Live demo URL
    • is_pro – Set to true for premium demos
    • plugins – Required or optional plugins for the demo
  3. Pro Demos: If is_pro is true, users need a valid license or code to import the demo.
  4. Plugins: You can define required plugins (auto-installed) and optional plugins (can be skipped by the user).

Benefits for Theme Developers

  • Offer multiple demos for your theme users.
  • Allow selective installation of required and optional plugins.
  • Provide free and premium (pro) demos.
  • Enhance the theme setup experience with one-click demo import.

How can we help?