Skip to content

Instantly share code, notes, and snippets.

View huzaifaarain's full-sized avatar
🌎
me@muhammadhuzaifa.pro://~ workspace

Huzaifa Saif-ur-Rehman huzaifaarain

🌎
me@muhammadhuzaifa.pro://~ workspace
View GitHub Profile
@huzaifaarain
huzaifaarain / class-virtualthemedpage-bc.php
Created December 17, 2018 12:53 — forked from brianoz/class-virtualthemedpage-bc.php
WordPress Virtual page with theme
<?php
/*
* Virtual Themed Page class
*
* This class implements virtual pages for a plugin.
*
* It is designed to be included then called for each part of the plugin
* that wants virtual pages.
*
* It supports multiple virtual pages and content generation functions.
@huzaifaarain
huzaifaarain / functions.php
Created December 6, 2018 12:53 — forked from BFTrick/functions.php
WooCommerce add an Empty Cart button
<?php
// check for empty-cart get param to clear the cart
add_action( 'init', 'woocommerce_clear_cart_url' );
function woocommerce_clear_cart_url() {
global $woocommerce;
if ( isset( $_GET['empty-cart'] ) ) {
$woocommerce->cart->empty_cart();
}
}

Using Git to Manage a Live Web Site

Overview

As a freelancer, I build a lot of web sites. That's a lot of code changes to track. Thankfully, a Git-enabled workflow with proper branching makes short work of project tracking. I can easily see development features in branches as well as a snapshot of the sites' production code. A nice addition to that workflow is that ability to use Git to push updates to any of the various sites I work on while committing changes.

Contents