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.
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.
Hide the “Edit gallery” link
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.
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.
add_filter( 'modula_troubleshooting_disable_srcset', '__return_true' );Find what breaks a gallery
To find what breaks a gallery in the first place, see how to troubleshoot Modula with the Health Check plugin and Modula debug tools.