latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

New settings – display, but won't save

Home Forums Community Forum New settings – display, but won't save

This topic contains 3 replies, has 4 voices. Last updated by  Jason (Lead Developer) 4 years, 9 months ago.

Topic Author Topic
Posted: Tuesday Mar 13th, 2012 at 4:46 pm #8053
Nathan
Username: nathanbriggs

Hey,

I’ve created a new section for the list servers screen. It displays fine, but saving doesn’t work (I’ve checked the network traffic, and the new form fields and their data are being sent with the POST).

Is there something else I need to be doing?

Code: https://gist.github.com/2031438

Hugs,
Nathan

List Of Topic Replies

Viewing 3 replies - 1 through 3 (of 3 total)
Author Replies
Author Replies
Posted: Wednesday Mar 14th, 2012 at 3:36 am #8087

Hi Nathan. Very cool! :)

I don’t know what the problem could be, but I’ll ask Jason in case he knows.

Posted: Wednesday Mar 14th, 2012 at 2:02 pm #8128
Raam Dev
Username: Raam
Staff Member
Awarded Nathan Experienced and Advanced user badges.
Posted: Thursday Mar 15th, 2012 at 6:23 pm #8293
Staff Member

Ni Nathan. Thanks for writing in.

Looking good! You just need to tell s2Member that your new option keys should be saved. You can accomplish this by filtering s2Member’s set of default option key/value pairs. Just set them to a default empty string value is fine.

<?php
add_filter("ws_plugin__s2member_default_options", "my_extra_default_options");
function my_extra_default_options($defaults = array())
	{
		for($n = $GLOBALS&#91;"WS_PLUGIN__"&#93;&#91;"s2member"&#93;&#91;"c"&#93;&#91;"levels"&#93;; $n >= 0; $n--)
			{
				$defaults["level".$n."_ncb_getresponse_list_ids"] = "";
			}
		return /* Return with extra default option keys. */ $defaults;
	}
?>
Viewing 3 replies - 1 through 3 (of 3 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.