Skip to:
Content

bbPress.org

Opened 12 years ago

Last modified 8 years ago

#1883 new enhancement

Smarter template notices

Reported by: alexvorn2's profile alexvorn2 Owned by:
Milestone: 2.8 Priority: normal
Severity: normal Version: 2.0
Component: Tools - Warnings/Notices Keywords: needs-patch
Cc: stephen@…

Description (last modified by johnjamesjacoby)

Currently, the themes include several hardcoded template notices at the top of various forms and pages. Ideally, these should fall under one dedicated action or template tag, with a loose convention on how to add/remove/modify notices.

This has the positive side-effect of eliminating duplicate code, and strings in the template files themselves. For example, when searching for "account has the ability to post unrestricted HTML" - six results are displayed. This means changing it in 6 different places instead of only once in a function.

Change History (14)

#1 @johnjamesjacoby
12 years ago

  • Description modified (diff)
  • Keywords 2nd-opinion removed
  • Summary changed from remove repetitive text to Smarter template notices

Modified ticket title and description. Valid, but needed a little more meat.

#2 @alexvorn2
12 years ago

cool! :)

#3 @netweb
12 years ago

  • Cc stephen@… added

#4 @johnjamesjacoby
12 years ago

  • Milestone changed from 2.2 to Future Release

No time in 2.2; moving back to Future Release.

#5 @netweb
12 years ago

Whilst we are at it.... Adding 'context' to the notices.

eg. "You must be logged in to create new topics."

"You must be logged in to create new topics. Click here to login."

#6 @gawain
12 years ago

In relation to the bug #2116 I opened today, I'd be interested in having a go at this.

How does something like this look:

<?php bbp_tag_topic_cannot_reply() ?>
function bbp_tag_topic_cannot_reply()
{
    return apply_filters( 'bbp_tag_topic_cannot_reply', _e( 'You cannot create new topics.', bbpress ) );
}

#7 @alexvorn2
12 years ago

  • Milestone changed from Future Release to 2.3

#8 @johnjamesjacoby
12 years ago

  • Milestone changed from 2.3 to 2.4

Punting to 2.4.

#9 follow-up: @gawain
12 years ago

Based on your comment in #2116, I presume you'd be happier with something like this then, jjj?

<?php bbp_topic_tag_cannot_reply() ?>
function bbp_topic_tag_cannot_reply()
{
    return _e( 'You cannot create new topics.', bbpress );
}

#10 in reply to: ↑ 9 @johnjamesjacoby
12 years ago

  • Milestone changed from 2.4 to 2.5

Replying to gawain:

Based on your comment in #2116, I presume you'd be happier with something like this then, jjj?

<?php bbp_topic_tag_cannot_reply() ?>
function bbp_topic_tag_cannot_reply()
{
    return _e( 'You cannot create new topics.', bbpress );
}

I really like keeping these in the theme. It makes it super easy to modify, and sets an easy convention plugins to introduce new messages.

Moving to 2.5 to keep thinking about this.

#11 @johnjamesjacoby
11 years ago

  • Milestone changed from 2.5 to 2.6

2.5 is going to focus on performance improvements. Moving to 2.6.

#12 @johnjamesjacoby
11 years ago

  • Milestone changed from 2.6 to 2.7

Bump to 2.7.

#13 @johnjamesjacoby
10 years ago

  • Milestone changed from 2.7 to 2.8

Bumping all 2.7 to 2.8 milestone.

This ticket was mentioned in Slack in #bbpress by robkk. View the logs.


8 years ago

Note: See TracTickets for help on using tickets.