Changes in sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/inc/widgets.php [8942:10781]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/inc/widgets.php
r8942 r10781 11 11 protected static $widget_id_base = 'handbook_pages'; 12 12 13 protected $post_types = array( 'handbook' );13 protected $post_types; 14 14 15 15 /** … … 72 72 } 73 73 74 $this->post_types = (array) apply_filters( 'handbook_post_types', $this->post_types ); 75 $this->post_types = array_map( array( $this, 'append_suffix' ), $this->post_types ); 74 $this->post_types = WPorg_Handbook_Init::get_post_types(); 76 75 77 76 $post_type = ''; … … 94 93 95 94 // Exclude root handbook page from the table of contents. 96 $page = get_page_by_path( $ this->append_suffix( $post_type ), OBJECT, $post_type );95 $page = get_page_by_path( $post_type, OBJECT, $post_type ); 97 96 if ( ! $page ) { 98 $slug = s ubstr( $post_type, 0, -9);97 $slug = str_replace( '-handbook', '', $post_type ); 99 98 $page = get_page_by_path( $slug, OBJECT, $post_type ); 100 99 } … … 108 107 109 108 return $args; 110 }111 112 public function append_suffix( $t ) {113 if ( in_array( $t, array( 'handbook', 'page' ) ) ) {114 return $t;115 }116 117 return $t . '-handbook';118 109 } 119 110
Note: See TracChangeset
for help on using the changeset viewer.