Changeset 6337
- Timestamp:
- 01/10/2018 06:04:22 PM (7 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-customizations.php
r6287 r6337 53 53 add_filter( 'postbox_classes_plugin_plugin-committers', array( __NAMESPACE__ . '\Metabox\Committers', 'postbox_classes' ) ); 54 54 add_filter( 'postbox_classes_plugin_plugin-support-reps', array( __NAMESPACE__ . '\Metabox\Support_Reps', 'postbox_classes' ) ); 55 add_filter( 'wp_ajax_get-notes', array( __NAMESPACE__ . '\Metabox\Internal_Notes', 'get_notes' ) ); 55 56 add_filter( 'wp_ajax_add-committer', array( __NAMESPACE__ . '\Metabox\Committers', 'add_committer' ) ); 56 57 add_filter( 'wp_ajax_delete-committer', array( __NAMESPACE__ . '\Metabox\Committers', 'remove_committer' ) ); -
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/list-table/class-plugin-comments.php
r6287 r6337 42 42 <table class="<?php echo implode( ' ', $this->get_table_classes() ); ?>" data-comment-type="<?php echo esc_attr( $this->comment_type ); ?>" style="display:none;"> 43 43 <colgroup> 44 <col width="15%"> 45 <col width="65%"> 44 46 <col width="20%"> 45 <col width="80%">46 47 </colgroup> 47 48 <tbody id="the-comment-list"<?php if ( $singular ) { echo " data-wp-lists='list:$singular'"; } ?>> … … 55 56 <?php 56 57 } 58 59 /** 60 * @return array 61 */ 62 protected function get_column_info() { 63 return [ 64 [ 65 'author' => __( 'Author' ), 66 'comment' => _x( 'Comment', 'column name' ), 67 'date' => __( 'Date' ), 68 ], 69 [], 70 [], 71 'comment', 72 ]; 73 } 57 74 } -
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-internal-notes.php
r6287 r6337 39 39 wp_comment_trashnotice(); 40 40 } 41 42 /** 43 * Ajax handler for getting notes. 44 * 45 * @global int $post_id 46 * 47 * @param string $action Action to perform. 48 */ 49 function get_notes( $action ) { 50 global $post_id; 51 if ( empty( $action ) ) { 52 $action = 'get-comments'; 53 } 54 check_ajax_referer( $action ); 55 56 if ( empty( $post_id ) && ! empty( $_REQUEST['p'] ) ) { 57 $id = absint( $_REQUEST['p'] ); 58 if ( ! empty( $id ) ) { 59 $post_id = $id; 60 } 61 } 62 63 if ( empty( $post_id ) ) { 64 wp_die( -1 ); 65 } 66 $wp_list_table = new Plugin_Comments( [ 67 'screen' => convert_to_screen( [ 'screen' => 'edit-comments' ] ), 68 ] ); 69 70 if ( ! current_user_can( 'edit_post', $post_id ) ) { 71 wp_die( -1 ); 72 } 73 74 $wp_list_table->prepare_items(); 75 76 if ( ! $wp_list_table->has_items() ) { 77 wp_die( 1 ); 78 } 79 80 $x = new \WP_Ajax_Response(); 81 ob_start(); 82 foreach ( $wp_list_table->items as $comment ) { 83 if ( ! current_user_can( 'edit_comment', $comment->comment_ID ) && 0 === $comment->comment_approved ) { 84 continue; 85 } 86 get_comment( $comment ); 87 $wp_list_table->single_row( $comment ); 88 } 89 $comment_list_item = ob_get_clean(); 90 91 $x->add( [ 92 'what' => 'comments', 93 'data' => $comment_list_item, 94 ] ); 95 $x->send(); 96 } 41 97 } -
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/js/edit-form.js
r5867 r6337 70 70 }; 71 71 72 wp.ajax.post( 'get- comments', data ).always( function( response ) {72 wp.ajax.post( 'get-notes', data ).always( function( response ) { 73 73 response = wpAjax.parseAjaxResponse( response ); 74 74
Note: See TracChangeset
for help on using the changeset viewer.