Here is a little tidbit that has helped me when programming WordPress plugins.


Use a single setting…
Example

<?php

$options = get_option( 'pluginShortNameSettings' );

echo $options['settingA'];
echo $options['settingB'];
echo $options['settingC'];
echo $options['settingD'];
?>

This simplifies the code necessary to load all the settings for your plugin - it reduces it to a single line.

Further, when coding plugins, I separate the code for displaying the options form from the code required to save the new settings.

<?php
function pluginNameSaveOptions()
{
  $options = get_option( 'pluginShortNameSettings' );
  $options['settingA'] = stripslashes( $_POST['settingA'] );
  $options['settingB'] = stripslashes( $_POST['settingB'] );
  $options['settingC'] = stripslashes( $_POST['settingC'] );
  $options['settingD'] = stripslashes( $_POST['settingD'] );
  update_option( 'pluginShortNameSettings', $options );

}

function pluginNameOptionsForm()
{
  pluginNameSaveOptions();
  $options = get_option( 'pluginShortNameSettings' );
  // form xhtml here
}

?>

This is the form that is working very well these days.


Older Posts:
quick solution to vexing http post problem
"Googling Phrase I'm Posting Php Code Form Using Http Post Forbidden Here Solution Simple .htaccess File Folder Script Single Line It. SecFilterInheritance"

bumptop - new windows desktop interface
"Full Blown Desktop Replacement Installed Machine. Check Out."
Newer Posts:wordpress plugin activation code
"Support Question WordPress Codex I'm Posting Here Future Reference. However Pattern Pattern Use Needing Activate Function Plugin. $activateFunction 'activateMyPlugin' Change"

printing from windows vista to windows xp
"Laptop Running Windows Vista. Wanted Print HP LaserJet 4L Connected Desktop Running Windows XP. Problem Kept Getting Access Denied Error. Keep Reading Work This. Ended Several Tutorials Different Approaches"

Something to say?