Skip to content

Instantly share code, notes, and snippets.

View oakwoodgates's full-sized avatar
🦉

oakwoodgates

🦉
View GitHub Profile
@kevinwhoffman
kevinwhoffman / resources-web-developers-designers.md
Last active January 26, 2024 21:20
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

@ChrisFlannagan
ChrisFlannagan / geodistance.php
Created October 13, 2017 16:52
Calculate distance between to coordinates of latitude and longitude using the WP REST API and return posts ordered by distance from user's coordinates
<?php
/**
* Heavily borrowed from: http://xplus3.net/2010/08/08/filtering-on-a-non-standard-database-field-with-wordpress/
**/
class CoordinatesTable extends DB {
protected $db_option = "coordinates_db";
( function( api ) {
'use strict';
// Add callback for when the header_textcolor setting exists.
api( 'header_textcolor', function( setting ) {
var isHeaderTextDisplayed, linkSettingValueToControlActiveState;
/**
* Determine whether the site title and tagline should be displayed.
*
@modemlooper
modemlooper / custom-notification.php
Last active April 2, 2024 18:18
BuddyPress add custom notification
<?php
// this is to add a fake component to BuddyPress. A registered component is needed to add notifications
function custom_filter_notifications_get_registered_components( $component_names = array() ) {
// Force $component_names to be an array
if ( ! is_array( $component_names ) ) {
$component_names = array();
}
// Add 'custom' component to registered components array
<?php
/**
* Convert a comma separated file into an associated array.
* The first row should contain the array keys.
*
* Example:
*
* @param string $filename Path to the CSV file
* @param string $delimiter The separator used in the file
* @param boolean $asHash Use header row as keys in the returned array
@westonruter
westonruter / functions.php
Last active December 31, 2021 11:47
Demonstrate how to add support to Widget Customizer for sidebars and widgets which have JavaScript initialization http://wordpress.org/plugins/widget-customizer/
<?php
/**
* The functions.php for a theme, adding theme support for widget-customizer,
* and registering a sidebar whose widgets maintain equal heights even when
* widgets in the sidebar are updated via Customizer. This is for demonstration
* purposes, and normally JS wouldn't be embedded in PHP.
* @see http://wordpress.org/plugins/widget-customizer/
*/
/**
@toddlahman
toddlahman / gist:6302114
Last active January 18, 2020 09:40
Prevent Duplicate Form Submissions with jQuery
jQuery(function() {
$("form").submit(function() {
// submit more than once return false
$(this).submit(function() {
return false;
});
// submit once return true
return true;
});
});
@simonlk
simonlk / Woocommerce - output product variations in tab
Last active February 21, 2022 20:27
Output Woocommerce product variations as a table within a tab on the single product page
// Add to functions.php
/*===================================================
Created by sk from Renegade Empire with help
from these sources:
http://docs.woothemes.com/document/editing-product-data-tabs/
http://www.sean-barton.co.uk/2013/03/remove-woocommerce-20-reviews-tab/#.UYnWe7XfB6N
http://www.sean-barton.co.uk/2013/03/sb-add-woocommerce-tabs-wordpress-plugin/#.UYrYL7XfB6M
@codearachnid
codearachnid / extend_wp_widget_factory.php
Created April 21, 2012 13:09
Extend the WP_Widget_Factory class by overloading the register method to allow for passing params
<?php
/*
*
* Extends the WP_Widget_Factory class by overloading the register method to allow for passing params
*
*/
Class Extend_WP_Widget_Factory extends WP_Widget_Factory {
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/