Skip to content

Instantly share code, notes, and snippets.

@calliaweb
calliaweb / cambridge-food-collective-order-export.php
Last active October 4, 2016 11:20
Export Woo & WC Vendors orders including commission rate and amount
<?php
/*
Plugin Name: Cambridge Food Collective Orders Export
Plugin URI: http://www.calliaweb.co.uk
Description: Adds Cambridge Food Collective orders export functionality
Version: 1.0.0
Author: Jo Waltham
Author URI: http://www.calliaweb.co.uk
*/
@calliaweb
calliaweb / jmw_remove_buddypress_messages_for_non_ppmpro_members.php
Created October 7, 2016 16:43
Remove Messages from Navigation and Add Friends, Private Message and Public Message from BuddyPress profiles if current user or profile viewed does not have a Paid Membership Pro member level
<?php
add_action( 'bp_init', 'jmw_remove_buddypress_messages_for_non_ppmpro_members' );
/**
* Remove Messages from Navigation and Add Friends, Private Message and Public Message from BuddyPress profiles
* if current user or profile viewed does not have a Paid Membership Pro member level
*/
function jmw_remove_buddypress_messages_for_non_ppmpro_members() {
global $current_user;
@calliaweb
calliaweb / functions.php
Created October 9, 2016 18:20 — forked from kloon/functions.php
WooCommerce 2.1 Add confirm password option at checkout
<?php
// place the following code in your theme's functions.php file
// Add a second password field to the checkout page.
add_action( 'woocommerce_checkout_init', 'wc_add_confirm_password_checkout', 10, 1 );
function wc_add_confirm_password_checkout( $checkout ) {
if ( get_option( 'woocommerce_registration_generate_password' ) == 'no' ) {
$checkout->checkout_fields['account']['account_password2'] = array(
'type' => 'password',
'label' => __( 'Confirm password', 'woocommerce' ),
'required' => true,
@calliaweb
calliaweb / jmw_make_edit_default_for_own_bp_profile.php
Created February 16, 2017 18:19
BuddyPress - make edit screen the default for own profile
<?php
add_action( 'bp_setup_nav', 'jmw_make_edit_default_for_own_bp_profile', 15 );
/*
* Edit the buddypress menus
*/
function jmw_make_edit_default_for_own_bp_profile() {
global $bp;
if ( ! bp_is_my_profile() ) {
<?php
add_filter( 'genesis_comment_list_args', 'jmw_disable_genesis_comment_avatar' );
/**
* Disable comment avatars in Genesis.
* Set comment avatar size to 0 and use the default WordPress comment function instead of the Genesis one.
*
* @param array $args Comment args
* @return array Filtered comment args
*/