This file contains hidden or 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( | |
'doing_it_wrong_run', | |
static function ( $function_name ) { | |
if ( '_load_textdomain_just_in_time' === $function_name ) { | |
debug_print_backtrace(); | |
error_log(wp_debug_backtrace_summary()); | |
} | |
} | |
); |
This file contains hidden or 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_flag opcache.enable Off |
This file contains hidden or 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 each post individually | |
POST_IDS=$(wp post list --post_type=locations --meta_key=page_subtype --meta_value=event --format=ids) | |
for ID in $POST_IDS; do | |
TIMESTAMP=$(date +"%Y%m%d_%H%M%S") | |
wp export --dir=export --post__in=$ID | |
mv export/doprcenakole.wordpress.*.xml export/${TIMESTAMP}.xml | |
done | |
# Switch to the other WordPress installation | |
cd /path/to/other/wordpress/installation |
This file contains hidden or 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
## EXPIRES HEADER CACHING ## | |
<IfModule mod_expires.c> | |
ExpiresActive On | |
ExpiresDefault "access plus 1 month" | |
</IfModule> | |
<IfModule mod_headers.c> | |
Header set Cache-Control "max-age=0, no-cache, must-revalidate" | |
</IfModule> |
This file contains hidden or 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 | |
for LOCATION in $(wp post list --post_type=locations --posts_per_page=-1 --format=ids); do | |
for PARTNER in $(wp post list --post_type=partners --connected_type=page2page --connected_items=$LOCATION --nopaging=true --posts_per_page=100 --format=ids); do | |
wp post delete $PARTNER --force | |
done | |
done |
This file contains hidden or 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
browser-sync start --proxy "http://localhost:8080" --files "**/*" --no-notify |
This file contains hidden or 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
RewriteEngine on | |
RewriteCond %{HTTP_HOST} ^domain.rocks$ [NC,OR] | |
RewriteCond %{HTTP_HOST} ^www.domain.rocks$ | |
RewriteCond %{REQUEST_URI} !bedrock/web/ | |
RewriteRule (.*) /bedrock/web/$1 [L] | |
# or | |
RewriteEngine on | |
RewriteCond %{HTTP_HOST} ^(www.)?domain.rocks$ |
This file contains hidden or 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 gallery_2_galleryInFlexibleLayout(){ | |
$arr = [ | |
'post_type' => 'cp_resident', | |
'posts_per_page' => -1, | |
'fields' => 'ids' | |
]; | |
$q = new WP_Query($arr); | |
foreach ($q->posts as $id) { |
This file contains hidden or 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
#recover previous db backup, not last! | |
cd db_backup && wp db import "$(print -lr -- **/*(om[2,2]))" |
This file contains hidden or 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
wp db drop --yes && wp db import $(find db_backup/* -printf '%T+ %p\n' | sort -r | head -n 1) |
NewerOlder