Created
January 24, 2014 15:24
-
-
Save pippinsplugins/8599402 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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