How to get current post ID in quick edit callback

You can get the ID per JavaScript from the quick edit screen’s parent tr: that has an attribute id="edit-418", where 418 is the post ID.

So extract this number, get the post data per AJAX, and insert the values you need. Not elegant.

Read wp-admin/js/inline-edit-post.js to see how the core does it.

Leave a Comment