Created
April 24, 2017 15:37
-
-
Save MatthieuScarset/e92c21be282139c8747e61e568328e76 to your computer and use it in GitHub Desktop.
Programmatically create Paragraph Types (bundles).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_install(). | |
*/ | |
function MYMODULE_install() { | |
// Create new Bundle. | |
$bundle = new stdClass(); | |
$bundle->name = 'Test Bundle'; // user friendly label | |
$bundle->bundle = 'paragraphy_test'; // machine name | |
$bundle->locked = 0; | |
$status = paragraphs_bundle_save($bundle); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment