Joddit Global CSS Fixed for WordPress 4

I really like the simple CSS plugin — Joddit Global CSS. It works great. Well, it worked great until I upgraded to WordPress 4. Then it broke.

After upgrading, I couldn’t see any of my stylesheets via the admin interface, but they were still loading.

So I posted a message to the author of the plugin to let them know there’s a bug and that I’d be happy to help out with fixing it.

I didn’t hear back from the author, but it seemed like an easy enough thing to fix, which it was.

The problem with the Joddit Global CSS plugin is that it uses the WP_List_Table class that comes with WordPress. You aren’t supposed to do that.

According to the WordPress documentation, plugin and theme developers are supposed to make a copy of the version of WP_List_Table and include it with the plugin or theme that needs it. The one included with WordPress is subject to change and will break code that relies on it directly, even sub-classing it is wrong. That’s what happened with Joddit Global CSS.

So I made a copy of the version of WP_List_Table (class-wp-list-table.php) from WordPress 3.9.2 and put it in the plugin lib director. I changed the name of the class from WP_List_Table to My_List_Table to avoid collisions with WordPress core and other plugins or themes that could load WP_List_Table.

So if you’re running WordPress 4 and you can’t see your Joddit Global CSS stylesheets in the admin, just run my tweaked fork.

In your plugins directory, after you delete or remove the version of Joddit Global CSS is in there, clone my Git fork of the plugin.

git clone https://github.com/hack3r3d/joddit-global-css.git
Share Button