add_action(‘pre_get_posts’, function($query) { if ($query->is_search() && !is_admin()) { $referer = wp_get_referer(); $site_url = get_site_url(); if (empty($referer) || strpos($referer, $site_url) !== 0) { // Block the request early to save CPU header(‘HTTP/1.1 403 Forbidden’); exit; } } });Continue reading
function wpb_change_search_url() { if ( is_search() && ! empty( $_GET[‘s’] ) ) { wp_redirect( home_url( “/search/” ) . urlencode( get_query_var( ‘s’ ) ) ); exit(); } } add_action( ‘template_redirect’, ‘wpb_change_search_url’ );Continue reading
// this is the class definition class myfair_Show_Data { public function __construct() { $this->loadShows(); if (isset($this->showList) && is_array($this->showList) && count($this->showList) > 0) { $this->loadShowCustomData(); } } public function loadShows() { $loop = new WP_Query(array( ‘post_type’ => ‘show’, ‘post_parent’ => ‘0’,…Continue reading
/** * Allow SVG uploads for administrator users. * * @param array $upload_mimes Allowed mime types. * * @return mixed */ add_filter( ‘upload_mimes’, function ( $upload_mimes ) { // By default, only administrator users are allowed to add SVGs. //…Continue reading
/** * ERC Utilities * */ function get_Cid($s_id, $user_id, $insert = null) { if (!$s_id || !$user_id) return null; $user = new WP_User($user_id); // if (!in_array(‘client’, $user->roles)) return null; $show = get_city($s_id) . ‘ ‘ . get_year($s_id); $loop = new…Continue reading
/** * ERC Utilities * */ function get_Cid($s_id, $user_id, $insert = null) { if (!$s_id || !$user_id) return null; $user = new WP_User($user_id); // if (!in_array(‘client’, $user->roles)) return null; $show = get_city($s_id) . ‘ ‘ . get_year($s_id); $loop = new…Continue reading
add_filter( ‘aioseo_report_summary_enable’, ‘__return_false’ );Continue reading
add_filter( ‘aioseo_toc_hash_prefix’, function( $prefix ) { return ”; } );Continue reading