Making WordPress.org


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/inc/template-tags.php

    r10768 r10000  
    66 * Wrapper function for WPorg_Handbook_Init::get_post_types().
    77 *
    8  * @return array Array of handbook post types.
     8 * @return array Array with full handbook post type names {post-type}-handbook.
    99 */
    1010function wporg_get_handbook_post_types() {
     
    1313    }
    1414
    15     return WPorg_Handbook_Init::get_post_types();
     15    $post_types = WPorg_Handbook_Init::get_post_types();
     16
     17    foreach ( $post_types as $key => $post_type ) {
     18        if ( 'handbook' !== $post_type ) {
     19            $post_types[ $key ] = $post_type . '-handbook';
     20        }
     21    }
     22
     23    return $post_types;
    1624}
    1725
     
    7583 * @return bool True if the current page is the landing page for a handbook, false otherwise.
    7684 */
    77 function wporg_is_handbook_landing_page() {
    78     return (
    79         $GLOBALS['wp_query']->is_handbook_root
    80     ||
    81         (
    82             ! empty( $GLOBALS['wp_query']->query_vars['handbook'] )
    83         &&
    84             $GLOBALS['wp_query']->found_posts === 1
    85         &&
    86             ! empty( $GLOBALS['wp_query']->query_vars['page_id'] )
    87         )
    88     );
     85 function wporg_is_handbook_landing_page() {
     86     return $GLOBALS['wp_query']->is_handbook_root;
    8987 }
    9088
Note: See TracChangeset for help on using the changeset viewer.