Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* Product attributes
*
* Used by list_attributes() in the products class
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.1.3
*/
<?php
$attributes['attribute_name']['position'] = '1';
$tmp = Array();
foreach( $attributes as $ma ) {
$tmp[] = $ma['position'];
}
array_multisort( $tmp, $attributes );
array(6) {
["pa_opacity"]=>
array(6) {
["name"]=>
string(10) "pa_opacity"
["value"]=>
string(0) ""
["position"]=>
string(1) "0"
["is_visible"]=>
<?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>
<?php
/**
* Product attributes
*
* Used by list_attributes() in the products class
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.1.3
*/
else {
$link = 'http://domain.com';
}
<?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';
}
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
@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