Skip to content

Instantly share code, notes, and snippets.

@AshlinRejo
AshlinRejo / Woo Discount: Subscription signup fee override fix
Created Jun 13, 2019
Woo Discount: Subscription signup fee override fix
View Woo Discount: Subscription signup fee override fix
add_filter('woo_discount_rules_run_before_calculate_event_on_before_calculate_subtotal_in_cart_rules', '__return_false');
View add-to-cart-redirect.php
<?php
/**
* Don't redirect on archive pages.
*
* @param string $redirect
*
* @return string
*/
function iconic_add_to_cart_form_action( $redirect ) {
@bekarice
bekarice / filter-wc-orders-by-gateway.php
Last active Feb 19, 2021
Filters WooCommerce Orders by Payment Gateway Used
View filter-wc-orders-by-gateway.php
<?php
/**
* Plugin Name: Filter WooCommerce Orders by Payment Method
* Plugin URI: http://skyverge.com/
* Description: Filters WooCommerce orders by the payment method used :)
* Author: SkyVerge
* Author URI: http://www.skyverge.com/
* Version: 1.0.0
* Text Domain: wc-filter-orders-by-payment
*
@jacobdubail
jacobdubail / php
Created Jan 30, 2017
Function to auto-set your ACF5 Pro license key
View php
function jtd_acf_auto_set_license_keys() {
if ( !get_option('acf_pro_license') && defined('ACF_5_KEY') ) {
$save = array(
'key' => ACF_5_KEY,
'url' => home_url()
);
$save = maybe_serialize($save);
@claudiosanches
claudiosanches / custom-my-account-endpoint.php
Last active Jan 31, 2021
Example of custom My Account endpoint.
View custom-my-account-endpoint.php
<?php
class My_Custom_My_Account_Endpoint {
/**
* Custom endpoint name.
*
* @var string
*/
public static $endpoint = 'my-custom-endpoint';
@nathanrice
nathanrice / functions.php
Created Jan 6, 2016
Add back blogPosting Schema to Genesis sites
View functions.php
<?php
/*
Add back Schema.org/blogPosting microdata to post entries.
Replace all instances of "themedemo" with something unique to your site.
User input is required in the last function. Be sure to fill these fields in with your own information.
Instances where you need to fill in information will be marked with a comment that indicates so.
*/
@emilysnothere
emilysnothere / add_action.php
Last active Oct 26, 2020
Adding fields to the WordPress post submit box
View add_action.php
add_action('post_submitbox_misc_actions', createCustomField);
add_action('save_post', saveCustomField);
View how to screencapture and make animated gifs or whathaveyou.md

Screencapture and animated gifs

I say "animated gif" but in reality I think it's irresponsible to be serving "real" GIF files to people now. You should be serving gfy's, gifv's, webm, mp4s, whatever. They're a fraction of the filesize making it easier for you to deliver high fidelity, full color animation very quickly, especially on bad mobile connections. (But I suppose if you're just doing this for small audiences (like bug reporting), then LICEcap is a good solution).

Capturing (Easy)

  1. Launch quicktime player
  2. do Screen recording

screen shot 2014-10-22 at 11 16 23 am

@webaware
webaware / gfeway-only-months.php
Created Apr 13, 2014
only allow Monthly for recurring payments for Gravity Forms eWAY plugin
View gfeway-only-months.php
<?php
/*
Plugin Name: GFeWAY Recurring Monthly
Plugin URI: https://gist.github.com/webaware/10569363
Description: only allow Monthly for recurring payments
Version: 1
Author: WebAware
Author URI: http://webaware.com.au/
@ref: http://wordpress.org/support/topic/how-to-make-interval-type-have-monthly-option-only
@mischah
mischah / z.md
Last active Feb 16, 2021
Installing und initializing z (https://github.com/rupa/z) with help of Homebrew.
View z.md

#The power of z

Do you spend lots of time doing things like this?

cd this/is/the/path/that/i/want/so/i/type/it/all/out/to/get/whereiwant

With z, you could just do this: