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('acf/location/rule_types', 'acf_location_rules_types'); | |
function acf_location_rules_types( $choices ) { | |
$choices['Woocommerce']['woocommerce_attribute'] = 'Atributo'; | |
return $choices; | |
} | |
add_filter('acf/location/rule_values/woocommerce_attribute', 'acf_location_rules_values_woocommerce_attribute'); | |
function acf_location_rules_values_woocommerce_attribute( $choices ) { | |
$atributes = wc_get_attribute_taxonomies(); |
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 | |
class YS_Mail { | |
public function YS_Mail() {} | |
public function enviar( $e ) { | |
$headers = "From: ".$e['from_name']." <".$e['to_mail']."> \n"; | |
$headers .= "Reply-To:".$e['from_name']." <".$e['from_mail']."> \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
This XML file does not appear to have any style information associated with it. The document tree is shown below. | |
<rss xmlns:g="http://base.google.com/ns/1.0" version="2.0"> | |
<channel> | |
<title>Example - Online Store</title> | |
<link>http://www.example.com</link> | |
<description> | |
This is a sample feed containing the required and recommended attributes for a variety of different products | |
</description> | |
<!-- | |
First example shows what attributes are required and recommended for items that are not in the apparel 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
<html> | |
<head> | |
<title>reCAPTCHA demo: Simple page</title> | |
<script src="https://www.google.com/recaptcha/api.js" async defer></script> | |
<script> | |
function onSubmit(token) { | |
document.getElementById("demo-form").submit(); | |
} | |
</script> | |
</head> |
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 $attributes = $product->get_attributes() // GET ALL ATRIBUTES ?> | |
<?php foreach( $attributes as $key => $value ): ?> | |
<?php $attribute_name = preg_replace( '/pa_/', '', $key ) // GET ATTRIBUTE NAME ?> | |
<label> | |
<select name="attribute_pa_<?php echo $attribute_name ?>" id="attribute_pa_<?php echo $attribute_name ?>"> | |
<option value=""><?php echo $attribute_name ?></option> | |
<?php $attribute_name = wc_get_product_terms( get_the_ID(), $key ) // GET ATTRIBUTE NAME ?> | |
<?php $attribute_slug = wc_get_product_terms( get_the_ID(), $key, array( 'fields' => 'slugs' ) ) // GET ATTRIBUTE SLUG ?> | |
<?php for ( $i=0; $i<count( $attribute_name ); $i++ ): // array_slice BECAUSE ARRAY INDEX IS NOT SEQUENCIAL ?> | |
<option value="<?php $slug = array_slice( $attribute_slug, $i, 1 ); echo $slug[0]; ?>"><?php $name = array_slice( $attribute_name, $i, 1 ); echo $name[0]; ?></option> |
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 | |
/* | |
Plugin Name: Your Shipping plugin | |
Plugin URI: https://woocommerce.com/ | |
Description: Your shipping method plugin | |
Version: 1.0.0 | |
Author: WooThemes | |
Author URI: https://woocommerce.com/ | |
*/ |
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
setInterval(function(){ | |
botao = jQuery('#wp-smush-bulk-wrap-box > div.box-container > div.wp-smush-bulk-wrapper > button'); | |
if( botao.attr('disabled') != 'disabled' ) { | |
botao.trigger('click'); | |
} | |
}, 1000); |
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
RewriteEngine On | |
RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in.*$ [NC] | |
RewriteRule ^.*/uploads/.*$ http://domain.com/protected.jpg [L,R=301] |
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
namespace: "flex-", //{NEW} String: Prefix string attached to the class of every element generated by the plugin | |
selector: ".slides > li", //{NEW} Selector: Must match a simple pattern. '{container} > {slide}' -- Ignore pattern at your own peril | |
animation: "fade", //String: Select your animation type, "fade" or "slide" | |
easing: "swing", //{NEW} String: Determines the easing method used in jQuery transitions. jQuery easing plugin is supported! | |
direction: "horizontal", //String: Select the sliding direction, "horizontal" or "vertical" | |
reverse: false, //{NEW} Boolean: Reverse the animation direction | |
animationLoop: true, //Boolean: Should the animation loop? If false, directionNav will received "disable" classes at either end | |
smoothHeight: false, //{NEW} Boolean: Allow height of the slider to animate smoothly in horizontal mode | |
startAt: 0, //Integer: The slide that the slider should start on. Array nota |
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 | |
function wpsx_redefine_locale( $locale ) { | |
$lang = $_GET['lang']; | |
if( $lang == 'en'){ | |
$locale = 'en_US'; | |
} else { | |
$locale = 'pt_BR'; | |
} | |
return $locale; | |
} |
NewerOlder