WordPress API

by Jason on July 5, 2009

Recently I’ve gotten into WordPress plugin development. I’ve created a few plugins for clients that include widgets, settings pages, and hooks into several actions. However, one thing I’ve not yet been able to figure out is how to encrypt settings page options. Has anyone done this?

There are currently a few ways to create settings pages. You can either write out the entire form, or you can create sections and fields using the API. Each option, however, utilizes get_option() to show the current value.

This is fine, however there is no API function (that I’ve found) that runs BEFORE an option is updated. The only function I have right now is update_option_(the_option)(). But, this runs AFTER the update has already happened. So, if I wanted to encrypt those options using server-side encryption, I would enter into an infinite loop since I’d be calling update_option_(the_option)() over and over again.

Has anyone ever encrypted settings page option values before? If so, how do you go about doing it properly?

I’m sure I can hack together a solution that encrypts & decrypts the values using Javascript on the form, but that just seems dirty to me.

I’d be interested to hear if anyone else has had this problem.

5 comments

I’m looking for some help using the wordpress API. I need to create a page that will let a customer fill out a form and from that info create a wordpress page.

I am using custom fields now, and that works, but I have to do the work. I need a way to have a customer input their own information (custom fields will work here as well), and maybe even edit it later.

So I guess it would have to be tied to their userid / password. We could create the page for them, and the let them edit the custom fields or something like that.

Interested in helping?

Austin

by Austin on August 9, 2009 at 1:13 pm. #

Hi Jason,

I saw your Bronto Ruby API post on DZone, but the download is now broken. Do you still have it available? It would totally save me a good amount of time if you did.

Thanx!

by Christian on September 2, 2009 at 7:20 pm. #

Hi Christian,

Yes, that post was a long time ago! I’m sure the Bronto API has changed since I last worked with it, but if they are still rockin’ the wsdl with the authenticated session header then I’m sure it’s still a bear to get connected with Ruby.

Anywho, I’ve gzipped up the old bronto Ruby code.

http://www.jason-palmer.com/bronto.tar.gz

Enjoy!

by Jason on September 2, 2009 at 8:13 pm. #

Thanx dude!!! You rock. I’m going to give it a look. If I make any changes, I’ll send them back to you. They don’t seem to have that many updates so I’m hoping it won’t be a full rewrite.

by Christian on September 4, 2009 at 12:57 pm. #

Hi Jason,

I tried to download the code from here
http://www.jason-palmer.com/bronto.tar.gz
but its showing me 404 error page. Do you still have it available? Can you please share.

Thanks

by Sunny on December 7, 2011 at 2:22 pm. #

Leave your comment

Required.

Required. Not published.

If you have one.