Advertisement
miriamdepaula

WordPress: Settings Page

Jun 20th, 2012
6,530
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.66 KB | None | 0 0
  1. <div id="poststuff">
  2.   <form method="post" action="<?php admin_url( 'themes.php?page=theme-settings' ); ?>">
  3.       <?php
  4.      wp_nonce_field( "wptester-settings-page" );
  5.  
  6.      if ( $pagenow == 'themes.php' && $_GET['page'] == 'theme-settings' ){
  7.  
  8.          if ( isset ( $_GET['tab'] ) ) $tab = $_GET['tab'];
  9.          else $tab = 'homepage';
  10.  
  11.          echo '<table class="form-table">';
  12.           switch ( $tab ){
  13.               case 'general' :
  14.                   ?>
  15.                   <tr>
  16.                       <th><label for="wptester_tag_class">Tags with CSS classes:</label></th>
  17.                       <td>
  18.                           <input id="wptester_tag_class" name="wptester_tag_class" type="checkbox" <?php if ( $settings["wptester_tag_class"] ) echo 'checked="checked"'; ?> value="true" />
  19.                           <span class="description">Output each post tag with a specific CSS class using its slug.</span>
  20.                       </td>
  21.                   </tr>
  22.  
  23.                   <?php
  24.              break;
  25.              case 'footer' :
  26.                  ?>
  27.  
  28.                   <tr>
  29.                       <th><label for="wptester_ga">Insert tracking code:</label></th>
  30.                       <td>
  31.                           <textarea id="wptester_ga" name="wptester_ga" cols="60" rows="5"><?php echo esc_html( stripslashes( $settings["wptester_ga"] ) ); ?></textarea><br/>
  32.                           <span class="description">Enter your Google Analytics tracking code:</span>
  33.                       </td>
  34.                   </tr>
  35.  
  36.                   <?php
  37.              break;
  38.              case 'homepage' :
  39.                  ?>
  40.  
  41.                   <tr>
  42.                       <th><label for="wptester_intro">Introduction</label></th>
  43.                       <td>
  44.                           <textarea id="wptester_intro" name="wptester_intro" cols="60" rows="5" ><?php echo esc_html( stripslashes( $settings["wptester_intro"] ) ); ?></textarea><br/>
  45.                           <span class="description">Enter the introductory text for the home page:</span>
  46.                       </td>
  47.                   </tr>
  48.  
  49.                   <?php
  50.              break;
  51.          }
  52.          echo '</table>';
  53.       }
  54.       ?>
  55.  
  56.       <p class="submit" style="clear: both;">
  57.           <input type="submit" name="Submit"  class="button-primary" value="Update Settings" />
  58.           <input type="hidden" name="wptester-settings-submit" value="Y" />
  59.       </p>
  60.   </form>
  61.  
  62.   <p><?php echo $theme_data['Name'] ?> theme by <a href="http://wpmidia.com.br/">wpmidia</a> | <a href="http://twitter.com/wpmidia">Follow me on Twitter</a>! | Join <a href="http://facebook.com/wpmidia.lab">wpmidia on Facebook</a>!</p>
  63.  
  64. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement