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