Skip to content

Instantly share code, notes, and snippets.

@octalmage
octalmage / clearcart.php
Created October 26, 2015 07:00
Force clear WooCommerce cart for WordPress user.
<?php
add_action( 'init', 'force_clear_woocommerce_cart' );
function force_clear_woocommerce_cart()
{
$user_ID = get_current_user_id();
if ($user_ID === 68364)
{
@DianaEromosele
DianaEromosele / Change "origin" of your GIT repository
Created August 7, 2016 00:31
Change "origin" of your GIT repository
$ git remote rm origin
$ git remote add origin git@github.com:aplikacjainfo/proj1.git
$ git config master.remote origin
$ git config master.merge refs/heads/master

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@neilgee
neilgee / acf-rs2.php
Last active July 11, 2023 03:13
Relationship Field ACF as Shortcode
<?php //<~ don't add me in
add_shortcode( 'tl_related_lights', 'tl_related_lights_relationship' ); // Add your shortcode here
// Add Relationship field between same CPT
function tl_related_lights_relationship() {
ob_start();
$posts = get_field('relationship_field_name'); // Add your ACF field in here
@zackpyle
zackpyle / *Best PowerPack Module Customization Snippets*
Last active May 18, 2023 15:26
Best PowerPack Module Customization Snippets #powerpack #beaverbuilder
Collection of PowerPack module customizations I've gathered over the years