Opened 12 years ago
Closed 12 years ago
#21179 closed enhancement (fixed)
filter error message displayed when a site is over quota
Reported by: | jkudish | Owned by: | westi |
---|---|---|---|
Milestone: | 3.5 | Priority: | normal |
Severity: | normal | Version: | 3.4.1 |
Component: | Media | Keywords: | has-patch |
Focuses: | Cc: |
Description
Add a new filter for the message that is displayed when omitting the upload form for a site that has exceeded its upload quota
Attachments (4)
Change History (16)
#2
in reply to:
↑ 1
@
12 years ago
Replying to scribu:
Use a translation file or the 'gettext' filter?
That would constrain me to displaying a single paragraph and to what's inside the spintf
, what if I want to display something completely different there? In this case, we want to improve the user experience for our users by displaying a little bit more than a single sentence.
#3
follow-up:
↓ 4
@
12 years ago
You can put `</p><p>' sequence in the middle of text - this way you will be able to create more paragraphs.
#4
in reply to:
↑ 3
@
12 years ago
Replying to sirzooro:
You can put `</p><p>' sequence in the middle of text - this way you will be able to create more paragraphs.
Yes I could. But quite frankly doing a gettext filter + this hack is well, very hacky. Adding a filter is easy and others can benefit too
#5
@
12 years ago
I think that a better solution here is to move the current message into a function which is hooked onto an action that is fired here so that the output can easily be suppressed / augmented by a plugin without relying on using the gettext filters.
We could probably move the check onto the pre-upload-ui
action with a high priority instead of introducing a new action.
#6
follow-up:
↓ 7
@
12 years ago
- Cc daryl@… added
21179.patch implements westi's proposed solution, with one twist. Since the original code does a return inline if multisite and no space left and actions can't really do returns, I've also added a filter that'll do the inline return if true. The function we fire on pre-upload-ui
then applies the filter with a __return_true
value. Not sure this is the best approach, but it's the only sane way I could think of short of just using a filter inside the current check.
#7
in reply to:
↑ 6
@
12 years ago
Replying to dllh:
21179.patch implements westi's proposed solution, with one twist. Since the original code does a return inline if multisite and no space left and actions can't really do returns, I've also added a filter that'll do the inline return if true. The function we fire on
pre-upload-ui
then applies the filter with a__return_true
value. Not sure this is the best approach, but it's the only sane way I could think of short of just using a filter inside the current check.
I forgot about the return complicating things so I think the best thing is an action inside the if like in the latest patch which makes this simple to override with a remove action call.
#8
@
12 years ago
Before commit I need to move the location of the add_action call as it it too late to be easily removed in the patch.
#9
@
12 years ago
- Milestone changed from Awaiting Review to 3.5
- Owner set to westi
- Status changed from new to accepted
#11
@
12 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
The new function seems a bit out of place between media_upload_flash_bypass()
and media_upload_html_bypass()
.
21179.2.diff moves multisite_over_quota_message()
to the end of the file and adds PHPDocs for it and for the nearby functions. Also fixes @since
for media_upload_max_image_resize()
, which was introduced in 3.3 ([18482]), not in 2.6.
Use a translation file or the 'gettext' filter?