Skip to content

Instantly share code, notes, and snippets.

@marekale
marekale / wp-tao-nfc.php
Last active March 14, 2018 06:49
WP Tao and Nextend Facebook Connect 2.0.2 integration.
<?php
abstract class MaraleWPTaoNFC {
public static function pre_user_email_wpfilter( $raw_email ) {
$email = sanitize_email($raw_email);
if ( isset($_REQUEST['loginFacebook']) && $_REQUEST['loginFacebook'] == '1'
&& !email_exists( $email ) ) {
@marekale
marekale / wc-bookings-autocomplete-orders.php
Last active August 7, 2023 15:06
By design WooCommerce only autocompletes orders for downloadable and virtual products. This snippet autocompletes order which has only bookable products with all bookings completed, and has status processing..
<?php
abstract class MaraleAutocompleteOrders {
public static function wc_booking_complete_action11( $booking_id ) {
if ( 'wc-booking-complete' !== current_action() ) {
return;
}
$booking = get_wc_booking( $booking_id );
if ( 'complete' === $booking->get_status() ) {
$order_id = $booking->get_order_id();
static::maybe_complete_order($order_id);