Types logo

 

The Embedded version lets you create custom types, taxonomy and fields for your theme or plugin, without requiring any plugin. The site will have all of Types functionality, but without the ability to modify your settings.

You should create your setup locally using the full plugin-version of Types. Then, you’ll copy the embedded code to your theme or plugin and export Types settings to it.

The settings are saved in an XML file. When you want to update Types settings in the embedded version, repeat the export process.


One-Time Setup – Create the Embedded Types Directory

1. Create the directory called embedded-types in the root folder of your theme or plugin.

2. Copy the entire content of the embedded directory from Types to the embedded-types directory that you just created.

3. Include them from the theme’s functions.php file by adding these statements at the very beginning (right after the php statement):

require_once dirname(__FILE__) . '/embedded-types/types.php';

Export Your Settings

Every time you want to update the configuration setting, from your development version to the deployment code, you’ll need to export the setting files and copy them to the theme (or plugin).

Go to the Types->Import/Export menu and click on the Export button. You will receive a ZIP file with the XML and PHP configuration files (both are required).

This zip file will contain:

  • settings.xml: This contains all the custom post types and groups.
  • settings.php: This file controls the import process. It contains a $timestamp variable that tells the code when an import is required.

To distribute and use the created Types in a theme you need to put settings.xml and setting.php into the embedded-types directory. Types will check the $timestamp in settings.php to see if it’s a newer version. If it is then Types will import the settings.xml files and create the custom post types and groups defined.

You determine if configuration imports happen automatically or require user-approval.  When you export the settings, you’ll see the option to auto-import updates or request your users to accept the import.  You’ll see this value in the $auto_import variable in setting.php.

Unzip the export ZIP file and place both settings.xml and setting.php into the embedded-types directory.