[advanced] How To Add New Media Sources i.e. From a Meta

With the latest release, the option to create your own Media Source was added.

This means, you can add now any type of Media Source you want.



Let’s say we want to create a new Source Type that makes use of the Essential Grid Image Meta.


1. The First step is to create a new Meta through Essential Grid like shown here:




2. The next step is to add the following code to your themes functions.php


This will add a new entry called Interior Photo to the available list in the Grid Settings. As type, there can be set many different things, it will be the icon that is used. For a full list of available icons, please open essential-grid/public/css/settings.css and search for .eg-icon-soundcloud. .eg-icon- need to be always beeing ignored in this setting. So for the soundcloud icon, you would only write ‘type’ => ‘soundcloud’.





3. The last step now is this script block. Further explanations are found in each line of code. This can also be inserted into the themes functions.php file.



Now the Grids have the capability to use a Meta as the Media Source.