Skip to content

Instantly share code, notes, and snippets.

View kuznacic's full-sized avatar

Eric Kuznacic kuznacic

View GitHub Profile
@presswizards
presswizards / utm-to-button.js
Created March 18, 2025 06:58
UTM to button link
document.addEventListener('DOMContentLoaded', function () {
const params = new URLSearchParams(window.location.search);
const utmParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content'];
let utmString = '';
utmParams.forEach(param => {
if (params.has(param)) {
utmString += `${utmString ? '&' : '?'}${param}=${encodeURIComponent(params.get(param))}`;
}
});
<?php
/**
* Plugin Name: Disable Textdomain Error
* Description: Prevents triggering errors for the '_load_textdomain_just_in_time' function.
* Author: Kowsar Hossain
* Version: 1.0
*
* Note: This is a Must-Use (MU) plugin. Place this file in the 'wp-content/mu-plugins' directory.
*/
@stingray82
stingray82 / Add Items to Media Libary
Last active November 18, 2023 13:15
Additional Items to Media Library for image licencing
<?php
// Add custom fields for image attribution and license information in media library
function add_image_attribution_field($form_fields, $post) {
$form_fields['image_attribution'] = array(
'label' => 'Image Attribution',
'input' => 'text',
'value' => get_post_meta($post->ID, 'image_attribution', true),
);
$form_fields['image_license_for'] = array(
@skyshab
skyshab / example.php
Created March 1, 2022 18:30
Remove "subscribe to calendar" dropdown from the main calendar page
<?php
// Remove subscribe to calendar dropdown from main calendar page
add_filter( 'tribe_template_html:events/v2/components/subscribe-links/list', '__return_false' );
@NateWr
NateWr / show-shortcodes-for-fdm.php
Created December 20, 2018 10:18
Show the menu and menu item shortcodes in the admin lists.
<?php
/**
* Plugin Name: Show Shortcodes for Food and Drink Menu
* Plugin URI: http://themeofthecrop.com
* Description: Show the menu and menu item shortcodes in the admin lists.
* Version: 1.0
* Author: Theme of the Crop
* Author URI: http://themeofthecrop.com
* License: GNU General Public License v2.0 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
@westcoastdigital
westcoastdigital / menu-logo.js
Created August 29, 2018 05:42
Move logo to middle of menu in GeneratePress
(function($) {
$(function() {
/**
* Move logo to middle of menu
*/
wcd_move_logo();
$(window).resize(function() {
var exists = $("#primary-menu .menu li.menu-logo").length;
// check if isnt already in menu and if isnt then move
if (exists == 0) {
@kevinwhoffman
kevinwhoffman / resources-web-developers-designers.md
Last active October 21, 2025 14:29
Resources for Web Developers and Designers

Resources for Web Developers and Designers

This is an incomplete list of resources including courses and individuals who publish content that has helped me grow as a web developer and designer. Many of these resources are WordPress-specific as that is my current area of specialization. This list will grow over time. If you've got something to add, send me a link @kevinwhoffman and I'll check it out!

Course Providers

@andrasguseo
andrasguseo / change-wording-with-context.php
Created May 12, 2017 20:21
Change the wording of any bit of text or string, which has a context
<?php
function tribe_custom_theme_text_with_context ( $translation, $text, $context, $domain ) {
// Put your custom text here in a key => value pair
// Example: 'Text you want to change' => 'This is what it will be changed to'
// The text you want to change is the key, and it is case-sensitive
// The text you want to change it to is the value
// You can freely add or remove key => values, but make sure to separate them with a comma
// This example changes the label "Venue" to "Location", and "Related Events" to "Similar Events"
@cliffordp
cliffordp / functions.php
Last active October 17, 2018 19:56
BCC multiple email addresses, including the site admin email address, on all Event Tickets' RSVP ticket emails so they get a copy of it too
<?php
/**
* BCC multiple email addresses, including the site admin email address, on all Event Tickets' RSVP ticket emails so they get a copy of it too
*
* Updated 2018-01-18 for Event Tickets 4.5.2+
* HOWEVER, this has been tested and we think there might be an issue with
* the version of PHPMailer (what wp_mail() uses) included with WordPress, which
* is why BCCs are not working.
* Therefore, you can use this other snippet for how to initiate a new, separate
* email message to the Organizer (but it could be customized to go to someone
@cliffordp
cliffordp / functions.php
Last active March 30, 2018 03:20
Set default quantity of 1 for all ET and ET+ tickets: RSVP, Woo, EDD
<?php
/**
* Set default quantity of 1 for all tickets:
* - Event Tickets RSVP
* - Event Tickets Plus WooCommerce
* - Event Tickets Plus Easy Digital Downloads
*
* From https://gist.github.com/cliffordp/5b57df71be8b52f595817ddbf81acdab
* Same as this snippet but also make the quantity readonly: https://gist.github.com/cliffordp/80b33455779b74ec49f6ea3033cb47bf