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
-- | |
-- Table structure for table `wp_search_filter_cache` | |
-- | |
DROP TABLE IF EXISTS `wp_search_filter_cache`; | |
/*!40101 SET @saved_cs_client = @@character_set_client */; | |
/*!40101 SET character_set_client = utf8 */; | |
CREATE TABLE `wp_search_filter_cache` ( | |
`id` bigint(20) NOT NULL AUTO_INCREMENT, | |
`post_id` bigint(20) NOT NULL, |
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 | |
function hide_acf_admin_on_pantheon() { | |
if (class_exists('acf')) { // If acf is installed | |
if(isset($_ENV['PANTHEON_ENVIRONMENT'])) { // If on pantheon | |
// hide the acf menu item | |
return false; | |
} else { // else on local host | |
// show the acf menu item | |
return true; | |
} |
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
/** Phone number stripper */ | |
function strip_phone($number) { | |
$replace = array('.', '-', '(', ')', ' '); | |
$numberClean = str_replace($replace, '', $number); | |
return $numberClean; | |
} |
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
// expected function get_the_excerpt($post_id) is deprecated | |
function get_post_excerpt_by_id($id) { | |
global $post; | |
$post = get_post($id); | |
setup_postdata($post); | |
$the_excerpt = get_the_excerpt(); | |
wp_reset_postdata(); | |
return $the_excerpt; | |
} |
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
/** | |
* Overwrite for allowing plugin updates on localhost | |
*/ | |
if ( is_admin() ) { | |
add_filter( 'filesystem_method', create_function( '$a', 'return "direct";' ) ); | |
if ( ! defined( 'FS_CHMOD_DIR' ) ) { | |
define( 'FS_CHMOD_DIR', 0751 ); | |
} | |
} |
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
// In wp-config | |
if ( in_array( $_ENV['PANTHEON_ENVIRONMENT'], array( 'test', 'live' ) ) ) { | |
define('IS_IT_LIVE', true); | |
} | |
else { | |
define( 'IS_IT_LIVE', false ); | |
} | |
// Basic Example | |
@if(defined('IS_IT_LIVE')) |
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
/* HTTPS REDIRECT*/ | |
if (isset($_SERVER['PANTHEON_ENVIRONMENT']) && ($_SERVER['HTTPS'] === 'OFF') && (php_sapi_name() != "cli")) { | |
if (!isset($_SERVER['HTTP_USER_AGENT_HTTPS']) || (isset($_SERVER['HTTP_USER_AGENT_HTTPS']) && $_SERVER['HTTP_USER_AGENT_HTTPS'] != 'ON')) { | |
header('HTTP/1.0 301 Moved Permanently'); | |
header('Location: https://'. $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); | |
exit(); | |
# Name transaction "redirect" in New Relic for improved reporting (optional) | |
if (extension_loaded('newrelic')) { |