This file contains 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 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 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 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
/* To disable the Gutenberg’s CSS loading on the front-end */ | |
function tw_unload_files() { | |
wp_dequeue_style ( 'wp-block-library' ); | |
wp_dequeue_style ( 'wp-block-library-theme' ); | |
} | |
add_action( 'wp_enqueue_scripts', 'tw_unload_files', 100 ); | |
/* To disable Elementor’s Google font */ |
This file contains 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 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
/* By Luciano Cezareto + Crocoblock */ | |
/* Adicione esse trecho no functions.php do tema [ou tema filho mais seguro] */ | |
/* no campo search do smartfilters no query variable coloque: | |
user_prop::user_email; user_prop::user_login; user_prop::user_nicename; user_prop::ID; user_prop::user_url | |
--->> importante use ponto e virgula (;) para adicionar mais de um termo caso necessário. */ | |
/* | |
Veja o Prints: | |
https://imgur.com/a/amQwmzv | |
https://imgur.com/a/3foNmbH |
This file contains 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 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 | |
/* Botão de Logout com Redirect | |
[logout url='/pagina-que-deseja-redirecionar'] | |
Use o parametro url para informar o destino após o logout. | |
Design by: Dante Testa | |
*/ |
This file contains 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
<FilesMatch "\.(jpg|jpeg|png|gif|pdf)$"> | |
Header set X-Robots-Tag "noindex, nofollow" | |
</FilesMatch> | |
/* | |
apos RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] | |
*/ | |
RewriteCond %{REQUEST_URI} ^(.*)?/(wp-content/uploads/.*)$ |
This file contains 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. |
NewerOlder