This file will setup Wordpress, wordpress-cli & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yml" and run the command
#To Start
$ docker-compose up -d
# To Stop
<?php | |
add_action('pre_get_posts', function($query) { | |
if ($query->is_feed() && filter_input(INPUT_GET, 'count', FILTER_VALIDATE_INT) && filter_input(INPUT_GET, 'count', FILTER_VALIDATE_INT)) { | |
$query->set('posts_per_rss', filter_input(INPUT_GET, 'count', FILTER_VALIDATE_INT)); | |
} | |
return $query; | |
}); |
# ----------------------------------------------------------------- | |
# ver 1.1.0 | |
# | |
# Change Log: | |
# 20160721 - First version | |
# 20171018 - error_log added | |
# ----------------------------------------------------------------- | |
# ignore all files starting with . or ~ | |
.* |
<?php | |
add_filter('acf/settings/save_json', function($path) { | |
return get_stylesheet_directory() . '/acf-json'; | |
}); | |
add_filter('acf/settings/load_json', function($paths) { | |
unset($paths[0]); | |
$paths[] = get_stylesheet_directory() . '/acf-json'; | |
return $paths; |
<?php | |
add_action('acf/input/admin_footer', function() { | |
$themeJsonFile = get_stylesheet_directory() . '/theme.json'; | |
if(file_exists($themeJsonFile)) { | |
$themeJson = json_decode(file_get_contents($themeJsonFile)); | |
$colorsArray = []; | |
$colorsJson = ''; | |
foreach($themeJson->settings->color->palette as $color) { | |
$colorsArray[] = $color->color; |
<?php | |
/** | |
* Load Single Page by Category | |
*/ | |
add_filter('single_template', function ($template) { | |
foreach ((array) get_the_category() as $cat) { | |
$templateFile = STYLESHEETPATH . "/single-category-{$cat->slug}.php"; | |
if (file_exists($templateFile)) { |
module.exports = { | |
'root': true, | |
'extends': 'eslint:recommended', | |
'globals': { | |
'wp': true, | |
}, | |
'env': { | |
'node': true, | |
'es6': true, | |
'amd': true, |
USER_NAME = "^[A-Za-z0-9_-]{min number of character,max number of character}$"; | |
TELEPHONE = "(^\\+)?[0-9()-]*"; | |
TELEPHONE_OPTIONAL = "^($|(^\\+)?[0-9()-]*)$" | |
EMAIL = "^([a-zA-Z0-9\.\_\+\-]+)@([a-zA-Z0-9\-]+)(\.[a-zA-Z]+)+$"; | |
EMAIL_OPTIONAL = "^($|[a-zA-Z0-9_\\.\\+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-\\.]+)$"; |
<?php | |
// WP_Query arguments | |
$args = array( | |
'post_type' => 'post', | |
'post_status' => array( 'publish' ), | |
'posts_per_page' => -1, | |
'ignore_sticky_posts' => true, | |
'meta_query' => array( | |
'relation' => 'OR', |
{ | |
/* | |
Plugins | |
- phpfmt - PHP formatter <https://marketplace.visualstudio.com/items?itemName=kokororin.vscode-phpfmt> | |
- phpcs - <https://marketplace.visualstudio.com/items?itemName=ikappas.phpcs> | |
- PHP IntelliSense - <https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-intellisense> | |
- PHP DocBlocker - <https://marketplace.visualstudio.com/items?itemName=neilbrayfield.php-docblocker> | |
- Sass - <https://marketplace.visualstudio.com/items?itemName=Syler.sass-indented> | |
- SCSS IntelliSense <https://marketplace.visualstudio.com/items?itemName=mrmlnc.vscode-scss> | |
- SCSS Everywhere <https://marketplace.visualstudio.com/items?itemName=gencer.html-slim-scss-css-class-completion> |