Skip to content

Instantly share code, notes, and snippets.

View kodie's full-sized avatar
💻
#doworkson

Kodie Grantham kodie

💻
#doworkson
View GitHub Profile
//add_action('wp_head', 'update_meta_values');
function update_meta_values() {
/*
* Takes a set of fields and resets them as part of a repeater
* To start, create a new repeater field and enter the slug in $new_repeater
* Find the fields you would like to move in wp_posts and set the post_parent to the new repeater's ID
*/
// Slug of the new repeater
@elimn
elimn / Tribe__Events__Filterbar__Filters__Category_Custom.php
Created June 21, 2016 05:59
MT | TEC | Customized version of the Category Filter that includes CSS classes for subcategories
<?php
/**
* Customized version of the Category Filter that includes CSS classes for subcategories
* New filter available in WP-Admin > Events > Settings > Filters
*/
if ( class_exists( 'Tribe__Events__Filterbar__Filters__Category' ) ) {
class Tribe__Events__Filterbar__Filters__Category_Custom extends Tribe__Events__Filterbar__Filters__Category {
@kodie
kodie / parse_argv.php
Last active January 10, 2022 17:09
Parse $argv in PHP get the command, arguments, options, and flags
<?php
/**
* Parses $argv to get the command, arguments, options, and flags.
*
* @param array $args The $argv variable.
* @param array $short_opts Optional. An array with keys set to short options and their values set to the long option they're assigned to.
* @param array $flag_opts Optional. An array of options to be treated as flags. If a flag is not defined here, it will be treated as an option.
*
* @return array An array with the command, arguments, options, and flags keys.
*/
@magician11
magician11 / listen-for-shopify-webhooks.js
Created November 21, 2016 08:06
How to listen to Shopify webhook event data with Node.js
/* eslint-disable no-console */
const express = require('express');
const bodyParser = require('body-parser');
const app = express();
/*
Shopify issues a HTTP POST request.
- https://help.shopify.com/api/tutorials/webhooks#receive-webhook