bbp_get_view_id( string $view = '' )
Get the view id
Description
Use view id if supplied, otherwise bbp_get_view_rewrite_id() query var.
Parameters
- $view
-
(Optional) View id.
Default value: ''
Return
(bool|string) ID on success, false on failure
Source
File: bp-forums/common/template.php
function bbp_get_view_id( $view = '' ) { $bbp = bbpress(); if ( !empty( $view ) ) { $view = sanitize_title( $view ); } elseif ( ! empty( $bbp->current_view_id ) ) { $view = $bbp->current_view_id; } else { $view = get_query_var( bbp_get_view_rewrite_id() ); } if ( array_key_exists( $view, $bbp->views ) ) { return $view; } return false; }
Changelog
Version | Description |
---|---|
bbPress (r2789) | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.