Skip to:
Content

BuddyPress.org

Opened 12 years ago

Closed 11 years ago

#5043 closed enhancement (no action required)

Current page is single message check

Reported by: henrywright's profile henrywright Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Messages 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)

#1 @henrywright
12 years ago

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') ) ) )

#2 @henrywright
12 years ago

  • Type changed from defect (bug) to enhancement

#3 @boonebgorges
11 years ago

  • Component changed from Core to Messaging
  • Milestone changed from Awaiting Review to 1.9

Sounds like a good idea. If you could work it into a patch, that'd be great.

#4 @boonebgorges
11 years ago

  • Keywords needs-patch added

#5 @henrywright
11 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
Last edited 11 years ago by henrywright (previous) (diff)

#6 @boonebgorges
11 years ago

  • Milestone 1.9 deleted
  • Resolution set to invalid
  • Status changed from new to closed

Excellent, thanks henrywright! I've updated the codex page http://codex.buddypress.org/developer/developer-docs/template-tag-reference/

Note: See TracTickets for help on using tickets.