Divi modules normally come up with three modules tabs

download

What if we want to add new tabs for our custom modules?  Divi theme provides awesome filter to add tabs on your module. You can see on

Divi/Includes/Builder/class-et-builder-element.php

return apply_filters( 'et_builder_main_tabs', $tabs );   

Now we are using new tabs on existing modules tabs.

add_filter( 'et_builder_main_tabs', 'custom_module_add_module_tabs'  );

function custom_module_add_module_tabs( $tabs ) {
$tabs[ 'custom_modules_tab_slug' ] = esc_html__( 'Custom Modules Tabs', 'et_builder' );
return $tabs;
}

This will produce modules tabs as follows:

custom-modules

Note: If you find nothing changes after doing following this all steps properly, then you have to clear local storage of browser . You can do this by running this javascript command on console window.

window.localStorage.clear()

Also to appear on module tab you need to add setting  on that section[ tab ]

Let me know if you have any question or queries regarding to divi theme or its module.

Thanks

Advertisements

Join the Conversation

4 Comments

  1. Hi, sir

    Thanks for your posting of this article.

    This post describes what i want in my wordpress site.

    I am very interesting in this post and tried as you said.

    But after i added the above code in functions.php and I can’t see anything changed.

    Even I removed caches of my firefox browser, but nothing happened.

    Please let me know more details.

    Thanks.

    Like

  2. I have tried it as the above. but can see nothing changed.
    perhaps it will be the reason why i didn’t do window.localStorage.clear() in concole?
    but i can’t see console window in firefox browser.

    so, i did clear all caches in my browser.but i can’t find anything about it.
    Please help me about it asap.

    Like

  3. Hi Faud,

    First create tabs as per the tutorial given and then add some section/setting, then only that tab will appear…You can get reference of other module to add section.

    Thanks

    Like

  4. Hi, Sushil. I try change displayed name and slug of tab ‘general’. Is this possible?
    Or it can not be changed to something else instead of Content?

    Like

Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: