This file contains 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
img.desaturate { | |
-webkit-filter: grayscale(100%); | |
filter: grayscale(100%); | |
filter: gray; | |
filter: url("data:image/svg+xml;utf8,<svg version='1.1' xmlns='http://www.w3.org/2000/svg' height='0'><filter id='greyscale'><feColorMatrix type='matrix' values='0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0' /></filter></svg>#greyscale"); | |
} |
This file contains 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
var makeComp = (function(){ | |
var accents = { | |
a: 'àáâãäåæ', | |
c: 'ç', | |
e: 'èéêëæ', | |
i: 'ìíîï', | |
n: 'ñ', | |
o: 'òóôõöø', | |
s: 'ß', | |
u: 'ùúûü', |
This file contains 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
/** | |
* isVTEXUserIdentified | |
* Verifica se o usuário VTEX está identificado (quando o sistema identificou | |
* o usuário pelo e-mail, mas ele ainda não digitou sua senha). | |
* | |
* @return BOOL | |
* TRUE - Se se estiver identificado ou autenticado | |
* FALSE - Se não estiver identificado | |
*/ | |
function isVTEXUserIdentified() { |
This file contains 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
$.slugify = function(text) { | |
return text.toString().toLowerCase() | |
.replace(/\s+/g, '-') // Replace spaces with - | |
.replace(/[^\w\-]+/g, '') // Remove all non-word chars | |
.replace(/\-\-+/g, '-') // Replace multiple - with single - | |
.replace(/^-+/, '') // Trim - from start of text | |
.replace(/-+$/, ''); // Trim - from end of text | |
} |
This file contains 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
$.urlParam = function(name, url){ | |
var url = url || window.location.href; | |
var reg = new RegExp('[\?&]' + name + '=([^&#]*)', 'g'); | |
var results, returnResult = new Array(), i = 0; | |
while(results = reg.exec(url)) { | |
returnResult[i] = results; | |
i++; | |
} |
This file contains 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_action( 'woocommerce_archive_description', 'woocommerce_category_image', 2 ); | |
function woocommerce_category_image() { | |
if ( is_product_category() ){ | |
global $wp_query; | |
$cat = $wp_query->get_queried_object(); | |
$thumbnail_id = get_woocommerce_term_meta( $cat->term_id, 'thumbnail_id', true ); | |
$image = wp_get_attachment_url( $thumbnail_id ); | |
if ( $image ) { | |
echo '<img src="' . $image . '" alt="" />'; | |
} |
This file contains 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 nl2br (str, is_xhtml) { | |
var breakTag = (is_xhtml || typeof is_xhtml === 'undefined') ? '<br />' : '<br>'; | |
return (str + '').replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1' + breakTag + '$2'); | |
} |
This file contains 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_action( 'save_post', 'elo_people_custom_permalink' ); | |
// add_filter( 'wp_insert_post_data', 'elo_people_custom_permalink' ); | |
function elo_people_custom_permalink( $data, $postarr ) { | |
$post = get_post($data); | |
$exec_in = array('equipe', 'comunicador'); | |
if( in_array($post->post_type, $exec_in) ) { | |
$post_title = get_post_meta($post->ID, '_people_nome', true); | |
$post_name = sanitize_title( $post_title ); |
This file contains 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 and action: Choose one | |
**/ | |
// Add to all post types | |
// add_filter('manage_post_posts_columns', 'cg_new_columns_headers'); | |
// add_action('manage_post_posts_custom_column', 'cg_new_columns_content', 10, 2); |
This file contains 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(($key = array_search($del_val, $array)) !== false) { | |
unset($array[$key]); | |
} |