Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions classes/controllers/FrmFormsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1232,6 +1232,8 @@ public static function get_settings_vars( $id, $errors = array(), $args = array(

global $frm_vars;

self::maybe_print_media_templates();

if ( ! is_array( $args ) ) {
// For reverse compatibility.
$args = array(
Expand Down Expand Up @@ -1269,6 +1271,27 @@ public static function get_settings_vars( $id, $errors = array(), $args = array(
require FrmAppHelper::plugin_path() . '/classes/views/frm-forms/settings.php';
}

/**
* Print WordPress media templates email actions does not trigger a "Uncaught Error: Template not found: #tmpl-media-selection" error when the media button is clicked.
*
* @since x.x
*
* @return void
*/
private static function maybe_print_media_templates() {
if ( FrmAppHelper::pro_is_included() ) {
// This issue does not exist when Pro is active so exit early.
return;
}

add_action(
'wp_enqueue_editor',
function () {
wp_print_media_templates();
}
);
}

/**
* @since 4.0
*/
Expand Down