Skip to content

Instantly share code, notes, and snippets.

View epschmidt's full-sized avatar

Eric Schmidt epschmidt

View GitHub Profile
@jdennes
jdennes / LICENSE
Last active March 7, 2024 04:40
Subscribing to a Campaign Monitor list using AJAX
The MIT License (MIT)
Copyright (c) James Dennes
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
<?php
// This is on the taxonomy archive page, like taxonomy-colors.php
// First get the info about the current term
$term = get_term_by( 'slug', get_query_var( 'colors' ), 'colors' );
// Then see if there's any children of this tax term
$children = get_terms( 'colors', array( 'child_of' => $term->term_id ) );
@luetkemj
luetkemj / wp-query-ref.php
Last active May 25, 2024 10:56
WP: Query $args
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/
@jcobb
jcobb / gist:2993853
Created June 26, 2012 06:42
Combine multiple WordPress queries
<?php
// An example of creating two separate WP queries, combining the results,
// sorting by date and formatting the results for us in a loop like a regular query.
// order the posts by date in descending order (should go in functions.php to keep things tidy)
function order_by_date( $a, $b )
{
return strcmp( $b->post_date, $a->post_date );
}
@bmcbride
bmcbride / LeafletToWKT.js
Last active June 7, 2022 02:17
Leaflet layer to WKT
function toWKT(layer) {
var lng, lat, coords = [];
if (layer instanceof L.Polygon || layer instanceof L.Polyline) {
var latlngs = layer.getLatLngs();
for (var i = 0; i < latlngs.length; i++) {
latlngs[i]
coords.push(latlngs[i].lng + " " + latlngs[i].lat);
if (i === 0) {
lng = latlngs[i].lng;
lat = latlngs[i].lat;
@lordspace
lordspace / gist:5175010
Created March 16, 2013 04:36
Removes an error message shown by Limit Login Attempts WordPress plugin. NN attemmpts remaining. We don't need to give info to the attacker. Making error null solves half of the problem. There is a wrapper with a red border which we will remove with : login_error_message_hide_empty_error_container
add_filter('login_head', create_function('$a', "wp_enqueue_script('jquery');"));
add_filter('login_errors', 'login_error_message');
add_action('login_footer', 'login_error_message_hide_empty_error_container');
/**
* Removes an error message shown by Limit Login Attempts plugin.
* NN attempts remaining. We don't need to give info to the attacker.
* Making error null solves half of the problem. There is a wrapper with
* a red border which we will remove with : login_error_message_hide_empty_error_container
*
@thenbrent
thenbrent / wcs-remove-my-subscriptions-buttons.php
Last active July 21, 2024 13:59
Remove any given button from the My Subscriptions table on the My Account page. By default, only the "Change Payment Method" button is removed, but you can uncomment additional actions to remove those buttons also.
<?php
/**
* Plugin Name: Remove Subscription Action Buttons from My Account
* Plugin URI: https://gist.github.com/thenbrent/8851287/
* Description: Remove any given button from the <a href="http://docs.woothemes.com/document/subscriptions/customers-view/#section-2">My Subscriptions</a> table on the My Account page. By default, only the "Change Payment Method" button is removed, but you can uncomment additional actions to remove those buttons also.
* Author: Brent Shepherd
* Author URI:
* Version: 2.0
*/
@mclanecreative
mclanecreative / my-account.php
Last active March 27, 2023 23:12
Adds Tabs to WooCommerce "My Account" page. Instructions: add my-account.php to your /woocommerce/myaccount/ folder. Next, add the CSS to your child theme's style.css file. 11/25/2015 - Added tab6 for Event Espresso WP User Integration. Next challenge is to include Sensei My Courses & Pippin's AffiliateWP on these tabs.
<?php
/**
* My Account page
*
* @author WooThemes
* @edited by McLane Creative
* @package WooCommerce/Templates
* @version 3.1.0
*/
@Pross
Pross / FUE_Addon_Subscriptions_Extras.php
Last active April 9, 2018 17:32
Small class to add a replacement variable to subscription emails in the Woocommerce Follow Up Emails plugin for WordPress
<?php
/**
* Plugin Name: WooCommerce Follow Up Emails Extra Variable
* Description: Add a replacement variable to subscription emails in the Woocommerce Follow Up Emails plugin for WordPress
* Version: 1.0
* Author: Pross
* Author URI: http://www.pagelines.com
* Requires at least: 4.0
* Tested up to: 4.2
*