Skip to:
Content

bbPress.org

Opened 8 years ago

Closed 8 years ago

Last modified 4 years ago

#2116 closed enhancement (wontfix)

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

Reported by: 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 8 years ago.

Download all attachments as: .zip

Change History (11)

#1 @gawain
8 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
8 years ago

why print and not echo?

#3 @gawain
8 years ago

echo returns an error:

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

#4 @netweb
8 years ago

Related #1883

#5 @johnjamesjacoby
8 years ago

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

#6 @johnjamesjacoby
8 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
8 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
8 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
4 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
4 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.