BP_Groups_Group::strip_leading_and( string $s )

Strips the leading AND and any surrounding whitespace from a string.

Description

Used here to normalize SQL fragments generated by WP_Meta_Query and other utility classes.

Parameters

$s

(string) (Required) String.

Return

(string)

Source

File: bp-groups/classes/class-bp-groups-group.php

	protected static function strip_leading_and( $s ) {
		return preg_replace( '/^\s*AND\s*/', '', $s );
	}

Changelog

Changelog
Version Description
BuddyPress 2.7.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.