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 | |
| // Hook para detectar a exclusão de posts | |
| add_action('before_delete_post', 'wpscripts_handle_post_deletion'); | |
| function wpscripts_handle_post_deletion($post_id) { | |
| global $wpdb; | |
| // Verifica se o post tem uma imagem destacada | |
| $thumbnail_id = get_post_thumbnail_id($post_id); |
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
| USADO EM https://galeriacdsports.com.br/home/ | |
| TRECHO JS/CSS | |
| <script> | |
| jQuery(document).ready(function() { | |
| jQuery(document).on('input change', '.sn_qtd', function() { | |
| var input = jQuery(this); | |
| var step = parseInt(input.attr('step'), 10); | |
| var value = parseInt(input.val(), 10); |
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 JS | |
| --------------- | |
| document.addEventListener('DOMContentLoaded', function () { | |
| // Função para filtrar os options do select box | |
| function filtrarOptionsSelectBox(termIds) { | |
| // Obtem o select box pela classe (ajuste conforme necessário) | |
| const selectBox = document.querySelector('.jet-select__control[name="filial"]'); | |
| if (!selectBox) 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
| /* | |
| Esse script serve para mostrar um menu de favoritos só quando houver itens no data store - do tipo local storage | |
| Aplique a class .showinfo no item do menu | |
| e coloque o código no elementor custom code all pages. | |
| */ | |
| <script> | |
| jQuery(document).ready(function() { |
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 [delete_user] | |
| <?php | |
| function wpscripts_delete_user_shortcode($atts) { | |
| // Extrai os atributos | |
| $atts = shortcode_atts(array( | |
| 'userid' => 0, | |
| ), $atts, 'delete_user'); |
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 meu_shortcode_consultar_disponibilidade() { | |
| ob_start(); // Inicia a captura de saída para permitir a utilização de echo | |
| ?> | |
| <!-- Botão para consultar disponibilidade --> | |
| <button id="botao-consultar-disponibilidade" type="button">Consultar disponibilidade</button> | |
| <!-- Div para exibir o resultado --> | |
| <div id="resultado-consulta"></div> | |
| <!-- JavaScript para manipular o clique do botão e interagir com o AJAX --> |
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 |