Filter the Divi Module Custom CSS Fields

Written by Dan Mossop

The Divi theme developer documentation describes how to control the Custom CSS Fields for a module's settings.

There's a built-in filter for modifying these fields, which you can use like so:

add_filter("{$slug}_custom_css_fields", "edit_custom_css_fields", 10, 3);

function edit_custom_css_fields($custom_css_fields, $slug, $main_css_element) {
	return $custom_css_fields;
}

Unlock the Full Potential of Shortcodes in Divi!

Empower your Divi site with the Divi Shortcode Enabler. This plugin allows shortcodes to run effortlessly in various Divi module fields, enhancing functionality and customization across your site. Perfect for utilizing custom CSS fields and advanced styling options!

About Dan Mossop

Dan is a Scottish-born web developer, now living in Brisbane with his wife and son. He has been sharing tips and helping users with Divi since 2014. He created Divi Booster, the first Divi plugin, and continues to develop it along with 20+ other Divi plugins. Dan has a PhD in Computer Science, a background in web security and likes a lot of stuff, 

0 Comments

Submit a Comment

Comments are manually moderated and approved at the time they are answered. A preview is shown while pending but may disappear if your are cookies cleared - don't worry though, the comment is still in the queue.

Your email address will not be published. Required fields are marked *.

We may earn a commission when you visit links on our website.