From a78a581b417534b8eca1b79b1daa8e304e542eb8 Mon Sep 17 00:00:00 2001 From: Django Doucet Date: Mon, 2 Oct 2023 18:05:48 -0600 Subject: [PATCH] enqueue reply script on front end --- includes/class-admin.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/includes/class-admin.php b/includes/class-admin.php index 5f91c52..59e1b48 100644 --- a/includes/class-admin.php +++ b/includes/class-admin.php @@ -18,6 +18,7 @@ class Admin { \add_action( 'admin_init', array( self::class, 'register_settings' ) ); \add_action( 'personal_options_update', array( self::class, 'save_user_description' ) ); \add_action( 'admin_enqueue_scripts', array( self::class, 'enqueue_scripts' ) ); + \add_action( 'wp_enqueue_scripts', array( self::class, 'comment_enqueue_scripts' ) ); \add_filter( 'comment_row_actions', array( self::class, 'reply_comments_actions' ), 10, 2 ); if ( ! is_user_disabled( get_current_user_id() ) ) { @@ -298,4 +299,10 @@ class Admin { wp_enqueue_script( 'activitypub-reply', plugins_url( 'assets/js/activitypub-reply.js', ACTIVITYPUB_PLUGIN_FILE ), array( 'jquery' ), '1.0.0', false ); } } + + public static function comment_enqueue_scripts() { + if ( is_singular() ) { + wp_enqueue_script( 'activitypub-reply', plugins_url( 'assets/js/activitypub-reply.js', ACTIVITYPUB_PLUGIN_FILE ), array( 'jquery' ), '1.0.0', false ); + } + } }