BBP_Admin::enqueue_scripts()
Enqueue any admin scripts we might need
Description Description
Source Source
File: includes/admin/classes/class-bbp-admin.php
public function enqueue_scripts() { // Get the current screen $current_screen = get_current_screen(); // Enqueue suggest for forum/topic/reply autocompletes wp_enqueue_script( 'suggest' ); // Post type checker (only topics and replies) if ( 'post' === $current_screen->base ) { switch ( $current_screen->post_type ) { case bbp_get_reply_post_type() : case bbp_get_topic_post_type() : // Enqueue the common JS wp_enqueue_script( 'bbp-admin-common-js' ); // Topics admin if ( bbp_get_topic_post_type() === $current_screen->post_type ) { wp_enqueue_script( 'bbp-admin-topics-js' ); // Replies admin } elseif ( bbp_get_reply_post_type() === $current_screen->post_type ) { wp_enqueue_script( 'bbp-admin-replies-js' ); } break; } // Enqueue the badge JS } elseif ( in_array( $current_screen->id, array( 'dashboard_page_bbp-about', 'dashboard_page_bbp-credits' ), true ) ) { wp_enqueue_script( 'bbp-admin-badge-js' ); } }
Changelog Changelog
Version | Description |
---|---|
2.2.0 | Introduced. |