<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>WP e-Commerce Plugin Documentation &#187; Settings</title>
	<atom:link href="http://docs.getshopped.org/category/developer-documentation/api/settings/feed/" rel="self" type="application/rss+xml" />
	<link>http://docs.getshopped.org</link>
	<description>The documentation website for the WP e-Commerce Plugin</description>
	<lastBuildDate>Tue, 07 May 2013 06:41:52 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Settings Page API</title>
		<link>http://docs.getshopped.org/documentation/settings-page-api/</link>
		<comments>http://docs.getshopped.org/documentation/settings-page-api/#comments</comments>
		<pubDate>Thu, 15 Dec 2011 01:57:11 +0000</pubDate>
		<dc:creator>gary</dc:creator>
				<category><![CDATA[Settings]]></category>

		<guid isPermaLink="false">http://docs.getshopped.org/?post_type=documentation&#038;p=2842</guid>
		<description><![CDATA[WP e-Commerce Settings Page API. Third-party plugin / theme developers can add their own tabs to WPEC store settings page. Let&#8217;s say you want to create a tab for your plugin called &#8220;Recommendation System&#8221;, for example. You first need to register the tab ID and title like this: [php] function my_plugin_settings_tabs( $settings_page ) { $settings_page-&#62;register_tab( [...]]]></description>
				<content:encoded><![CDATA[<p>WP e-Commerce Settings Page API.</p>
<p>Third-party plugin / theme developers can add their own tabs to WPEC store settings page.</p>
<p><span id="more-2842"></span></p>
<p>Let&#8217;s say you want to create a tab for your plugin called &#8220;Recommendation System&#8221;, for example. You first need to register the tab ID and title like this:</p>
<p>[php]<br />
 function my_plugin_settings_tabs( $settings_page ) {<br />
     $settings_page-&gt;register_tab( &#8216;recommendation_system&#8217;, &#8216;Recommendation System&#8217; );<br />
 }<br />
 add_action( &#8216;wpsc_load_settings_tab_class&#8217;, &#8216;my_plugin_settings_tabs&#8217;, 10, 1 );<br />
[/php]</p>
<p>Note that you need to hook into <code>wpsc_load_settings_tab_class</code> to do this.</p>
<p>The next step is to create a class for your tab which inherits from the base <code>WPSC_Settings_Tab</code>. The name of the class needs to follow this convention: all the words have to be capitalized and separated with an underscore, and prefixed with <code>WPSC_Settings_Tab_</code>.</p>
<p>In our example, because we registered our tab ID as <code>recommendation_system</code>, the class name should be <code>WPSC_Settings_Tab_Recommendation_System</code>.</p>
<p>[php]<br />
 class WPSC_Settings_Tab_Recommendation_System extends WPSC_Settings_Tab<br />
 {<br />
     public function display() {<br />
         echo &#8216;&lt;h3&gt;Recommendation System Settings&lt;/h3&gt;&#8217;;<br />
         // output your tab content here<br />
     }<br />
 }<br />
[/php]</p>
<p>All tab has to implement a method <code>display()</code> which outputs the HTML content for the tab. You don&#8217;t need to output the <code>&lt;form&gt;</code> element because it will be done for you.</p>
<p>When outputting your form fields for the tab, name the fields <code>wpsc_options[$your_option_name]</code> so that they will automatically get saved to the database when the user submits the form. E.g.:</p>
<p>[php]<br />
 &lt;input type=&quot;text&quot; value=&quot;something&quot; name=&quot;wpsc_options[some_option]&quot; /&gt;<br />
[/php]</p>
<p>If you need to handle the form submission yourself, create a method in your tab class called <code>callback_submit_options()</code>. Then process your submitted fields there.</p>
<p>[php]<br />
 class WPSC_Settings_Tab_Recommendation_System extends WPSC_Settings_Tab<br />
 {<br />
     // &#8230;<br />
     public function callback_submit_options() {<br />
         if ( isset( $_POST['my_option'] ) )<br />
             update_option( &#8216;my_option&#8217;, $_POST['my_option'] );<br />
     }<br />
     // &#8230;<br />
 }<br />
[/php]</p>
]]></content:encoded>
			<wfw:commentRss>http://docs.getshopped.org/documentation/settings-page-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
