Making WordPress.org


Ignore:
Timestamp:
05/31/2016 07:45:40 PM (10 years ago)
Author:
coffee2code
Message:

developer.wordpress.org: Fix document title generation.

  • Fix conditional to properly check for handbook home page so title can be assigned the handbook's name.
  • Prepend separator later so as not to interfere with string comparisons.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/extras.php

    r3246 r3279  
    6565    }
    6666    // Add handbook name to title if relevent
    67     elseif ( is_singular() && false !== strpos( $post_type, 'handbook' ) ) {
     67    elseif ( ( is_singular() || is_post_type_archive() ) && false !== strpos( $post_type, 'handbook' ) ) {
    6868        if ( $post_type_object = get_post_type_object( $post_type ) ) {
    69             $handbook_label = " $sep " . get_post_type_object( $post_type )->labels->name;
    70             $handbook_name  = " $sep " . \WPorg_Handbook::get_name( $post_type ) . " Handbook";
     69            $handbook_label = get_post_type_object( $post_type )->labels->name;
     70            $handbook_name  = \WPorg_Handbook::get_name( $post_type ) . " Handbook";
    7171
    7272            // Replace title with handbook name if this is landing page for the handbook
     
    7575            // Otherwise, append the handbook name
    7676            } else {
    77                 $title .= $handbook_name;
     77                $title .= " $sep " . $handbook_name;
    7878            }
    7979        }
Note: See TracChangeset for help on using the changeset viewer.