`WP_List_Table`'s constructor registers an `'admin_footer'` callback when AJAX is enabled. As such, if you create multiple instances of the class, you get multiple JS blobs on the page when the callbacks fire. Extra instances get made when `wp_comment_reply()` invokes the class constructor without checking for the existing instance via the `$wp_list_table` global.
We shall check the `$wp_list_table` global in `wp_comment_reply()`. Props sorich87. Fixes #17413. Built from https://develop.svn.wordpress.org/trunk@31019 git-svn-id: http://core.svn.wordpress.org/trunk@31000 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
a5593a64d3
commit
5e4941023b
|
@ -412,7 +412,7 @@ function get_inline_data($post) {
|
|||
* @param bool $table_row
|
||||
*/
|
||||
function wp_comment_reply($position = '1', $checkbox = false, $mode = 'single', $table_row = true) {
|
||||
|
||||
global $wp_list_table;
|
||||
/**
|
||||
* Filter the in-line comment reply-to form output in the Comments
|
||||
* list table.
|
||||
|
@ -435,10 +435,12 @@ function wp_comment_reply($position = '1', $checkbox = false, $mode = 'single',
|
|||
return;
|
||||
}
|
||||
|
||||
if ( $mode == 'single' ) {
|
||||
$wp_list_table = _get_list_table('WP_Post_Comments_List_Table');
|
||||
} else {
|
||||
$wp_list_table = _get_list_table('WP_Comments_List_Table');
|
||||
if ( ! $wp_list_table ) {
|
||||
if ( $mode == 'single' ) {
|
||||
$wp_list_table = _get_list_table('WP_Post_Comments_List_Table');
|
||||
} else {
|
||||
$wp_list_table = _get_list_table('WP_Comments_List_Table');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.2-alpha-31018';
|
||||
$wp_version = '4.2-alpha-31019';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue