[wp-hackers] altering the Quick Edit box

Steve Taylor steve at sltaylor.co.uk
Sat Nov 21 18:38:26 UTC 2009

I've searched a lot on this issue, but all I can find is other people
stuck on it. Basically, I'm trying to add fields to the Quick Edit box
for pages.

A plugin I'm working on
(http://wordpress.org/extend/plugins/lock-pages/) tries to lock the
editing of specified pages' parent and slug. It works fine on the
normal page edit screen - it stores the old values in hidden fields,
and reverts to them if the user is barred from editing them.

But Quick Edits slip right past this. I got as far as working this out:

- The Quick Edits are each generated dynamically from a hidden
"template" at the bottom of the page
- Each row has a hidden div, which contains a div for each field's value
- The JS dynamically populates the values from these divs whenever
"Quick Edit" is clicked.

I got my hidden fields into the template with the
quick_edit_custom_box hook, fine. I also did some jQuery to
dynamically add the values needed to each tr.iedit.

But try as I might I couldn't populate them. I had something like this:

$( "form table.page tr.iedit a.editinline" ).click( function() {
  [code for populating hidden fields]
  return false;

But it just wouldn't run. It seemed as if when my function ran, WP's
inlineEditPost function hadn't yet created the Quick Edit box, so the
hidden fields weren't there to populate with values. I tried used
mouseup instead of click, no luck. Is there a clash here? Anyone else
had the same problem?


More information about the wp-hackers mailing list