|Author:||Johan van der Wijk|
Summary: If you need editors to be able to edit the content of widgets, or just want to control the content in widgets more easily, this plugin is great.
The short description for the custom post widget says it all: this plugin enables you to display the content of a custom post type called Content Block in a sidebar widget. Not all users can edit text widgets, which is annoying at times when you need authors to be able to control the content of a sidebar widget but don’t want to give them the rights to move those widgets around. Also, you often want to be able to use a rich text editor when editing the content of a widget.
The Custom Post Widget aims to solve that by giving you a custom post type, called “Content Block”, that you can display in a widget. The admin chooses which Content Block goes where in which sidebar, the editor can edit the contents, everybody’s happy.
You install the plugin and a new “content blocks” post type appears in the left hand menu. Simply create a few Content Blocks there, than go to the widgets area, add one or more of the Content Block widgets and select which content block to display within the widgets. Easy as pie, works as advertised.
The content block post type has featured image enabled by default, but doesn’t actually display them by default, though the FAQ states how to make them show up. I would actually make this a setting on the widget itself, where the admin should also be able to choose the size of the image. As it is now, I’m quite sure editors will complain that they added a featured image but it’s not showing up.
The code could use some more inline documentation but in general adheres nicely to WordPress standards and uses the proper API’s. When I tested it with WP_DEBUG set to true, which I think any and all developers should do, it did throw several notices both when creating or editing a custom block and when adding a new custom block widget. These should be (and can quite easily be) fixed.
Also, the developer doesn’t seem to know the
plugins_url() function which could save him a few headaches I think. Other than that, the code looks pretty darn good.