Skip to content

Instantly share code, notes, and snippets.

View dantetesta's full-sized avatar

DANTE TESTA dantetesta

View GitHub Profile
<?php
// O WordPress 'add_action' registra uma nova ação com a tag 'jet-engine/register-macros'
add_action( 'jet-engine/register-macros', function() {
/**
* Classe que formata uma string de data.
*/
class Format_Date_String extends \Jet_Engine_Base_Macros {
<?php
require_once( $_SERVER['DOCUMENT_ROOT'] . '/wp-load.php' );
global $wpdb;
$prefix = $wpdb->prefix;
$resultado = $wpdb->get_results("SELECT * FROM {$prefix}jet_cct_profissionais WHERE cct_status='publish' ORDER BY nome ASC", ARRAY_A);
$data = array();
<?php
/*
Author: Dante Testa
Date: 26/06/2023
www.dantetesta.com.br
*/
add_action( 'jet-form-builder/custom-action/add_tax', function( $request, $action_handler ) {
if (!isset($request['nome']) || !isset($request['taxonomia'])) {
<script>
jQuery(document).ready(function() {
var taxonomia_id = jQuery('select[name="tipoproduto"]').val();
var query_title = jQuery('input[name="query"]').val();
function fetch_data() {
jQuery.ajax({
url: ajaxurl,
method: 'POST',
<script>
jQuery(document).ready(function(){
jQuery.ajax({
url: '/wp-content/uploads/sistema-petshop/select-servicos.php',
type: 'GET',
dataType: 'json', // Tipo de dado esperado do servidor, nesse caso, um objeto JSON
success: function(data) {
var dropdown = jQuery("#servicos");
function custom_produtos_rewrite_rule() {
add_rewrite_rule(
'^([^/]+)/?$',
'index.php?post_type=produtos&name=$matches[1]',
'top'
);
}
add_action('init', 'custom_produtos_rewrite_rule', 10, 0);
function custom_post_type_link( $post_link, $post ) {
<!DOCTYPE html>
<html>
<head>
<title>Simulador de Financiamento de Veículos</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">
<style>
body {
background-color: #343a40;
color: #fff;
padding: 3% 10% 5% 10%;
<?php
function custom_products_rewrite_rule() {
add_rewrite_rule(
'^produtos/([^/]+)/([^/]+)/?$',
'index.php?post_type=produtos&categoria=$matches[1]&name=$matches[2]',
'top'
);
}
/*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'
<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';