What might I need to be able to get IK handle position and then lock/pin it there?

Hello all,
I was wondering if anyone might be able to help me by possibly pointing me toward where I might find information on how to make a small plugin that would allow me to select an IK handle (or multiple) and then pin the current position into place via hotkey or simply a button. This link is an exact example of what I am trying to accomplish.

I am fairly familiar with Python, so I feel I should be able to piece something together if I have a basic idea of what I need to be doing, I am mostly just looking for possible links to any examples anyone can recommend of what I might be needing to look for or modify in order to accomplish this. I am assuming I would need to, once the handle is selected, capture the current position, store it, then restrict the IK handle to that position, but only restrict that one particular bone/handle so the rest of the body can still move?

Thank you in advance,
-MH