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 my_custom_post_type() { | |
register_post_type('labs', [ | |
'label' => 'Labs', | |
'menu_icon' => 'data:image/svg+xml;base64,' . base64_encode('<svg width="20" height="20" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path fill="black" d="M1591 1448q56 89 21.5 152.5t-140.5 63.5h-1152q-106 0-140.5-63.5t21.5-152.5l503-793v-399h-64q-26 0-45-19t-19-45 19-45 45-19h512q26 0 45 19t19 45-19 45-45 19h-64v399zm-779-725l-272 429h712l-272-429-20-31v-436h-128v436z"/></svg>') | |
]); | |
} | |
add_action( 'init', 'my_custom_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
# WORDPRESS | |
# Exclude WordPress core folders and root files. | |
wp-admin/ | |
wp-includes/ | |
*.php | |
# WP-CONTENT | |
# Ignore all wp-content, except for specified folders. | |
wp-content/* | |
!wp-content/haste/ |
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
## WORDPRESS CORE FOLDERS | |
wp-admin/** | |
wp-includes/** | |
## WORDPRESS CONTENT | |
wp-content/languages/** | |
wp-content/upgrade/** | |
wp-content/uploads/** | |
wp-content/index.php |
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 woocommerce_pre_get_posts( $query ) { | |
if ( ! is_admin() && is_post_type_archive( 'product' ) && $query->is_main_query() ) { | |
// Option 1 | |
$args = array( | |
array( | |
'meta_key' => '_price', |
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
:: Name: db-update.bat | |
:: Purpose: Connect to server trough ssh and run wp-cli commands | |
:: Author: @allysonsouza | |
:: URL: https://github.com/allysonsouza | |
:: Version: 0.0.1 | |
:: License: GPL-v2 | |
@ECHO OFF | |
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION |
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
echo off | |
set filepath=%1 | |
set filename=%2 | |
break > %filepath%\%filename% |
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 | |
if( function_exists( 'icl_get_languages' ) ) { | |
$languages = icl_get_languages( 'skip_missing=N&orderby=KEY&order=DIR&link_empty_to=str'); | |
} | |
if( !empty( $languages ) ) { | |
foreach( array_reverse( $languages ) as $lang ) { | |
Kirki::add_field( 'daibase', array( | |
'settings' => 'field_' . $lang['code'], |
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 | |
/* | |
Plugin Name: Banana Replace | |
Plugin URI: 2017.saopaulo.wordcamp.org | |
Description: Substitui a palavra banana por um gif | |
Version: 1.0 | |
Author: Eu | |
Author URI: https://wordpress.org/ | |
License: GPL2 | |
License URI: https://www.gnu.org/licenses/gpl-2.0.html |
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
// Const | |
const webpack = require('webpack'); //to access built-in plugins | |
const ExtractTextPlugin = require("extract-text-webpack-plugin"); | |
const path = require('path'); | |
// ExtractPlugin - Multiple instances | |
// Configure individual stylesheet generation to use correctly with wp_enqueue_style | |
const extractMain = new ExtractTextPlugin('css/main.min.css'); | |
const extractAdmin = new ExtractTextPlugin('css/admin.min.css'); | |
const extractEditor = new ExtractTextPlugin('css/editor.min.css'); |
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
@echo off | |
:: Change to match your program's paths | |
start "XAMPP" "C:\xampp\xampp-control.exe" | |
start "Atom" "C:\Users\[MYUSER]\AppData\Local\atom\atom.exe" | |
start "SourceTree" "C:\Program Files (x86)\Atlassian\SourceTree\SourceTree.exe" | |
start "Cmder" "C:\Users\[MYUSER]\Downloads\cmder\cmder.exe" | |
exit |