Skip to:
Content

Opened 3 years ago

Last modified 7 months 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 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 (13)

comment:1 @johnjamesjacoby3 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.

comment:2 @alexvorn23 years ago

cool! :)

comment:3 @netweb3 years ago

  • Cc stephen@… added

comment:4 @johnjamesjacoby3 years ago

  • Milestone changed from 2.2 to Future Release

No time in 2.2; moving back to Future Release.

comment:5 @netweb2 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."

comment:6 @gawain2 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 ) );
}

comment:7 @alexvorn22 years ago

  • Milestone changed from Future Release to 2.3

comment:8 @johnjamesjacoby2 years ago

  • Milestone changed from 2.3 to 2.4

Punting to 2.4.

comment:9 follow-up: @gawain2 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 );
}

comment:10 in reply to: ↑ 9 @johnjamesjacoby22 months 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.

comment:11 @johnjamesjacoby20 months ago

  • Milestone changed from 2.5 to 2.6

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

comment:12 @johnjamesjacoby16 months ago

  • Milestone changed from 2.6 to 2.7

Bump to 2.7.

comment:13 @johnjamesjacoby7 months ago

  • Milestone changed from 2.7 to 2.8

Bumping all 2.7 to 2.8 milestone.

Note: See TracTickets for help on using tickets.