getherbert / herbert

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

Shortcode Argument Names as String #122

Closed David-Kurniawan closed 8 years ago

David-Kurniawan commented 8 years ago

Hi,,, i am newbie in wp plugin development... i try for creating shortcode using Argument Names , eg: [showMe keyword=foo bar] but in view, i just get foo, not foo bar. how i can showing foo bar as string not array ?

This my code :

// shortcodes.php

$shortcode->add(
    'showMe',
    'myAppApi::showMeVal',
    [
        'keyword' => 'keyword'
    ]
);

and my api like this:

// api.php

$api->add('showMeVal', function($keyword) {
    return (new ShortcodeController)->showmeact($keyword);
});

Thanks so much for the great framework :)

arippberger commented 8 years ago

@David-Kurniawan when using your shortcode, are you using quotes like [showMe keyword="foo bar"]?

David-Kurniawan commented 8 years ago

@arippberger Thanks so much,,,

Sorry.... i forgot about that....

now work perfect....

arippberger commented 8 years ago

No problem! Good luck!