Creating Options Pages

Creating options

First of all please check the screenshot, it is what we are going to create creating options this tutorial: 1. Create an Admin Page The first step for us is to decide where exactly in admin menu we are going to create an option page. The good news — you can create it anywhere, whether it is in the Settings section, Dashboard section or a new custom section with an icon. Create a custom options page Creating a new menu item with an icon is cool but the truth is when you create a plugin settings page, it is always better to add it as a submenu page under Settings.

Creating custom options panels in WordPress is relatively easy. How exchanges make money, to create the menu item and the new page, see Adding Administration Menus.

creating options

So long as you stick to this structure, WordPress will handle all of the option creation, update, saving, and redirection for you. It will check permissions, and do all that other magic behind the scenes.

creating options

Several new functions were added in WordPress 2. These new functions are optional in WordPress 2.

creating options

They are required for WordPress MU 2. Creating options Migrating Plugins and Themes to 2. This article only covers the markup of the Settings page itself.

Creating Income with Options

For more information regarding how to add the Settings page, refer to Administration Menus Where to Save the Code You can either put the code for your options page in your plugin php file or, for Themes, in functions. Closing Tags Then obviously close the form tag after your other options, creating options if you like, include another "Update Options" button, this is the WordPress default.

To save these properties to and restore them from a settings file, follow these steps, and then see Create a settings category.

They can also name a sanitize callback function as a security measure to check each option's value. View Otto's tutorial here for better examples of workable code. In addition, there's another article available by ozh. To add icon to for your options page use the following code [this will work on version 3. Much simpler and simply works.

creating options

This is an updated version of Otto's tutorial. Otherwise WordPress does not know which setting it is suppose to update and it will fail to update.

creating options

To solve it, use the solution in this WordPress Answers postor alternatively the one in this blog post. External Resources.

creating options