Skip to:
Content

bbPress.org

Opened 11 years ago

Closed 11 years ago

Last modified 7 years ago

#2116 closed enhancement (wontfix)

Add filter to allow customising 'You must be logged in to...' template notice

Reported by: gawain's profile gawain Owned by:
Milestone: Priority: normal
Severity: normal Version: trunk
Component: Component - Forums Keywords: has-patch
Cc:

Description

Usability use case(s):

  • Hyperlinking text to login page
  • Adding HTML social login buttons
  • etc...

Attachments (1)

bbpress-loggedin-filters.patch (1.7 KB) - added by gawain 11 years ago.

Download all attachments as: .zip

Change History (11)

#1 @gawain
11 years ago

If this looks like a worthwhile effort, I am happy to go through and add these filters in more locations where it makes sense. I just wanted to get a feel of whether this was a viable addition to the code base in the first place.

#2 @alexvorn2
11 years ago

why print and not echo?

#3 @gawain
11 years ago

echo returns an error:

PHP Parse error:  syntax error, unexpected 'echo' (T_ECHO)

#4 @netweb
11 years ago

Related #1883

#5 @johnjamesjacoby
11 years ago

Would rather keep filters out of templates, and build a proper set of error handler/message callbacks.

#6 @johnjamesjacoby
11 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Replying to gawain:
If all you want to do is change strings, you can use custom po/mo's to do this without filters.

http://codex.buddypress.org/developer/extending-buddypress/customizing-labels-messages-and-urls/

I don't like the idea of filtering strings, since they're already ran through several sets of functions and filters.

I'm going to close this, since keeping the strings in the templates is the most flexible solution.

#7 @gawain
11 years ago

No problem, thanks for looking at it jjj.

I do wonder though if (only) that one could be treated as a special case? My thinking here is adding 3rd party login functionality via a plugin that generates the HTML from a function call. An example here...

#8 follow-up: @johnjamesjacoby
11 years ago

Would rather not introduce something temporary or incomplete. If you want to link to the login_url() (which has been requested before) you could patch this to include a link to login?

#9 @johnjamesjacoby
7 years ago

Circling back, it's really too bad this isn't easier for folks.

I can't imagine an easy solution, considering the range of strings available to us.

Maybe filter gettext and check the original $text?

#10 in reply to: ↑ 8 @netweb
7 years ago

Replying to johnjamesjacoby:

Would rather not introduce something temporary or incomplete. If you want to link to the login_url() (which has been requested before) you could patch this to include a link to login?

This was just added to w.org recently: https://meta.trac.wordpress.org/changeset/4747

<?php printf( __( 'You must be <a href="%s">logged in</a> to reply to this review.', 'wporg-forums' ), wp_login_url() ); ?>

3rd party social login plugins typically extend the default login form I think... The above would cover that would it not?

cc @johnjamesjacoby

Note: See TracTickets for help on using tickets.