Today was a big day for the WordPress community. WordPress 3.1 was released, introducing a bunch of exciting new features. Like most people, I updated some of my WordPress installations right away. One of my clients installations was running my Smart WYSIWYG Smart Blocks of Content plugin and when I updated that installation to 3.1, I instantly noticed that there was something wrong.
All of the Smart Blocks where no longer available and WordPress trimmed the post_type of the Custom Post Type to a lowercase version without spaces. Once I started the plugin, I choose to use ‘Smart Block’ as a post_type, which seemed to be a great idea back then. But with the change to a lowercase version in the WordPress queries, all of the Smart Blocks where no longer query-able, so pretty useless.
Hero of the day is Andrew Nacin, who pointed me to some code in his Log Deprecated Notices plugin, which I could use to fix this problem. Few minutes ago, I fixed the plugin, all new Smart Blocks will be using ‘smartblock’ as post_type and all the old Smart Blocks will be converted to new onces, the minute you update the plugin to version 0.4.1.
UPDATE: Thanks to Brian’s comment, I managed to fix another bug in this plugin. It is fixed in version 0.4.2 which is now the latest version available.
Hi Coen,
Thanks for the great plugin. It’s been really useful in several situations, and today’s upgrade was very easy.
One minor issue I’ve had is in using the shortcode. If a shortcode is placed within post or page content, all of the SWBOC content appears at the top of the post, rather than where I placed the shortcode within the content. I was able to fix this by changing..
line 28 from: the_content();
to: $content .= get_the_content();
.. and adding at line 34: return $content;
Thanks again,
Brian
Thanks Brian for this bug report. It is fixed in version 0.4.2 of the plugin, should pop up at the plugins page in WordPress.org plugin directory.
A little note: When you use get_the_content(), all tags like are stripped out. When you apply apply_filters(‘the_content’, get_the_content()), it will use the filters to display the tags. Makes your Smart Block look exactly like you want it to, with markup tags. :)