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
| 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
| <?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
| <?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 | |
| // 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 | |
| // 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 | |
| // 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
Show hidden characters
| { | |
| "files": | |
| { | |
| "Equalizer": "http://raw.github.com/darkwing/Equalizer/master/Source/Equalizer.js", | |
| "Normalizer": "http://raw.github.com/necolas/normalize.css/master/normalize.css", | |
| "Timthumb": "http://timthumb.googlecode.com/svn/trunk/timthumb.php", | |
| "jQuery": "http://code.jquery.com/jquery.min.js", | |
| "jQuery Animate Shadow": "http://www.bitstorm.org/jquery/shadow-animation/archive/jquery.animate-shadow-min.js", | |
| "jQuery Autosize": "http://raw.github.com/jackmoore/autosize/master/jquery.autosize-min.js", | |
| "jQuery Black and White": "http://raw.github.com/GianlucaGuarini/jQuery.BlackAndWhite/master/jquery.BlackAndWhite.js", |
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 | |
| if(is_admin()) { | |
| add_filter('filesystem_method', create_function('$a', 'return "direct";' )); | |
| define( 'FS_CHMOD_DIR', 0751 ); | |
| } |
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_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 ); | |
| add_action( 'woocommerce_after_shop_loop_item', 'cg_loop_add_to_cart', 10 ); | |
| function cg_loop_add_to_cart() { | |
| // global $product; | |
| // echo '<form action="' . esc_url( get_permalink( $product->id ) ) . '" method="get"> | |
| // <button type="submit" class="single_add_to_cart_button button alt">View More</button> | |
| // </form>'; | |