Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breadcrumbs Title field not shown when theme support 'yoast-seo-breadcrumbs' #13015

Open
6 of 9 tasks
mingyeungs opened this issue May 23, 2019 · 2 comments
Open
6 of 9 tasks
Labels
component: admin severity: minor Yoast: Management Issues about options and management of the plugin

Comments

@mingyeungs
Copy link

mingyeungs commented May 23, 2019

  • I've read and understood the contribution guidelines.
  • I've searched for any related issues and avoided creating a duplicate issue.

Please give us a description of what happened.

When "Breadcrumbs" is set to disabled (which is the default setting btw), and the current theme has (add_theme_support( 'yoast-seo-breadcrumbs' );), the Breadcrumbs Title field (shown in green box below) for custom post types is not shown on the Search Appearance page.

yseo_search-appearance_template_cpt-archive

Please describe what you expected to happen and why.

The Breadcrumbs Title fields should show when the theme support 'yoast-seo-breadcrumbs', no matter if "Breadcrumb settings" has been explicitly set to Enabled.

Also notice that the "Enable Breadcrumbs" field is hidden when the theme support 'yoast-seo-breadcrumbs', and the user have no way to turn that on even if they wanted to.

Screen Shot 2019-05-23 at 4 32 22 PM

How can we reproduce this behavior?

  1. Fresh install Wordpress and Yoast SEO
  2. Activate a theme with add_theme_support( 'yoast-seo-breadcrumbs' )
  3. The breadcrumb title fields are not shown

Related code

Whether to show Breadcrumbs TItle is determined by WPSEO_Options::get( 'breadcrumbs-enable' ) === true (wordpress-seo/admin/views/tabs/metas/paper-content/post-type-content.php : Line 60).

The condition should be revised here, or WPSEO_Options::get( 'breadcrumbs-enable' ) should return true when theme support 'yoast-seo-breadcrumbs'

Technical info

  • If relevant, which editor is affected (or editors):
  • Classic Editor
  • Gutenberg
  • Classic Editor plugin
  • Which browser is affected (or browsers):
  • Chrome
  • Firefox
  • Safari
  • Other

Used versions

  • WordPress version: 5.2.1
  • Yoast SEO version: 11.1.1
  • Gutenberg plugin version:
  • Classic Editor plugin version:
  • Relevant plugins in case of a bug:
  • Tested with theme:
@Djennez
Copy link
Member

Djennez commented May 24, 2019

I was able to reproduce this bug with v11.3-RC2 Premium and WP 5.2.1.

For development:

The check for this is here:

if ( WPSEO_Options::get( 'breadcrumbs-enable' ) === true ) {
/* translators: %s is the plural version of the post type's name. */
echo '<h4>' . esc_html( sprintf( __( 'Breadcrumb settings for %s archive', 'wordpress-seo' ), $plural_label ) ) . '</h4>';
$yform->textinput( 'bctitle-ptarchive-' . $wpseo_post_type->name, __( 'Breadcrumbs title', 'wordpress-seo' ) );
}

Changing the conditional to this will make it work:

if ( WPSEO_Options::get( 'breadcrumbs-enable' ) === true || current_theme_supports( 'yoast-seo-breadcrumbs' )) {

However, I have a question about this: why are we treating these 2 conditionals separately? This would imply that somewhere down the line we expect different results if any of these conditionals differ. If this is just legacy, would it not be better to have checks for the theme support and override the option in the database to reflect this support? So that we can use just the WPSEO_Options::get( 'breadcrumbs-enable' anywhere instead of having to check for both (like in here).

@jdevalk
Copy link
Contributor

jdevalk commented May 27, 2019

I disagree that making it show there is the right solution: the fact that the theme supports it, doesn't mean you want to have them on. This looks like there is some logic that is weird though, will investigate.

@Djennez Djennez added severity: minor Yoast: Management Issues about options and management of the plugin and removed needs-product-feedback type: bug labels Oct 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: admin severity: minor Yoast: Management Issues about options and management of the plugin
Projects
None yet
Development

No branches or pull requests

3 participants