Skip to content

Instantly share code, notes, and snippets.

@pippinsplugins
Created January 24, 2014 15:24
Show Gist options
  • Select an option

  • Save pippinsplugins/8599402 to your computer and use it in GitHub Desktop.

Select an option

Save pippinsplugins/8599402 to your computer and use it in GitHub Desktop.
<?php
/*
* Plugin Name: Remove Double-Click to Edit for Comments
* Description: Disables the double-click to edit action for comments
* Author: Pippin Williamson
* Version: 1.0
*/
class Remove_Double_Click_To_Edit {
public function __construct() {
add_action( 'admin_footer', array( $this, 'javascript' ) );
}
public function javascript() {
global $pagenow;
if( 'edit-comments.php' != $pagenow ) {
return;
}
?>
<script>
(function($){
$('tr.comment').each(function() {
$(this).find('a.vim-q').each(function() {
$(this).removeClass('vim-q');
});
});
}(jQuery));
</script>
<?php
}
}
new Remove_Double_Click_To_Edit;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment