Skip to content

Instantly share code, notes, and snippets.

View funnychord's full-sized avatar

funnychord

View GitHub Profile
@helgatheviking
helgatheviking / nav-menu-roles-toggle.php
Last active June 4, 2020 09:47
Give Nav Menu Roles priority over any competing Walkers
<?php
/*
Plugin Name: Nav Menu Roles Toggle
Plugin URI: https://gist.github.com/helgatheviking/d00f9c033a4b0aab0f69cf50d7dcd89c
Description: Give NMR priority over any competing Walkers
Version: 0.2.0
Author: helgatheviking
Author URI: http://kathyisawesome.com
*/
@twoelevenjay
twoelevenjay / admin-create-new-customer-on-frontend-checkout.php
Created December 12, 2015 02:16
Allow admins to manually enter new WooCommerce orders from the frontend checkout field.
<?php
// Allow admins to manually enter new WooCommerce orders from the frontend checkout field.
// Hook the woocommerce_checkout_customer_id filter found in the WC_Checkout class.
add_filter( 'woocommerce_checkout_customer_id', 'change_current_user_id_to_new_user' );
function change_current_user_id_to_new_user( $user_id ) {
//Check if logged in user is admin.
if ( current_user_can( 'manage_options' ) ) {