Skip to content

Instantly share code, notes, and snippets.

@plusplugins
plusplugins / filter.php
Created December 23, 2015 18:46
Adding a custom field to Ultimate Members directory search options
add_filter('um_admin_custom_search_filters','add_my_custom_search_fields', 10, 1);
function add_my_custom_search_fields($fields) {
$fields['field_meta_key'] = array('title' => 'Enter field title'); // replace 'field_meta_key' with your field meta key
return $fields;
}
@lots0logs
lots0logs / functions.php
Created December 18, 2015 01:10
Divi - Custom Sidebar For WooCommerce Pages
<?php /* Don't include this line if your child theme functions.php already includes it */
function my_et_divi_output_content_wrapper_end() {
echo '</div> <!-- #left-area -->';
if (
( is_product() && 'et_full_width_page' !== get_post_meta( get_the_ID(), '_et_pb_page_layout', true ) )
||
( ( is_shop() || is_product_category() || is_product_tag() ) && 'et_full_width_page' !== et_get_option( 'divi_shop_page_sidebar', 'et_right_sidebar' ) )
) {
dynamic_sidebar( 'eCommerce Sidebar' );
@Jany-M
Jany-M / WP_remove_product_name_woocommerce_breadcrumbs.php
Created November 30, 2015 12:54
[WordPress] Remove Product Name & URL from WooCommerce Breadcrumbs
<?php
// In your theme, make a new folder woocommerce/global/
// Add this function in a file called breadcrumbs.php, in that folder
// or integrate the existing function accordingly.
/**
* Shop breadcrumb
*
* @author WooThemes
* @package WooCommerce/Templates
<?php
/**
* Change Date format in front-end
*/
add_filter('um_profile_field_filter_hook__date','my_custom_sanitize_fields', 9999, 2 );
function my_custom_sanitize_fields( $value, $data ){
global $ultimatemember;
if( $data['metakey'] == 'date-pickah' ){
$value = $ultimatemember->datetime->format( $value, "d M Y");
<?php
/**
* Custom sanitization of fields
*/
add_filter('um_profile_field_filter_hook__','my_custom_sanitize_fields', 99, 2 );
function my_custom_sanitize_fields( $value, $data ){
// Add tags to mail value
if ( !is_array( $value ) ) {
@filipecsweb
filipecsweb / functions.php
Last active November 2, 2017 07:17
Display Simple Product SKU, in WooCommerce loop pages, before item name
<?php
/**
* Display Simple Product SKU, in WooCommerce loop pages, before item name
*
* @return void
*/
function simple_product_sku_before_loop_item_title(){
global $product;
$type = $product->product_type;
add_action( 'um_before_new_user_register', 'require_whitelisted_email_for_signup' );
function require_whitelisted_email_for_signup( $args ) {
$user_email = $args['user_email'];
$approved_domains = array( 'yahoo.com', 'gmail.com', 'hotmail.com' );
$email_approved = false;
foreach ( $approved_domains as $domain ) {
$prefixed_domain = '@' . $domain;
if ( str_ends_with( $user_email, $prefixed_domain ) ) {
$email_approved = true;
@kittenlane
kittenlane / 1-remove-woocommerce-tabs.php
Last active October 5, 2024 14:18
Remove tabs but keep product description in WooCommerce
//* http://gasolicious.com/remove-tabs-keep-product-description-woocommerce/
// Location: add to functions.php
// Output: removes woocommerce tabs
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10 );
@pryley
pryley / UltimateMembersMods
Created May 4, 2015 22:45
This Wordpress plugin adds custom features and modifications to the Ultimate Member plugin family.
<?php
/**
* Plugin Name: Ultimate Member Modifications
* Plugin URI: http://geminilabs.io
* Description: This plugin adds custom features and modifications to the Ultimate Member plugin family.
* Version: 1.0.0
* Author: Gemini Labs
* Author URI: http://geminilabs.io
* License: MIT License
*/
@ultimatemember
ultimatemember / gist:f7eab149cb33df735b08
Last active May 30, 2024 18:03
Extend Ultimate Member Account page with custom tabs/content
/* add new tab called "mytab" */
add_filter('um_account_page_default_tabs_hook', 'my_custom_tab_in_um', 100 );
function my_custom_tab_in_um( $tabs ) {
$tabs[800]['mytab']['icon'] = 'um-faicon-pencil';
$tabs[800]['mytab']['title'] = 'My Custom Tab';
$tabs[800]['mytab']['custom'] = true;
return $tabs;
}