Changeset 21789 for trunk/wp-admin/includes/template.php
- Timestamp:
- 09/08/2012 04:58:34 AM (13 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/includes/template.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/template.php
r21781 r21789 555 555 556 556 <tr><td colspan="2" class="submit"> 557 <?php submit_button( __( 'Add Custom Field' ), 'add:the-list:newmeta ', 'addmeta', false, array( 'id' => 'newmeta-submit' ) ); ?>557 <?php submit_button( __( 'Add Custom Field' ), 'add:the-list:newmeta secondary', 'addmeta', false, array( 'id' => 'newmeta-submit' ) ); ?> 558 558 <?php wp_nonce_field( 'add-meta', '_ajax_nonce-add-meta', false ); ?> 559 559 </td></tr> … … 1116 1116 if ( $section['title'] ) 1117 1117 echo "<h3>{$section['title']}</h3>\n"; 1118 1118 1119 1119 if ( $section['callback'] ) 1120 1120 call_user_func( $section['callback'], $section ); 1121 1121 1122 1122 if ( ! isset( $wp_settings_fields ) || !isset( $wp_settings_fields[$page] ) || !isset( $wp_settings_fields[$page][$section['id']] ) ) 1123 1123 continue; … … 1638 1638 */ 1639 1639 function get_submit_button( $text = null, $type = 'primary', $name = 'submit', $wrap = true, $other_attributes = null ) { 1640 switch ( $type ) : 1641 case 'primary' : 1642 case 'secondary' : 1643 $class = 'button-' . $type; 1644 break; 1645 case 'delete' : 1646 $class = 'button-secondary delete'; 1647 break; 1648 default : 1649 $class = $type; // Custom cases can just pass in the classes they want to be used 1650 endswitch; 1651 $text = ( null == $text ) ? __( 'Save Changes' ) : $text; 1640 if ( ! is_array( $type ) ) 1641 $type = explode( ' ', $type ); 1642 1643 $button_shorthand = array( 'primary', 'tiny', 'small', 'large' ); 1644 $classes = array( 'button' ); 1645 foreach ( $type as $t ) { 1646 if ( 'secondary' === $t || 'button-secondary' === $t ) 1647 continue; 1648 $classes[] = in_array( $t, $button_shorthand ) ? 'button-' . $t : $t; 1649 } 1650 $class = implode( ' ', array_unique( $classes ) ); 1651 1652 if ( 'delete' === $type ) 1653 $class = 'button-secondary delete'; 1654 1655 $text = $text ? $text : __( 'Save Changes' ); 1652 1656 1653 1657 // Default the id attribute to $name unless an id was specifically provided in $other_attributes
Note: See TracChangeset
for help on using the changeset viewer.