Changeset 3901
- Timestamp:
- 05/15/2012 04:27:06 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-common-template.php
r3898 r3901 1676 1676 // Define variables 1677 1677 $front_id = $root_id = 0; 1678 $ancestors = $ breadcrumbs= $tag_data = array();1678 $ancestors = $crumbs = $tag_data = array(); 1679 1679 $pre_root_text = $pre_front_text = $pre_current_text = ''; 1680 1680 $pre_include_root = $pre_include_home = $pre_include_current = true; … … 1804 1804 // Do we want to include a link to home? 1805 1805 if ( !empty( $include_home ) || empty( $home_text ) ) 1806 $ breadcrumbs[] = '<a href="' . trailingslashit( home_url() ) . '" class="bbp-breadcrumb-home">' . $home_text . '</a>';1806 $crumbs[] = '<a href="' . trailingslashit( home_url() ) . '" class="bbp-breadcrumb-home">' . $home_text . '</a>'; 1807 1807 1808 1808 // Do we want to include a link to the forum root? … … 1820 1820 1821 1821 // Add the breadcrumb 1822 $ breadcrumbs[] = '<a href="' . $root_url . '" class="bbp-breadcrumb-root">' . $root_text . '</a>';1822 $crumbs[] = '<a href="' . $root_url . '" class="bbp-breadcrumb-root">' . $root_text . '</a>'; 1823 1823 } 1824 1824 … … 1837 1837 // Forum 1838 1838 case bbp_get_forum_post_type() : 1839 $ breadcrumbs[] = '<a href="' . bbp_get_forum_permalink( $parent->ID ) . '" class="bbp-breadcrumb-forum">' . bbp_get_forum_title( $parent->ID ) . '</a>';1839 $crumbs[] = '<a href="' . bbp_get_forum_permalink( $parent->ID ) . '" class="bbp-breadcrumb-forum">' . bbp_get_forum_title( $parent->ID ) . '</a>'; 1840 1840 break; 1841 1841 1842 1842 // Topic 1843 1843 case bbp_get_topic_post_type() : 1844 $ breadcrumbs[] = '<a href="' . bbp_get_topic_permalink( $parent->ID ) . '" class="bbp-breadcrumb-topic">' . bbp_get_topic_title( $parent->ID ) . '</a>';1844 $crumbs[] = '<a href="' . bbp_get_topic_permalink( $parent->ID ) . '" class="bbp-breadcrumb-topic">' . bbp_get_topic_title( $parent->ID ) . '</a>'; 1845 1845 break; 1846 1846 1847 1847 // Reply (Note: not in most themes) 1848 1848 case bbp_get_reply_post_type() : 1849 $ breadcrumbs[] = '<a href="' . bbp_get_reply_permalink( $parent->ID ) . '" class="bbp-breadcrumb-reply">' . bbp_get_reply_title( $parent->ID ) . '</a>';1849 $crumbs[] = '<a href="' . bbp_get_reply_permalink( $parent->ID ) . '" class="bbp-breadcrumb-reply">' . bbp_get_reply_title( $parent->ID ) . '</a>'; 1850 1850 break; 1851 1851 1852 1852 // WordPress Post/Page/Other 1853 1853 default : 1854 $ breadcrumbs[] = '<a href="' . get_permalink( $parent->ID ) . '" class="bbp-breadcrumb-item">' . get_the_title( $parent->ID ) . '</a>';1854 $crumbs[] = '<a href="' . get_permalink( $parent->ID ) . '" class="bbp-breadcrumb-item">' . get_the_title( $parent->ID ) . '</a>'; 1855 1855 break; 1856 1856 } … … 1859 1859 // Edit topic tag 1860 1860 } elseif ( bbp_is_topic_tag_edit() ) { 1861 $ breadcrumbs[] = '<a href="' . get_term_link( bbp_get_topic_tag_id(), bbp_get_topic_tag_tax_id() ) . '" class="bbp-breadcrumb-topic-tag">' . sprintf( __( 'Topic Tag: %s', 'bbpress' ), bbp_get_topic_tag_name() ) . '</a>';1861 $crumbs[] = '<a href="' . get_term_link( bbp_get_topic_tag_id(), bbp_get_topic_tag_tax_id() ) . '" class="bbp-breadcrumb-topic-tag">' . sprintf( __( 'Topic Tag: %s', 'bbpress' ), bbp_get_topic_tag_name() ) . '</a>'; 1862 1862 } 1863 1863 … … 1866 1866 // Add current page to breadcrumb 1867 1867 if ( !empty( $include_current ) || empty( $pre_current_text ) ) 1868 $breadcrumbs[] = '<span class="bbp-breadcrumb-current">' . $current_text . '</span>'; 1869 1870 /** Finish Up *********************************************************/ 1868 $crumbs[] = '<span class="bbp-breadcrumb-current">' . $current_text . '</span>'; 1869 1870 /** Separator *********************************************************/ 1871 1872 // Wrap the separator in a span before padding and filter 1873 if ( !empty( $sep ) ) 1874 $sep = '<span class="bbp-breadcrumb-separator">' . $sep . '</span>'; 1871 1875 1872 1876 // Pad the separator … … 1874 1878 $sep = str_pad( $sep, strlen( $sep ) + ( (int) $pad_sep * 2 ), ' ', STR_PAD_BOTH ); 1875 1879 1876 / / Allow the separator of the breadcrumb to be easily changed1877 $sep = apply_filters( 'bbp_breadcrumb_separator', $sep ); 1878 1879 // Filter breadcrumbs before imploding them1880 $ breadcrumbs = apply_filters( 'bbp_breadcrumbs', $breadcrumbs );1880 /** Finish Up *********************************************************/ 1881 1882 // Filter the separator and breadcrumb 1883 $sep = apply_filters( 'bbp_breadcrumb_separator', $sep ); 1884 $crumbs = apply_filters( 'bbp_breadcrumbs', $crumbs ); 1881 1885 1882 1886 // Build the trail 1883 $trail = !empty( $ breadcrumbs ) ? ( $before . implode( $sep, $breadcrumbs ) . $after ) : '';1884 1885 return apply_filters( 'bbp_get_breadcrumb', $trail, $ breadcrumbs, $r );1887 $trail = !empty( $crumbs ) ? ( $before . implode( $sep, $crumbs ) . $after ) : ''; 1888 1889 return apply_filters( 'bbp_get_breadcrumb', $trail, $crumbs, $r ); 1886 1890 } 1887 1891
Note: See TracChangeset
for help on using the changeset viewer.