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 | |
| function custom_products_rewrite_rule() { | |
| add_rewrite_rule( | |
| '^produtos/([^/]+)/([^/]+)/?$', | |
| 'index.php?post_type=produtos&categoria=$matches[1]&name=$matches[2]', | |
| 'top' | |
| ); | |
| } |
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
| /*MOTRA OS ANEXOS DOS TICKETS*/ | |
| 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
| <script> | |
| /* | |
| AUTOR: DANTE TESTA | |
| FUNÇÃO: PESQUISA CNPJ Receita WS + CEP na API VIA CEP + CONCATENAÇÃO DE ENDEREÇO | |
| */ | |
| jQuery(document).ready(function($) { | |
| var cnpj = '#cnpj'; | |
| var situacao = '#situacao'; |
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 |