Making WordPress.org


Ignore:
Timestamp:
11/16/2018 09:24:02 PM (7 years ago)
Author:
iandunn
Message:

WordCamp Central: Apply coding standards.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/themes/wordcamp-central-2012/header.php

    r6086 r7861  
    3333    $site_description = get_bloginfo( 'description', 'display' );
    3434    if ( $site_description && ( is_home() || is_front_page() ) )
    35         echo " | $site_description";
     35        echo esc_html( " | $site_description" );
    3636
    3737    // Add a page number if necessary:
    38     if ( $paged >= 2 || $page >= 2 )
    39         echo ' | ' . sprintf( __( 'Page %s', 'twentyten' ), max( $paged, $page ) );
     38    if ( $paged >= 2 || $page >= 2 ) {
     39        echo ' | ' . sprintf( esc_html__( 'Page %s', 'twentyten' ), (int) max( $paged, $page ) );
     40    }
    4041
    4142    ?></title>
     
    4344<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
    4445<?php
    45     /* Always have wp_head() just before the closing </head>
     46    /*
     47     * Always have wp_head() just before the closing </head>
    4648     * tag of your theme, or you will break many plugins, which
    4749     * generally use this hook to add elements to <head> such
     
    8385    <div id="masthead" class="group">
    8486        <?php /*  Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff */ ?>
    85         <a href="#<?php echo is_front_page()? 'wc-hero-panel': 'content'; ?>" class="skip-link screen-reader-text"><?php _e( 'Skip to content', 'twentyten' ); ?></a>
     87        <a href="#<?php echo is_front_page() ? 'wc-hero-panel' : 'content'; ?>" class="skip-link screen-reader-text">
     88            <?php esc_html_e( 'Skip to content', 'twentyten' ); ?>
     89        </a>
    8690
    87         <?php $heading_tag = ( is_home() || is_front_page() ) ? 'h1' : 'div'; ?>
    88         <<?php echo $heading_tag; ?> id="site-title">
     91        <?php $use_heading_tag = is_home() || is_front_page(); ?>
     92        <?php echo $use_heading_tag ? '<h1 id="site-title">' : '<div id="site-title">'; ?>
    8993            <span>
    90                 <a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
     94                <a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
     95                    <?php bloginfo( 'name' ); ?>
     96                </a>
    9197            </span>
    92         </<?php echo $heading_tag; ?>>
     98        <?php echo $use_heading_tag ? '</h1>' : '</div>'; ?>
    9399
    94100        <div id="access" role="navigation">
    95101            <?php /* Our navigation menu.  If one isn't filled out, wp_nav_menu falls back to wp_page_menu.  The menu assiged to the primary position is the one used.  If none is assigned, the menu with the lowest ID is used.  */ ?>
    96             <button class="wc-primary-button menu-toggle"><?php _e( 'Primary Menu', 'adirondack' ); ?></button>
     102            <button class="wc-primary-button menu-toggle">
     103                <?php esc_html_e( 'Primary Menu', 'twentyten' ); ?>
     104            </button>
    97105            <?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?>
    98106        </div><!-- #access -->
     
    111119            </p>
    112120            <p class="wc-hero-actions">
    113                 <a href="<?php echo home_url( '/about/' ); ?>" class="wc-hero-learnmore">Learn More</a> or
    114                 <a href="<?php echo home_url( '/schedule/' ); ?>" class="wc-primary-button">Find a WordCamp</a>
     121                <a href="<?php echo esc_url( home_url( '/about/' ) ); ?>" class="wc-hero-learnmore">Learn More</a> or
     122                <a href="<?php echo esc_url( home_url( '/schedule/' ) ); ?>" class="wc-primary-button">Find a WordCamp</a>
    115123            </p>
    116124        </div><!-- .wc-hero-intro -->
     
    120128                // Get image attachments from page Home.
    121129                $attachments = get_posts( array(
    122                     'post_type' => 'attachment',
     130                    'post_type'      => 'attachment',
    123131                    'posts_per_page' => 10,
    124                     'post_parent' => get_the_ID(),
     132                    'post_parent'    => get_the_ID(),
    125133                    'post_mime_type' => 'image',
    126                     'orderby' => 'date',
    127                     'order' => 'DESC',
     134                    'orderby'        => 'date',
     135                    'order'          => 'DESC',
    128136                ) );
    129137            ?>
     
    162170                <?php elseif ( WordCamp_Central_Theme::get_subscription_status() == false ) : ?>
    163171                    <h3>Join the <strong>Mailing List</strong></h3>
    164                     <form action="<?php echo home_url( '/' ); ?>" method="POST">
    165                     <input type="hidden" name="wccentral-form-action" value="subscribe" />
    166                     <input type="text" class="wc-hero-mailinglist-email" placeholder="Enter your email address" name="wccentral-subscribe-email" />
    167                     <input type="submit" class="wc-hero-mailinglist-submit" value="Go" />
     172
     173                    <form action="<?php echo esc_url( home_url( '/' ) ); ?>" method="POST">
     174                        <input type="hidden" name="wccentral-form-action" value="subscribe" />
     175                        <input type="text" class="wc-hero-mailinglist-email" placeholder="Enter your email address" name="wccentral-subscribe-email" />
     176                        <input type="submit" class="wc-hero-mailinglist-submit" value="Go" />
    168177                    </form>
    169178                <?php endif; // get_subscription_status ?>
Note: See TracChangeset for help on using the changeset viewer.