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 | |
/** | |
* File: Sort posts in alphabetical order, ignoring initial articles. | |
* | |
* This condition is achieved using the `post_fields` and `posts_orderby` | |
* filters. The implementer must provide their own list of definite and | |
* indefinite articles for the hooks to ignore. | |
* | |
* To enable natural language sorting, pass the following Query parameter: |
<?php | |
use Pimple\Container; | |
use Charcoal\Model\ModelInterface; | |
use Charcoal\Model\CollectionInterface; | |
use App\Post; | |
$container = new Container(); | |
$container['cache'] = function (Container $container) { |
<?php | |
/** | |
* Convert array to an object recursively, a new instances of the stdClass. | |
* | |
* @param array $props The array to convert into an object. | |
* @return object | |
*/ | |
function props(array $props) : object | |
{ |
<?php | |
/** | |
* Call the callback with one or all handlers disabled for the given action or filter. | |
* | |
* Temporarily disables the specified hook, or all hooks, from a specified filter or action | |
* before calling $callback. | |
* | |
* @link https://gist.github.com/westonruter/6647252 | |
* |
<?php | |
/** | |
* Hook a function or method to an array of actions. | |
* | |
* @param string[] $tags Array of names of filters to hook the $function callback to. | |
* @param callable $function_to_add The callback to be run when the filter is applied. | |
* @param int $priority Optional. Used to specify the order in which the functions | |
* associated with a particular action are executed. Default 10. | |
* @param int $accepted_args Optional. The number of arguments the function accepts. Default 1. |
<?php | |
if (!function_exists('is_blank')) { | |
/** | |
* Determine whether a variable has a non-empty value. | |
* | |
* Alternative to {@see empty()} that accepts non-empty values: | |
* - _0_ (0 as an integer) | |
* - _0.0_ (0 as a float) | |
* - _"0"_ (0 as a string) |
<?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. |
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
).