Skip to content

Instantly share code, notes, and snippets.

View davidryal's full-sized avatar

David Anderson davidryal

View GitHub Profile
@ideadude
ideadude / wordpress_colon_searches.php
Last active January 23, 2024 02:58
If a colon is in a user search query in the WP Users dashboard or the PMPro Members List, try to speed up the query.
<?php
/**
* Functions affecting admins and the admin dashboard.
*/
/**
* Return array of fields found in the wp_users table.
* This function used in the others below to determine if a key entered in a search like "email:address@domain.com"
* is referencing the user_email column of the wp_users table or a unique meta key.
*/
function my_pmpro_get_user_table_columns() {
@sbrajesh
sbrajesh / hide-subscribers.php
Last active May 22, 2024 11:37
Hide Subscriber Users from BuddyPress member Directory
<?php
/**
* Excludes users from BuddyPress Members list.
*
* @param string $qs Query string.
* @param string $object object loop identikfier.
*
* @return string
*/
function bpdev_exclude_users( $qs = false, $object = false ) {