Page MenuHomePhabricator

add hook to EditPage.php in getEditButtons
Closed, ResolvedPublic

Description

Author: skizzerz

Description:
Can you add a hook to the function getEditButtons in /includes/EditPage.php (immediately before the return $buttons; line). Not sure what to call it, perhaps "modifyEditButtons" or something? It would allow for the modification of the array $buttons, which contains the edit buttons Save, Preview, Live, and Diff.

Anyway, the implementation of such a hook would allow for numerous extensions to add their own features to the row of buttons or even change appearances/functionality of existing ones (for example, forcing anonymous users to preview before saving).

I'm too lazy to write up a patch for the addition of a single line, so here's the change :P

/includes/EditPage.php line 1964-1965
currently

return $buttons;

change to

wfRunHooks('modifyEditButtons', array(&$buttons));
return $buttons;


Version: 1.12.x
Severity: enhancement

Details

Reference
bz12902

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:05 PM
bzimport set Reference to bz12902.
bzimport added a subscriber: Unknown Object (MLST).

t.laqua wrote:

Don't you have commit access now?

skizzerz wrote:

Yeah, I do. I just wrote this bug before I got it. Anyway, implemented in r30888