Posts

Showing posts with the label Integrating

Integrating WordPress Into PHP Scripts

Overview Today, I had to use a custom PHP script that I created a while ago in a new WordPress application. Instead of developing a WordPress plugin to handle this existing code, I choose instead to use WordPress directly inside my script. Using WordPress inside your script is a great option if you have a lot of custom PHP code. When you have a large PHP code base from your previous development efforts. There are typically other libraries inside your code, such as Symfony, Zend Framework, Pear, etc, that you don’t want to take apart. You have working code and you want it to stay together. In my case, I had created a form for data collection for a client. But this was no ordinary form. It had over 100 form variables. They were made up of text input, radio boxes, checkboxes, and textarea’s. I wanted to use this form directly inside my WordPress application. Plus I wanted the integration to easy. The solution was actually quite simple. Existing PHP Code For example, assume this...