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
// Move all .jpgs files to a jpg folder | |
mkdir jpg && mv *.jpg jpg | |
mkdir jpg && find . -type f -name "*.jpg" -exec mv {} jpg \; | |
// Show hidden files in finder | |
defaults write com.apple.finder AppleShowAllFiles -boolean true && killall Finder | |
// Hide hidden files in finder | |
defaults delete com.apple.finder AppleShowAllFiles && killall Finder |
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 | |
/** | |
* Check if we are on a child or grandchild page of the page. | |
* | |
* @param integer $id The ID of the page we're looking for pages underneath | |
* @param boolean $parent Whether to check if we are on the parent page as well | |
* @return boolean | |
*/ | |
function wp_is_child( $id=0, $parent=false ) { | |
global $post; |
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 | |
/** Access localhost on same network **/ | |
$IP = $_SERVER['HTTP_HOST']; | |
$projectDir = 'projectfolder'; | |
$localIPs = array( '127.0.0.1','::1' ); | |
if( !in_array( $_SERVER['REMOTE_ADDR'], $localIPs ) ) { | |
define( 'WP_SITEURL', "http://$IP/$projectDir" ); | |
define( 'WP_HOME', "http://$IP/$projectDir" ); | |
} |
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 | |
backup_tables('localhost',DB_USER,DB_PASSWORD,DB_NAME); | |
/* backup the db OR just a table */ | |
function backup_tables($host,$user,$pass,$name,$tables = '*') | |
{ | |
$link = mysql_connect($host,$user,$pass); |
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 | |
/** | |
* Gravity Forms Unrequire. | |
* Unrequire all required fields so you don't have to fill them out during testing. | |
*/ | |
class GravityFormsUnrequire { | |
var $args = null; | |
public function __construct( $args = array() ) { | |
extract( wp_parse_args( $args, array( | |
'admins_only' => true, |
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 | |
/** | |
* Display the archive links for a single year. | |
* | |
* @param integer $year The year you would like to display the archives for | |
* @param string $menu_class Class to add to the ul tag | |
* @return void | |
*/ | |
function wp_single_year_monthly_archives($year=null, $menu_class=null) { | |
if($year == 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
<?php | |
// Disable Searching | |
add_action( 'parse_query', function($query){if(is_search())$query->is_404=true;} ); | |
add_filter( 'get_search_form', 'return 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
<?php | |
/** | |
* Force child pages to have the same template as their parent | |
* | |
* @param boolean $include_grandchildren Whether to include grandchildren | |
* @return void | |
*/ | |
function wp_force_parent_template( $include_grandchildren=false ) { | |
global $post; | |
if( is_page() ) { |
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
$error: #ff4856; | |
.gfield_required { | |
color: $error; | |
} | |
.validation_error { | |
text-align: center; | |
margin: 1rem 0 !important; | |
font-size: 0.9rem !important; |
OlderNewer