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 | |
/** | |
* Add the input field to the form | |
* | |
* @param int $form_id | |
* @param null|int $post_id | |
* @param array $form_settings | |
*/ |
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
#!/bin/bash | |
set -euo pipefail | |
# define variáveis padrão para o BD (com possibilidade de receber de outro script) | |
DB_HOST="${DB_HOST:-127.0.0.1}" | |
DB_USER="${DB_USER:-root}" | |
DB_PASS="${DB_PASS:-root}" | |
if (( DOCKER_INST )); then | |
DIR_INSTALACAO= | |
WPCLI=$wp_docker |
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
/** | |
* This code should be added to functions.php of your theme | |
**/ | |
function my_woocommerce_catalog_orderby( $args ) { | |
$args['meta_key'] = '_stock_status'; | |
$args['orderby'] = array( 'meta_value' => 'ASC', 'date' => 'DESC' ); | |
return $args; | |
} | |
add_filter( 'woocommerce_get_catalog_ordering_args', 'my_woocommerce_catalog_orderby' ); |
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 | |
// Remove acentos e espaços dos arquivos no upload | |
function custom_sanitize_file_name ( $filename ) { | |
$filename = remove_accents( $filename ); | |
$filename = strtolower( $filename ); | |
$file_parts = pathinfo( $filename ); | |
$new_filename = sanitize_title( $file_parts['filename'] ); | |
if ( ! empty( $file_parts['extension'] ) ) { |
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 | |
global $wpdb; | |
$taxonomy_slug = 'area'; | |
$wpdb->query( "DELETE a, b, c, d | |
FROM {$wpdb->term_taxonomy} a | |
LEFT JOIN {$wpdb->terms} b | |
ON (a.term_id = b.term_id) | |
LEFT JOIN {$wpdb->term_relationships} c |
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
#!/bin/bash | |
set -euo pipefail | |
# from this answer: https://askubuntu.com/a/630530/700841 | |
# with some changes, like testing versions, for instance. | |
# | |
# How to use: | |
# 1. put this at /usr/local/bin/ as atom-auto-update (without .sh) | |
# 2. save and make it executable with `sudo chmod +x /usr/local/bin/atom-auto-update` | |
# 3. run whenever you want with `sudo atom-auto-update` |
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
export wp_docker='sudo docker exec -i docker_wordpress_1 wp' | |
export DB_HOST="mysql" | |
export DB_USER="wordpress" | |
export DB_PASS="wordpress" | |
export DB_NAME="wordpress" | |
export DOCKER_INST=1 | |
source $( dirname "${BASH_SOURCE[0]}" )/wpinstall.sh |
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 a,b,c | |
FROM wp_posts a | |
LEFT JOIN wp_term_relationships b ON ( a.ID = b.object_id ) | |
LEFT JOIN wp_postmeta c ON ( a.ID = c.post_id ) | |
WHERE a.post_type = '<POST_TYPE>' |
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
'.text.html': | |
'WP Plugin - empty index': | |
'prefix': 'plugin_index' | |
'body': """ | |
<?php | |
// Silence is golden | |
""" | |
'WP Plugin - new plugin': | |
'prefix': 'plugin_file' | |
'body': """ |
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
<h2 id="bem-vindos-ao-forum-de-suporte">Bem-vindo(a) ao fórum de suporte <a href="#bem-vindos-ao-forum-de-suporte">#</a></h2> | |
Esta página é uma mensagem de boas-vindas aos <a href="https://br.wordpress.org/support/">fóruns de suporte</a> do WordPress do Brasil. Esperamos que este documento seja útil para você, uma vez que é destinado a ser um manual de "começo rápido" ao invés de uma documentação completa. Esta introdução feita para que você possa encontrar o seu caminho pelo fórum e comece a usá-lo o mais rápido possível. <!-- Para encontrar informações detalhadas e completas sobre o fórum, acesse o artigo [[pt-br:Usando_o_Fórum_de_Suporte|Utilizando os fóruns de suporte]] do Codex. --> | |
Antes de publicar, tenha certeza de que está publicando sobre um site que utiliza o WordPress.org e <strong>NÃO</strong> o WordPress.com. Caso você não tenha certeza, leia o artigo <a href="https://br.support.wordpress.com/com-vs-org/">WordPress.com e WordPress.org</a> para entender a diferença. | |
Estes fóruns são destinados |
OlderNewer