… uses array_merge? Great, but why is this relevant? Consider you are creating a short code wrapper for a function where some of the arguments that are passed to the function must be specific values and the others are meant to be exposed to the user. As an example, let’s look at a shortcode using … ∞
Seems simple enough; and, it is … just one line of code will add this functionality: You could add this to your active theme’s functions.php file, but the better method would be to use this from a plugin. Here is a simple, fully functional, code snippet for a plugin to do this:
This post will further expand on the possible uses of the_widget() as the basis of the code you can use to create a shortcode for a WordPress sidebar widget.