diff --git a/index.php b/index.php index d2c2071..dedc302 100644 --- a/index.php +++ b/index.php @@ -9,4 +9,135 @@ Author URI: https://mxstbr.com License: MIT */ + +// Inject the feedback.fish JavaScript file into the DOM just before the body +function enqueue_feedback_fish_script() +{ + $projectId = get_option('feedback_fish_project_id'); + wp_register_script( + 'feedback-fish', + "https://feedback.fish/ff.js?pid=$projectId", + [], + null, + true + ); + wp_enqueue_script('feedback-fish'); +} +add_action('wp_enqueue_scripts', 'enqueue_feedback_fish_script'); + +// Add defer="defer" to the feedback.fish