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
| Query de Aniversariantes do Mês | |
| SELECT *, | |
| um.meta_value AS data_nascimento | |
| FROM {prefix}users AS u | |
| INNER JOIN {prefix}usermeta AS um ON u.ID = um.user_id | |
| WHERE u.user_status = 0 | |
| AND um.meta_key = '_data-nascimento' | |
| AND MONTH(um.meta_value) = MONTH(CURRENT_DATE()) | |
| ORDER BY um.meta_value ASC; |
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
| /* | |
| Crie um campo de texto chamado slug | |
| Adicione um call a hook notification -- jet-form-builder/custom-filter/save-slug | |
| */ | |
| add_action( 'jet-form-builder/form-handler/after-insert-post', function( $data ) { | |
| // Certifique-se de que o campo 'slug' está presente nos dados enviados | |
| if ( ! empty( $data['slug'] ) ) { | |
| $slug = sanitize_title( $data['slug'] ); |
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
| add_filter( 'jet-form-builder/custom-filter/validar_metafield', 'validar_metafield_unico', 10, 3 ); | |
| function validar_metafield_unico( $result, $request, $action_handler ) { | |
| global $wpdb; | |
| // Recuperando valores do request | |
| $type = sanitize_text_field( $request['type'] ); // Tipo: CPT ou CCT | |
| $source = sanitize_text_field( $request['source'] ); // Nome do CCT ou CPT | |
| $nome_metafield = sanitize_text_field( $request['metafield'] ); // Nome do metafield a verificar | |
| $valor_metafield = sanitize_text_field( $request[$nome_metafield] ); // Valor do metafield |
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( 'jet-form-builder/custom-filter/validar', 'validar_cpf_filter', 10, 3 ); | |
| function validar_cpf_filter( $result, $request, $action_handler ) { | |
| global $wpdb; | |
| // Variáveis configuráveis |
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
| <div class="foto"> | |
| <img src="foto1.png"> | |
| <button class="copy-foto" data-img-src="foto1.png">Copiar</button> | |
| </div> | |
| <div class="foto"> | |
| <img src="foto2.png"> | |
| <button class="copy-foto" data-img-src="foto2.png">Copiar</button> | |
| </div> | |
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 get_spotify_iframe($atts) { | |
| // Acesso global ao objeto $wpdb para operações de banco de dados | |
| global $wpdb; | |
| // Obtenção do ID da postagem a partir do atributo 'id' | |
| $post_id = isset($atts['id']) ? intval($atts['id']) : 0; | |
| // Se não houver um ID válido, retorna vazio | |
| if (!$post_id) { | |
| return ''; |
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() { | |
| // Função para adicionar o listener de mudança em um select box | |
| function setupLimitForSelectBox(selectBoxId, limitFieldName) { | |
| jQuery(selectBoxId).on('change', function() { | |
| var limit = parseInt(jQuery('input[name="' + limitFieldName + '"]').val(), 10); | |
| var selectedOptions = jQuery(this).find('option:selected'); | |
| if (selectedOptions.length > limit) { | |
| // Reverter a última seleção | |
| selectedOptions.each(function(index) { |
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
| <div id="counter"></div> | |
| <script> | |
| jQuery(document).ready(function() { | |
| function calcularSubtotalDoItem(itemElemento) { | |
| var valorTextoElemento = jQuery(itemElemento).find('.sn_valor2 .jet-listing-dynamic-field__content').text().trim(); | |
| var valorNumerico = parseFloat(valorTextoElemento); | |
| var quantidadeInput = jQuery(itemElemento).find('.qtd-input.sn_qtd'); | |
| var quantidadeNumerica = parseFloat(quantidadeInput.val()); |
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
| // Adicionar coluna personalizada | |
| add_filter('manage_pedidos_posts_columns', function ($columns) { | |
| $columns['reenviar_email'] = 'Reenviar por E-mail'; | |
| return $columns; | |
| }); | |
| // Exibir conteúdo na coluna personalizada | |
| add_action('manage_pedidos_posts_custom_column', function ($column, $post_id) { | |
| if ($column == 'reenviar_email') { | |
| echo '<a href="#" class="reenviar-email" data-post-id="' . $post_id . '">Reenviar</a>'; |
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
| <div id="counter"></div> | |
| <script> | |
| jQuery(document).ready(function() { | |
| function calcularSubtotalDoItem(itemElemento) { | |
| var valorTextoElemento = jQuery(itemElemento).find('.sn_valor2 .jet-listing-dynamic-field__content').text().trim(); | |
| var valorNumerico = parseFloat(valorTextoElemento); | |
| var quantidadeInput = jQuery(itemElemento).find('.qtd-input.sn_qtd'); | |
| var quantidadeNumerica = parseFloat(quantidadeInput.val()); |