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
function get_discounted_price_custom( $product = null ) { | |
if ( $product == null ) { | |
return false; | |
} | |
if ( $product->is_type( 'variable' ) ) { | |
$default_attributes = $product->get_variation_default_attributes(); | |
$variation_id = iconic_find_matching_product_variation( $product, $default_attributes ); | |
$product = wc_get_product( $variation_id ); |
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
{# Get the categories related to my "entrySection" entries in structure order #} | |
{% set entries = craft.entries.section('entrySection') %} | |
{% set relatedCats = craft.categories.relatedTo(entries) %} | |
{# Loop the categories #} | |
{% for category in relatedCats %} | |
{{ category.title }} | |
{# Get and loop through entries related to this cat #} |
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
#from root dir | |
rsync -aAXv --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/home/usamba","/lost+found"} /* /home/usamba/backup_folder |
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
function attributeLabels() { | |
$labels = array( | |
'placeOfBirth' => 'Place Of Birth', | |
'notes' => 'Notes', | |
'status' => 'Status', | |
'studentID' => 'Student', | |
'entryYear' => 'Entry Year', | |
); | |
return array_merge($labels, parent::attributeLabels()); |
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
::set PATH=%PATH%;C:\wamp\bin\php\php5.3.13 ::not necessary if php is set on environment variables | |
::set FRAMEWORKS=C:\frameworks ::not necessary if frameworks is set on environment variables | |
@echo off | |
setlocal enabledelayedexpansion | |
set /a counter=0 | |
echo Please enter your choice: | |
for /f %%i in ('dir /b %FRAMEWORKS%"\yii*"') do ( | |
set /a counter+=1 | |
set option=!counter! %%i |
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
// Add in Google Analytics tracking; just in case ga.js isn't correctly loaded | |
var track = function(category, name, value) { | |
if (window._gaq) { | |
window._gaq.push(["_trackEvent", category, name, value]); | |
} | |
}; | |
track("Source", "Visit", this.href); |
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
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
<script>window.jQuery || document.write("<script src='js/libs/jquery-1.7.2.min.js'>\x3C/script>")</script> |
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
#Tools->Options->Miscellaneous->Files->Ignored Files Pattern | |
^(yiilite\.php|CVS|SCCS..... | |
#Create new php file in your project /protected directory named yii.php with this content: | |
class Yii extends YiiBase | |
{ | |
/** | |
* Returns the application singleton or null if the singleton has not been created yet. | |
* @return CWebApplication the application singleton, null if the singleton has not been created yet. | |
*/ |
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: Wordpress plugin OOP skeleton | |
# (!class_exists("PluginName")) {} | |
class PluginName { | |
public function __construct() { | |
// setup the text domain for localization purposes | |
load_plugin_textdomain( 'demo-plugin', false, dirname( plugin_basename( __FILE__ ) ) . '/lang' ); |
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: Wordpress widget skeleton | |
class My_Widget extends WP_Widget { | |
public function __construct() { | |
// widget actual processes | |
} | |
public function form( $instance ) { | |
// outputs the options form on admin |
NewerOlder