diff --git a/kohana-for-wordpress.php b/kohana-for-wordpress.php index 5289da1..4fcc7d6 100644 --- a/kohana-for-wordpress.php +++ b/kohana-for-wordpress.php @@ -491,8 +491,10 @@ function kohana_the_content_filter($content) break; } } - - + + // Make sure $content is a string at this point (could be a View object or anything that implements __toString()) + $content = (string)$content; + // Look for any Kohana requests that are dropped directly into the content $tag = "/\[request(.*?)\\]/"; $matches = array(); diff --git a/kohana_bootstrap.php b/kohana_bootstrap.php index 52cc7dc..eff2378 100644 --- a/kohana_bootstrap.php +++ b/kohana_bootstrap.php @@ -55,15 +55,6 @@ } Kohana::init(array('charset' => 'utf-8', 'base_url' => $kohana_base_url )); -/** **** Enable modules as defined in plugin settings - * Enable modules. Modules are referenced by a relative or absolute path. - */ -$k_mods = explode(',', get_option('kohana_modules') ); -foreach( $k_mods as $km ){ - $mods[trim($km)] = MODPATH.trim($km); -} -Kohana::modules($mods); - /** * Attach the file write to logging. Multiple writers are supported. */ @@ -74,6 +65,15 @@ */ Kohana::$config->attach(new Kohana_Config_File); +/** **** Enable modules as defined in plugin settings + * Enable modules. Modules are referenced by a relative or absolute path. + */ +$k_mods = explode(',', get_option('kohana_modules') ); +foreach( $k_mods as $km ){ + $mods[trim($km)] = MODPATH.trim($km); +} +Kohana::modules($mods); + /** * Set the routes. Each route must have a minimum of a name, a URI and a set of * defaults for the URI.