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

Contents in nested/inner blocks not recognized/collected #300

Open
2 tasks done
highbelt opened this issue Oct 11, 2021 · 0 comments
Open
2 tasks done

Contents in nested/inner blocks not recognized/collected #300

highbelt opened this issue Oct 11, 2021 · 0 comments

Comments

@highbelt
Copy link

  • 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.

Seems like word count is not working for „nested“ inner blocks (https://www.advancedcustomfields.com/resources/acf_register_block_type/, „Adding inner blocks“) as the current implementation excludes the parent/embedding blocks.

e.g.

return block.name.startsWith( "acf/" ) && jQuery( `[data-block="${block.clientId}"] .acf-block-preview` ).length === 1;

and
return block.name.startsWith( "acf/" ) && jQuery( `[data-block="${block.clientId}"] .acf-block-preview` ).length === 1;

jQuery( '[data-block="${block.clientId}"] .acf-block-preview' ).length in this case returns > 1 and the block will be ignored.

Changing the condition to .length >= 1 fixed it for me - not knowing, if this breaks somewhere else. 🤷
Is there a reason why it is set to === 1?

Please describe what you expected to happen and why.

All contents should be recognized, even if nested in another block

How can we reproduce this behavior?

  1. Add a nested block content/structure in your page/post
  2. Inner blocks will be ignored by the SEO analysis

Technical info

  • WordPress version: 5.7.3
  • ACF Content Analysis for Yoast SEO version: 3.0.1
  • Yoast SEO version: 17.1
  • ACF type: pro
  • ACF version: 5.9.9
  • Relevant plugins in case of a bug: -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant