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
27 changes: 27 additions & 0 deletions classes/controllers/FrmFormsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -596,9 +596,36 @@ private static function load_direct_preview() {
$form = FrmForm::getAll( array(), '', 1 );
}

self::fix_deprecated_null_param_warning();

require FrmAppHelper::plugin_path() . '/classes/views/frm-entries/direct.php';
}

/**
* Some themes have a null $src value.
* This function adds a filter to ensure that $src is not null.
* WP will call str_starts_with with the null value triggering a deprecated message otherwise.
*
* @since x.x
*
* @return void
*/
private static function fix_deprecated_null_param_warning() {
add_filter(
'script_loader_src',
/**
* @param string|null $src
* @return string
*/
function ( $src ) {
if ( is_null( $src ) ) {
$src = '';
}
return $src;
}
);
}

public static function untrash() {
self::change_form_status( 'untrash' );
}
Expand Down