Skip to content

Instantly share code, notes, and snippets.

View pattonwebz's full-sized avatar
🏠
Working from home

William Patton pattonwebz

🏠
Working from home
View GitHub Profile
@pattonwebz
pattonwebz / disable_core_search.php
Created December 5, 2022 20:28
Disable core search query handling
<?php
function disable_core_search_query_handling($query, $error = true) {
if (is_search() && !is_admin()) {
$query->is_search = false;
$query->query_vars['s'] = false;
$query->query['s'] = false;
// to error
@pattonwebz
pattonwebz / filter_cookie.php
Last active May 1, 2024 20:58
Filters the cookies being set by affwp and updates them when it's a matching ID to use a 30 day expiry.