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
var httpRequest; | |
if (window.XMLHttpRequest){ | |
httpRequest = new XMLHttpRequest(); | |
} else if (window.ActiveXObject) { | |
httpRequest = new ActiveXObject(); |
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
DELETE relations.*, taxes.*, terms.* | |
FROM wp_term_relationships AS relations | |
INNER JOIN wp_term_taxonomy AS taxes | |
ON relations.term_taxonomy_id=taxes.term_taxonomy_id | |
INNER JOIN wp_terms AS terms | |
ON taxes.term_id=terms.term_id | |
WHERE object_id IN (SELECT ID FROM wp_posts WHERE post_type='product'); | |
DELETE FROM wp_postmeta WHERE post_id IN (SELECT ID FROM wp_posts WHERE post_type = 'product'); | |
DELETE FROM wp_posts WHERE post_type = 'product'; |
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 | |
function curl_request ($url, $method="GET", $return_transfer=true, $timeout=50) { | |
$ch = curl_init($url); | |
$info = curl_getinfo($ch); | |
//OPTIONS | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, $return_transfer); | |
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); |
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 | |
//=============================================== | |
// PHP function that retrieves an array with all | |
// the taxonomies of certain WordPress Post Type. | |
// By: SamuraiPetrus | |
//=============================================== | |
// $taxonomies = get_object_taxonomies('your-post-type'); | |
// Codex get_object_taxonomies : https://developer.wordpress.org/reference/functions/get_object_taxonomies/ |
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 brazilian_real_notation ( $price = 0 ) { | |
return "R$" . number_format($price, 2, ',', '.'); | |
} |
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
//SISTEMA DE DROPDOWNS | |
//Configurações dos dropdowns | |
//Argumentos | |
// [0] => (String) (Obrigatório) Título, | |
// [1] => (Boolean) (Default: false) Apenas Mobile, | |
// Para manter os valores padrões, adicione apenas o título no array $dropdowns | |
// Para modificar os valores padrões, adicione um array no array $dropdowns com as modificações |
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 | |
//wp_is_ipad vai em functions.php | |
function wp_is_ipad ( ) { | |
if( strpos($_SERVER['HTTP_USER_AGENT'], 'iPad') ) { | |
return true; | |
} else{ | |
return false; | |
} | |
} |
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 | |
function get_filtered_terms ( $post_type, $taxonomy, $tax_query = 0, $meta_query = 0 ) { | |
//Filtra os posts de acordo com a filtragem passada | |
$args = [ | |
"post_type" => $post_type, | |
"posts_per_page" => -1, | |
]; | |
if ( $tax_query ) { |
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
<!DOCTYPE html> | |
<html lang="pt-br"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Lista de contatos</title> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css"> | |
<style media="screen"> | |
#vueroot{ |