[Plugin: WordPress SEO by Yoast] request small breadcrumb functionality with patch
-
Hi,
I need to remove the “post-type” link from the breadcrumb in a custom post type view. I have selected in the configuration to show a custom taxonomy.
The plugin output
Home > motos > bmw > BMW F800GS
And i need
Home > bmw > BMW F800GS
I had implemented a checkbox in the internal links configuration.
Don′t know if this can be interesting to commit to the svn, also i didn′t find a better way to show the patch. I have tried to open a ticket in the wordpress plugins trac but i can′t find the worpress-seo in the “component” field.
The patch against the svn version:
Index: frontend/class-breadcrumbs.php =================================================================== --- frontend/class-breadcrumbs.php (revisión: 567884) +++ frontend/class-breadcrumbs.php (copia de trabajo) @@ -73,9 +73,11 @@ } else if ( $on_front == "page" && is_home() ) { $links[] = array( 'id' => $blog_page ); } else if ( is_singular() ) { - if ( get_post_type_archive_link( $post->post_type ) ) { - $links[] = array( 'ptarchive' => $post->post_type ); - } + if ( !isset( $options['post_types-' . $post->post_type . '-maintax-rmpt'] ) ) { + if ( get_post_type_archive_link( $post->post_type ) ) { + $links[] = array( 'ptarchive' => $post->post_type ); + } + } if ( 0 == $post->post_parent ) { if ( isset( $options['post_types-' . $post->post_type . '-maintax'] ) && $options['post_types-' . $post->post_type . '-maintax'] != '0' ) { Index: admin/pages/internal-links.php =================================================================== --- admin/pages/internal-links.php (revisión: 567884) +++ admin/pages/internal-links.php (copia de trabajo) @@ -26,6 +26,7 @@ $values[ $tax->name ] = $tax->labels->singular_name; } $content .= $wpseo_admin_pages->select( 'post_types-' . $pt->name . '-maintax', $pt->labels->name, $values ); + $content .= $wpseo_admin_pages->checkbox( 'post_types-' . $pt->name . '-maintax-rmpt', __( 'Remove the post-type link from the breadcrumb', 'wordpress-seo' ) ); } } $content .= '<br/>'; @@ -53,4 +54,4 @@ } ?></pre>'; $wpseo_admin_pages->postbox( 'internallinks', __( 'Breadcrumbs Settings', 'wordpress-seo' ), $content ); -$wpseo_admin_pages->admin_footer(); \ No newline at end of file +$wpseo_admin_pages->admin_footer();
- The topic ‘[Plugin: WordPress SEO by Yoast] request small breadcrumb functionality with patch’ is closed to new replies.