title: HTML Not Allowed in WordPress PHP Hack
body: <p>I'm now in charge of our church's website that is based on WordPress. I'm trying to figure out these adjustments to the Theme Options.</p>
  
  <p>Basically, HTML is allowed in “Welcome Message” and “Footer,” but if I use it anywhere else it works, until you update again in which case it breaks and the HTML is stripped out. I'd like to figure out how to allow HTML in Event descriptions as well, so that I can place links and not have them stopped out after updating something else in the options.</p>
  
  <p>I'm looking for a little help to understand this PHP file and figure out what is allowing the HTML in one place and not in another.</p>
  
  <p>Theme Options (controls the WordPress Admin Panel where text is added):</p>
  
  <pre><code>&lt;?php
  
  add_action('init','of_options');
  
  if (!function_exists('of_options')) {
  function of_options(){
  
  // VARIABLES
  $themename = get_theme_data(STYLESHEETPATH . '/style.css');
  $themename = $themename['Name'];
  $shortname = "fumco";
  
  // Populate OptionsFramework option in array for use in theme
  global $of_options;
  $of_options = get_option('of_options');
  
  $GLOBALS['template_path'] = get_bloginfo('stylesheet_directory');
  
  //Access the WordPress Categories via an Array
  $of_categories = array();  
  $of_categories_obj = get_categories('hide_empty=0');
  foreach ($of_categories_obj as $of_cat) {
      $of_categories[$of_cat-&gt;cat_ID] = $of_cat-&gt;cat_name;}
  $categories_tmp = array_unshift($of_categories, "Select a category:");    
  
  //Access the WordPress Pages via an Array
  $of_pages = array();
  $of_pages_obj = get_pages('sort_column=post_parent,menu_order');    
  foreach ($of_pages_obj as $of_page) {
      $of_pages[$of_page-&gt;ID] = $of_page-&gt;post_name; }
  $of_pages_tmp = array_unshift($of_pages, "Select a page:");       
  
  // Image Alignment radio box
  $options_thumb_align = array("alignleft" =&gt; "Left","alignright" =&gt; "Right","aligncenter" =&gt; "Center"); 
  
  // Image Links to Options
  $options_image_link_to = array("image" =&gt; "The Image","post" =&gt; "The Post"); 
  
  //Testing 
  $options_select = array("one","two","three","four","five"); 
  $options_radio = array("one" =&gt; "One","two" =&gt; "Two","three" =&gt; "Three","four" =&gt; "Four","five" =&gt; "Five"); 
  
  //Stylesheets Reader
  $alt_stylesheet_path = STYLESHEETPATH . '/styles/';
  $alt_stylesheets = array();
  
  if ( is_dir($alt_stylesheet_path) ) {
      if ($alt_stylesheet_dir = opendir($alt_stylesheet_path) ) { 
          while ( ($alt_stylesheet_file = readdir($alt_stylesheet_dir)) !== false ) {
              if(stristr($alt_stylesheet_file, ".css") !== false) {
                  $alt_stylesheets[] = $alt_stylesheet_file;
              }
          }    
      }
  }
  
  //More Options
  $uploads_arr = wp_upload_dir();
  $all_uploads_path = $uploads_arr['path'];
  $all_uploads = get_option('of_uploads');
  $other_entries = array("Select a number:","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19");
  $body_repeat = array("no-repeat","repeat-x","repeat-y","repeat");
  $body_pos = array("top left","top center","top right","center left","center center","center right","bottom left","bottom center","bottom right");
  
  // Set the Options Array
  $options = array();
  
  
  /* Home page banners set (upto 4 banners with alt, link and target url) */
  $options[] = array( "name" =&gt; "Home Banners",
                      "type" =&gt; "heading");
  
  $options[] = array( "name" =&gt; "Banner Image #1",
                                          "desc" =&gt; "Upload the banner image. Banner size should be 980x325 pixels. Leave blank if not required.",
                                          "id" =&gt; $shortname."_banner01",
                                          "type" =&gt; "upload");
  $options[] = array( "name" =&gt; "Alternative Text",
                      "desc" =&gt; "Provide alternative text for the banner image. Leave blank if not required.",
                      "id" =&gt; $shortname."_banner01_alt",
                      "type" =&gt; "text");
  $options[] = array( "name" =&gt; "Link on Banner",
                      "desc" =&gt; "Provide hyperlink url if required.",
                      "id" =&gt; $shortname."_banner01_href",
                      "type" =&gt; "text");
  $options[] = array( "name" =&gt; "Link Target",
                      "desc" =&gt; "Open link in new window",
                      "id" =&gt; $shortname."_banner01_target",
                      "type" =&gt; "checkbox");
  
  $options[] = array( "name" =&gt; "Banner Image #2",
                                          "desc" =&gt; "Upload the banner image. Banner size should be 980x325 pixels. Leave blank if not required.",
                                          "id" =&gt; $shortname."_banner02",
                                          "type" =&gt; "upload");
  $options[] = array( "name" =&gt; "Alternative Text",
                      "desc" =&gt; "Provide alternative text for the banner image. Leave blank if not required.",
                      "id" =&gt; $shortname."_banner02_alt",
                      "type" =&gt; "text");
  $options[] = array( "name" =&gt; "Link on Banner",
                      "desc" =&gt; "Provide hyperlink url if required.",
                      "id" =&gt; $shortname."_banner02_href",
                      "type" =&gt; "text");
  $options[] = array( "name" =&gt; "Link Target",
                      "desc" =&gt; "Open link in new window",
                      "id" =&gt; $shortname."_banner02_target",
                      "type" =&gt; "checkbox");
  
  $options[] = array( "name" =&gt; "Banner Image #3",
                                          "desc" =&gt; "Upload the banner image. Banner size should be 980x325 pixels. Leave blank if not required.",
                                          "id" =&gt; $shortname."_banner03",
                                          "type" =&gt; "upload");
  $options[] = array( "name" =&gt; "Alternative Text",
                      "desc" =&gt; "Provide alternative text for the banner image. Leave blank if not required.",
                      "id" =&gt; $shortname."_banner03_alt",
                      "type" =&gt; "text");
  $options[] = array( "name" =&gt; "Link on Banner",
                      "desc" =&gt; "Provide hyperlink url if required.",
                      "id" =&gt; $shortname."_banner03_href",
                      "type" =&gt; "text");
  $options[] = array( "name" =&gt; "Link Target",
                      "desc" =&gt; "Open link in new window",
                      "id" =&gt; $shortname."_banner03_target",
                      "type" =&gt; "checkbox");
  
  $options[] = array( "name" =&gt; "Banner Image #4",
                                          "desc" =&gt; "Upload the banner image. Banner size should be 980x325 pixels. Leave blank if not required.",
                                          "id" =&gt; $shortname."_banner04",
                                          "type" =&gt; "upload");
  $options[] = array( "name" =&gt; "Alternative Text",
                      "desc" =&gt; "Provide alternative text for the banner image. Leave blank if not required.",
                      "id" =&gt; $shortname."_banner04_alt",
                      "type" =&gt; "text");
  $options[] = array( "name" =&gt; "Link on Banner",
                      "desc" =&gt; "Provide hyperlink url if required.",
                      "id" =&gt; $shortname."_banner04_href",
                      "type" =&gt; "text");
  $options[] = array( "name" =&gt; "Link Target",
                      "desc" =&gt; "Open link in new window",
                      "id" =&gt; $shortname."_banner04_target",
                      "type" =&gt; "checkbox");
  
  
  /* Welcome Message */
  $options[] = array( "name" =&gt; "Welcome Message",
                      "type" =&gt; "heading");                                       
  $options[] = array( "name" =&gt; "Title",
                                          "desc" =&gt; "Enter Title for the welcome text. Use '&amp;lt;span&amp;gt;...&amp;lt;/span&amp;gt; tags for highlight in red.",
                                          "id" =&gt; $shortname."_welcome_title",
                                          "std" =&gt; "&lt;span&gt;Welcome&lt;/span&gt; to First United Methodist Chuch of Orlando.",
                                          "type" =&gt; "text"); 
  $options[] = array( "name" =&gt; "Message",
                      "desc" =&gt; "Enter welcome message. You allowed to use HTML tags to style the message.",
                      "id" =&gt; $shortname."_welcome_message",
                      "std" =&gt; "Come worship and connect with us. We pray that you have a rejuvenating experience. Know that we welcome all seekers of Christ, recognizing that all individuals are unique creations of God. We welcome you &amp;ndash; just as you are. &lt;br /&gt;Here, there is a place for everyone.&lt;br /&gt;&amp;ldquo;Come and you will see.&amp;rdquo; - John 1:39",
                      "type" =&gt; "textarea");
  
  
  /* Worship Time - Add upto 3 worship times */
  $options[] = array( "name" =&gt; "Worship Times",
                      "type" =&gt; "heading");
  
  $options[] = array( "name" =&gt; "Worship Times #1",
                                          "desc" =&gt; "Enter title for worship time.",
                                          "id" =&gt; $shortname."_worship01_title",
                                          "type" =&gt; "text"); 
  $options[] = array( "name" =&gt; "Date and Time",
                                          "desc" =&gt; "Enter worship date and time here. It will displayed in same manner as you write here.",
                                          "id" =&gt; $shortname."_worship01_time",
                                          "type" =&gt; "text");          
  $options[] = array( "name" =&gt; "Description",
                                          "desc" =&gt; "Enter 2-3 line description for the Worship.",
                                          "id" =&gt; $shortname."_worship01_text",
                                          "type" =&gt; "text");
  
  $options[] = array( "name" =&gt; "Worship Times #2",
                                          "desc" =&gt; "Enter title for worship time.",
                                          "id" =&gt; $shortname."_worship02_title",
                                          "type" =&gt; "text");
  $options[] = array( "name" =&gt; "Date and Time",
                                          "desc" =&gt; "Enter worship date and time here. It will displayed in same manner as you write here.",
                                          "id" =&gt; $shortname."_worship02_time",
                                          "type" =&gt; "text");
  $options[] = array( "name" =&gt; "Description",
                                          "desc" =&gt; "Enter 2-3 line description for the Worship.",
                                          "id" =&gt; $shortname."_worship02_text",
                                          "type" =&gt; "text");
  
  $options[] = array( "name" =&gt; "Worship Times #3",
                                          "desc" =&gt; "Enter title for worship time.",
                                          "id" =&gt; $shortname."_worship03_title",
                                          "type" =&gt; "text");
  $options[] = array( "name" =&gt; "Date and Time",
                                          "desc" =&gt; "Enter worship date and time here. It will displayed in same manner as you write here.",
                                          "id" =&gt; $shortname."_worship03_time",
                                          "type" =&gt; "text");
  $options[] = array( "name" =&gt; "Description",
                                          "desc" =&gt; "Enter 2-3 line description for the Worship.",
                                          "id" =&gt; $shortname."_worship03_text",
                                          "type" =&gt; "text");
  
  
  /* Upcoming Events - Add upto 3 events */
  $options[] = array( "name" =&gt; "Upcoming Events",
                      "type" =&gt; "heading");
  
  $options[] = array( "name" =&gt; "Event #1",
                                          "desc" =&gt; "Enter title for events.",
                                          "id" =&gt; $shortname."_event01_title",
                                          "type" =&gt; "text");
  $options[] = array( "name" =&gt; "Sub Heading",
                                          "desc" =&gt; "Enter sub heading for the event.",
                                          "id" =&gt; $shortname."_event01_subheading",
                                          "std" =&gt; "",
                                          "type" =&gt; "text");
  $options[] = array( "name" =&gt; "Description",
                                          "desc" =&gt; "Enter 2-3 line description for the Event.",
                                          "id" =&gt; $shortname."_event01_text",
                                          "type" =&gt; "text");
  $options[] = array( "name" =&gt; "Event #2",
                                          "desc" =&gt; "Enter title for events.",
                                          "id" =&gt; $shortname."_event02_title",
                                          "type" =&gt; "text");
  $options[] = array( "name" =&gt; "Sub Heading",
                                          "desc" =&gt; "Enter sub heading for the event.",
                                          "id" =&gt; $shortname."_event02_subheading",
                                          "std" =&gt; "",
                                          "type" =&gt; "text");
  $options[] = array( "name" =&gt; "Description",
                                          "desc" =&gt; "Enter 2-3 line description for the Event.",
                                          "id" =&gt; $shortname."_event02_text",
                                          "type" =&gt; "text");
  $options[] = array( "name" =&gt; "Event #3",
                                          "desc" =&gt; "Enter title for events.",
                                          "id" =&gt; $shortname."_event03_title",
                                          "type" =&gt; "text");
  $options[] = array( "name" =&gt; "Sub Heading",
                                          "desc" =&gt; "Enter sub heading for the event.",
                                          "id" =&gt; $shortname."_event03_subheading",
                                          "std" =&gt; "",
                                          "type" =&gt; "text");
  $options[] = array( "name" =&gt; "Description",
                                          "desc" =&gt; "Enter 2-3 line description for the Event.",
                                          "id" =&gt; $shortname."_event03_text",
                                          "type" =&gt; "text");
  
  $options[] = array( "name" =&gt; "Event #4",
                                          "desc" =&gt; "Enter title for events.",
                                          "id" =&gt; $shortname."_event04_title",
                                          "type" =&gt; "text");
  $options[] = array( "name" =&gt; "Sub Heading",
                                          "desc" =&gt; "Enter sub heading for the event.",
                                          "id" =&gt; $shortname."_event04_subheading",
                                          "std" =&gt; "",
                                          "type" =&gt; "text");
  $options[] = array( "name" =&gt; "Description",
                                          "desc" =&gt; "Enter 2-3 line description for the Event.",
                                          "id" =&gt; $shortname."_event04_text",
                                          "type" =&gt; "text");
  $options[] = array( "name" =&gt; "Event #5",
                                          "desc" =&gt; "Enter title for events.",
                                          "id" =&gt; $shortname."_event05_title",
                                          "type" =&gt; "text");
  $options[] = array( "name" =&gt; "Sub Heading",
                                          "desc" =&gt; "Enter sub heading for the event.",
                                          "id" =&gt; $shortname."_event05_subheading",
                                          "std" =&gt; "",
                                          "type" =&gt; "text");
  $options[] = array( "name" =&gt; "Description",
                                          "desc" =&gt; "Enter 2-3 line description for the Event.",
                                          "id" =&gt; $shortname."_event05_text",
                                          "type" =&gt; "text");
  
  
  /* Advertisement / Campaign Banners (displayed on home page and sidebar) */
  $options[] = array( "name" =&gt; "Campaign Banners",
                      "type" =&gt; "heading");
  
  $options[] = array( "name" =&gt; "Campaign Image #1",
                                          "desc" =&gt; "Upload the campaign banner image for the home page. Banner size should be 494x168 pixels.",
                                          "id" =&gt; $shortname."_campaign01_image",
                                          "type" =&gt; "upload");
  $options[] = array( "name" =&gt; "Campaign Sidebar Image",
                                          "desc" =&gt; "Upload the campaign banner image for the sidebar. Banner size should be 307x86 pixels.",
                                          "id" =&gt; $shortname."_campaign01_small",
                                          "type" =&gt; "upload");
  $options[] = array( "name" =&gt; "Alternative Text",
                      "desc" =&gt; "Provide alternative text for the campaign image. Leave blank if not required.",
                      "id" =&gt; $shortname."_campaign01_alt",
                      "type" =&gt; "text");
  $options[] = array( "name" =&gt; "Link on Campaign",
                      "desc" =&gt; "Provide hyperlink url if required.",
                      "id" =&gt; $shortname."_campaign01_href",
                      "type" =&gt; "text");
  $options[] = array( "name" =&gt; "Link Target",
                      "desc" =&gt; "Open link in new window",
                      "id" =&gt; $shortname."_campaign01_target",
                      "type" =&gt; "checkbox");
  
  $options[] = array( "name" =&gt; "Campaign Image #2",
                                          "desc" =&gt; "Upload the campaign banner image for the home page. Banner size should be 494x168 pixels.",
                                          "id" =&gt; $shortname."_campaign02_image",
                                          "type" =&gt; "upload");
  $options[] = array( "name" =&gt; "Campaign Sidebar Image",
                                          "desc" =&gt; "Upload the campaign banner image for the sidebar. Banner size should be 307x86 pixels.",
                                          "id" =&gt; $shortname."_campaign02_small",
                                          "type" =&gt; "upload");
  $options[] = array( "name" =&gt; "Alternative Text",
                      "desc" =&gt; "Provide alternative text for the campaign image. Leave blank if not required.",
                      "id" =&gt; $shortname."_campaign02_alt",
                      "type" =&gt; "text");
  $options[] = array( "name" =&gt; "Link on Campaign",
                      "desc" =&gt; "Provide hyperlink url if required.",
                      "id" =&gt; $shortname."_campaign02_href",
                      "type" =&gt; "text");
  $options[] = array( "name" =&gt; "Link Target",
                      "desc" =&gt; "Open link in new window",
                      "id" =&gt; $shortname."_campaign02_target",
                      "type" =&gt; "checkbox");
  
  
  /* Footer address and copyright statement */
  $options[] = array( "name" =&gt; "Footer Text",
                      "type" =&gt; "heading");   
  $options[] = array( "name" =&gt; "Address",
                                          "desc" =&gt; "Enter address which will be displayed in footer. Use HTML tags to format the text.",
                                          "id" =&gt; $shortname."_footer_address",
                                          "std" =&gt; "&lt;strong&gt;First United Methodist Church of Orlando&lt;/strong&gt;&lt;br /&gt;142 East Jackson Street, Orlando, FL 32801&lt;br /&gt;Telephone 407.849.6080 &lt;br /&gt;Email: &lt;a href='mailto:Contact@FirstChurchOrlando.org'&gt;Contact@FirstChurchOrlando.org&lt;/a&gt;",
                                          "type" =&gt; "textarea");
  $options[] = array( "name" =&gt; "Copyright Text",
                                          "desc" =&gt; "Enter copyright text here..",
                                          "id" =&gt; $shortname."_footer_copyright",
                                          "std" =&gt; "&amp;copy;Copyright2011. First United Methodist Church of Orlando, All right reserved",
                                          "type" =&gt; "textarea");
  
  update_option('of_template',$options);                    
  update_option('of_themename',$themename);   
  update_option('of_shortname',$shortname);
  
  }
  }
  ?&gt;
  </code></pre>
  
  <p>The HTML inserted DOES NOT work when inserted into the template here:</p>
  
  <pre><code>    &lt;ul&gt;&lt;?php
  for ($i=1; $i&lt;=5; $i++) {
    if (get_option('fumco_event0'.$i.'_title')== '') {
      // Do nothing
    } else {
  
      if (get_option('fumco_event0'.$i.'_title')) {
        echo '&lt;li&gt;';
        echo '&lt;h3&gt;'.get_option('fumco_event0'.$i.'_title').'&lt;/h3&gt;';
        echo '&lt;span class="event-datetime"&gt;';
        if (get_option('fumco_event0'.$i.'_subheading')) {
          echo get_option('fumco_event0'.$i.'_subheading');
        }
        echo '&lt;/span&gt;';
        if (get_option('fumco_event0'.$i.'_text')) {
          echo '&lt;p&gt;'.get_option('fumco_event0'.$i.'_text').'&lt;/p&gt;';
        }
        echo '&lt;/li&gt;';
      }
    }
  }
  ?&gt;&lt;/ul&gt;
  </code></pre>
  
  <p>The HTML added DOES work in this spot:</p>
  
  <pre><code>&lt;?php if (get_option('fumco_footer_address')) {
        echo get_option('fumco_footer_address');
      } else {
        echo '&lt;strong&gt;First United Methodist Church of Orlando&lt;/strong&gt;&lt;br /&gt;
              142 East Jackson Street, Orlando, FL 32801&lt;br /&gt;
              Telephone 407.849.6080 &lt;br /&gt;
              Email: &lt;a href="mailto:Contact@FirstChurchOrlando.org"&gt;Contact@FirstChurchOrlando.org&lt;/a&gt;';
      } ?&gt;
  </code></pre>