Bug #2027
closedCAC Featured Content - fatal error on non-MS
0%
Description
I noticed a fatal error when I tried selecting a featured Member on a non-MS installation of WordPress: it turns out that the function get_user_id_from_string() is Multisite-only.
This is a good opportunity to go through the plugin and make sure that there aren't other places where it dies on non-MS. Obviously, the Blog bit should not appear. Ideally, the Post section would degrade gracefully, so that the Blog field disappears and posts are automatically pulled from the main blog. At the very minimum, these sections should be disabled all together if ( !is_multisite() ), just to avoid fatal errors.
As for the specific case of get_user_id_from_string(), it would be a real shame the Members featured content type didn't work just due to MS vs non-MS. A simple solution is, in a utility file, do the following:
if ( !function_exists( 'get_user_id_from_string' ) ) { function get_user_id_from_string( $string ) { // just copy WP's function - I don't think there's anything particularly MS-specific about it } }
I'm marking this ticket High because it really is a must-have before launching the plugin publicly - definitely don't want to start crashing people's sites!