Skip to main content

Change how many earlier versions of an email design are kept

Premium Intermediate

The Email Editor keeps the last 20 versions per email per show, with no setting. This filter changes the number; $type is _wrapper for a show’s branding, and $show_id is 0 for the site-wide design.

Code

<?php
add_filter( 'benecaster_email_editor_template_versions_kept', function ( int $keep, string $type, int $show_id ): int {
    // Keep more of the email you change most, and less of everything else.
    return 'welcome' === $type ? 50 : 10;
}, 10, 3 );

View on GitHub →

Hooks Used

Need this built rather than just documented? See our services →