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 | |
define('INBOUND_FAST_AJAX' , true ); | |
/** | |
* Enable Fast Ajax | |
*/ | |
add_filter( 'option_active_plugins', 'ajax_disable_plugins' ); | |
function ajax_disable_plugins($plugins){ |
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 | |
// This is the cleaner code per request of a thread in the LinkedIn group "WordPress" | |
// ... | |
// register and enqueue loadCSS | |
function load_scripts_and_styles() { | |
// register loadCSS | |
wp_register_script( 'load-css-async', get_stylesheet_directory_uri() . '/path/to/js/loadCSS.js', array(), '', 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
/** | |
* Exclude certain post types from nginx cache cleanup by Till Kruss | |
* | |
*/ | |
function nginx_cache_excluded_custom_post_types( $post_types ) { | |
$post_types[] = 'shop_order'; | |
$post_types[] = 'shop_order_refund'; | |
$post_types[] = 'shop_subscription'; | |
$post_types[] = 'ticket'; | |
$post_types[] = 'ticket_reply'; |
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 SetSearchArgs( $formattedArgs, $args = [] ) { | |
if( isset( $args[ 'post_type' ] ) && ( count( $args[ 'post_type' ] ) > 1 || gettype( $args[ 'post_type' ] ) === 'string' ) ) { | |
if( gettype( $args[ 'post_type' ] ) === 'array' ) { | |
$existing_query = $formattedArgs[ 'query' ]; | |
unset( $formattedArgs[ 'query' ] ); | |
$formattedArgs[ 'query' ][ 'function_score' ][ 'query' ] = $existing_query; |
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 | |
php -d memory_limit=-1 $(which wp) package install wp-cli/profile-command:@stable --allow-root | |
php -d memory_limit=-1 $(which wp) package install wp-cli/doctor-command:@stable --allow-root |
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
# Clean WPEngine variables for use with local clone setups | |
# Author: Mike from https.//wp-bullet.com | |
# run this in the root folder where wp-config.php lives | |
# define wp-config.php path | |
WPCONFIGPATH="wp-config.php" | |
# clean up WPE variables from wp-config.php | |
sed -i '/wpe/d' ${WPCONFIGPATH} | |
sed -i '/WPE/d' ${WPCONFIGPATH} |
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
cd wp-content/plugins | |
git clone https://github.com/Mindsize/mindsize-newrelic | |
cd mindsize-newrelic | |
composer install | |
wp plugin activate mindsize-newrelic --skip-plugins --skip-themes --allow-root |
OlderNewer