Changeset 1816
- Timestamp:
- 09/07/2009 09:00:29 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-templatetags.php
r1759 r1816 1584 1584 echo bp_get_the_body_class(); 1585 1585 } 1586 add_action( 'bp_body_class', 'bp_the_body_class' ); 1587 1588 function bp_get_the_body_class() { 1586 function bp_get_the_body_class( $wp_classes ) { 1589 1587 if ( bp_is_blog_page() || bp_is_activation_page() || bp_is_register_page() ) 1590 $ class[] = 'blog-page';1588 $bp_classes[] = 'blog-page'; 1591 1589 1592 1590 if ( !bp_is_blog_page() && !is_home() && !bp_is_register_page() && !bp_is_activation_page() ) 1593 $ class[] = 'internal-page';1591 $bp_classes[] = 'internal-page'; 1594 1592 1595 1593 if ( bp_is_blog_page() && is_home() ) 1596 $ class[] = 'home-page';1594 $bp_classes[] = 'home-page'; 1597 1595 1598 1596 if ( bp_is_directory() ) 1599 $ class[] = 'directory';1597 $bp_classes[] = 'directory'; 1600 1598 1601 1599 if ( bp_is_profile() && !bp_is_blog_page() ) 1602 $ class[] = 'profile';1600 $bp_classes[] = 'profile'; 1603 1601 1604 1602 if ( bp_is_activity() && !bp_is_blog_page() ) 1605 $ class[] = 'activity';1603 $bp_classes[] = 'activity'; 1606 1604 1607 1605 if ( bp_is_blogs() && !bp_is_blog_page() ) 1608 $ class[] = 'blogs';1606 $bp_classes[] = 'blogs'; 1609 1607 1610 1608 if ( bp_is_wire() && !bp_is_blog_page() ) 1611 $ class[] = 'wire';1609 $bp_classes[] = 'wire'; 1612 1610 1613 1611 if ( bp_is_messages() && !bp_is_blog_page() ) 1614 $ class[] = 'messages';1612 $bp_classes[] = 'messages'; 1615 1613 1616 1614 if ( bp_is_friends() && !bp_is_blog_page() ) 1617 $ class[] = 'friends';1615 $bp_classes[] = 'friends'; 1618 1616 1619 1617 if ( bp_is_groups() && !bp_is_blog_page() ) 1620 $ class[] = 'groups';1618 $bp_classes[] = 'groups'; 1621 1619 1622 1620 if ( bp_is_settings() && !bp_is_blog_page() ) 1623 $ class[] = 'settings';1621 $bp_classes[] = 'settings'; 1624 1622 1625 1623 if ( bp_is_site_item() ) 1626 $ class[] = 'single-item';1624 $bp_classes[] = 'single-item'; 1627 1625 1628 1626 if ( bp_is_inbox() ) 1629 $ class[] = 'inbox';1627 $bp_classes[] = 'inbox'; 1630 1628 1631 1629 if ( bp_is_friend_requests() ) 1632 $ class[] = 'friend-requests';1630 $bp_classes[] = 'friend-requests'; 1633 1631 1634 1632 if ( bp_is_friends_screen() ) 1635 $ class[] = 'my-friends';1633 $bp_classes[] = 'my-friends'; 1636 1634 1637 1635 if ( bp_is_create_blog() ) 1638 $ class[] = 'create-blog';1636 $bp_classes[] = 'create-blog'; 1639 1637 1640 1638 if ( bp_is_recent_commments() ) 1641 $ class[] = 'recent-comments';1639 $bp_classes[] = 'recent-comments'; 1642 1640 1643 1641 if ( bp_is_recent_posts() ) 1644 $ class[] = 'recent-posts';1642 $bp_classes[] = 'recent-posts'; 1645 1643 1646 1644 if ( bp_is_my_blogs() && !bp_is_directory() ) 1647 $ class[] = 'my-blogs';1645 $bp_classes[] = 'my-blogs'; 1648 1646 1649 1647 if ( bp_is_my_groups() && !bp_is_directory() ) 1650 $ class[] = 'my-groups';1648 $bp_classes[] = 'my-groups'; 1651 1649 1652 1650 if ( bp_is_group_leave() ) 1653 $ class[] = 'leave-group';1651 $bp_classes[] = 'leave-group'; 1654 1652 1655 1653 if ( bp_is_group_invites() ) 1656 $ class[] = 'group-invites';1654 $bp_classes[] = 'group-invites'; 1657 1655 1658 1656 if ( bp_is_group_members() ) 1659 $ class[] = 'group-members';1657 $bp_classes[] = 'group-members'; 1660 1658 1661 1659 if ( bp_is_group_forum_topic() ) 1662 $ class[] = 'group-forum-topic';1660 $bp_classes[] = 'group-forum-topic'; 1663 1661 1664 1662 if ( bp_is_group_forum() ) 1665 $ class[] = 'group-forum';1663 $bp_classes[] = 'group-forum'; 1666 1664 1667 1665 if ( bp_is_group_wire() ) 1668 $ class[] = 'group-wire';1666 $bp_classes[] = 'group-wire'; 1669 1667 1670 1668 if ( bp_is_group_admin_page() ) 1671 $ class[] = 'group-admin';1669 $bp_classes[] = 'group-admin'; 1672 1670 1673 1671 if ( bp_is_group_create() ) 1674 $ class[] = 'group-create';1672 $bp_classes[] = 'group-create'; 1675 1673 1676 1674 if ( bp_is_group_home() ) 1677 $ class[] = 'group-home';1675 $bp_classes[] = 'group-home'; 1678 1676 1679 1677 if ( bp_is_profile_wire() ) 1680 $ class[] = 'profile-wire';1678 $bp_classes[] = 'profile-wire'; 1681 1679 1682 1680 if ( bp_is_change_avatar() ) 1683 $ class[] = 'change-avatar';1681 $bp_classes[] = 'change-avatar'; 1684 1682 1685 1683 if ( bp_is_profile_edit() ) 1686 $ class[] = 'profile-edit';1684 $bp_classes[] = 'profile-edit'; 1687 1685 1688 1686 if ( bp_is_friends_activity() ) 1689 $ class[] = 'friends-activity';1687 $bp_classes[] = 'friends-activity'; 1690 1688 1691 1689 if ( bp_is_my_activity() ) 1692 $ class[] = 'my-activity';1690 $bp_classes[] = 'my-activity'; 1693 1691 1694 1692 if ( bp_is_register_page() ) 1695 $ class[] = 'registration';1693 $bp_classes[] = 'registration'; 1696 1694 1697 1695 if ( bp_is_activation_page() ) 1698 $ class[] = 'activation';1696 $bp_classes[] = 'activation'; 1699 1697 1700 1698 if ( is_single() ) 1701 $ class[] = 'blog-single';1699 $bp_classes[] = 'blog-single'; 1702 1700 1703 1701 if ( is_category() ) 1704 $ class[] = 'blog-category';1702 $bp_classes[] = 'blog-category'; 1705 1703 1706 1704 if ( is_tag() ) 1707 $ class[] = 'blog-tag';1705 $bp_classes[] = 'blog-tag'; 1708 1706 1709 1707 if ( is_search() ) 1710 $ class[] = 'blog-search';1708 $bp_classes[] = 'blog-search'; 1711 1709 1712 1710 if ( is_day() ) 1713 $ class[] = 'blog-day';1711 $bp_classes[] = 'blog-day'; 1714 1712 1715 1713 if ( is_month() ) 1716 $ class[] = 'blog-month';1714 $bp_classes[] = 'blog-month'; 1717 1715 1718 1716 if ( is_year() ) 1719 $class[] = 'blog-year'; 1720 1721 return implode( ' ', $class ); 1722 } 1717 $bp_classes[] = 'blog-year'; 1718 1719 return apply_filters( 'bp_get_the_body_class', array_merge( (array) $bp_classes, (array) $wp_classes ), $bp_classes, $wp_classes ); 1720 } 1721 add_filter( 'body_class', 'bp_get_the_body_class' ) 1723 1722 1724 1723 -
trunk/bp-themes/bp-sn-framework/header.php
r1745 r1816 28 28 </head> 29 29 30 <body class="<?php do_action( 'bp_body_class' ) ?>">30 <body <?php body_class() ?>> 31 31 32 32 <div id="search-login-bar">
Note: See TracChangeset
for help on using the changeset viewer.