Skip to content

Instantly share code, notes, and snippets.

Jo Waltham calliaweb

Block or report user

Report or block calliaweb

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View disable_comment_avatars_in-genesis.php
<?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
*/
@calliaweb
calliaweb / jmw_make_edit_default_for_own_bp_profile.php
Created Feb 16, 2017
BuddyPress - make edit screen the default for own profile
View jmw_make_edit_default_for_own_bp_profile.php
<?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() ) {
@calliaweb
calliaweb / functions.php
Created Oct 9, 2016 — forked from kloon/functions.php
WooCommerce 2.1 Add confirm password option at checkout
View functions.php
<?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_remove_buddypress_messages_for_non_ppmpro_members.php
Created Oct 7, 2016
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
View jmw_remove_buddypress_messages_for_non_ppmpro_members.php
<?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 / cambridge-food-collective-order-export.php
Last active Oct 4, 2016
Export Woo & WC Vendors orders including commission rate and amount
View cambridge-food-collective-order-export.php
<?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
*/
View exclude-tag-from-tag-cloud.php
<?php
add_filter( 'widget_tag_cloud_args', 'jmw_exclude_tag_from_tag_cloud');
function jmw_exclude_tag_from_tag_cloud( $args ) {
$args[ 'exclude' ] = '36'; // ID of the tag. If multiple tags use comma delimited sting '2,5,36'
return $args;
}
/*
* Other arguments that can be changed
@calliaweb
calliaweb / genesis-site-description-line-break.php
Created Apr 2, 2016
Add line break to site description at "--" in Genesis child themes
View genesis-site-description-line-break.php
<?php
add_filter( 'genesis_seo_description', 'jmw_site_description', 10, 3 );
/**
* Add line break to site description at "--" in Genesis child themes
* @link http://www.jowaltham.com/line-break-site-description-genesis
*
* @param string $description The html string that is output as the site description
* @param string $inside The site description in General Settings
* @param string $wrap The html string to wrap around the site description
View section-of-genesis_html5_comment_callback.php
<?php
/**
* Allows developer to control whether to print the comment date.
*
* @since 2.2.0
*
* @param boolean $comment_date Whether to print the comment date
* @param string $post_type The current post type
*/
View genesis-comments-with-just-date-no-link.php
View remove-comment-time-from-genesis-comments.php
<?php
add_filter( 'genesis_show_comment_date', 'jmw_show_comment_date_with_link' );
/**
* Show Comment Date with link but without the time
*
* Stop the output of the Genesis core comment dates and outputs comments with date and link only.
* The genesis_show_comment_date filter was introduced in Genesis 2.2 (will not work with older versions)
*
* @author Jo Waltham
You can’t perform that action at this time.