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
// you MUST change static1 to your CDN subdomain as needed | |
function aafd_cdn_srcset($sources){ | |
foreach ( $sources as $source ) { | |
$sources[ $source['value'] ][ 'url' ] = str_replace('http://www', 'https://static1', $sources[ $source['value'] ][ 'url' ]); | |
// you MAY use external domains as well | |
// $sources[ $source['value'] ][ 'url' ] = str_replace('http://www.example.com', 'https://static.examplecdnprovider.com', $sources[ $source['value'] ][ 'url' ]); | |
} | |
return $sources; | |
} |
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
/** | |
* yourprefix_free_shipping_pac function. | |
* filters Woocommerce Correio's PAC shipping method cost to zero | |
* | |
* @access public | |
* @param array $arr Array with data sent by woocommerce-correios WC_Correios_International_Shipping and WC_Correios_Shipping classes | |
* @param int $instance_id sent by woocommerce-correios WC_Correios_International_Shipping and WC_Correios_Shipping classe | |
* @return array | |
*/ | |
function yourprefix_free_shipping_pac($arr, $instance_id){ |
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
/** | |
* yourprefix_free_shipping_pac function. | |
* filtra o custo do método de envio PAC no plugin Woocommerce Correios | |
* | |
* @access public | |
* @param array $arr Array com dados enviado pelas classes WC_Correios_International_Shipping e WC_Correios_Shipping do woocommerce-correios | |
* @param int $instance_id enviado pelas classes WC_Correios_International_Shipping and WC_Correios_Shipping do woocommerce-correios | |
* @return array | |
*/ | |
function seuprefixo_pac_gratis($arr, $instance_id){ |
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
# ----------------------------------------------------------------- | |
# .gitignore for WordPress @salcode | |
# ver 20160309 | |
# | |
# From the root of your project run | |
# curl -O https://gist.githubusercontent.com/salcode/b515f520d3f8207ecd04/raw/.gitignore | |
# to download this file | |
# | |
# By default all files are ignored. You'll need to whitelist | |
# any mu-plugins, plugins, or themes you want to include in the repo. |
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 dm_redirect_admin() {// line 607 on WordPress MU Domain Mapping 0.5.5.1 | |
// don't redirect admin ajax calls | |
if ( strpos( $_SERVER['REQUEST_URI'], 'wp-admin/admin-ajax.php' ) !== false ) | |
return; | |
global $wp_customize; // gets $wp_customize global | |
if ( get_site_option( 'dm_redirect_admin' ) && !isset($wp_customize) ) { // redirects to original url only if $wp_customize is not set | |
// redirect mapped domain admin page to original url | |
$url = get_original_url( 'siteurl' ); | |
if ( false === strpos( $url, $_SERVER[ 'HTTP_HOST' ] ) ) { | |
wp_redirect( untrailingslashit( $url ) . $_SERVER[ 'REQUEST_URI' ] ); |
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
// Adding categories name to body class on archives | |
add_filter('body_class','add_category_to_classes'); | |
function add_category_to_classes( $classes ) { | |
if ( is_single() ) { | |
global $post; | |
// assigns post it to variable to avoid reading an array for every loop iteration | |
// maybe a micro optmization? Guilty as charged! | |
$post_id = $post->ID; | |
foreach( ( get_the_category( $post_id ) ) as $category ) { |
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
# Copyright (C) 2014 | |
# This file is distributed under the same license as the package. | |
msgid "" | |
msgstr "" | |
"Project-Id-Version: \n" | |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/wp-knowledgebase\n" | |
"POT-Creation-Date: 2017-02-05 15:47-0200\n" | |
"PO-Revision-Date: 2017-02-05 15:51-0200\n" | |
"Last-Translator: Celso Bessa - 2Aces <celso.bessa@2aces.com.br>\n" | |
"Language-Team: \n" |
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
/** | |
* 2a_feed_request function. | |
* adds any post type to RSS Feeds. In this example, we use 'post' and 'page' post types | |
* | |
* @access public | |
* @param mixed $qv | |
* @return array $qv filter $qv variable | |
*/ | |
function 2a_feed_request($qv) { | |
if ( isset( $qv['feed'] ) && !isset( $qv['post_type'] ) ) { |
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 aa_rss_post_thumbnail( $content ) { | |
$post_id = $post->ID; | |
global $post; | |
if( has_post_thumbnail( $post_id ) ) { | |
$content = '<p class="rss-feed-thumbnail">' . get_the_post_thumbnail( $post_id ) . | |
'</p>' . $content; | |
} | |
return $content; | |
} | |
add_filter('the_excerpt_rss', 'aa_rss_post_thumbnail'); |
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
https://www.instagram.com/p/BR9WECTBBO2/ | |
https://www.instagram.com/p/BR-3-n-gfxX/ | |
https://www.instagram.com/p/BCvLrA3h68d/ | |
https://www.instagram.com/p/BSAVqqOhRbx/ | |
https://www.instagram.com/p/BC0S5MErQgs/ | |
https://www.instagram.com/p/BRsxYu-lYbr/ | |
https://www.instagram.com/p/BSBBjrhBCDA/ | |
https://www.instagram.com/p/BSBXawBjB9v/ | |
https://www.instagram.com/p/BSAVLi4hzSL/ | |
https://www.instagram.com/p/BR_chtulGHT/ |
OlderNewer