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
alias wpdebug0='wp config set WP_DEBUG false --raw --type=constant' | |
alias wpdebug1='wp config set WP_DEBUG true --raw --type=constant' | |
alias rmdss='find . -name '.DS_Store' -type f -delete' | |
alias rmnm='find . -name 'node_modules' -type d -delete' | |
alias rmcv='find . -name 'vendor' -type d -delete' | |
alias guiau='git update-index --assume-unchange' | |
alias guinau='git update-index --no-assume-unchange' | |
alias jpdev1='wp config set JETPACK_DEV_DEBUG true --type=constant --raw' | |
alias jpdev0='wp config set JETPACK_DEV_DEBUG false --type=constant --raw' | |
alias wplangupdate='wp language core update && wp language plugin update --all && wp language theme update --all' |
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
/** | |
* Extract full name to first and last name. | |
* | |
* @version 1.0.1 | |
* @link https://gist.github.com/camaleaun/a9ab8de21dd9830708f927b6db69c021 | |
* @param string $name Full name. | |
* @param string $object Optional. If true return as OBJECT (with 'first' and 'last' as properties) (Default ARRAY_N). | |
* @return array|object First and last names. | |
*/ | |
function pluginname_split_name( $name, $object = 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
if ( defined( 'WP_CLI' ) && WP_CLI ) { | |
WP_CLI::add_hook( 'after_wp_load', 'pluginname_cli_runner' ); | |
} | |
function pluginname_test() { | |
WP_CLI::success( 'Command works.' ); | |
} | |
function pluginname_cli_runner() { | |
WP_CLI::add_command( 'pluginname test', 'pluginname_test' ); | |
} |
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_filter( 'sanitize_file_name', 'themename_sanitize_file_name' ); | |
/** | |
* Remove accents, maybe lowercase and underscores to dashes | |
* | |
* @version 1.0.4 | |
* @link https://gist.github.com/camaleaun/d8d12d04ff879a89d833c9eb39362eda | |
* @param string $filename Name of file. | |
* @return string Sanitized file name. |
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
{ | |
"keys": ["tab"], | |
"command": "expand_abbreviation_by_tab", | |
// put comma-separated syntax selectors for which | |
// you want to expandEmmet abbreviations into "operand" key | |
// instead of SCOPE_SELECTOR. | |
// Examples: source.js, text.html - source | |
"context": [ | |
{ |
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
<!--[if lte IE 8]> | |
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2-legacy.js"></script> | |
<![endif]--> | |
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2.js"></script> | |
<script> | |
hbspt.forms.create({ | |
portalId: "PORTAL_ID_HERE", | |
formId: "FORM_ID_HERE" | |
}); | |
var chatData = {}; |
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
add_action( 'init', 'short_aliases' ); | |
add_filter( 'short_aliases', 'shorts_redirect' ) ); | |
function short_aliases() { | |
$aliases = apply_filters( 'short_aliases', array() ); | |
if ( ! is_array( $aliases ) ) { | |
$aliases = array(); | |
} | |
foreach ( $aliases as $alias => $redirects ) { | |
add_rewrite_rule( "^$alias/?", $redirects, 'top' ); |
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> | |
<head> | |
<title>WordPress Inspector</title> | |
<meta charset="utf-8"> | |
<link rel="icon" href="https://visie.com.br/favicon.ico"> | |
<style> | |
body { | |
margin: 0; | |
padding: 0; |
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 ( ! defined( 'ABSPATH' ) ) { | |
define( 'ABSPATH', dirname( __FILE__ ) . '/' ); | |
} | |
error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR ); | |
if ( file_exists( ABSPATH . 'wp-config.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
add_filter( 'woocommerce_account_menu_items', 'daico_account_menu_items2' ); | |
function daico_account_menu_items2( $items ) { | |
unset( $items['customer-logout'] ); | |
$items['orders'] = 'Vendas'; | |
$items['customer-logout'] = 'Sair'; | |
return $items; | |
} |