Skip to content

Instantly share code, notes, and snippets.

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

Donna McMaster donnamcmaster

🏠
Working from home
View GitHub Profile
@kohnmd
kohnmd / functions.php
Created March 5, 2014 03:51
Remove Post Locked Dialog in WP Admin
<?php
add_filter('show_post_locked_dialog', '__return_false');
@certainlyakey
certainlyakey / functions.php
Created April 28, 2014 07:10
Wordpress - allow editors edit menus
// Allow editors edit menus
$role_object = get_role( 'editor' );
$role_object->add_cap( 'edit_theme_options' );
<?php
// Version CSS file in a theme
wp_enqueue_style(
'theme-styles',
get_stylesheet_directory_uri() . '/style.css',
array(),
filemtime( get_stylesheet_directory() . '/style.css' )
);
@woogists
woogists / wc-query-woocommerce-active.php
Last active March 1, 2023 14:02
[Theming Snippets] Query whether WooCommerce is activated
/**
* Check if WooCommerce is activated
*/
if ( ! function_exists( 'is_woocommerce_activated' ) ) {
function is_woocommerce_activated() {
if ( class_exists( 'woocommerce' ) ) { return true; } else { return false; }
}
}
@rhukster
rhukster / sphp.sh
Last active July 26, 2023 02:13
Easy Brew PHP version switching (Now moved to https://github.com/rhukster/sphp.sh)
#!/bin/bash
# Creator: Phil Cook
# Modified: Andy Miller
#
# >>> IMPORTANT: Moved to: https://github.com/rhukster/sphp.sh
# >>> Kept here for legacy purposes
#
osx_major_version=$(sw_vers -productVersion | cut -d. -f1)
osx_minor_version=$(sw_vers -productVersion | cut -d. -f2)
osx_patch_version=$(sw_vers -productVersion | cut -d. -f3)
@justintadlock
justintadlock / register-post-type.php
Last active October 22, 2023 05:55
Help file when registering post types.
<?php
# Register custom post types on the 'init' hook.
add_action( 'init', 'my_register_post_types' );
/**
* Registers post types needed by the plugin.
*
* @since 1.0.0
* @access public
@Rarst
Rarst / r-debug.php
Last active February 3, 2024 17:30
R Debug (set of dump helpers for debug)
<?php
/*
Plugin Name: R Debug
Description: Set of dump helpers for debug.
Author: Andrey "Rarst" Savchenko
Author URI: https://www.rarst.net/
License: MIT
*/
@salcode
salcode / .gitignore
Last active February 27, 2024 12:11
.gitignore file for a general web project - Bare Minimum Git
# -----------------------------------------------------------------
# .gitignore
# Bare Minimum Git
# https://salferrarello.com/starter-gitignore-file/
# ver 20221125
#
# From the root of your project run
# curl -O https://gist.githubusercontent.com/salcode/10017553/raw/.gitignore
# to download this file
#
# Luke's config for the Zoomer Shell
# Enable colors and change prompt:
autoload -U colors && colors
PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b "
# History in cache directory:
HISTSIZE=10000
SAVEHIST=10000
HISTFILE=~/.cache/zsh/history