WordPress.org

Make WordPress Core

#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:

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 21 months ago.

Download all attachments as: .zip

Change History (7)

@azaozz21 months ago

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

comment:2 @azaozz21 months 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.

comment:3 @swissspidy21 months ago

  • Keywords has-patch added

comment:4 @nacin20 months 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.

comment:5 @johnbillion19 months ago

  • Keywords commit added

Patch still applies.

comment:6 @nacin19 months 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.