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
Para enviar os dados do localStorage para uma planilha do Google, você precisará criar uma integração usando a API do Google Sheets. A seguir, descrevo os passos básicos para realizar essa tarefa: | |
Crie uma Planilha do Google: | |
Abra o Google Drive. | |
Clique no botão "Novo" e selecione "Google Planilhas" para criar uma nova planilha. | |
Nomeie a planilha e adicione as colunas correspondentes aos dados que você deseja armazenar. | |
Crie um Projeto na Google Cloud Platform: | |
Acesse a Google Cloud Platform Console. |
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 | |
// Adicionar ou remover automaticamente produtos da categoria "promoções" com base no preço promocional | |
function update_promotion_category_based_on_sale() { | |
$promo_category = get_term_by('slug', 'promocoes', 'product_cat'); // Substitua 'promocoes' pela slug da categoria "promoções" | |
if (!$promo_category) { | |
return; | |
} | |
$args = array( |
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 | |
// credits: https://github.com/woocommerce/woocommerce/issues/17487#issuecomment-565433819 | |
add_action( 'woocommerce_product_duplicate', function ( $duplicate, $product ) { | |
$taxonomies = [ 'taxonomy1', 'taxonomy2' ]; | |
foreach ( $taxonomies as $taxonomy ) { | |
$terms = get_the_terms( $product->get_id(), $taxonomy ); | |
if ( ! is_wp_error( $terms ) ) { | |
wp_set_object_terms( $duplicate->get_id(), wp_list_pluck( $terms, 'term_id' ), $taxonomy ); | |
} |
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 | |
/** | |
* Crie um arquivo chamado admin_search_custom_fields.php no diretorio /includes/ | |
* E add o COD abaixo. | |
* | |
* Extend WordPress search to include custom fields | |
* https://taciara.com.br | |
* | |
* Join posts and postmeta tables | |
* http://codex.wordpress.org/Plugin_API/Filter_Reference/posts_join |
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 | |
/** | |
* @author Taciara Furtado <[email protected]> | |
* @version 1.0.0 | |
*/ | |
add_action( 'woocommerce_after_single_product', 'site_add_accordion_products', 55 ); | |
function site_add_accordion_products () { | |
global $product;?> |
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 | |
$args = array( | |
'post_type' => 'page', | |
'posts_per_page' => -1, | |
//'post_parent' => $post->ID, | |
'post_parent' => $post->post_parent, | |
'order' => 'ASC', | |
'orderby' => 'title' | |
); |
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 | |
/** | |
* WordPress Chosen Taxonomy Metabox | |
* Author: Helen Hou-Sandi | |
* | |
* Use Chosen for a replacement taxonomy metabox in WordPress | |
* Useful for taxonomies that aren't changed much on the fly and are | |
* non-hierarchical in nature, as Chosen is for flat selection only. | |
* You can always use the taxonomy admin screen to add/edit taxonomy terms. | |
* Categories need slightly different treatment from the rest in order to |
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 | |
// ############### ACEITAR SVG NO WORDPRESS ############### | |
function bodhi_svgs_upload_mimes( $mimes = array() ) { | |
if ( current_user_can( 'administrator' ) ) { | |
// allow SVG file upload | |
$mimes['svg'] = 'image/svg+xml'; | |
$mimes['svgz'] = 'image/svg+xml'; | |
return $mimes; | |
} else { | |
return $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
<?php | |
// SHOTCODE ACCORDION DINAMICO NA PAGINA | |
add_shortcode('accordion', 'dwm_accordion'); | |
function dwm_accordion($atts) { ?> | |
<?php ob_start(); ?> | |
<div class="accordion-page"> |
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
/** | |
* fullPage 2.0.9 | |
* https://github.com/alvarotrigo/fullPage.js | |
* MIT licensed | |
* | |
* Copyright (C) 2013 alvarotrigo.com - A project by Alvaro Trigo | |
*/ | |
(function($) { | |
$.fn.fullpage = function(options) { |
NewerOlder