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
## HOOK WORDPRESS | |
<?php | |
function wpscripts_get_woocommerce_products() { | |
if (!class_exists('WooCommerce')) { | |
wp_send_json_error('WooCommerce não está instalado.'); | |
} | |
$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
jQuery(document).ready(function($) { | |
var cepId = '#chckant_cep'; | |
var enderecoId = '#chckant_endereco'; | |
var bairroId = '#chckant_bairro'; | |
var cidadeId = '#chckant_cidade'; | |
var estadoId = '#chckant_estado'; | |
var numeroId = '#chckant_numero'; | |
function setLoading(loading) { |
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 buscar_posts_por_posicao() { | |
// Define as posições na ordem específica | |
$posicoes = ['Goleiro', 'Zagueiro', 'Lateral', 'Meio-campista', 'Atacante']; | |
$ids_final = []; | |
foreach ($posicoes as $posicao) { | |
// Argumentos da consulta | |
$args = [ | |
'post_type' => 'ecpf-elenco', // Ajustado para o CPT específico | |
'posts_per_page' => -1, // Para buscar todos os posts dessa posição |
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 | |
// Adiciona o shortcode no WordPress | |
function buscar_permalink_relacionado() { | |
// Obtém o ID do post atual | |
$post_id = get_the_ID(); | |
// Recupera o valor do metafield '_cadastro-relacionado' | |
$relacionado_id = get_post_meta($post_id, '_cadastro-relacionado', true); |
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 | |
/* Esse hook foi ativado pelo jetformbuilder call a hook */ | |
add_action('jet-form-builder/custom-action/universalapi', 'minha_acao_personalizada_api', 10, 2); | |
/** | |
* Função que executa uma chamada de API quando um formulário é enviado. | |
* | |
* @param array $form_data Os dados do formulário enviado. |
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
// uso do shortcode = [calcular_dias data="d/m/Y"] | |
<?php | |
function calcular_dias_desde($atts) { | |
// Extrai os atributos do shortcode | |
$atts = shortcode_atts( | |
array( | |
'data' => '01/01/1970', // Data padrão se nenhuma for fornecida | |
), |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Sorteio JetMaster 2024</title> | |
<style> | |
body { | |
font-family: 'Arial', sans-serif; | |
background-color: #f4f4f4; |
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 modificada para aceitar limites como parâmetros | |
function inicializarTratamentoCheckbox(selector, limite) { | |
$(selector).on('change', function() { | |
var grupo = $(this).closest('.tabs-panel'); | |
var checkboxesSelecionados = $('input[type="checkbox"]:checked', grupo).length; | |
if (checkboxesSelecionados > limite) { | |
$(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
Esse estilo CSS serve para manter o tamanho fixo da area de print no celular | |
@media (max-width: 1200px) { | |
#print-area { | |
width: 1000px !important; | |
overflow-x: auto; | |
} | |
} | |
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() { | |
// Inicializa a mensagem com uma template string vazia | |
let msgzap = ''; | |
// Itera de 1 a 10, construindo a mensagem a partir dos elementos .txt1 até .txt10 | |
for (let i = 1; i <= 10; i++) { | |
let textContent = jQuery(`.txt${i}`).text().trim(); | |
// Adiciona o texto à mensagem msgzap com a formatação desejada |