Skip to content

Instantly share code, notes, and snippets.

View jo-flynn's full-sized avatar
🏳️‍🌈
🧜🏻‍♀️

josie flynn jo-flynn

🏳️‍🌈
🧜🏻‍♀️
View GitHub Profile
<?php
$page_meta = new_cmb2_box([
'id' => 'page_meta',
'title' => 'Page Options',
'object_types' => ['page'],
'context' => 'normal',
'priority' => 'high',
'show_names' => true
]);
$page_meta->add_field([
<?php
if (!empty($title)) {
?>
<h4>
<?php
echo $title;
?>
</h4>
<?php
}
@jo-flynn
jo-flynn / functions.php
Created September 8, 2016 20:45
silencio_partial
<?php
/**
* Load a template part & pass in variables declared in caller scope. Optionally return as a string.
* @param string $path path to template file, minus .php (eg. `content-page`, `partial/folder/template-name`)
* @param array $args map of variables to load into scope
* @param bool $echo echo or return rendered template
* @return null or rendered template string
*/
function silencio_partial($path, $args = [], $echo = true) {
if (!empty($args)) {
@jo-flynn
jo-flynn / recurse.sh
Created December 7, 2012 18:48
Recursively search directory
find [PATH] | xargs grep -P [PATTERN] -ls | less