Making WordPress.org

Changeset 3485


Ignore:
Timestamp:
06/19/2016 10:02:49 PM (8 years ago)
Author:
coffee2code
Message:

Handbook plugin: Exclude root handbook page with post type's slug (minus '-handbook') from the table of contents.

File:
1 edited

Legend:

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

    r2565 r3485  
    5050        // Exclude root handbook page from the table of contents.
    5151        $page = get_page_by_path( $this->append_suffix( $post->post_type ), OBJECT, $post->post_type );
     52        if ( ! $page ) {
     53            $slug = substr( $post->post_type, 0, -9 );
     54            $page = get_page_by_path( $slug, OBJECT, $post->post_type );
     55        }
    5256        if ( $page ) {
    5357            $args['exclude'] = $page->ID;
Note: See TracChangeset for help on using the changeset viewer.