common — Get HTML from a view file in the common/ directory.¶
The common function loads a script, optionally passing in some variables. Themes and plugins can use this function to separate distinct blocks of output into different scripts, even if all the output will appear on one page.
By default, common tries to load the script from the “common” directory for the current theme, but any view directory can be specified.
common($file, $vars = array(), $dir = 'common')¶
Get HTML from a view file in the common/ directory.
Optionally, parameters can be passed to the view, and the view can be loaded from a different directory.
- $file (string) – Filename
- $vars (array) – A keyed array of variables to be extracted into the script
- $dir (string) – Defaults to ‘common’