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
<?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
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
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
//DROPDOWNS WEART | |
//Adicione aqui os droptitles | |
//Dropdowns: Todos os dropdowns | |
//Close on scroll:Dropdowns que serão fechados mediante scroll | |
$dropdowns = ["banners", "categories", "painel", "filterby"]; | |
$close_on_scroll = [$dropdowns[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 LIGHTBOX - SamuraiPetrus | |
// Requer JQuery | |
//============= | |
//ABRIR LIGHTBOX | |
// DESKTOP - height: 515px; width: 815px; | |
// TABLET - height: 485px; width: 615px; | |
// MOBILE - height: 315px; width: 305px; | |
function OpenImageLightBox (content) { |
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 | |
// ========================= | |
// I9ME FUNCTIONS | |
// ========================= | |
//Console PHP - Desenvolvido por Paulo Arthur e SamuraiPetrus | |
// (Imprime arrays PHP no Console do Browser) | |
//============= | |
// Parâmetros |
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 | |
public function init() { | |
$labels_flores = array( | |
"name" => __( "Flores", "" ), | |
"singular_name" => __( "Flor", "" ), | |
"menu_name" => __( "Flores", "" ), | |
"all_items" => __( "Todas as flores", "" ), | |
"add_new" => __( "Adicionar nova flor", "" ), | |
"add_new_item" => __( "Adicionar nova flor", "" ), |
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
// ============ | |
// Excerpt Limiter - Desenvolvido por SamuraiPetrus (https://github.com/SamuraiPetrus) | |
// (Limitador de string que corta o texto no último espaço em branco) | |
//============= | |
// Parâmetros | |
//============= | |
//$text -> (str) Texto a ser limitado. | |
//$chars -> (int) (default: 100) Número de caracteres do texto final. | |
function excerpt_limiter($str, $chars=100){ |
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
$obj = get_queried_object(); | |
$loop = new WP_Query([ | |
'post_type' => "produtos", | |
'meta_query' => array( | |
array( | |
'key' => '_thumbnail_id', | |
'compare' => 'NOT EXISTS' | |
)), | |
'tax_query' => [[ | |
'taxonomy' => 'tipos-produtos', |