Skip to content

Instantly share code, notes, and snippets.

@austinpray
austinpray / the-events-calendar-automatic-ticket-categories.php
Created June 20, 2019 15:03 — forked from MWDelaney/the-events-calendar-automatic-ticket-categories.php
Automatically apply "tribe_events_cat" taxonomy terms to WooCommerce tickets when tickets are saved or updated.
<?php
// Apply product categories to newly created or saved tickets that match the The Events Calendar categories of the associated event
add_action('event_tickets_after_save_ticket', function ($event_id, $ticket, $raw_data, $classname) {
if (empty($ticket) || !isset($ticket->ID)) {
return;
}
// Apply the "event-tickets" category to add tickets so that all tickets have at least this category to start
wp_add_object_terms($ticket->ID, 'event-tickets', 'product_cat');
@austinpray
austinpray / getter.js
Last active February 17, 2017 00:32 — forked from hensondev/getter.js
const get = function (name) {
return (
`public String get ${name.charAt(0).toUpperCase()}${name.slice(1)}() {
\treturn this.${name};
}`
);
};
var get = function (name) {
return "public String get" + name.charAt(0).toUpperCase() + name.slice(1,name.length) + "() {\n \treturn this." + name + ";" + "\n}"
};
@austinpray
austinpray / bower.json
Last active August 29, 2015 14:15 — forked from drawcard/bower.json
{
"name": "sage",
"homepage": "http://roots.io/sage/",
"authors": [
"Ben Word <ben@benword.com>"
],
"license": "MIT",
"private": true,
"dependencies": {
"modernizr": "~2.8.3",
<!doctype html>
<html>
<head>
<!-- Run in full-screen mode. -->
<meta name="apple-mobile-web-app-capable" content="yes">
<!-- Make the status bar black with white text. -->
<meta name="apple-mobile-web-app-status-bar-style" content="black">