This gist has been deprecated and moved to a repository and published on Packagist:
mcaskill/sage-theme-wrapper
Add the following filter to your theme's functions.php:
| <?php | |
| if (!function_exists('get_var_type')) { | |
| /** | |
| * Get the type, resource name, or class name of a variable. | |
| * | |
| * Returns the type (name if an object or resource) of the PHP variable $var. | |
| * | |
| * @link http://php.net/manual/en/function.gettype.php#104224 | |
| * @param mixed $var The variable being type checked. |
| { | |
| "admin": { | |
| "elfinder": { | |
| "connector": { | |
| "bind": { | |
| "upload.pre mkdir.pre mkfile.pre rename.pre archive.pre ls.pre": [ | |
| "Plugin.Normalizer.cmdPreprocess", | |
| "Plugin.Sanitizer.cmdPreprocess" | |
| ], | |
| "ls": [ |
| <?php | |
| /** | |
| * Application HTTP Middlewares | |
| * | |
| * @link https://github.com/mcaskill/Slim-Polyglot | |
| * @global App $app The Charcoal application. | |
| * @package Charcoal | |
| */ |
| <?php | |
| if (!function_exists('is_var_empty')) { | |
| /** | |
| * Determine whether a variable is empty. | |
| * | |
| * Alternative to {@see empty()} which will resolve stringable and arrayable objects. | |
| * | |
| * @param mixed $var The value to be checked. | |
| * @return boolean Returns FALSE if var exists and has a non-empty value. Otherwise returns TRUE. |
| <?php | |
| if (!function_exists('oneof')) { | |
| /** | |
| * Returns the first argument that is set and non-empty. | |
| * | |
| * It will guess where to stop based on the types of the arguments, e.g. | |
| * "" has priority over array() but not 1. | |
| * | |
| * @link https://github.com/vito/chyrp/ Origin of function. |
| <?php | |
| if (!function_exists('fallback')) { | |
| /** | |
| * Sets a given variable if it is not set. | |
| * | |
| * The last of the arguments or the first non-empty value will be used. | |
| * | |
| * @link https://github.com/vito/chyrp/ Origin of function. | |
| * @param mixed $var The variable to return or set. |
| <?php | |
| if (!function_exists('strip_html')) { | |
| /** | |
| * Strip HTML and PHP tags from a string. | |
| * | |
| * @param string $str The input string. | |
| * @return string Returns the stripped string. | |
| */ | |
| function strip_html($str) |
| <?php | |
| if (!function_exists('html_build_attributes')) { | |
| /** | |
| * Generate a string of HTML attributes | |
| * | |
| * @param array $attr Associative array of attribute names and values. | |
| * @param callable|null $callback Callback function to escape values for HTML attributes. | |
| * Defaults to `htmlspecialchars()`. | |
| * @return string Returns a string of HTML attributes. |
This gist has been deprecated and moved to a repository and published on Packagist:
mcaskill/sage-theme-wrapper
Add the following filter to your theme's functions.php:
This gist has been deprecated and moved to a repository and published on Packagist:
mcaskill/bedrock-autoloader
Standalone version of the Bedrock Autoloader for must-use plugins.
Add the following snippet to the mu-plugins directory (or add bedrock-autoloader.php).