Skip to content

Instantly share code, notes, and snippets.

@campaignupgrade
campaignupgrade / find-wordpress-root.sh
Created March 10, 2019 00:31
Finds WordPress root from any subdirectory in the WordPress install
while [ ! -e wp-config.php ]; do
if [ $pwd/ = / ]; then
echo "No Wordpress root found" >&2; exit 1
fi
cd ../
done
if [ -e wp-config.php ]; then
wproot=$(pwd)
fi
@campaignupgrade
campaignupgrade / functions.php
Last active March 15, 2019 04:19
Advanced Ads — Convert <div> to <aside>
<?php
/**
* Changes ad wrapper <div> element to <aside> element
* Does not work with cache-busting containers
*
* @param string $output ad output.
* @param object $ad Advanced_Ads_Ad object.
*
* @return string
class f6_dropdown_menu extends Walker_Nav_Menu {
// Add vertical menu class and submenu data attribute to sub menus
function start_lvl( &$output, $depth = 0, $args = array() ) {
$indent = str_repeat( "\t", $depth );
$output .= "\n$indent<ul class=\"vertical menu dropdown\">\n";
}
name: myproject
recipe: wordpress
config:
php: '7.3'
xdebug: false
proxy:
theme: