Changeset 15810
- Timestamp:
- 10/14/2010 07:58:06 PM (13 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/template.php
r15802 r15810 2087 2087 } 2088 2088 2089 /** 2090 * Echos a paragraph-wrapped submit button, with provided text and appropriate class 2091 * 2092 * @since 3.1.0 2093 * 2094 * @param string $text The text of the button (defaults to 'Save Changes') 2095 * @param string $type The type of button. One of: primary, secondary, delete 2096 * @param string $name The HTML name of the submit button. Defaults to "submit" 2097 */ 2098 function submit_button( $text = NULL, $type = 'primary', $name = 'submit' ) { 2099 echo get_submit_button( $text, $type, $name ); 2100 } 2101 2102 /** 2103 * Returns a paragraph-wrapped submit button, with provided text and appropriate class 2104 * 2105 * @since 3.1.0 2106 * 2107 * @param string $text The text of the button (defaults to 'Save Changes') 2108 * @param string $type The type of button. One of: primary, secondary, delete 2109 * @param string $name The HTML name of the submit button. Defaults to "submit" 2110 */ 2111 function get_submit_button( $text = NULL, $type = 'primary', $name = 'submit' ) { 2112 switch ( $type ) : 2113 case 'primary' : 2114 case 'secondary' : 2115 $class = 'button-' . $type; 2116 break; 2117 case 'delete' : 2118 $class = 'button-secondary delete'; 2119 break; 2120 default : 2121 $class = $type; // Custom cases can just pass in the classes they want to be used 2122 endswitch; 2123 $text = ( NULL == $text ) ? __( 'Save Changes' ) : $text; 2124 return '<p class="submit"><input type="submit" name="' . esc_attr( $name ) . '" class="' . esc_attr( $class ) . '" value="' . esc_attr( $text ) . '" /></p>'; 2125 } 2126 -
trunk/wp-admin/options-discussion.php
r15448 r15810 241 241 <?php do_settings_sections('discussion'); ?> 242 242 243 <p class="submit"> 244 <input type="submit" name="Submit" class="button-primary" value="<?php esc_attr_e('Save Changes') ?>" /> 245 </p> 243 <?php submit_button(); ?> 246 244 </form> 247 245 </div> -
trunk/wp-admin/options-general.php
r15757 r15810 348 348 <?php do_settings_sections('general'); ?> 349 349 350 <p class="submit"> 351 <input type="submit" name="Submit" class="button-primary" value="<?php esc_attr_e('Save Changes') ?>" /> 352 </p> 350 <?php submit_button(); ?> 353 351 </form> 354 352 -
trunk/wp-admin/options-media.php
r15132 r15810 133 133 <?php do_settings_sections('media'); ?> 134 134 135 <p class="submit"> 136 <input type="submit" name="Submit" class="button-primary" value="<?php esc_attr_e('Save Changes') ?>" /> 137 </p> 135 <?php submit_button(); ?> 138 136 139 137 </form> -
trunk/wp-admin/options-permalink.php
r15279 r15810 222 222 <?php do_settings_sections('permalink'); ?> 223 223 224 <p class="submit"> 225 <input type="submit" name="submit" class="button-primary" value="<?php esc_attr_e('Save Changes') ?>" /> 226 </p> 224 <?php submit_button(); ?> 227 225 </form> 228 226 <?php if ( !is_multisite() ) { ?> -
trunk/wp-admin/options-privacy.php
r15132 r15810 51 51 <?php do_settings_sections('privacy'); ?> 52 52 53 <p class="submit"> 54 <input type="submit" name="Submit" class="button-primary" value="<?php esc_attr_e('Save Changes') ?>" /> 55 </p> 53 <?php submit_button(); ?> 56 54 </form> 57 55 -
trunk/wp-admin/options-reading.php
r15227 r15810 95 95 <?php do_settings_sections( 'reading' ); ?> 96 96 97 <p class="submit"> 98 <input type="submit" name="Submit" class="button-primary" value="<?php esc_attr_e( 'Save Changes' ); ?>" /> 99 </p> 97 <?php submit_button(); ?> 100 98 </form> 101 99 </div> -
trunk/wp-admin/options-writing.php
r15132 r15810 149 149 <?php do_settings_sections('writing'); ?> 150 150 151 <p class="submit"> 152 <input type="submit" name="Submit" class="button-primary" value="<?php esc_attr_e('Save Changes') ?>" /> 153 </p> 151 <?php submit_button(); ?> 154 152 </form> 155 153 </div>
Note: See TracChangeset
for help on using the changeset viewer.