enqueue reply script on front end

This commit is contained in:
Django Doucet 2023-10-02 18:05:48 -06:00
parent f018432033
commit a78a581b41

View file

@ -18,6 +18,7 @@ class Admin {
\add_action( 'admin_init', array( self::class, 'register_settings' ) ); \add_action( 'admin_init', array( self::class, 'register_settings' ) );
\add_action( 'personal_options_update', array( self::class, 'save_user_description' ) ); \add_action( 'personal_options_update', array( self::class, 'save_user_description' ) );
\add_action( 'admin_enqueue_scripts', array( self::class, 'enqueue_scripts' ) ); \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 ); \add_filter( 'comment_row_actions', array( self::class, 'reply_comments_actions' ), 10, 2 );
if ( ! is_user_disabled( get_current_user_id() ) ) { 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 ); 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 );
}
}
} }