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 | |
| // Changes how price is displayed | |
| add_filter( 'woocommerce_get_price_html', 'wpa83367_price_html', 100, 2 ); | |
| function wpa83367_price_html( $price, $product ){ | |
| $return = str_replace( '<ins>', 'Por: <ins>', $price ); | |
| $return = str_replace( '<del>', '<small class="price-from">De: <del>', $return ); | |
| $return = str_replace( '</del>', '</del></small><br/>', $return ); | |
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 | |
| // Change wp-admin colors | |
| add_action('admin_head', 'custom_colors'); | |
| function custom_colors() { | |
| echo '<style type="text/css">#wphead{background:#069}</style>'; | |
| } |
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 | |
| // remove update nag | |
| if ( !current_user_can( 'edit_users' ) ) { | |
| add_action( 'init', create_function( '$a', "remove_action( 'init', 'wp_version_check' );" ), 2 ); | |
| add_filter( 'pre_option_update_core', create_function( '$a', "return null;" ) ); | |
| } |
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 | |
| // Display variation's price even if min and max prices are the same | |
| add_filter('woocommerce_available_variation', 'variationPriceFix', 10, 3); | |
| function variationPriceFix ($value, $object = null, $variation = null) { | |
| if ($value['price_html'] == '') { | |
| $value['price_html'] = '<span class="price">' . $variation->get_price_html() . '</span>'; | |
| } | |
| return $value; | |
| } |
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 randomPassword($length = 10) { | |
| $alphabet = 'abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ0123456789'; | |
| $pass = array(); //remember to declare $pass as an array | |
| $alphaLength = strlen($alphabet) - 1; //put the length -1 in cache | |
| for ($i = 0; $i < $length; $i++) { | |
| $n = rand(0, $alphaLength); | |
| $pass = $alphabet[$n]; | |
| } |
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
| DELIMITER $$ | |
| CREATE PROCEDURE fillPaisesNome() | |
| BEGIN | |
| DECLARE paisesNoName INT; | |
| DECLARE controle INT; | |
| SET paisesNoName = (SELECT COUNT(*) FROM `io_paises` WHERE `io_paises`.`nome` IS NULL); | |
| SET controle = 0; | |
| WHILE controle < paisesNoName DO | |
| UPDATE `io_paises` AS `pais` |
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 SelectText(element) { | |
| var text = document.getElementById(element); | |
| if ($.browser.msie) { | |
| var range = document.body.createTextRange(); | |
| range.moveToElementText(text); | |
| range.select(); | |
| } else if ($.browser.mozilla || $.browser.opera) { | |
| var selection = window.getSelection(); | |
| var range = document.createRange(); | |
| range.selectNodeContents(text); |
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
| // Make #main's height go to footer and fill up all the page | |
| jQuery(document).ready(function() { | |
| // Size that main have to be | |
| var mainPredefinedHeight = jQuery(window).height() | |
| - jQuery('#header').outerHeight(true) | |
| - jQuery('#footer').outerHeight(true) | |
| - parseInt(jQuery('#main').css('paddingBottom')) | |
| ; | |
| if( jQuery('#main').height() < mainPredefinedHeight) { |
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
| find . ! -name one ! -name two -maxdepth 1 -type f -delete |
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 disableselect(e) | |
| { | |
| return false; | |
| } | |
| document.onselectstart=new Function ("return false"); | |
| if (window.sidebar){document.onmousedown=disableselect; | |
| document.onclick=reEnable;} |