Skip to content

Instantly share code, notes, and snippets.

name: myproject
recipe: wordpress
php: '7.3'
xdebug: false
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";
campaignupgrade / functions.php
Last active March 15, 2019 04:19
Advanced Ads — Convert <div> to <aside>
* 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
campaignupgrade /
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
cd ../
if [ -e wp-config.php ]; then
<?xml version="1.0" encoding="UTF-8" ?>
<!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your site. -->
<!-- It contains information about your site's posts, pages, comments, categories, and other content. -->
<!-- You may use this file to transfer that content from one site to another. -->
<!-- This file is not intended to serve as a complete backup of your site. -->
<!-- To import this information into a WordPress site follow these steps: -->
<!-- 1. Log in to that site as an administrator. -->
<!-- 2. Go to Tools: Import in the WordPress admin panel. -->
<!-- 3. Install the "WordPress" importer from the list. -->
campaignupgrade /
Last active April 28, 2018 03:29 — forked from PurpleBooth/
A template to make good

Sage 9 to WPEngine Deployment setup

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.


campaignupgrade / App.php
Last active April 14, 2018 04:45
Multiple values in an array variable in Sober Controller (Sage 9)
// in controller
public function homepageFields() {
return array (
$subheading => get_field('subheading'),
$video = get_field('video_link')
DATE(booking_time) <= '2012-12-28'
Source Joomla website renders correctly:
In Joomla content in MySQL before export:
<div><span class="wf_caption" style="display: block; max-width: 640px; width: 100%;"><img src="" alt="(Image: Muhammad Ansi, Untitled (Pier), 2016.)" width="640" style="width: 100%; margin: auto;" /><span style="margin-top: 3px; display: block;">(Image: <a href="" >Muhammad Ansi</a>, Untitled [Pier], 2016.)</span></span></div>
In XML export file:
campaignupgrade / WPAllImport disable check duplicates
Last active January 4, 2018 00:00
WpAllImport skip dupe check
add_filter( 'wp_all_import_is_check_duplicates', 'wpai_is_check_duplicates', 10, 2 );
function wpai_is_check_duplicates( $is_check_duplicates, $import_id ) {
return false;