This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# git aliases - taken from oh-my-zsh's git plugin and translated to bash | |
# https://github.com/robbyrussell/oh-my-zsh/wiki/Cheatsheet#helpful-aliases-for-common-git-tasks | |
# https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/git/git.plugin.zsh | |
function git_current_branch() { | |
ref=$(git symbolic-ref HEAD 2> /dev/null) || \ | |
ref=$(git rev-parse --short HEAD 2> /dev/null) || return | |
echo ${ref#refs/heads/} | |
} | |
function git_current_repository() { | |
ref=$(git symbolic-ref HEAD 2> /dev/null) || \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<table class="widefat fixed" cellspacing="0"> | |
<thead> | |
<tr> | |
<th id="cb" class="manage-column column-cb check-column" scope="col"></th> <!-- this column contains checkboxes --> | |
<th id="columnname" class="manage-column column-columnname" scope="col"></th> | |
<th id="columnname" class="manage-column column-columnname num" scope="col"></th> <!-- "num" added because the column contains numbers --> | |
</tr> | |
</thead> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function my_searchwp_term_pattern_whitelist( $whitelist ) { | |
$my_whitelist = array( | |
"/(\\b[-_.]?[0-9a-zA-Z]+(?:[-_.]+[0-9a-zA-Z]+)+[-_.]?)/iu", // strings with letters, numbers, hyphens, underscores, and periods (no spaces) | |
); | |
// we want our pattern to be considered the most specific | |
// so that false positive matches do not interfere | |
$whitelist = array_merge( $my_whitelist, $whitelist ); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('admin_init', function () { | |
// Redirect any user trying to access comments page | |
global $pagenow; | |
if ($pagenow === 'edit-comments.php') { | |
wp_redirect(admin_url()); | |
exit; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: WP ACF Obj Cache Fix | |
* Plugin URI: http://bitpiston.com/ | |
* Description: Fix for Advanced Custom Fields expiry with 3rd party Object Caches. | |
* Author: BitPiston Studios | |
* Author URI: http://bitpiston.com/ | |
* Version: 1.1.1 | |
* Licence: BSD | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# This script configures WordPress file permissions based on recommendations | |
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions | |
# | |
# Author: Michael Conigliaro | |
# | |
WP_OWNER=changeme # <-- wordpress owner | |
WP_GROUP=changeme # <-- wordpress group | |
WP_ROOT=/home/changeme # <-- wordpress root directory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function folderSize ($dir) | |
{ | |
$size = 0; | |
foreach (glob(rtrim($dir, '/').'/*', GLOB_NOSORT) as $each) { | |
$size += is_file($each) ? filesize($each) : folderSize($each); | |
} |