Making WordPress.org

Changeset 810


Ignore:
Timestamp:
08/21/2014 11:35:53 PM (12 years ago)
Author:
coffee2code
Message:

Code Reference: use configured handbook name instead of post type label in handbook page titles

File:
1 edited

Legend:

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

    r797 r810  
    6161        elseif ( false !== strpos( $post_type, 'handbook' ) ) {
    6262                if ( $post_type_object = get_post_type_object( $post_type ) ) {
    63                         $label = get_post_type_object( $post_type )->labels->name . " $sep ";
    64                         // Don't add the label for a page of the same name as post type name.
    65                         if ( $title != $label ) {
    66                                 $title .= $label;
     63                        $handbook_label = get_post_type_object( $post_type )->labels->name . " $sep ";
     64                        $handbook_name  = \WPorg_Handbook::get_name( $post_type ) . " Handbook $sep ";
     65
     66                        // Replace title with handbook name if this is landing page for the handbook
     67                        if ( $title == $handbook_label ) {
     68                                $title = $handbook_name;
     69                        // Otherwise, append the handbook name
     70                        } else {
     71                                $title .= $handbook_name;
    6772                        }
    6873                }
Note: See TracChangeset for help on using the changeset viewer.