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
/** | |
* @brief Splits an address string containing a street, number and number addition | |
* | |
* @param $streetStr string An address string containing a street, number (optional) and number addition (optional) | |
* | |
* @return array Data array with the following keys: street, number and numberAddition. | |
*/ | |
private function split_street($streetStr) { | |
$aMatch = array(); |
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 | |
/** | |
* This is free and unencumbered software released into the public domain. | |
* | |
* Anyone is free to copy, modify, publish, use, compile, sell, or | |
* distribute this software, either in source code form or as a compiled | |
* binary, for any purpose, commercial or non-commercial, and by any | |
* means. | |
* |
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 | |
/////////////////////////////////////////////////////////////////////////////// | |
// | |
// Scans for 3-letter domain names. | |
// | |
/////////////////////////////////////////////////////////////////////////////// | |
// This is the number of domains the script will stop at. | |
$i = 100; | |
ob_start(); |
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 | |
/*-----------------------------------------------------------------------------------*/ | |
/* Conditional Logic to Detect Various Event Related Views/Pages | |
/*-----------------------------------------------------------------------------------*/ | |
if( tribe_is_month() && !is_tax() ) { // Month View Page | |
echo 'were on the month view page'; | |
} elseif( tribe_is_month() && is_tax() ) { // Month View Category 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
<?php | |
function specificity($selector) { | |
// Pseudo classes | |
$classes = array(":link", ":visited", ":hover", ":active", ":focus", ":target", ":lang", ":enabled", | |
":disabled", ":checked", ":indeterminate", ":root", ":nth-child", ":nth-last-child", | |
":nth-of-type", ":nth-last-of-type", ":first-child", ":last-child", ":first-of-type", | |
":last-of-type", ":only-child", ":only-of-type", ":empty", ":contains", ":not"); | |
// Pseudo elements |
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 | |
/** | |
* This is the template for the output of the events list widget. | |
* All the items are turned on and off through the widget admin. | |
* There is currently no default styling, which is highly needed. | |
* | |
* You can customize this view by putting a replacement file of the same name (events-list-load-widget-display.php) in the events/ directory of your theme. | |
* | |
* When the template is loaded, the following vars are set: $start, $end, $venue, $address, $city, $state, $province'], $zip, $country, $phone, $cost |
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 | |
/** | |
* Create an SVG sprite as a DOMDocument. | |
*/ | |
class Sprite { | |
/** | |
* The URI for the SVG namespace. | |
* |
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 | |
/** | |
* Conditional to test if we're in the loop of the main query on a WordPress page. | |
* Please note that checking `in_the_loop() && is_main_query()` will NOT work in | |
* this scenario. | |
*/ | |
add_action( 'loop_start', 'my_loop_start' ); | |
add_action( 'loop_end', 'my_loop_end' ); |
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 brrad_geocode($street_address,$city,$state){ | |
$street_address = str_replace(" ", "+", $street_address); //google doesn't like spaces in urls, but who does? | |
$city = str_replace(" ", "+", $city); | |
$state = str_replace(" ", "+", $state); | |
$url = "http://maps.googleapis.com/maps/api/geocode/json?address=$street_address,+$city,+$state&sensor=false"; | |
$google_api_response = wp_remote_get( $url ); | |
OlderNewer