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
| /** | |
| * Helper function for responsive jQuery Spectragram | |
| * @require - jquery-spectragram.js plugin - https://github.com/adrianengine/jquery-spectragram | |
| */ | |
| // Target the spectragram's wrapper as per the plugin's docs: | |
| var insta = jQuery('#instagram_feed'); | |
| // Check for the wrapper's presence in the DOM | |
| if (insta.length) { | |
| !function(a){jQuery.fn.responsiveInstagram=function(b){var c,d,e,f=a(this),g=a(window).width();return e={width:610,extraHeight:80,breakpoint:620},b=a.extend(e,b),g<=b.breakpoint?f.css("width","100%"):f.css("width",b.width.toString(10)+"px"),c=f.width(),d=Math.round(c+b.extraHeight),f.css("height",d.toString(10)+"px"),this}}(jQuery); |
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 | |
| //wp_localize_script by default passes everything in as strings so for booleans and integers when being referenced in your javascript you need to do some trickery | |
| //Example 1 - passing in booleans as strings | |
| $options = get_option('ng_slicknavmenu'); | |
| // Add PHP plugin variables to the $params[] array to pass to jQuery | |
| $data = array ( | |
| 'ng_slicknav_menu' => $options['ng_slicknav_menu'], | |
| 'ng_slicknav_position' => $options['ng_slicknav_position'], |
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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <!-- Generated by: TmTheme-Editor --> | |
| <!-- ============================================ --> | |
| <!-- app: http://tmtheme-editor.herokuapp.com --> | |
| <!-- code: https://github.com/aziz/tmTheme-Editor --> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>author</key> | |
| <string>Mattia Astorino</string> |
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 custom_variable_price_html( $price, $product ) { | |
| $price = ''; | |
| if ( ! $product->min_variation_price || $product->min_variation_price !== $product->max_variation_price ) { | |
| $price .= '<span class="from">' . __( 'A partir de' ) . ' </span>'; | |
| } | |
| $price .= woocommerce_price( $product->get_price() ); | |
| if ( $product->max_variation_price && $product->max_variation_price !== $product->min_variation_price ) { |
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 cs_add_to_cart_text( $text ) { | |
| return __( 'Orçar' ); | |
| } | |
| // Loop. | |
| add_filter( 'woocommerce_product_add_to_cart_text', 'cs_add_to_cart_text' ); | |
| // Single. | |
| add_filter( 'woocommerce_product_single_add_to_cart_text', 'cs_add_to_cart_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
| /** | |
| * WooCommerce Quanity buttons add-back | |
| */ | |
| jQuery( function( $ ) { | |
| var $testProp = $( 'div.quantity:not(.buttons_added), td.quantity:not(.buttons_added)' ).find('qty'); | |
| if ($testProp && $testProp.prop('type') != 'date') { | |
| // Quantity buttons | |
| $( 'div.quantity:not(.buttons_added), td.quantity:not(.buttons_added)' ).addClass( 'buttons_added' ).append( '<input type="button" value="+" class="plus" />' ).prepend( '<input type="button" value="-" class="minus" />' ); | |
| // Target quantity inputs on product pages |
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 custom_upload_mimes ( $existing_mimes=array() ) { | |
| // Add *.EPS files to Media upload | |
| $existing_mimes['eps'] = 'application/postscript'; | |
| return $existing_mimes; | |
| } | |
| add_filter('upload_mimes', 'custom_upload_mimes'); |
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
| jQuery(document).ready(function($) { | |
| /** | |
| * Media Uploader | |
| */ | |
| var media_uploader = null; | |
| function open_media_uploader_video(img, field) { | |
| media_uploader = wp.media({ | |
| title: 'Select or Upload Media', | |
| button: { | |
| text: 'Use this media' |
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
| #!/usr/bin/env bash | |
| # As in: http://stackoverflow.com/a/41289659/7331008 | |
| # Exiting on errors | |
| set -e | |
| # Set required version | |
| VERSION="4.2.0" |
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 | |
| add_filter( 'pre_get_avatar_data', 'smyles_set_avatar_based_on_user_meta', 10, 2 ); | |
| /** | |
| * Use URL from User Meta for Avatar | |
| * | |
| * This will return a URL value set in the user's meta to use as an avatar, if it | |
| * exists, and is a valid URL. Should work everywhere on the site unless you're | |
| * using a custom avatar plugin that overrides or does not call core get_avatar_data() | |
| * |