{"id":2167,"date":"2017-06-28T11:08:03","date_gmt":"2017-06-28T09:08:03","guid":{"rendered":"https:\/\/hesmid.nl\/test\/?p=2167"},"modified":"2017-06-28T16:26:44","modified_gmt":"2017-06-28T14:26:44","slug":"beaver-builder","status":"publish","type":"post","link":"https:\/\/hesmid.nl\/test\/beaver-builder\/","title":{"rendered":"Beaver Builder"},"content":{"rendered":"<h1 class=\"title\">Custom module developer guide<\/h1>\n<p><a href=\"http:\/\/kb.wpbeaverbuilder.com\/article\/124-custom-module-developer-guide#overview\">http:\/\/kb.wpbeaverbuilder.com\/article\/124-custom-module-developer-guide#overview<\/a><\/p>\n<ul>\n<li><a href=\"http:\/\/kb.wpbeaverbuilder.com\/article\/124-custom-module-developer-guide#overview\">Overview<\/a><\/li>\n<li>1.\u00a0<a href=\"http:\/\/kb.wpbeaverbuilder.com\/article\/124-custom-module-developer-guide#create-plugin\">Create a\u00a0plugin<\/a><\/li>\n<li>2.\u00a0<a href=\"http:\/\/kb.wpbeaverbuilder.com\/article\/124-custom-module-developer-guide#add-module\">Add a module to your plugin<\/a><\/li>\n<li>3.\u00a0<a href=\"http:\/\/kb.wpbeaverbuilder.com\/article\/124-custom-module-developer-guide#module-settings\">Define module settings<\/a><\/li>\n<li>4.\u00a0<a href=\"http:\/\/kb.wpbeaverbuilder.com\/article\/124-custom-module-developer-guide#module-settings-css-js\">Module settings CSS and JavaScript<\/a><\/li>\n<li>5.\u00a0<a href=\"http:\/\/kb.wpbeaverbuilder.com\/article\/124-custom-module-developer-guide#module-html\">Module HTML<\/a><\/li>\n<li>6.\u00a0<a href=\"http:\/\/kb.wpbeaverbuilder.com\/article\/124-custom-module-developer-guide#module-css\">Module CSS<\/a><\/li>\n<li>7.\u00a0<a href=\"http:\/\/kb.wpbeaverbuilder.com\/article\/124-custom-module-developer-guide#module-js\">Module JavaScript<\/a><\/li>\n<li><a href=\"http:\/\/kb.wpbeaverbuilder.com\/article\/124-custom-module-developer-guide#module-property-ref\">Module property reference<\/a><\/li>\n<li><a href=\"http:\/\/kb.wpbeaverbuilder.com\/article\/124-custom-module-developer-guide#module-method-ref\">Module method reference<\/a><\/li>\n<li><a href=\"http:\/\/kb.wpbeaverbuilder.com\/article\/124-custom-module-developer-guide#setting-fields-ref\">Setting fields reference<\/a><\/li>\n<li><a href=\"http:\/\/kb.wpbeaverbuilder.com\/article\/124-custom-module-developer-guide#repeater-fields-ref\">Repeater fields reference<\/a><\/li>\n<li><a href=\"http:\/\/kb.wpbeaverbuilder.com\/article\/124-custom-module-developer-guide#create-custom-fields\">Create custom fields<\/a><\/li>\n<li><a href=\"http:\/\/kb.wpbeaverbuilder.com\/article\/124-custom-module-developer-guide#live-preview-ref\">Live preview reference<\/a><\/li>\n<li><a href=\"http:\/\/kb.wpbeaverbuilder.com\/article\/124-custom-module-developer-guide#partial-refresh-ref\">Partial refresh reference<\/a><\/li>\n<li><a href=\"http:\/\/kb.wpbeaverbuilder.com\/article\/124-custom-module-developer-guide#override-built-in\">Override built-in modules<\/a><\/li>\n<li><a href=\"http:\/\/kb.wpbeaverbuilder.com\/article\/124-custom-module-developer-guide#localization\">Localization<\/a><\/li>\n<\/ul>\n<h2>Create a plugin<\/h2>\n<ul>\n<li>Make a new folder in plugins: <code>bb-plugin-custom<\/code><\/li>\n<li>Create a php file with the same name:\u00a0<code>bb-plugin-custom.php<\/code><\/li>\n<li>Copy-paste this in the file:&lt;?php<br \/>\n\/**<br \/>\n* Plugin Name: My Custom Modules<br \/>\n* Plugin URI: http:\/\/www.mywebsite.com<br \/>\n* Description: Custom modules for the Beaver Builder Plugin.<br \/>\n* Version: 1.0<br \/>\n* Author: Your Name<br \/>\n* Author URI: http:\/\/www.mywebsite.com<br \/>\n*\/<\/p>\n<p>define( &#8216;MY_MODULES_DIR&#8217;, plugin_dir_path( __FILE__ ) );<br \/>\ndefine( &#8216;MY_MODULES_URL&#8217;, plugins_url( &#8216;\/&#8217;, __FILE__ ) );<br \/>\nfunction my_load_module_examples() {<br \/>\nif ( class_exists( &#8216;FLBuilder&#8217; ) ) {<br \/>\n\/\/ Include your custom modules here.<br \/>\n}<br \/>\n}<br \/>\nadd_action( &#8216;init&#8217;, &#8216;my_load_module_examples&#8217; );<\/li>\n<li>Edit the information such as Plugin Name and Author. You should also rename the constants\u00a0<code>MY_MODULES_DIR<\/code>\u00a0and\u00a0<code>MY_MODULES_URL<\/code>\u00a0to match your plugin&#8217;s namespace, keeping the\u00a0<code>_DIR<\/code>and\u00a0<code>_URL<\/code>\u00a0suffixes.<\/li>\n<\/ul>\n<h2 id=\"add-module\">Add a module to your plugin<\/h2>\n<p>&nbsp;<\/p>\n<h2 id=\"override-built-in\">Overriding built-In modules<\/h2>\n<p>Any of the built-in modules can be overridden within your theme by following the steps below.<\/p>\n<p>1. Create a new folder in your theme&#8217;s folder named\u00a0<strong>fl-builder<\/strong>.<\/p>\n<p>2. Create a new folder within your theme&#8217;s fl-builder folder named\u00a0<strong>modules<\/strong>.<\/p>\n<p>3. Copy the module you wish to override from\u00a0<em>wp-content\/plugins\/bb-plugin\/modules<\/em>to your theme&#8217;s\u00a0<em>fl-builder\/modules<\/em>\u00a0folder.<\/p>\n<p>That&#8217;s it! You can now start editing the module to suit your needs. Note that even though you can customize the module&#8217;s code, the module&#8217;s folder name, main PHP file name, and main class name must remain unchanged to be recognized by the builder.<\/p>\n<section class=\"callout-yellow\">If you\u2019re not seeing your changes, try clearing the Page Builder cache.<\/section>\n<section class=\"callout-yellow\"><\/section>\n<section class=\"callout-yellow\"><\/section>\n","protected":false},"excerpt":{"rendered":"<p>Custom module developer guide http:\/\/kb.wpbeaverbuilder.com\/article\/124-custom-module-developer-guide#overview Overview 1.\u00a0Create a\u00a0plugin 2.\u00a0Add a module to your plugin 3.\u00a0Define module settings 4.\u00a0Module settings CSS and JavaScript 5.\u00a0Module HTML 6.\u00a0Module CSS 7.\u00a0Module JavaScript Module property reference Module method reference Setting fields reference Repeater fields reference Create custom fields Live preview reference Partial refresh reference Override built-in modules Localization Create a [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[17],"tags":[374,18],"acf":[],"_links":{"self":[{"href":"https:\/\/hesmid.nl\/test\/wp-json\/wp\/v2\/posts\/2167"}],"collection":[{"href":"https:\/\/hesmid.nl\/test\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hesmid.nl\/test\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hesmid.nl\/test\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hesmid.nl\/test\/wp-json\/wp\/v2\/comments?post=2167"}],"version-history":[{"count":3,"href":"https:\/\/hesmid.nl\/test\/wp-json\/wp\/v2\/posts\/2167\/revisions"}],"predecessor-version":[{"id":2172,"href":"https:\/\/hesmid.nl\/test\/wp-json\/wp\/v2\/posts\/2167\/revisions\/2172"}],"wp:attachment":[{"href":"https:\/\/hesmid.nl\/test\/wp-json\/wp\/v2\/media?parent=2167"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hesmid.nl\/test\/wp-json\/wp\/v2\/categories?post=2167"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hesmid.nl\/test\/wp-json\/wp\/v2\/tags?post=2167"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}