Ticket #2667: 2667.patch
File 2667.patch, 2.2 KB (added by , 8 years ago) |
---|
-
trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-customizations.php
39 39 40 40 add_action( 'wp_ajax_replyto-comment', array( $this, 'save_custom_comment' ), 0 ); 41 41 add_filter( 'comment_row_actions', array( $this, 'custom_comment_row_actions' ), 10, 2 ); 42 add_filter( 'get_comment_link', array( $this, 'link_internal_notes_to_admin' ), 10, 2 ); 42 43 43 44 // Admin Metaboxes 44 45 add_action( 'add_meta_boxes', array( $this, 'register_admin_metaboxes' ), 10, 2 ); … … 108 109 switch ( $hook_suffix ) { 109 110 case 'post.php': 110 111 wp_enqueue_style( 'plugin-admin-post-css', plugins_url( 'css/edit-form.css', Plugin_Directory\PLUGIN_FILE ), array( 'edit' ), 2 ); 111 wp_enqueue_script( 'plugin-admin-post-js', plugins_url( 'js/edit-form.js', Plugin_Directory\PLUGIN_FILE ), array( 'wp-util', 'wp-lists' ), 1);112 wp_enqueue_script( 'plugin-admin-post-js', plugins_url( 'js/edit-form.js', Plugin_Directory\PLUGIN_FILE ), array( 'wp-util', 'wp-lists' ), 2 ); 112 113 wp_localize_script( 'plugin-admin-post-js', 'pluginDirectory', array( 113 114 'removeCommitterAYS' => __( 'Are you sure you want to remove this committer?', 'wporg-plugins' ), 114 115 ) ); … … 413 414 } 414 415 415 416 /** 417 * Changes the permalink for internal notes to link to the edit post screen. 418 * 419 * @param string $link The comment permalink with '#comment-$id' appended. 420 * @param \WP_Comment $comment The current comment object. 421 * @return string The permalink to the given comment. 422 */ 423 public function link_internal_notes_to_admin( $link, $comment ) { 424 if ( 'internal-note' === $comment->comment_type ) { 425 $link = get_edit_post_link( $comment->comment_post_ID ); 426 $link = $link . '#comment-' . $comment->comment_ID; 427 } 428 429 return $link; 430 } 431 432 /** 416 433 * Saves a comment that is not built-in. 417 434 * 418 435 * We pretty much have to replicate all of `wp_ajax_replyto_comment()` to be able to comment on draft posts.