Last active
July 12, 2021 04:31
-
-
Save htdat/06d77ea326d53cb1ae1e6b68c96aa0c3 to your computer and use it in GitHub Desktop.
See https://core.trac.wordpress.org/ticket/49089 and https://github.com/Automattic/Edit-Flow/issues/654
This file contains 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: Replicate core issue 49089 | |
Plugin URI: https://core.trac.wordpress.org/ticket/49089 | |
Description: Steps to replicate: (1) Visit wp-admin/edit.php, (2) Try to edit a post with "Quick Edit" to trigger the ajax action, (3) Check PHP error log (debug.log) | |
Author: htdat | |
Version: 0.1-dev | |
*/ | |
add_action( | |
'wp_ajax_inline-save', | |
function () { | |
new WP_List_Table( | |
array( | |
'plural' => 'plural', | |
'singular' => 'singular', | |
'ajax' => true, | |
/** | |
* The PHP error does not happen if `screen` value is different from NULL or `` | |
* Removing the comment below will prevent the error from happening | |
*/ | |
// 'screen' => 'anything', | |
) | |
); | |
}, | |
/** | |
* Core calls this action with priority = 1, and since it's an AJAX request, | |
* the whole process is terminated early before the added action here can be reached out | |
* | |
* @see https://github.com/WordPress/wordpress-develop/blob/132984c20f4a539dddeeaf7f9f65716854a89b55/src/wp-admin/admin-ajax.php#L163-L165 | |
*/ | |
-1 | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment