Add_shortcode as a Class to pass arguments to a function
To create multiple shortcodes, you can get the default values from a static attribut of the class. This code create 2 shortcodes myshortcode1 and myshortcode2. In the included files, you can read variables $_atts, $content and $tag class MyLittleClass { public static $shortcodes; public static function init() { self::$shortcodes = [ “myshortcode1” => [ “defaultValues” … Read more