Opened 13 years ago
Closed 13 years ago
#5043 closed enhancement (no action required)
Current page is single message check
| Reported by: | henrywright | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Messages | Version: | |
| Severity: | normal | Keywords: | needs-patch |
| Cc: |
Description
The template tag reference has checks for the compose, inbox and sentbox pages:
http://codex.buddypress.org/developer/developer-docs/template-tag-reference/
bp_is_compose_screen
bp_is_sentbox
bp_is_inbox
The documentation doesn't seem to detail a function which checks if the current page being viewed is the single message page. I am using the long way of doing it as my work around:
if ( bp_is_current_component('messages') && ( !bp_is_current_action('compose') && !bp_is_current_action('sentbox') && !bp_is_current_action('inbox') ) )
Change History (6)
#3
@
13 years ago
- Component Core → Messaging
- Milestone Awaiting Review → 1.9
Sounds like a good idea. If you could work it into a patch, that'd be great.
#5
@
13 years ago
Hey boonebgorges
On further investigation it seems a patch isn't needed. The following functions are already available in bp-core-template.php:
bp_is_messages_conversation(), bp_is_messages_compose_screen(), bp_is_messages_sentbox(), bp_is_messages_inbox()
The Codex just needs an update as it is using the wrong function names:
bp_is_compose_screen, bp_is_sentbox, bp_is_inbox
#6
@
13 years ago
- Milestone 1.9
- Resolution → invalid
- Status new → closed
Excellent, thanks henrywright! I've updated the codex page http://codex.buddypress.org/developer/developer-docs/template-tag-reference/
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Apologies, my workaround should be this:
if ( ( bp_is_current_component('messages') && ( !bp_is_current_action('compose') && !bp_is_current_action('sentbox') && !bp_is_current_action('inbox') ) ) )