getherbert / herbert

The WordPress Plugin Framework:
http://getherbert.com/
632 stars 94 forks source link

Shortcode fatal error #58

Closed csrui closed 9 years ago

csrui commented 9 years ago

I'm getting the following error trying to use shortcodes with herbert. Anyone else getting this?

Catchable fatal error: Object of class Herbert\Framework\Response could not be converted to string in /Volumes/Work/data/wp_tests/wp-includes/shortcodes.php on line 303

I've tried via API

$shortcode->add(
    'MyPluginShowPostName',
    'myPluginApi::showPostName'
);

...

$api->add('showPostName', function($postId)
{
    return (new PostController)->showPostName($postId);
});

And also via controller directly like so

$shortcode->add(
    'MyPluginShowPostName',
    __NAMESPACE__ . '\Controllers\PostController@showPostName'
);
jasonagnew commented 9 years ago

@csrui any chance you could run a composer update as I thought I'd fixed that issue yesterday.

csrui commented 9 years ago

Awesome!

It's working both ways, controller and API.

csrui commented 9 years ago

There's still something wrong with the shortcode...

The shortcode should appear between the two content

my_custom_shirts___wordpress_testing_ground sentences.

jasonagnew commented 9 years ago

Good spot, run composer update and that should be fixed. Make sure it pulls in 0.9.13 just incase it doesn't pick it up right away.

csrui commented 9 years ago

@jasonagnew Working fine now, closing the issue. Thanks