Changeset 17732
- Timestamp:
- 04/27/2011 11:03:27 PM (12 years ago)
- Location:
- trunk/wp-content/themes/twentyeleven
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-content/themes/twentyeleven/inc/theme-options/theme-options.php
r17721 r17732 77 77 78 78 /** 79 * Return the current Twenty Eleven theme options, with default values as fallback80 */ 81 function twentyeleven_get_ theme_options() {82 $defaults =array(79 * Return the default Twenty Eleven theme option values 80 */ 81 function twentyeleven_get_default_theme_options() { 82 return array( 83 83 'color_scheme' => 'light', 84 'link_color' => ' 1b8be0',84 'link_color' => '#1b8be0', 85 85 'theme_layout' => 'content-sidebar', 86 86 ); 87 } 88 89 /** 90 * Return the current Twenty Eleven theme options, with default values as fallback 91 */ 92 function twentyeleven_get_theme_options() { 93 $defaults = twentyeleven_get_default_theme_options(); 87 94 $options = get_option( 'twentyeleven_theme_options', $defaults ); 88 95 … … 206 213 207 214 <p class="submit"> 208 <input type="submit" class="button-primary" value="<?php _e( 'Save Options', 'twentyeleven' ); ?>" />215 <input type="submit" class="button-primary" value="<?php esc_attr_e( 'Save Options', 'twentyeleven' ); ?>" /> 209 216 </p> 210 217 </form> … … 215 222 /** 216 223 * Sanitize and validate input. Accepts an array, return a sanitized array. 224 * 225 * todo set up Reset Options action 217 226 */ 218 227 function twentyeleven_theme_options_validate( $input ) { 219 // todo get defaults, and use insteadd of null for fallback 220 // could also be used to trigger a Reset Options action 221 222 // Our color scheme option must actually be in our array of color scheme options 223 if ( ! isset( $input['color_scheme'] ) ) 224 $input['color_scheme'] = null; 225 if ( ! array_key_exists( $input['color_scheme'], twentyeleven_color_schemes() ) ) 226 $input['color_scheme'] = null; 227 228 // Our link color option must be safe text with no HTML tags 229 $input['link_color'] = wp_filter_nohtml_kses( $input['link_color'] ); 230 231 // Our theme layout option must actually be in our array of theme layout options 232 if ( ! isset( $input['theme_layout'] ) ) 233 $input['theme_layout'] = null; 234 if ( ! array_key_exists( $input['theme_layout'], twentyeleven_layouts() ) ) 235 $input['theme_layout'] = null; 228 $defaults = twentyeleven_get_default_theme_options(); 229 230 // Color scheme must be in our array of color scheme options 231 if ( ! isset( $input['color_scheme'] ) || ! array_key_exists( $input['color_scheme'], twentyeleven_color_schemes() ) ) 232 $input['color_scheme'] = $defaults['color_scheme']; 233 234 // Link color must be 3 or 6 hexadecimal characters 235 if ( ! isset( $input[ 'link_color' ] ) ) { 236 $input['link_color'] = $defaults['link_color']; 237 } else { 238 if ( preg_match( '/^#?([a-f0-9]{3}){1,2}$/i', $input['link_color'] ) ) { 239 $link_color = $input['link_color']; 240 // If color value doesn't have a preceding hash, add it 241 if ( false === strpos( $link_color, '#' ) ) 242 $link_color = '#' . $link_color; 243 } else { 244 $input['link_color'] = $defaults['link_color']; 245 } 246 } 247 248 // Theme layout must be in our array of theme layout options 249 if ( ! isset( $input['theme_layout'] ) || ! array_key_exists( $input['theme_layout'], twentyeleven_layouts() ) ) 250 $input['theme_layout'] = $defaults['theme_layout']; 236 251 237 252 return $input; … … 287 302 288 303 // Is the link color just the default color? 289 if ( ' 1b8be0' == $current_link_color ) :304 if ( '#1b8be0' == $current_link_color ) : 290 305 return; // we don't need to do anything then 291 292 306 else : 293 307 ?> … … 296 310 a, 297 311 .entry-title a:hover { 298 color: <?php echo $current_link_color ?>;312 color: <?php echo $current_link_color; ?>; 299 313 } 300 314 </style> -
trunk/wp-content/themes/twentyeleven/style.css
r17726 r17732 311 311 /* Links */ 312 312 a { 313 color: #444; 313 color: #1B8BE0; 314 text-decoration: none; 314 315 } 315 316 a:visited { 316 color: #444;317 317 } 318 318 a:focus, 319 319 a:active, 320 320 a:hover { 321 color: #1b8be0;321 text-decoration: underline; 322 322 } 323 323 … … 455 455 #branding #s { 456 456 background: url(images/search.png) no-repeat 5px 6px; 457 -moz-border-radius: 2px; 458 border-radius: 2px; 457 459 float: right; 458 460 font-size: 14px; … … 516 518 font-weight: bold; 517 519 letter-spacing: 0; 518 text-decoration: none;519 520 text-transform: none; 520 521 } … … 557 558 } 558 559 .entry-meta a { 559 color: #222; 560 font-weight: bold; 561 text-decoration: none; 560 font-weight: bold; 562 561 } 563 562 .entry-meta a:focus, 564 563 .entry-meta a:active, 565 564 .entry-meta a:hover { 566 color: #1b8be0;567 565 } 568 566 .entry-content, … … 586 584 } 587 585 .entry-content a { 588 color: #1b8be0;589 586 } 590 587 .entry-content a:hover { 591 color: #ff4b33;592 588 } 593 589 .entry-content table, … … 643 639 } 644 640 .page-link a:hover { 645 background: # 1b8be0;646 color: # bfddf3;641 background: #777; 642 color: #fff; 647 643 font-weight: bold; 648 644 } … … 730 726 } 731 727 .entry-header .comments-link a:hover { 732 background: # 1b8be0;733 border-color: #0861a5;734 color: #bfddf3;728 background: #777; 729 color: #fff; 730 border-color: #555; 735 731 } 736 732 .entry-header .comments-link .leave-reply { … … 767 763 } 768 764 .singular .entry-header a { 769 color: #1b8be0;770 765 } 771 766 .singular .entry-header a:hover { 772 color: #ff4b33;773 767 } 774 768 .singular footer.entry-meta { … … 791 785 } 792 786 .singular .entry-meta .edit-link a { 787 color: #fff; 793 788 position: absolute; 794 789 bottom: auto; … … 1219 1214 } 1220 1215 #content nav a { 1221 color: #1b8be0;1222 1216 font-size: 12px; 1223 1217 font-weight: bold; 1224 1218 line-height: 2.2em; 1225 text-decoration: none;1226 1219 } 1227 1220 #content nav a:focus, 1228 1221 #content nav a:active, 1229 1222 #content nav a:hover { 1230 color: #ff4b33;1231 1223 } 1232 1224 #nav-above { … … 1293 1285 } 1294 1286 .widget a { 1295 color: #1b8be0;1296 1287 font-weight: bold; 1297 1288 text-decoration: none; 1298 1289 } 1299 1290 .widget a:hover { 1300 color: #ff4b33;1291 text-decoration: underline; 1301 1292 } 1302 1293 … … 1474 1465 } 1475 1466 .comment-meta a { 1476 color: #1b8be0;1477 text-decoration: none;1478 1467 font-weight: bold; 1479 1468 } … … 1481 1470 .comment-meta a:active, 1482 1471 .comment-meta a:hover { 1483 color: #ff4b33;1484 1472 } 1485 1473 .commentlist .avatar { … … 1513 1501 .commentlist .children .bypostauthor > article .comment-meta .vcard .avatar { 1514 1502 } 1515 .comment-reply-link { 1516 color: #1778c2; 1503 a.comment-reply-link { 1517 1504 font-size: 12px; 1518 1505 font-weight: bold; 1519 text-decoration: none; 1520 } 1521 .comment-reply-link:hover { 1506 } 1507 .comment-reply-link:hover, 1508 .comment-reply-link:active, 1509 .comment-reply-link:focus { 1522 1510 } 1523 1511 … … 1532 1520 } 1533 1521 .commentlist > li.bypostauthor .comment-meta a { 1534 color: #ccc;1535 text-decoration: none;1536 1522 font-weight: bold; 1537 1523 } … … 1539 1525 .commentlist > li.bypostauthor .comment-meta a:active, 1540 1526 .commentlist > li.bypostauthor .comment-meta a:hover { 1541 color: #ff4b33;1542 1527 } 1543 1528 .commentlist > li.bypostauthor:before { … … 1545 1530 } 1546 1531 .commentlist > li.bypostauthor .comment-content a { 1547 color: #1b8be0;1548 1532 } 1549 1533 .commentlist > li.bypostauthor .comment-content a:focus, 1550 1534 .commentlist > li.bypostauthor .comment-content a:active, 1551 1535 .commentlist > li.bypostauthor .comment-content a:hover { 1552 color: #ff4b33;1553 1536 } 1554 1537 .commentlist > li.bypostauthor .comment-reply-link { 1555 color: #ccc;1556 1538 } 1557 1539 .commentlist > li.bypostauthor .comment-reply-link:focus, 1558 1540 .commentlist > li.bypostauthor .comment-reply-link:active, 1559 1541 .commentlist > li.bypostauthor .comment-reply-link:hover { 1560 color: #ff4b33;1561 1542 } 1562 1543 … … 1566 1547 .commentlist > li.bypostauthor .children .comment-meta a, 1567 1548 .commentlist > li.bypostauthor .children .comment-reply-link { 1568 color: #333;1569 1549 } 1570 1550 .commentlist > li.bypostauthor .children .comment-meta a:focus, 1571 1551 .commentlist > li.bypostauthor .children .comment-meta a:active, 1572 1552 .commentlist > li.bypostauthor .children .comment-meta a:hover { 1573 color: #ff4b33;1574 1553 } 1575 1554 .commentlist .children > li.bypostauthor { … … 1582 1561 } 1583 1562 .commentlist .children > li.bypostauthor > article .comment-meta a { 1584 color: #ccc;1585 text-decoration: none;1586 1563 font-weight: bold; 1587 1564 } … … 1595 1572 .commentlist .children > li.bypostauthor > article .comment-reply-link:active, 1596 1573 .commentlist .children > li.bypostauthor > article .comment-reply-link:hover { 1597 color: #ff4b33;1598 1574 } 1599 1575 .commentlist .children > li.bypostauthor > article .comment-content a { … … 1603 1579 .commentlist .children > li.bypostauthor > article .comment-content a:active, 1604 1580 .commentlist .children > li.bypostauthor > article .comment-content a:hover { 1605 color: #ff4b33;1606 1581 } 1607 1582 … … 1619 1594 } 1620 1595 #respond a { 1621 color: #ccc;1622 1596 } 1623 1597 #respond a:focus, 1624 1598 #respond a:active, 1625 1599 #respond a:hover { 1626 color: #ff4b33;1627 1600 } 1628 1601 #respond input[type="text"], … … 1687 1660 } 1688 1661 #respond .logged-in-as a { 1689 color: #478fa2;1690 font-weight: bold;1691 text-decoration: none;1692 1662 } 1693 1663 #respond p { … … 1817 1787 } 1818 1788 #site-generator a { 1819 text-decoration: none;1820 1789 font-weight: bold; 1821 1790 }
Note: See TracChangeset
for help on using the changeset viewer.