Quantcast
Channel: Topic Tag: plugin | WordPress.org
Viewing all articles
Browse latest Browse all 26892

Jo Biesta on "Submit button not saving settings"

$
0
0

Have a look how other plugin authors generate admin pages, personally i'm not too familiar with the way you have done things, therefore i can't say what could be causing the settings to not save properly.

I myself just have another php file for the settings page which is just like a form, it updates the options using update_option and gets the options using get_option.

This may be a simpler way of doing it if you're not too familiar with the wordpress codex.

You can add the admin page as follows ( this is a sample from one of my plugins)

function callback_settings() {
	include('callback_settings.php');
}
function callback_admin_actions() {
	add_menu_page("Callback Request", "Callback Request", 1, "Callback Request", "callback_settings");
}
add_action('admin_menu', 'callback_admin_actions');

As you can see this just includes the callback_settings page as an administration page.

In terms of outputting the options on a page itself you can just use what you've put above using esc_attr( get_option('optionname'));.

Hopefully that will help a bit!

Jo


Viewing all articles
Browse latest Browse all 26892

Trending Articles