Changeset 3130 for branches/plugin/bbp-includes/bbp-general-template.php
- Timestamp:
- 05/10/2011 04:31:29 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-general-template.php
r3118 r3130 1086 1086 * 1087 1087 * @param string $sep Separator. Defaults to '←' 1088 * @param bool $current_page Include the current item 1089 * @param bool $root Include the root page if one exists 1088 1090 * @uses bbp_get_breadcrumb() To get the breadcrumb 1089 1091 */ … … 1098 1100 * 1099 1101 * @param string $sep Separator. Defaults to '←' 1102 * @param bool $current_page Include the current item 1103 * @param bool $root Include the root page if one exists 1100 1104 * @uses bbp_get_breadcrumb() To get the breadcrumb 1101 1105 */ 1102 function bbp_breadcrumb( $sep = ' › ', $current_page = true ) {1103 echo bbp_get_breadcrumb( $sep );1106 function bbp_breadcrumb( $sep = ' › ', $current_page = true, $root = true ) { 1107 echo bbp_get_breadcrumb( $sep, $current_page, $root ); 1104 1108 } 1105 1109 /** … … 1109 1113 * 1110 1114 * @param string $sep Separator. Defaults to '←' 1115 * @param bool $current_page Include the current item 1116 * @param bool $root Include the root page if one exists 1117 * 1111 1118 * @uses get_post() To get the post 1112 1119 * @uses bbp_get_forum_permalink() To get the forum link … … 1124 1131 * @return string Breadcrumbs 1125 1132 */ 1126 function bbp_get_breadcrumb( $sep = ' › ', $current_page = true ) {1133 function bbp_get_breadcrumb( $sep = ' › ', $current_page = true, $root = true ) { 1127 1134 global $post, $bbp; 1128 1135 … … 1132 1139 1133 1140 // Get post ancestors 1134 $ancestors = array_reverse( get_post_ancestors( $post->ID ) ); 1141 $ancestors = array_reverse( get_post_ancestors( $post->ID ) ); 1142 1143 // Do we want to include the forum root? 1144 if ( !empty( $root ) && ( get_option( '_bbp_include_root' ) ) && ( $root_slug = get_option( '_bbp_root_slug' ) ) ) { 1145 1146 // Page exists at the root slug location, so add it to the breadcrumb 1147 if ( $page = get_page_by_path( $root_slug ) ) { 1148 $breadcrumbs[] = '<a href="' . trailingslashit( home_url( $root_slug ) ) . '">' . get_the_title( $page->ID ) . '</a>'; 1149 } 1150 } 1135 1151 1136 1152 // Loop through parents
Note: See TracChangeset
for help on using the changeset viewer.