bp_core_install_network_search()

Create function for network search component.

Description

Source

File: bp-core/admin/bp-core-admin-schema.php

function bp_core_install_network_search() {
	global $wpdb;
	$bp_prefix = bp_core_get_table_prefix();

	$wpdb->query("DROP FUNCTION IF EXISTS `{$bp_prefix}bp_strip_tags`;");
	$wpdb->query( "
	CREATE FUNCTION `{$bp_prefix}bp_strip_tags`(str text) RETURNS text CHARSET utf8
BEGIN
    DECLARE start, end INT DEFAULT 1;
    LOOP
        SET str = COALESCE(str, '');
        SET start = LOCATE(\"<\", str, start);
        IF (!start) THEN RETURN str; END IF;
        SET end = LOCATE(\">\", str, start);
        IF (!end) THEN SET end = start; END IF;
        SET str = INSERT(str, start, end - start + 1, \"\");
    END LOOP;
END;" );

}

Changelog

Changelog
Version Description
BuddyBoss 1.0.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.