diff --git a/.gitignore b/.gitignore index caa92b0..97455ab 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,9 @@ phpcs.xml node_modules npm-debug.log docs +coverage +coverage-html .sass-cache -/.phpunit.result.cache +.phpunit.result.cache +tests/phpunit/.phpunit.result.cache phpstan.neon \ No newline at end of file diff --git a/admin/includes/class-gcmi-remote-files-list-table.php b/admin/includes/class-gcmi-remote-files-list-table.php index 568e86c..c16744d 100644 --- a/admin/includes/class-gcmi-remote-files-list-table.php +++ b/admin/includes/class-gcmi-remote-files-list-table.php @@ -24,10 +24,24 @@ */ class Gcmi_Remote_Files_List extends WP_List_Table { - /** Class constructor */ + /** + * Class constructor + */ public function __construct() { + // necessario per WP < 6.1, see: https://core.trac.wordpress.org/changeset/54414 . + if ( is_null( get_current_screen() ) ) { + set_current_screen( 'admin.php' ); + } + $screen = get_current_screen(); + if ( ! is_null( $screen ) ) { + $screen_id = $screen->id; + } else { + $screen_id = 'admin.php'; + } parent::__construct( array( + // necessario per WP < 6.1 . + 'screen' => $screen_id, 'singular' => 'fname', // singular name of the listed records. 'plural' => 'fnames', // plural name of the listed records. 'ajax' => false, // should this table support ajax?