Make WordPress Core

Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#13007 closed enhancement (wontfix)

Provide Post-like UI for editing commentmeta

Reported by: beaulebens Owned by:
Milestone: Priority: low
Severity: normal Version: 3.0
Component: Comments Keywords:
Focuses: Cc:


Now that the commentmeta table is available, it seems like it'd make sense to have a simple UI for accessing/editing metadata associated with a comment via wp-admin.

I imagine this could be largely a copy-paste of the Custom Fields portion of the Post Edit screen, just tying into wp_commentmeta instead. This UI could just appear on the bottom of the current Comment Edit screen (/wp-admin/comment.php?action=editcomment&c=123)

Unless someone beats me to it, I'll take a stab at a patch some time soonish.

Change History (10)

comment:1 @mikeschinkel5 years ago

  • Cc mikeschinkel@… added

comment:2 @ptahdunbar5 years ago

  • Cc trac@… added

comment:3 @sparkweb4 years ago

I wanted to do the same thing. I wrapped this in a plugin and I did a copy-paste on the code and got it all displaying fine, but then ran into big troubles on the jQuery side, trying to get it to add/save/update/delete. I couldn't really figure out what was going on in wp-admin/js/custom-fields.dev.js. Here's the link to the plugin in case anyone wants to take it from here: http://wordpress.org/extend/plugins/comment-meta-display/

Since I couldn't even get Add to work, I set the whole meta box to be hidden if there wasn't any meta data to be found for the comment.

comment:4 @nacin4 years ago

  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from new to closed

We shouldn't have this in core, considering we should probably phase out the Custom Fields box for posts too. A plugin sounds pretty nifty.

comment:5 @scribu4 years ago

  • Keywords needs-patch removed

Agree with phasing out the Custom Fields box. It's useless if the theme (or a plugin) doesn't do something with the inserted data.

comment:6 @sparkweb4 years ago

But as a theme developer, I use custom fields all the time for little things on a page-by-page basis. Isn't it better to just leave it turned off on screen settings but available to be turned on (viewable) by anyone who needs it?

I know its better to create your own meta_box (which I guess I'd kind of agree with), but that definitely takes some technical skill. Seems like it would be a pretty big barrier to entry for a lot of folks just wanting to use one or two custom fields in a page or post.

Version 0, edited 4 years ago by sparkweb (next)

comment:7 @scribu4 years ago

It is already hidden by default.

Yeah, it does take quite some skill actually; the 'save_post' hook is full of gotchas.

comment:8 @sparkweb4 years ago

So I guess what I'm saying is: don't phase out the custom fields box for posts, instead just leave it hidden. Seems like it would be consistent to have the same functionality for comment meta as well. Although, since this is a much-less-used feature, I guess it would be fine to just leave it as a plugin for those that need -- except that the plugin doesn't exist (yet).

comment:9 follow-up: @GaryJ4 years ago

  • Cc gary@… added

Slightly OT: Is there a ticket related to the phasing out of Custom Fields for posts?

comment:10 in reply to: ↑ 9 @nacin4 years ago

Replying to GaryJ:

Slightly OT: Is there a ticket related to the phasing out of Custom Fields for posts?

Nope. I doubt this will happen soon, but we've laid the groundwork for a while now -- we now hide the meta box by default, we've introduced register_meta() to mitigate any info-disclosure risks, and are working on an API for custom meta boxes that will hopefully make it easy for developers to do their own box.

Note: See TracTickets for help on using tickets.