mirror of
https://github.com/inretio/WordPress-Plugin-Boilerplate
synced 2025-04-19 13:45:35 +03:00
Add shortcode support.
This commit is contained in:
parent
a8291082b5
commit
a57e6e7460
3 changed files with 42 additions and 0 deletions
|
@ -100,4 +100,18 @@ class Plugin_Name_Public {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* Shortcode processing function.
|
||||
* Shortcode can take arguments like [plugin-name-shortcode argm='123']
|
||||
*/
|
||||
public function plugin_name_shortcode_func($atts) {
|
||||
$a = shortcode_atts( array(
|
||||
'argm' => '0',
|
||||
), $atts
|
||||
);
|
||||
return (
|
||||
$a['argm']
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue