basename ) ) { return; } // Switch to the new site bbp_switch_to_site( $blog_id ); // Do the bbPress activation routine do_action( 'bbp_new_site', $blog_id, $user_id, $domain, $path, $site_id, $meta ); // Restore original site bbp_restore_current_site(); } /** * Show icons in list-table column headers instead of strings * * @since 2.6.0 bbPress (r5833) * * @param array $columns Column headers fed into list-table objects * * @return array Possibly altered column headers */ function bbp_filter_column_headers( $columns = array() ) { // Do not filter column headers by default - maybe we'll turn it on later if ( ! apply_filters( 'bbp_filter_column_headers', false ) ) { return $columns; } /** Forums ****************************************************************/ // Forum topic count if ( isset( $columns[ 'bbp_forum_topic_count' ] ) ) { $columns[ 'bbp_forum_topic_count' ] = '' . esc_html__( 'Topics', 'bbpress' ) . ''; } // Forum reply count if ( isset( $columns[ 'bbp_forum_reply_count' ] ) ) { $columns[ 'bbp_forum_reply_count' ] = '' . esc_html__( 'Replies', 'bbpress' ) . ''; } /** Topics ****************************************************************/ // Topic forum if ( isset( $columns[ 'bbp_topic_forum' ] ) ) { $columns[ 'bbp_topic_forum' ] = '' . esc_html__( 'Forum', 'bbpress' ) . ''; } // Topic reply count if ( isset( $columns[ 'bbp_topic_reply_count' ] ) ) { $columns[ 'bbp_topic_reply_count' ] = '' . esc_html__( 'Replies', 'bbpress' ) . ''; } /** Replies ***************************************************************/ // Reply forum if ( isset( $columns[ 'bbp_reply_forum' ] ) ) { $columns[ 'bbp_reply_forum' ] = '' . esc_html__( 'Forum', 'bbpress' ) . ''; } // Reply topic if ( isset( $columns[ 'bbp_reply_topic' ] ) ) { $columns[ 'bbp_reply_topic' ] = '' . esc_html__( 'Topic', 'bbpress' ) . ''; } return $columns; } /** * Filter sample permalinks so that certain languages display properly. * * @since 2.0.0 bbPress (r3336) * * @param string $post_link Custom post type permalink * @param object $_post Post data object * @param bool $leavename Optional, defaults to false. Whether to keep post name or page name. * @param bool $sample Optional, defaults to false. Is it a sample permalink. * * @return string The custom post type permalink */ function bbp_filter_sample_permalink( $post_link, $_post, $leavename = false, $sample = false ) { // Bail if not on an admin page and not getting a sample permalink if ( ! empty( $sample ) && is_admin() && bbp_is_custom_post_type() ) { return urldecode( $post_link ); } // Return post link return $post_link; } /** Sub-Actions ***************************************************************/ /** * Piggy back admin_init action * * @since 2.1.0 bbPress (r3766) */ function bbp_admin_init() { do_action( 'bbp_admin_init' ); } /** * Piggy back admin_menu action * * @since 2.1.0 bbPress (r3766) */ function bbp_admin_menu() { do_action( 'bbp_admin_menu' ); } /** * Piggy back admin_head action * * @since 2.1.0 bbPress (r3766) */ function bbp_admin_head() { do_action( 'bbp_admin_head' ); } /** * Piggy back admin_notices action * * @since 2.1.0 bbPress (r3766) */ function bbp_admin_notices() { do_action( 'bbp_admin_notices' ); } /** * Dedicated action to register bbPress importers * * @since 2.1.0 bbPress (r3766) */ function bbp_register_importers() { do_action( 'bbp_register_importers' ); } /** * Dedicated action to register admin styles * * @since 2.6.0 bbPress (r6912) */ function bbp_register_admin_styles() { /** * Action used to register the admin styling * * @since 2.1.0 * @deprecated 2.6.0 */ do_action( 'bbp_register_admin_style' ); /** * Action used to register all admin styling * * @since 2.6.0 */ do_action( 'bbp_register_admin_styles' ); } /** * Dedicated action to register admin scripts * * @since 2.6.0 bbPress (r6912) */ function bbp_register_admin_scripts() { do_action( 'bbp_register_admin_scripts' ); } /** * Dedicated action to register admin settings * * @since 2.1.0 bbPress (r3766) */ function bbp_register_admin_settings() { do_action( 'bbp_register_admin_settings' ); } /** * Dedicated action to output admin tools.php sections * * @since 2.6.0 bbPress (r6273) */ function bbp_admin_tool_box() { do_action( 'bbp_admin_tool_box' ); } /** * Dedicated action to hook into the current screen * * @since 2.6.0 bbPress (r6185) * * @param WP_Screen $current_screen */ function bbp_current_screen( $current_screen = '' ) { do_action( 'bbp_current_screen', $current_screen ); }