Code Samples

Simple upload field for WordPress plugins/themes

With this you can upload images through your plugin/theme. They are saved as attachments. Please add nonce fields for security reasons. more

Log in a WordPress user programmatically

With this snippet you can log in a WordPress user automatically. more

Preserve options when using multiple pages and the settings api

See my previous paste for the whole class (minus this) more

WordPress plugin/theme options page

I use helper methods/functions in my themes and plugins to create the input fields, this was simplified for the example here. more

WordPress pagination

Automatically tag and categorize WordPress posts on save

The function should probably check if the post already has the tag/category before adding it a second time. I should probably look into the wp_is_post_revision() part again as well. more