Skip to content

Instantly share code, notes, and snippets.

@bwhli
bwhli / Redirect WordPress Logout to Home Page
Created July 7, 2015 04:54
Redirect WordPress Logout to Home Page
//* Redirect WordPress Logout to Home Page
add_action('wp_logout',create_function('','wp_redirect(home_url());exit();'));
@bwhli
bwhli / Customize Genesis Search Box Text
Last active August 29, 2015 14:24
Customize Genesis Search Box Text
//* Customize search form input box text
add_filter( 'genesis_search_text', 'sp_search_text' );
function sp_search_text( $text ) {
return esc_attr( 'YourTextHere' );
}
@bwhli
bwhli / PMS Update 1 of 3
Last active August 30, 2015 14:11
PMS Update 1/3
wget https://downloads.plex.tv/plex-media-server/0.9.12.4.1192-9a47d21/plexmediaserver_0.9.12.4.1192-9a47d21_amd64.deb
@bwhli
bwhli / PMS Update 2 of 3
Last active August 29, 2015 14:24
PMS Update 2 of 3
sudo dpkg -i plexmediaserver_0.9.12.4.1192-9a47d21_amd64.deb
@bwhli
bwhli / PMS Update 3 of 3
Created July 9, 2015 04:42
PMS Update 3 of 3
rm plexmediaserver_0.9.12.4.1192-9a47d21_amd64.deb
delay 0.5 -- time to release modifier keys if for example the script is run with command-R
tell application "System Events"
set frontmost of process "Live" to true
keystroke "q" using command down
delay 0.5
tell application "System Events" to keystroke (ASCII character 28) --left arrow
delay 0.5
tell application "System Events" to keystroke (ASCII character 28) --left arrow
delay 0.5
keystroke return
<?php
$country_code = $_SERVER ["HTTP_CF_IPCOUNTRY"];
if ($country_code=="US") {
$link = 'http://us.domain.com';
}
else if ($country_code=="GB") {
$link = 'http://uk.domain.com';
}
else {
$link = 'http://domain.com';
}
<?php
/**
* Product attributes
*
* Used by list_attributes() in the products class
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.1.3
*/
<pre>
<?php
var_dump( $attributes );
?>
</pre>