如何将程序集成到Wordpress中

I wrote a program that takes an array of images and forms a lightbox with some nice social bells and whistles. I would like to begin integrating it into WordPress but I have almost no experience developing WordPress other than a hello world plugin. I immagine there is a specific way Wordpress Prefers you do this. I am familiar with some of the wordpress API like $the_post and such.

My question is how can I pull the array of image urls from a WordPress gallery AND how can I add my onlick event to every image overriding whatever default action WordPress places on them?

A plugin is the preferred way to bundle WordPress functionality. You could add a hook that manipulates the output of the image gallery.

If this is not something you plan to share, you may be able to simply use JavaScript to manipulate the DOM and add your own actions/content.