Skip to content

Instantly share code, notes, and snippets.

View webgurus's full-sized avatar
🏠
Working from home

Gergely Márton webgurus

🏠
Working from home
View GitHub Profile
@strangerstudios
strangerstudios / my_template_redirect_membersonly.php
Created May 11, 2015 19:25
Code gists to help when running Theme My Login on Multisite with PMPro
/*
This is a collection of code gists that can optionally be used when running Themed My Login on a multisite network
to help things flow better.
Be sure to NETWORK ACTIVATE Theme My Login.
To be specific, this setup is meant for cases where users registering at the main site are gaining access to a "membersonly" subsite and users should effectively have a WP user account on all subsites within the network. i.e. all of the subsites are parts of the main site instead of completely different sites.
*/
/*
<?php
//BEGIN PROCESS THE FORM - NOTE $attributes global var is a merge of $_GET and $_POST - so the fields submitted in the form :);
if(empty($stripe_errors) && !empty($attributes['stripe_card_form_submitted'])){
$customer_args = array(
'card' => $attributes['stripeToken']
, 'description'=>trim($attributes['customer']['name']) . ';' . trim($attributes['customer']['email'])
, 'email'=>$attributes['customer']['email']
);
//create a new customer
//ALWAYS create the customer record in the root application - NOT using the stripe connect access_token
@smutek
smutek / Bootstrap4Nav-Sage9.md
Last active July 30, 2022 06:50
Bootstrap 4 Walker for Sage 9

Credit

This is a frankensteind version of the current Soil nav walker, by the Roots team, and Michael Remoero's Sagextras walker. All credit goes to those good folks. :)

Use

  • Replace the contents of header.blade.php with the attached header.
  • Copy the walker.php file to the /app directory.
  • Add walker.php to the Sage required files array in resources/functions.php - eg. on a stock Sage install the entry would look like:
/**
@yocontra
yocontra / aoe2hd.md
Last active June 9, 2023 18:28
Age of Empires II HD - For Mac OSX
@nicooprat
nicooprat / custom-callback.php
Created October 22, 2018 17:22
Create an ACF block with Sage 9 & Blade
function my_acf_block_render_callback( $block ) {
$slug = str_replace('acf/', '', $block['name']);
$block['slug'] = $slug;
$block['classes'] = implode(' ', [$block['slug'], $block['className'], $block['align']]);
echo \App\template("blocks/${slug}", ['block' => $block]);
}