Making WordPress.org

Changeset 453


Ignore:
Timestamp:
03/03/2014 09:56:36 PM (12 years ago)
Author:
johnjamesjacoby
Message:

Use home_url() in URL's instead of hard-coding bloginfo( 'url' ). Also remove duplicate header-nav and header-subnav templates in child themes.

Location:
sites/trunk/buddypress.org/public_html/wp-content/themes
Files:
4 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/buddypress.org/public_html/wp-content/themes/bb-base/functions.php

    r451 r453  
    1414show_admin_bar( true );
    1515
     16/**
     17 * Are we looking at a codex site
     18 *
     19 * @return bool
     20 */
     21function bb_base_is_codex() {
     22        return (bool) strstr( $_SERVER['HTTP_HOST'], 'codex' );
     23}
     24
    1625// Include in Codex code on codex sites
    17 if ( strstr( $_SERVER['HTTP_HOST'], 'codex' ) ) {
     26if ( bb_base_is_codex() ) {
    1827        include( get_template_directory() . '/functions-codex.php' );
    1928}
  • sites/trunk/buddypress.org/public_html/wp-content/themes/bb-base/header-nav.php

    r442 r453  
    11<ul id="nav" class="menu">
    2         <li <?php if ( is_page( 'about'    ) ) : ?>class="current"<?php endif; ?>><a href="<?php bloginfo( 'url' ); ?>/about/">About</a></li>
    3         <li <?php if ( is_page( 'plugins'  ) ) : ?>class="current"<?php endif; ?>><a href="<?php bloginfo( 'url' ); ?>/plugins/">Plugins</a></li>
    4         <li <?php if ( is_page( 'themes'   ) ) : ?>class="current"<?php endif; ?>><a href="<?php bloginfo( 'url' ); ?>/themes/">Themes</a></li>
     2        <li <?php if ( is_page( 'about'    ) ) : ?>class="current"<?php endif; ?>><a href="<?php echo home_url( 'about'   ); ?>">About</a></li>
     3        <li <?php if ( is_page( 'plugins'  ) ) : ?>class="current"<?php endif; ?>><a href="<?php echo home_url( 'plugins' ); ?>">Plugins</a></li>
     4        <li <?php if ( is_page( 'themes'   ) ) : ?>class="current"<?php endif; ?>><a href="<?php echo home_url( 'themes'  ); ?>">Themes</a></li>
    55        <li><a href="http://codex.bbpress.org/">Documentation</a></li>
    6         <li <?php if ( is_post_type_archive( 'post' ) || is_singular( 'post' ) || is_date() || is_tag() || is_category() || is_home() ) : ?>class="current"<?php endif; ?>><a href="<?php bloginfo( 'url' ); ?>/blog/">Blog</a></li>
    7         <li <?php if ( is_bbpress() ) : ?>class="current"<?php endif; ?>><a href="<?php bloginfo( 'url' ); ?>/forums/">Support</a></li>
    8         <li class="download<?php if ( is_page( 'download' ) ) : ?> current<?php endif; ?>"><a href="<?php bloginfo( 'url' ); ?>/download/">Download</a></li>
     6        <li <?php if ( is_post_type_archive( 'post' ) || is_singular( 'post' ) || is_date() || is_tag() || is_category() || is_home() ) : ?>class="current"<?php endif; ?>><a href="<?php echo home_url( 'blog' ); ?>">Blog</a></li>
     7        <?php if ( function_exists( 'is_bbpress' ) ) : ?><li <?php if ( is_bbpress() ) : ?>class="current"<?php endif; ?>><a href="<?php bbp_forums_url(); ?>">Support</a></li><?php endif; ?>
     8        <li class="download<?php if ( is_page( 'download' ) ) : ?> current<?php endif; ?>"><a href="<?php echo home_url( 'download' ); ?>">Download</a></li>
    99</ul>
  • sites/trunk/buddypress.org/public_html/wp-content/themes/bb-base/header-subnav.php

    r442 r453  
    22        <div id="subnav"><div id="subnav-inner">
    33                <ul id="nav-secondary" class="menu">
    4                         <?php if ( is_user_logged_in() ) : ?>
    5                                 <li><a href="<?php bloginfo( 'url' ); ?>/forums/new-topic/">Create New Topic</a></li>
     4                        <?php if ( is_user_logged_in() && function_exists( 'bbp_forums_url' ) ) : ?>
     5                                <li><a href="<?php bbp_forums_url( 'new-topic' ); ?>">Create New Topic</a></li>
    66                        <?php endif; ?>
    77                </ul>
     
    1111                                <li><a href="//wordpress.org/support/register.php">Register</a></li>
    1212                                <li><a href="//wordpress.org/support/bb-login.php">Lost Password</a></li>
    13                                 <li><a href="<?php bloginfo( 'url' ); ?>/login/">Log In</a></li>
    14                         <?php else : ?>
     13                                <li><a href="<?php echo home_url( 'login' ); ?>">Log In</a></li>
     14                        <?php elseif ( function_exists( 'bbp_favorites_permalink' ) ) : ?>
    1515                                <li><a href="<?php bbp_favorites_permalink( bbp_get_current_user_id() ); ?>">Favorites</a></li>
    1616                                <li><a href="<?php bbp_subscriptions_permalink( bbp_get_current_user_id() ); ?>">Subscriptions</a></li>
Note: See TracChangeset for help on using the changeset viewer.