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> | |
/* | |
AUTOR: DANTE TESTA | |
FUNÇÃO: PESQUISA CNPJ NA API RECEITA WS + CONCATENAÇÃO DE ENDEREÇO | |
*/ | |
jQuery(document).ready(function($) { | |
var cnpj = '#cnpj'; |
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> | |
/* | |
AUTOR: DANTE TESTA | |
FUNÇÃO: PESQUISA CEP NA API VIA CEP + CONCATENAÇÃO DE ENDEREÇO | |
DATA: 18/05/2023 | |
*/ | |
jQuery(document).ready(function($) { | |
/*SETUP DE CAMPOS DO FORMULÁRIO - Altere com seus seletores abaixo! */ |
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 custom_tickets_rewrite_rule() { | |
add_rewrite_rule( | |
'tickets/([0-9]+)/?$', | |
'index.php?post_type=tickets&p=$matches[1]', | |
'top' | |
); | |
} | |
add_action('init', 'custom_tickets_rewrite_rule', 10, 0); | |
function custom_post_type_link( $post_link, $post ) { |
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 mostrar_anexos_de_tickets( $atts ) { | |
global $wpdb; | |
// Atributos padrões | |
$atts = shortcode_atts( | |
array( | |
'id' => 0, | |
'tipo' => 'comentarios', | |
), $atts, 'mostrar_anexos' | |
); |
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 agendar a remoção do usuário após o registro | |
add_action('jet-engine-booking/agendamento_remocao', 'agendar_remocao_usuario'); | |
function agendar_remocao_usuario($campos) { | |
// Obter o objeto do usuário usando o nome de login | |
$usuario = get_user_by('login', $campos['codigo']); | |
// Agendar a remoção do usuário após 24 horas |
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
/// PROBLEMA /// | |
Listing grid de um CPT. | |
Cada linha tem um botão EDITAR. | |
O botão abre JetPopup com um form dentro. | |
Após editar os campos não posso configurar no form uma ação de REDIRECT, pois ela faz o refresh na página e o listing volta para a primeira página. | |
Se a edição ocorreu lá pela página 10, olha o trabalho toda hora ter que voltar para a página onde estava antes do EDITAR. | |
//👉 Colocar dentro de um widget HTML na página onde o popup irá abrir | |
<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
<?php | |
//Registra a action do agendamento | |
add_action( | |
"jet-form-builder/custom-action/agendar_evento", | |
"agendamento_wp" | |
); | |
function agendamento_wp() | |
{ | |
//NAME ID DO CAMPO - 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
###### HOW TO USE - AJAX SWITCHER ####### | |
buy plugin here: https://plugins.dantetesta.com.br/ajaxswitcher/ | |
TO USE =>> CPT | |
[ajaxswitcher metakey="_status" size="40" type="cpt"] | |
OU | |
TO USE =>> CURRENT USER | |
[ajaxswitcher metakey="_status" size="40" type="current_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
/* | |
################ MANUAL #################### | |
Parameters: | |
type ="current_user" or type ="author_user" this get information about a especific scope. | |
if you use current_user the image was returned is about current user about section. | |
inf you use author_user the image was returned is about user author about the post scope. | |
size = "150" to define the size of image/area (in pixels) | |
metakey = "name-meta" to define a metafield metakey slug if you have a custom metafield on user profile. |