$ docker
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 | |
// Download this snippet as a plugin and more at: https://wordbits.io/snippet/list-all-wordpress-actions-fired/ | |
// Created by: jeffmatson | |
?> | |
<?php | |
add_action( 'shutdown', function(){ | |
foreach( $GLOBALS['wp_actions'] as $action => $count ) | |
printf( '%s (%d) <br/>' . PHP_EOL, $action, $count ); | |
}); |
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
#!/usr/bin/env bash | |
#styles | |
VP_NONE='\033[00m' | |
VP_RED='\033[01;31m' | |
VP_GREEN='\033[01;32m' | |
VP_YELLOW='\033[01;33m' | |
VP_PURPLE='\033[01;35m' | |
VP_CYAN='\033[01;36m' | |
VP_WHITE='\033[01;37m' |
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
<ul class="products"> | |
<?php | |
$args = array( | |
'post_type' => 'product', | |
'posts_per_page' => 12, | |
'tax_query' => array( | |
array( | |
'taxonomy' => 'product_visibility', | |
'field' => 'name', | |
'terms' => 'featured', |
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( 'rocket_cache_reject_ua', 'wprocket_remove_fb_ua' ); | |
function wprocket_remove_fb_ua( $ua ) { | |
if ( in_array( 'facebookexternalhit', $ua ) ) { | |
$ua = array_flip( $ua ); | |
unset( $ua[ 'facebookexternalhit' ] ); | |
$ua = array_flip( $ua ); | |
} | |
return $ua; | |
} |
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 | |
/*********************************************************************** | |
A simple PHP function that will correctly uppercase Greek language | |
with proper spelling rules (removing accents in uppercased letters). | |
This is a server-side alternative to CSS uppercase() for Greek. | |
Greek CSS uppercase() is not working right on some browsers. | |
You can fix this by using javascript (increases browser load time) or | |
in server side by using this function here. |
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 ( 'on' == et_get_option( 'divi_back_to_top', 'false' ) ) : ?> | |
<span class="et_pb_scroll_top et-pb-icon"></span> | |
<?php endif; | |
if ( ! is_page_template( 'page-template-blank.php' ) ) : ?> | |
<footer id="main-footer"> | |
<?php get_sidebar( 'footer' ); ?> |
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 | |
// PHP memory limit for this site | |
define( 'WP_MEMORY_LIMIT', '128M' ); | |
define( 'WP_MAX_MEMORY_LIMIT', '256M' ); // Increase admin-side memory limit. | |
// Database | |
define( 'WP_ALLOW_REPAIR', true ); // Allow WordPress to automatically repair your database. | |
define( 'DO_NOT_UPGRADE_GLOBAL_TABLES', true ); // Don't make database upgrades on global tables (like users) | |
// Explicitely setting url |
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 script will copy your wordpress from public_html (or wherever) | |
* and place it in a staging folder. | |
* It will then clone the database, reconfigure the config file | |
* and replace URL's from the original URL to your staging URL. | |
* It will then make sure to NOT allow search engines to index the page. | |
* | |
* Use this script to clone your main wp in order to test maintenance work |
NewerOlder