Skip to:
Content

bbPress.org

Ticket #2269: 2269.1.diff

File 2269.1.diff, 5.2 KB (added by netweb, 11 years ago)

First pass

  • plugin/includes/common/template-tags.php

    diff --git a/plugin/includes/common/template-tags.php b/plugin/includes/common/template-tags.php
    index 79d0b71..3e297fe 100644
    a b function bbp_breadcrumb( $args = array() ) { 
    21412141
    21422142                        // If capable, include a link to edit the tag
    21432143                        if ( current_user_can( 'manage_topic_tags' ) ) {
    2144                                 $tag_data[] = '<a href="' . bbp_get_topic_tag_edit_link() . '" class="bbp-edit-topic-tag-link">' . __( '(Edit)', 'bbpress' ) . '</a>';
     2144                                $tag_data[] = '<a href="' . bbp_get_topic_tag_edit_link() . '" class="bbp-edit-topic-tag-link" itemprop="url">' . __( '(Edit)', 'bbpress' ) . '</a>';
    21452145                        }
    21462146
    21472147                        // Implode the results of the tag data
    function bbp_breadcrumb( $args = array() ) { 
    21622162                $r = bbp_parse_args( $args, array(
    21632163
    21642164                        // HTML
    2165                         'before'          => '<div class="bbp-breadcrumb"><p>',
     2165                        'before'          => '<div class="bbp-breadcrumb" itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><p>',
    21662166                        'after'           => '</p></div>',
    21672167
    21682168                        // Separator
    function bbp_breadcrumb( $args = array() ) { 
    21862186                        // Current
    21872187                        'include_current' => $pre_include_current,
    21882188                        'current_text'    => $pre_current_text,
    2189                         'current_before'  => '<span class="bbp-breadcrumb-current">',
     2189                        'current_before'  => '<span class="bbp-breadcrumb-current" itemprop="title">',
    21902190                        'current_after'   => '</span>',
    21912191                ), 'get_breadcrumb' );
    21922192
    function bbp_breadcrumb( $args = array() ) { 
    21992199
    22002200                // Do we want to include a link to home?
    22012201                if ( !empty( $r['include_home'] ) || empty( $r['home_text'] ) ) {
    2202                         $crumbs[] = '<a href="' . trailingslashit( home_url() ) . '" class="bbp-breadcrumb-home">' . $r['home_text'] . '</a>';
     2202                        $crumbs[] = '<a href="' . trailingslashit( home_url() ) . '" class="bbp-breadcrumb-home" itemprop="url"><span itemprop="title">' . $r['home_text'] . '</span></a>';
    22032203                }
    22042204
    22052205                // Do we want to include a link to the forum root?
    function bbp_breadcrumb( $args = array() ) { 
    22162216                        }
    22172217
    22182218                        // Add the breadcrumb
    2219                         $crumbs[] = '<a href="' . $root_url . '" class="bbp-breadcrumb-root">' . $r['root_text'] . '</a>';
     2219                        $crumbs[] = '<a href="' . $root_url . '" class="bbp-breadcrumb-root" itemprop="url"><span itemprop="title">' . $r['root_text'] . '</span></a>';
    22202220                }
    22212221
    22222222                // Ancestors exist
    function bbp_breadcrumb( $args = array() ) { 
    22372237
    22382238                                        // Forum
    22392239                                        case bbp_get_forum_post_type() :
    2240                                                 $crumbs[] = '<a href="' . bbp_get_forum_permalink( $parent->ID ) . '" class="bbp-breadcrumb-forum">' . bbp_get_forum_title( $parent->ID ) . '</a>';
     2240                                                $crumbs[] = '<a href="' . bbp_get_forum_permalink( $parent->ID ) . '" class="bbp-breadcrumb-forum" itemprop="url"><span itemprop="title">' . bbp_get_forum_title( $parent->ID ) . '</span></a>';
    22412241                                                break;
    22422242
    22432243                                        // Topic
    22442244                                        case bbp_get_topic_post_type() :
    2245                                                 $crumbs[] = '<a href="' . bbp_get_topic_permalink( $parent->ID ) . '" class="bbp-breadcrumb-topic">' . bbp_get_topic_title( $parent->ID ) . '</a>';
     2245                                                $crumbs[] = '<a href="' . bbp_get_topic_permalink( $parent->ID ) . '" class="bbp-breadcrumb-topic" itemprop="url"><span itemprop="title">' . bbp_get_topic_title( $parent->ID ) . '</span></a>';
    22462246                                                break;
    22472247
    22482248                                        // Reply (Note: not in most themes)
    22492249                                        case bbp_get_reply_post_type() :
    2250                                                 $crumbs[] = '<a href="' . bbp_get_reply_permalink( $parent->ID ) . '" class="bbp-breadcrumb-reply">' . bbp_get_reply_title( $parent->ID ) . '</a>';
     2250                                                $crumbs[] = '<a href="' . bbp_get_reply_permalink( $parent->ID ) . '" class="bbp-breadcrumb-reply" itemprop="url"><span itemprop="title">' . bbp_get_reply_title( $parent->ID ) . '</span></a>';
    22512251                                                break;
    22522252
    22532253                                        // WordPress Post/Page/Other
    22542254                                        default :
    2255                                                 $crumbs[] = '<a href="' . get_permalink( $parent->ID ) . '" class="bbp-breadcrumb-item">' . get_the_title( $parent->ID ) . '</a>';
     2255                                                $crumbs[] = '<a href="' . get_permalink( $parent->ID ) . '" class="bbp-breadcrumb-item" itemprop="url"><span itemprop="title">' . get_the_title( $parent->ID ) . '</span></a>';
    22562256                                                break;
    22572257                                }
    22582258                        }
    22592259
    22602260                // Edit topic tag
    22612261                } elseif ( bbp_is_topic_tag_edit() ) {
    2262                         $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>';
     2262                        $crumbs[] = '<a href="' . get_term_link( bbp_get_topic_tag_id(), bbp_get_topic_tag_tax_id() ) . '" class="bbp-breadcrumb-topic-tag" itemprop="url"><span itemprop="title">' . sprintf( __( 'Topic Tag: %s', 'bbpress' ), bbp_get_topic_tag_name() ) . '</span></a>';
    22632263
    22642264                // Search
    22652265                } elseif ( bbp_is_search() && bbp_get_search_terms() ) {
    2266                         $crumbs[] = '<a href="' . home_url( bbp_get_search_slug() ) . '" class="bbp-breadcrumb-search">' . __( 'Search', 'bbpress' ) . '</a>';
     2266                        $crumbs[] = '<a href="' . home_url( bbp_get_search_slug() ) . '" class="bbp-breadcrumb-search" itemprop="url"><span itemprop="title">' . __( 'Search', 'bbpress' ) . '</span></a>';
    22672267                }
    22682268
    22692269                /** Current ***********************************************************/