Lukasz Koprowski

Born and raised in Poland. Now 19 years old Computer Student at Imperial College London. Passionate about programming and webdesign. Likes a good book or a movie, and trains boxing.

Project Description

This project is about improving management of threaded comments in WordPress. Currently there’s no preview of threads in the Dashboard, they all are treated equally, and there is no easy way to move comments between posts or threads. For re-threading comments a Drag’n’Drop interface would be provided as it seems to be the most natural way to perform such an action. Probably some way to revert changes will be provided.

Technical

Introducing two function to comments.php. Internally they would call wp_update_comment() to perform updating of comment’s parent/post. By default comment along with its entire sub-thread will be moved/reparented.

  • wp_move_comment($comment_id[], $post_id[], $single[]) – moves comment with/without entire sub-thread to another post
  • wp_reparent_comment($comment_id[], $parent_id[], $single[]) – re-parent comment with/without its sub-thread
  • wp_update_comment() – modified to accept parent and post_id as modifiable comment’s properties

Comments

  • choice between threaded and plain view of comments
  • moving a comment between posts and pages, using list of posts/pages
  • re-parenting using list of comments for a current post
  • threaded view would display posts threaded as in the frontend
  • threaded view would have sorting disabled
  • threaded view would allow for re-parenting using html5/jquery drag’n’drop

Edit Comment

  • ‘move’ widget
  • re-parenting and moving a comment using simple menu with list of targets
  • link to list of post-specific comments, with currently edited comment highlighted after getting there

Bulk editing

Both bulk moving and re-parenting will be possible, but only by moving/re-parenting to a single target. Roots of selected sub-threads will become siblings rooted at the same place. Siblings will be ordered chronologically.

Keyboard shortcuts

Keyboard shortcuts will not be supported for moving/re-parenting.

XML-RPC support

MoveComment and reparentComment accept arrays of ids and targets to allow mass editing.

  • wp.editComment – modified to accept parent and post_id as modifiable comment’s properties.
  • wp.moveComment – moves comment with/without its entire sub-thread
  • wp.reparentComment – changes comment’s parent, may re-parent entire sub-thread

New actions

If multiple comments are moved to the other page, action for ever single one is fired. In case of re-threading action only for a subthread’s root is run.

  • move_comment – Runs before comment is moved
  • moved_comment – Runs after comment is moved
  • reparent_comment – Runs before comment’s parent is changed
  • reparented_comment – Runs after comment’s parent is changed

Project Schedule

  • April 26 – May 22 – Study the code, finalize implementation details
  • May 23 – June 5 – Code main functions.
  • June 6 – June 12 – Finish ‘Comments’ and widgets UI modifications.
  • June 13 – June 23 – Finish modifying ‘Comments’ to show threaded view of comments.
  • June 24 – June 30 – Create XML-RPC support.
  • July 1 – July 11 – Finish js side of project (d’n’d, undo etc.).
  • July 12 – August 15 – Fixing, testing, polishing and documenting.

Mentors: Westi and Koop