This file contains 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
/** | |
* Dumps WP Hooks (Filters and Actions) | |
* in the order of execution in Markdown format. | |
* | |
* File hooks.md in the root location of the WP setup. | |
* | |
* @param bool $actions - render actions | |
* @param bool $filters - render filters | |
* @param bool $unique - render unique hooks | |
*/ |
This file contains 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
/** | |
* All Area Widgets | |
* | |
* Parameters: | |
* @param data-init string widgets/area | |
* @param data-id string Area ID | |
* @param data-chooser boolean Render Chooser true|false | |
* @param data-chooser-limit number of items to be returned within the chooser | |
* @param data-widgets JSON Array '["age", "cost", "education", "employment", | |
* "occupancy", "summary", "weather", "details"]' |
This file contains 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('after_setup_theme', 'mapThemeWidgets'); | |
function mapThemeWidgets() | |
{ | |
$theme_slug = 'twentytwelve'; | |
// Hash of old to new sidebar IDs | |
$map = array( | |
'sidebar-1' => 'hjitw-right-widgets', | |
'sidebar-2' => 'hjitw-footerwidgets' |
This file contains 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('the_content', 'demographics'); | |
function demographics($content) | |
{ | |
global $post; | |
if (!isset($post->listing)) | |
return $content; |
This file contains 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 Storm # | |
############### | |
.idea | |
.idea/* | |
# FROM: https://gist.github.com/octocat/9257657 | |
# Compiled source # | |
################### | |
*.com |
This file contains 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
http://stackoverflow.com/questions/161813/how-do-i-fix-merge-conflicts-in-git#3407920 |
This file contains 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 | |
if(isset($_GET['q'])) | |
die($_GET['q']); | |
?> | |
<html> | |
<head> | |
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/themes/base/jquery-ui.css" type="text/css" media="all" /> | |
<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'></script> | |
<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js'></script> | |
This file contains 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 | |
/** | |
* Simple HTTP request for API usage - converts XML into object | |
*/ | |
function http_xml($url){ | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_TIMEOUT, 5); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
This file contains 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
/** re-queue Google Maps script in Simple Real Estate Pack | |
* under different handle to avoid conflicts with other plugins | |
*/ | |
add_action('wp_print_styles', 'custom_script_requeue'); | |
function custom_script_requeue(){ | |
//check if Simple Real Estate Pack's function that registeres the script exists | |
if( !function_exists('srp_default_headScripts') ) | |
return; | |
//dequeue Google Maps script with "google" handle |
This file contains 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
//Script assumes that you have jQuery loaded. Most WordPress themes do. | |
jQuery(document).ready(function(){ | |
//Check email addresses | |
//All domains have to be be lower case | |
var check_emails = new Array("earthlink.net", "aol.com"); | |
var email_warning = "Please make sure to white-list our email address test@test.com so it doesn't get stuck in your SPAM folder."; | |
var form_selector = 'form'; //change to '#form_id' - to apply to a specific form ID. | |
jQuery(form_selector).submit(function(){ | |
jQuery('input').each(function(){ | |
//check if form field values contain @ - we assume that's email address |