Opened 12 years ago
Last modified 8 years ago
#1883 new enhancement
Smarter template notices
Reported by: | 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 )
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
@
12 years ago
- Description modified (diff)
- Keywords 2nd-opinion removed
- Summary changed from remove repetitive text to Smarter template notices
#4
@
12 years ago
- Milestone changed from 2.2 to Future Release
No time in 2.2; moving back to Future Release.
#5
@
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
@
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 ) ); }
#9
follow-up:
↓ 10
@
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
@
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
@
11 years ago
- Milestone changed from 2.5 to 2.6
2.5 is going to focus on performance improvements. Moving to 2.6.
Modified ticket title and description. Valid, but needed a little more meat.