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 | |
$data = array(); | |
/* ... */ | |
$tpl_vars = array(); | |
foreach ( $data as $key => $value ) { | |
$tpl_vars[ '{{' . $key . '}}' ] = esc_attr( $value ); | |
} |
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 | |
cd /srv/www | |
mkdir vvv-upgrade-backups | |
find /etc/nginx/custom-sites/ -name '*.conf' | xargs grep -h 'root' | grep '/' | sed 's:\s*root\s\s*::' | sed 's:;$::' > roots.txt | |
for root in $(cat roots.txt); do | |
echo $root; | |
cd $root; | |
filename=$( echo $root | sed 's:/srv/www/::' | sed 's:/:-:g' ).sql; |
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
config.vm.provider :virtualbox do |v| | |
v.customize ["modifyvm", :id, "--memory", 1024] | |
end |
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 () { | |
var els = [].slice.call( document.querySelectorAll( 'title, meta[content][name], meta[content][property]' ) ); | |
var meta = {}; | |
els.forEach( function ( el ) { | |
if ( el.nodeName.toLowerCase() === 'title' ) { | |
meta.title = el.textContent; | |
} else { | |
meta[ el.getAttribute( 'property' ) || el.getAttribute( 'name' ) ] = el.getAttribute( '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
eval $(wp eval "printf( 'mysql -u%s -p%s %s', escapeshellarg( DB_USER ), escapeshellarg( DB_PASSWORD ), escapeshellarg( DB_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
/data |
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 | |
class WMR_Auto_Upgrade { | |
public $whitelisted_plugins = array( | |
'akismet', | |
'customizer-everywhere', | |
'dependency-minification', | |
'jetpack', | |
'media-placeholders', |
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
$ phpcs --standard=WordPress-Core test.php | |
-------------------------------------------------------------------------------- | |
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES | |
-------------------------------------------------------------------------------- | |
5 | WARNING | Array keys should be surrounded by spaces unless they contain a | |
| | string or an integer. | |
6 | WARNING | Array keys should NOT be surrounded by spaces if they only | |
| | contain a string or an integer. | |
-------------------------------------------------------------------------------- |
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 | |
class Wide_Widget extends WP_Widget { | |
public function __construct() { | |
$id_base = 'wide'; | |
$name = __( 'So Wide'); | |
$widget_options = array( | |
'description' => __( 'Behold my size!' ), | |
); | |
$control_options = array( |