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
<script> | |
jQuery(document).ready(function($) { | |
// Função para tratar a mudança nos checkboxes de 'sexo' e 'cursos' | |
function tratarMudancaCheckbox() { | |
// Encontra o grupo do checkbox alterado ('sexo' ou 'cursos') | |
var grupo = $(this).closest('.tabs-panel'); | |
// Desmarca todos os outros checkboxes no mesmo grupo | |
$('input[type="checkbox"]', grupo).not(this).prop('checked', false); | |
} |
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 | |
/* Shortcode --->>> [botao_pdf] */ | |
function registrar_shortcode_botao_pdf() { | |
add_shortcode('botao_pdf', 'renderizar_botao_pdf'); | |
add_action('wp_enqueue_scripts', 'adicionar_scripts_ajax'); | |
} | |
add_action('init', 'registrar_shortcode_botao_pdf'); | |
function renderizar_botao_pdf() { |
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 | |
//https://portal.api2pdf.com/ | |
function my_enqueue_assets() { | |
wp_enqueue_script('jquery'); | |
wp_enqueue_style('font-awesome', 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css'); | |
} | |
add_action('wp_enqueue_scripts', 'my_enqueue_assets'); |
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) { |