Documentation

OnSearchGetTag

string
handler function(
string tag
);

"OnSearchGetTag" event is called when parsing the tag string from the Tags_prepare function.

Parameters

Parameter Description
tag Tag.

Returned value

Handler function can filter invalid symbols or tag values. And it must return the value even if the formatting was not applied.

See Also

  • Tags_prepare
  • Example of handler function:

    <?
    //init.php

    // register the "OnSearchGetTag" handler function of the "search" module
    AddEventHandler("search", "OnSearchGetTag", array("CMyClass", "OnSearchGetTag"));

    class CMyClass
    {
    function OnSearchGetTag($tag)
    {
    static $stop = array(
    "AX" => true,
    "FU" => true,
    );
    $tag = ToUpper($tag);
    if(array_key_exists($tag, $stop))
    return "";
    else
    return $tag;
    }
    }

    ?>


    © «Bitrix24», 2001-2022
    Up