Skip to content

Instantly share code, notes, and snippets.

View 1wdtv's full-sized avatar

1WD.tv - Make Money With Divi 1wdtv

View GitHub Profile
@rynaldos-zz
rynaldos-zz / wc-no-order-again.php
Last active January 14, 2021 13:19
[WooCommerce] Remove the "order again" button
remove_action( 'woocommerce_order_details_after_order_table', 'woocommerce_order_again_button' );
//Did this help? Donate me some BTC: 1BEsm8VMkYhSFJ92cvUYwxCtsfsB2rBfiG
@amboutwe
amboutwe / yoast_seo_meta_remove_dates.php
Last active October 5, 2020 08:39
Remove Date Meta Tags Output by Yoast SEO
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Remove Date Meta Tags Output by Yoast SEO
* Credit: Yoast development team
* Last Tested: Apr 09 2019 using Yoast SEO 10.1.3 on WordPress 5.1.1
* For Yoast SEO 14.0 or newer, please see https://yoast.com/help/date-appears-search-results/#h-managing-dates
*/
add_action('wpseo_dc_'.'DC.date.issued', '__return_false'); // Premium versions 5.2 or older
@noameppel
noameppel / memberpress_mailchimp_mergetags.php
Last active June 8, 2021 05:38
Hooks in to MemberPress $args array before sending new member info to MailChimp.
<?php
/**
* [cleanforest_mepr_add_my_tags]
* Hooks in to MemberPress $args array before sending new member info to MailChimp.
* Used to add custom MERGETAG information.
*/
function cleanforest_mepr_add_my_tags($args, $contact)
{
// MMERGE3 State
$state = get_user_meta($contact->ID, 'mepr-address-state', true);
@cartpauj
cartpauj / add-merge-fields.php
Created June 7, 2016 20:15
Add custom MERGE fields using MemberPress and their MailChimp 3.0 integration
<?php
//hooks in to MemberPress $args array before sending new subscriber info to MailChimp
function mepr_add_my_tags($args, $member) {
$zip = get_user_meta($member->ID, 'mepr-address-zip', true);
$country = get_user_meta($member->ID, 'mepr-address-country', true);
if($zip) {
$args['merge_fields']['MMERGE6'] = $zip; //YOU'LL NEED TO CHANGE MMERGEX TO MAP THEM TO YOUR OWN TAG VALUES
}
@1wdtv
1wdtv / ecommerce-quicklaunch-lab1013.markdown
Created February 5, 2016 14:40
ecommerce-quicklaunch-lab1013
@mathetos
mathetos / plugin.php
Last active April 13, 2023 16:48
Dependent Plugin Activation/Deactivation and Alert
<?php
/*
* Dependent Plugin Activation/Deactivation
*
* Sources:
* 1. https://pippinsplugins.com/checking-dependent-plugin-active/
* 2. http://10up.com/blog/2012/wordpress-plug-in-self-deactivation/
*
*/
@spivurno
spivurno / gw-gravity-forms-skip-registration-for-logged-in-users.php
Last active October 12, 2021 15:08
Gravity Wiz // Gravity Forms // Skip Registration for Logged in Users
<?php
/**
* Skip Registration for Logged In Users
* http://gravitywiz.com/2012/04/24/skip-user-registration-for-logged-in-users/
* Works for GF User Registration 3.0 and greater.
*/
add_filter( 'gform_is_delayed_pre_process_feed', 'maybe_delay_feeds', 10, 4 );
function maybe_delay_feeds( $is_delayed, $form, $entry, $slug ) {
if ( is_user_logged_in() && $slug == 'gravityformsuserregistration' ) {
return gf_user_registration()->has_feed_type( 'create', $form );
@strangerstudios
strangerstudios / my_pmpro_account_bullets_avatars.php
Created November 10, 2015 16:38
Display a member's gravatar and a link to update at Gravatar on the Membership Account page "Profile" section.
<?php
function my_pmpro_account_bullets_top_avatar()
{
global $current_user;
echo '<li class="alignright" style="display: inline-block; list-style: none; margin: -5rem 0 0 0;">' . get_avatar($current_user->ID, 200) . '</li>';
}
add_action("pmpro_account_bullets_top","my_pmpro_account_bullets_top_avatar");
function my_pmpro_account_bullets_bottom_avatar()
{
@mkrdip
mkrdip / remove-gf-divi.php
Last active January 13, 2021 13:32
Remove Google Fonts from Divi
<?php
function wpse_dequeue_google_fonts() {
wp_dequeue_style( 'divi-fonts' );
}
add_action( 'wp_enqueue_scripts', 'wpse_dequeue_google_fonts', 20 );
@strangerstudios
strangerstudios / copy_pmpro_memberships_pages.sql
Created August 1, 2015 17:19
Example SQL to copy PMPro page restrictions from one level to another.
#Copy PMPro page restrictions from level 1 to level 2. Change the 1 and 2 below to copy for different levels.
INSERT INTO wp_pmpro_memberships_pages (membership_id, page_id) SELECT 2, page_id FROM wp_pmpro_memberships_pages WHERE membership_id = 1;