Last active
July 12, 2021 04:31
-
-
Save htdat/06d77ea326d53cb1ae1e6b68c96aa0c3 to your computer and use it in GitHub Desktop.
Revisions
-
htdat renamed this gist
Jul 12, 2021 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
htdat revised this gist
Jul 12, 2021 . 1 changed file with 12 additions and 21 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,17 +1,15 @@ <?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', @@ -20,16 +18,9 @@ public function __construct() { * 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, -
htdat created this gist
Jun 14, 2021 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,41 @@ <?php /** * Snippet to replicate this issue https://core.trac.wordpress.org/ticket/49089 * Usage: * - Convert this file as a plugin, or much easier add this file under wp-content/mu-plugins * - Visit wp-admin/edit.php * - Try to edit a post with "Quick Edit" to trigger the ajax action * - Check PHP error log (debug.log) */ class Trac_49089_WP_List_Table extends WP_List_Table { public function __construct() { parent::__construct( 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', ) ); } } add_action( 'wp_ajax_inline-save', function () { new Trac_49089_WP_List_Table(); }, /** * 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 );