Skip to content

Instantly share code, notes, and snippets.

View Firestorm-Graphics's full-sized avatar

Firestorm Graphics Firestorm-Graphics

View GitHub Profile
@Firestorm-Graphics
Firestorm-Graphics / README.txt
Created July 17, 2017 10:45
fb-callback.php corrections to split first name and last name, also replace token->generate() with new uuid function
replace fb-callback.php, we have split the first and last names so they register in database seperately,
changed password generation slightly to use random uuid as part of phase out of old Token::generate();
TODO: Shouldnt we realy force the user to set a password on first login ? Shouldnt we require user to verify email aswell?
maybe we could do both in one email? user registers via fb -> receives verify email with link to create new password -> user creates password which verifys account
add the above generate_uuid4() function to us_helpers.
which incidently can be used in admin_backup.php to name the zips like: b6b42970-a25d-4bf8-b782-92fc3b5e7338
@Firestorm-Graphics
Firestorm-Graphics / functions.php
Created August 21, 2017 07:56 — forked from yojance/functions.php
Removing a Product From The Cart Programatically In WooCommerce
<?php
add_action( 'template_redirect', 'remove_product_from_cart' );
function remove_product_from_cart() {
// Run only in the Cart or Checkout Page
if( is_cart() || is_checkout() ) {
// Set the product ID to remove
$prod_to_remove = 56;
// Cycle through each product in the cart
foreach( WC()->cart->cart_contents as $prod_in_cart ) {