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
.constant-width-to-height-ratio { | |
background: #333; | |
width: 50%; | |
} | |
.constant-width-to-height-ratio::before { | |
content: ''; | |
padding-top: 30%; | |
float: left; | |
} | |
.constant-width-to-height-ratio::after { |
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 () { | |
$("body").on("click", function (e) { | |
// Defina o alvo | Ex.: ".notificacao,.boxPerfil" | Não faz nada se for o alvo. | |
if ($(e.target).closest(".notificacao,.boxPerfil").length) return; | |
// O que deve ser feito caso não seja o alvo? | |
console.log("Você clicou fora do alvo!"); | |
document.getElementById("optNotif").checked = false; | |
document.getElementById("optMenu").checked = 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
# Virtual Hosts | |
# | |
# Required modules: mod_log_config | |
# If you want to maintain multiple domains/hostnames on your | |
# machine you can setup VirtualHost containers for them. Most configurations | |
# use only name-based virtual hosts so the server doesn't need to worry about | |
# IP addresses. This is indicated by the asterisks in the directives below. | |
# | |
# Please see the documentation at |
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 | |
// nome=NOME_DO_CAMPO_ACF | |
add_filter('acf/load_field/name=nomes_dos_curadores', 'populateUserGroups'); | |
function populateUserGroups( $field ) | |
{ | |
// reset choices | |
$field['choices'] = array(); | |
// Pegar valor do wp_postmeta | 'key', 'id' |
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 | |
// Buscar todos os posts de 'post_type' = X | Aqui definido como 'property' | |
$allposts= get_posts( array('post_type'=>'property','numberposts'=>-1) ); | |
// Percorrer posts | |
foreach ($allposts as $post) { | |
// Excluir primeiro os anexos ligados ao Post | |
$attachments = get_attached_media( '', $post->ID ); | |
foreach ($attachments as $attachment) { |
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 | |
// Verifica se existe, se não criará | |
if ( ! wp_next_scheduled( 'cron_get_price_node_js' ) ) { | |
// O valor 'twicedaily' é um valor para executar duas vezes ao dia. Recomendo ter o CODEX da função para saber mais | |
// TEMPO , 'de quando em quanto tempo' , 'nome do action' | |
wp_schedule_event( time(), 'twicedaily', 'cron_get_price_node_js' ); | |
} | |
// 'nome do action' , 'nome da função que deverá ser chamada' |
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 | |
// Intervalo de 5 minutos para atualizar o RSS | |
add_filter( 'wp_feed_cache_transient_lifetime',create_function('$a', 'return 300;') ); |
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 | |
// CORS support to Wordpress RSS | |
add_action( 'pre_get_posts', 'add_header_origin' ); | |
function add_header_origin() { | |
if (is_feed()){ | |
header( 'Access-Control-Allow-Origin: *' ); | |
} | |
} |
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"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<!-- Bootstrap CSS --> | |
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous"> | |
<link href="https://fonts.googleapis.com/css2?family=Roboto+Mono&display=swap" rel="stylesheet"> |
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 ffq_parse_query_useronly( $wp_query ) { | |
// Verifica se está na página de edição | |
if ( strpos( $_SERVER[ 'REQUEST_URI' ], '/wp-admin/edit.php' ) !== false ) { | |
// Verifica os "poderes" de quem acessa | |
if ( !current_user_can( 'activate_plugins' ) ) { | |
// Function criada mais abaixo (child_remove_some_post_views) | |
add_action( 'views_edit-post', 'child_remove_some_post_views' ); | |
// Somente seus próprios posts | |
global $current_user; |
OlderNewer