Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#24930 closed defect (bug) (fixed)

Ability to customize full post locked message

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


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 5 years ago.

Download all attachments as: .zip

Change History (7)

5 years ago

#1 @azaozz
5 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
5 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
5 years ago

  • Keywords has-patch added

#4 @nacin
5 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
5 years ago

  • Keywords commit added

Patch still applies.

#6 @nacin
5 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.