Changeset 2737
- Timestamp:
- 03/11/2016 06:59:07 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-customizations.php
r2736 r2737 33 33 34 34 add_filter( 'postbox_classes_plugin_internal-notes', array( $this, 'postbox_classes' ) ); 35 add_filter( 'comment_row_actions', array( $this, 'custom_comment_row_actions' ), 10, 2 ); 35 36 } 36 37 … … 105 106 ); 106 107 107 // Replace the publish box 108 // Replace the publish box. 108 109 add_meta_box( 109 110 'submitdiv', … … 144 145 145 146 return array_filter( $classes ); 147 } 148 149 /** 150 * Filter the action links displayed for each comment. 151 * 152 * Actions for internal notes can be limited to replying for plugin reviewers. 153 * Plugin Admins can additionally trash, untrash, and quickedit a note. 154 * 155 * @param array $actions An array of comment actions. Default actions include: 156 * 'Approve', 'Unapprove', 'Edit', 'Reply', 'Spam', 157 * 'Delete', and 'Trash'. 158 * @param \WP_Comment $comment The comment object. 159 * @return array Array of comment actions. 160 */ 161 public function custom_comment_row_actions( $actions, $comment ) { 162 if ( 'internal-note' === $comment->comment_type ) { 163 $allowed_actions = array( 'reply' => true ); 164 165 if ( current_user_can( 'manage_comments' ) ) { 166 $allowed_actions['trash'] = true; 167 $allowed_actions['untrash'] = true; 168 $allowed_actions['quickedit'] = true; 169 } 170 171 $actions = array_intersect_key( $actions, $allowed_actions ); 172 } 173 174 return $actions; 146 175 } 147 176
Note: See TracChangeset
for help on using the changeset viewer.