Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#24930 closed defect (bug) (fixed)

Ability to customize full post locked message

Reported by: joepterry's profile joepterry Owned by: nacin's profile nacin
Milestone: 3.7 Priority: normal
Severity: minor Version: 3.6
Component: Revisions Keywords: has-patch commit
Focuses: Cc:

Description

Currently, plugins have the ability to restrict the user from overriding the post lock.

Unfortunately, even if the user is restricted from overriding, the end of the message still reads "If you take over, [user] will be blocked from continuing to edit."

Ideally, this message would observe the value of $override, which the plugin may or may not have modified with the override_post_lock filter - and not display the last sentence of the prompt if $override === false.

As an alternative, the post_locked_dialog hook could allow the plugin to modify the entire message, not just append to it.

Attachments (1)

24930.patch (1013 bytes) - added by azaozz 11 years ago.

Download all attachments as: .zip

Change History (7)

@azaozz
11 years ago

#1 @azaozz
11 years ago

24930.patch splits that string in two and outputs the second part only when $override is true as suggested by @joepterry.

Not sure how useful it is to make all the html from that dialog filterable in PHP. It would mean regex-ing translated text. The same can be done even easier with jQuery on DOM ready.

#2 @azaozz
11 years ago

  • Milestone changed from Awaiting Review to 3.6.1
  • Type changed from enhancement to defect (bug)

Setting to 3.6.1 despite the minimal string change. Without this the override_post_lock filter is quite hard to use.

#3 @swissspidy
11 years ago

  • Keywords has-patch added

#4 @nacin
11 years ago

  • Milestone changed from 3.6.1 to 3.7

No string changes in 3.6.1 — pushing to 3.7. You can get around this in albeit hacky ways for 3.6.x.

#5 @johnbillion
11 years ago

  • Keywords commit added

Patch still applies.

#6 @nacin
11 years ago

  • Owner set to nacin
  • Resolution set to fixed
  • Status changed from new to closed

In 25694:

Hide the "If you take over" string from the post locked dialog when the override_post_lock filter is used to prevent an override.

props azaozz.
fixes #24930.

Note: See TracTickets for help on using tickets.