Made in Europe, buy from Europe.

Black Friday

65% off Annual plans

25% off Lifetime · 10 per week

Ends December 2

Get the deal →

Modula troubleshooting filters for developers

Updated 2 min read

Modula troubleshooting filters are small pieces of code for unusual setups. With them you can hide the “Edit gallery” link on the front end, or turn off srcset.

These filters are meant for developers, and for cases where our support team asks you to add one.

Watch how to add a troubleshooting filter with a code snippets plugin, and see the Edit gallery link disappear from the page.

How to add a filter

Add the code to the functions.php file of your child theme, or use a code snippets plugin. A child theme is a small theme that keeps your own changes separate from the main theme.

Remove the code when you no longer need it.

Filter: modula_troubleshooting_disable_edit · Default: off

Logged-in users who can edit a gallery see an edit link under it on the front end. Visitors never see this link. The filter hides it for everyone.

PHP
add_filter( 'modula_troubleshooting_disable_edit', '__return_true' );

You can read more in how to remove the Edit Gallery link on the front end.

Turn off srcset

Filter: modula_troubleshooting_disable_srcset · Default: off

Modula gives gallery images a srcset, a list of image sizes. The browser uses it to pick a smaller file on small screens.

A theme, a CDN or an optimization plugin can load the wrong size because of it. A CDN is a network of servers that delivers your images. If this happens, the filter removes the srcset from Modula images.

PHP
add_filter( 'modula_troubleshooting_disable_srcset', '__return_true' );

To find what breaks a gallery in the first place, see how to troubleshoot Modula with the Health Check plugin and Modula debug tools.

Was this page helpful?
0 0

Still stuck?

Can’t find the answer?

Write to us with what you tried and what you expected to happen, and we’ll help you sort it out.