Update enqueue scripts

This commit is contained in:
Django Doucet 2023-02-06 22:00:37 -07:00
parent 0525645f7c
commit e46137a970

View file

@ -184,19 +184,9 @@ class Admin {
} }
public static function enqueue_scripts( $hook_suffix ) { public static function enqueue_scripts( $hook_suffix ) {
if ( false !== strpos( $hook_suffix, 'activitypub' ) ) { if ( false !== strpos( $hook_suffix, 'activitypub' ) || ( 'edit-comments.php' === $hook_suffix ) ) {
wp_enqueue_style( 'activitypub-admin-styles', plugins_url( 'assets/css/activitypub-admin.css', ACTIVITYPUB_PLUGIN_FILE ), array(), '1.0.0' ); wp_enqueue_style( 'activitypub-admin-styles', plugins_url( 'assets/css/activitypub-admin.css', ACTIVITYPUB_PLUGIN_FILE ), array(), '1.0.0' );
wp_enqueue_script( 'activitypub-admin-styles', plugins_url( 'assets/js/activitypub-admin.js', ACTIVITYPUB_PLUGIN_FILE ), array( 'jquery' ), '1.0.0', false ); wp_enqueue_script( 'activitypub-admin-styles', plugins_url( 'assets/js/activitypub-admin.js', ACTIVITYPUB_PLUGIN_FILE ), array( 'jquery' ), '1.0.0', false );
} }
if ( 'edit-comments.php' === $hook_suffix ) {
\wp_enqueue_script(
'activitypub_actions',
\plugin_dir_url( ACTIVITYPUB_PLUGIN ) . '/assets/js/activitypub-admin.js',
array( 'jquery' ),
\filemtime( \plugin_dir_path( ACTIVITYPUB_PLUGIN ) . 'assets/js/activitypub-admin.js' ),
true
);
}
} }
} }