Skip to content

Instantly share code, notes, and snippets.

View MikeGillihan's full-sized avatar
🏠
Working from home

Mike Gillihan MikeGillihan

🏠
Working from home
View GitHub Profile
@ControlledChaos
ControlledChaos / README.md
Last active February 20, 2025 23:41
Change the default WordPress post name to News and replace the Dashicon.

Change Default Posts to News

WordPress Snippet

@leepettijohn
leepettijohn / functions.php
Last active December 3, 2024 05:38
Add Event to The Events Calendar from a Gravity Form
//The following section is an add-on to this tutorial - https://tri.be/gravity-forms-events-calendar-submissions/
//Shout to CreativeSlice.com for their initial work
/* Before Starting:
- Make sure you have these three plugins installed
- Gravity Forms
- The Events Calendar
- Gravity Forms + Custom Post Types
- Once Gravity Forms is installed, create a form with these fields
- Single Line Text (Event Title)
- Paragraph Text (Event Description)
@kjbrum
kjbrum / WordPress Setup Script.md
Last active March 10, 2018 18:31
Easily set up a project with a Bitbucket repository, ServerPilot application, base plugin and theme, as well as run miscellaneous WordPress tasks.

WordPress Setup Script

Easily set up a project with a Bitbucket repository, ServerPilot application, base plugin and theme, as well as run miscellaneous WordPress tasks. Should be used with https://github.com/Mixd/wp-deploy.

Step 1: Setup project

# Enter your project directory
cd your/desired/project/directory
@bwhli
bwhli / Redirect WordPress Logout to Home Page
Created July 7, 2015 04:54
Redirect WordPress Logout to Home Page
//* Redirect WordPress Logout to Home Page
add_action('wp_logout',create_function('','wp_redirect(home_url());exit();'));

Deploy your site with git securely

This gist assumes:

  • you have a local git repo
  • you have an online remote repository (github)
  • you have a server running Apache with git already installed

you should be able to do the same with Java, Perl, RoR, JSP etc. however you'll need to recreate the (rather simple) PHP script

@jemoreto
jemoreto / multiple-roles-per-user.php
Created May 15, 2015 19:45
Multiple roles per user WordPress plugin. Working when creating a new user and editing an user. Thanks to nikolov-tmw (https://goo.gl/Xv563d) and evankennedy (https://goo.gl/sh2sX6).
/**
* Plugin Name: Multiple Roles per User
* Description: Allows anyone who can edit users to set multiple roles per user. In a default WordPress environment that wouldn't have much of an effect, since the user would have the privileges of the top-privileged role that you assign to him. But if you have custom roles with custom privileges, this might be helpful.
* Version: 1
* Author: nikolov.tmw
* Author URI: http://paiyakdev.com/
* License: GPL2
*/
/*
Copyright 2013 Nikola Nikolov (email: [email protected])
@salcode
salcode / .gitignore
Last active February 19, 2025 22:44
Please see https://salferrarello.com/wordpress-gitignore/ for the canonical version of this WordPress .gitignore file. Note: I do not receive notifications for comments here (because GitHub does not send notifications on Gists)
# -----------------------------------------------------------------
# .gitignore for WordPress @salcode
# ver 20180808
#
# From the root of your project run
# curl -O https://gist.githubusercontent.com/salcode/b515f520d3f8207ecd04/raw/.gitignore
# to download this file
#
# By default all files are ignored. You'll need to whitelist
# any mu-plugins, plugins, or themes you want to include in the repo.
@logoscreative
logoscreative / functions.php
Created January 24, 2015 19:05
Hook Gravity Forms Submission Into Events Calendar Pro
/* Make Events Form Work Redux */
add_filter("gform_post_data", "mb_set_post_date", 10, 3);
function mb_set_post_date($post_data, $form, $entry){
if($form["id"] != 48)
return $post_data;
$startdate = $entry["69"];
$starttime = $entry["5"];
@norcross
norcross / bypass-auto-update-email.php
Last active August 29, 2015 14:04
Disable the email notification for successful update
<?php
function rkv_bypass_auto_update_email( $send, $type, $core_update, $result ) {
// check our type and bail if successful
if ( ! empty( $type ) && $type == 'success' ) {
return false;
}
// return the send function
return true;
// --------------------------------------------------------------------------------------
// A More Modern Scale for Web Typography
// Based on this article: http://typecast.com/blog/a-more-modern-scale-for-web-typography
// --------------------------------------------------------------------------------------
$body-font-size: 1em !default;
// Adjusts body typography to be default
// for each browser.
@mixin reset-body-font-size($font-size: 100%, $size-adjustment: 0.5) {