You should look for where this function is being called. Not the function itself.
It's easier and cleaner if you wrap the hook, instead of wrapping all that code.
If you're using Notepad++ to edit your code, Press Ctrl+F to open Text Finder
Paste the following code:
$this->a_selection($a_item);
Hit find this parameter button and make the changes