Skip to content

Instantly share code, notes, and snippets.

Avatar

funnychord

View GitHub Profile
@helgatheviking
helgatheviking / nav-menu-roles-toggle.php
Last active Jun 4, 2020
Give Nav Menu Roles priority over any competing Walkers
View nav-menu-roles-toggle.php
<?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 Dec 12, 2015
Allow admins to manually enter new WooCommerce orders from the frontend checkout field.
View admin-create-new-customer-on-frontend-checkout.php
<?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' ) ) {